cognite-neat 0.88.1__py3-none-any.whl → 0.88.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cognite-neat might be problematic. Click here for more details.

Files changed (62) hide show
  1. cognite/neat/_version.py +1 -1
  2. cognite/neat/exceptions.py +2 -2
  3. cognite/neat/graph/loaders/_base.py +4 -4
  4. cognite/neat/graph/loaders/_rdf2asset.py +12 -14
  5. cognite/neat/graph/loaders/_rdf2dms.py +14 -10
  6. cognite/neat/issues/__init__.py +16 -0
  7. cognite/neat/{issues.py → issues/_base.py} +73 -5
  8. cognite/neat/issues/errors/external.py +21 -0
  9. cognite/neat/issues/errors/properties.py +75 -0
  10. cognite/neat/issues/errors/resources.py +123 -0
  11. cognite/neat/issues/errors/schema.py +0 -0
  12. cognite/neat/{rules/issues → issues}/formatters.py +9 -9
  13. cognite/neat/issues/neat_warnings/__init__.py +2 -0
  14. cognite/neat/issues/neat_warnings/identifier.py +27 -0
  15. cognite/neat/issues/neat_warnings/models.py +22 -0
  16. cognite/neat/issues/neat_warnings/properties.py +77 -0
  17. cognite/neat/issues/neat_warnings/resources.py +125 -0
  18. cognite/neat/rules/exporters/_rules2dms.py +3 -2
  19. cognite/neat/rules/exporters/_validation.py +2 -2
  20. cognite/neat/rules/importers/__init__.py +7 -3
  21. cognite/neat/rules/importers/_base.py +3 -3
  22. cognite/neat/rules/importers/_dms2rules.py +39 -18
  23. cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +44 -53
  24. cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +6 -5
  25. cognite/neat/rules/importers/_rdf/__init__.py +0 -0
  26. cognite/neat/rules/importers/_rdf/_imf2rules/__init__.py +3 -0
  27. cognite/neat/rules/importers/_rdf/_imf2rules/_imf2classes.py +82 -0
  28. cognite/neat/rules/importers/_rdf/_imf2rules/_imf2metadata.py +34 -0
  29. cognite/neat/rules/importers/_rdf/_imf2rules/_imf2properties.py +123 -0
  30. cognite/neat/rules/importers/{_owl2rules/_owl2rules.py → _rdf/_imf2rules/_imf2rules.py} +15 -11
  31. cognite/neat/rules/importers/{_inference2rules.py → _rdf/_inference2rules.py} +1 -1
  32. cognite/neat/rules/importers/_rdf/_owl2rules/_owl2classes.py +57 -0
  33. cognite/neat/rules/importers/_rdf/_owl2rules/_owl2metadata.py +68 -0
  34. cognite/neat/rules/importers/_rdf/_owl2rules/_owl2properties.py +59 -0
  35. cognite/neat/rules/importers/_rdf/_owl2rules/_owl2rules.py +76 -0
  36. cognite/neat/rules/importers/_rdf/_shared.py +586 -0
  37. cognite/neat/rules/importers/_spreadsheet2rules.py +1 -1
  38. cognite/neat/rules/importers/_yaml2rules.py +2 -1
  39. cognite/neat/rules/issues/__init__.py +1 -5
  40. cognite/neat/rules/issues/base.py +2 -21
  41. cognite/neat/rules/issues/dms.py +0 -134
  42. cognite/neat/rules/issues/spreadsheet.py +3 -3
  43. cognite/neat/rules/models/_types/_field.py +5 -2
  44. cognite/neat/rules/models/asset/_validation.py +1 -1
  45. cognite/neat/rules/models/dms/_schema.py +53 -30
  46. cognite/neat/rules/models/dms/_validation.py +2 -2
  47. cognite/neat/rules/models/entities.py +3 -0
  48. cognite/neat/rules/models/information/_validation.py +1 -1
  49. cognite/neat/workflows/steps/lib/current/rules_importer.py +73 -1
  50. cognite/neat/workflows/steps/lib/current/rules_validator.py +19 -7
  51. {cognite_neat-0.88.1.dist-info → cognite_neat-0.88.2.dist-info}/METADATA +1 -1
  52. {cognite_neat-0.88.1.dist-info → cognite_neat-0.88.2.dist-info}/RECORD +57 -42
  53. cognite/neat/graph/issues/loader.py +0 -104
  54. cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -215
  55. cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -209
  56. cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -203
  57. cognite/neat/rules/issues/importing.py +0 -423
  58. /cognite/neat/{graph/issues → issues/errors}/__init__.py +0 -0
  59. /cognite/neat/rules/importers/{_owl2rules → _rdf/_owl2rules}/__init__.py +0 -0
  60. {cognite_neat-0.88.1.dist-info → cognite_neat-0.88.2.dist-info}/LICENSE +0 -0
  61. {cognite_neat-0.88.1.dist-info → cognite_neat-0.88.2.dist-info}/WHEEL +0 -0
  62. {cognite_neat-0.88.1.dist-info → cognite_neat-0.88.2.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  cognite/neat/__init__.py,sha256=AiexNcHdAHFbrrbo9c65gtil1dqx_SGraDH1PSsXjKE,126
2
2
  cognite/neat/_shared.py,sha256=RSaHm2eJceTlvb-hMMe4nHgoHdPYDfN3XcxDXo24k3A,1530
3
- cognite/neat/_version.py,sha256=P5XVwIB6U8pfC7hf7GpFogFzmSGJkNu4O3TQwDhTFHk,23
3
+ cognite/neat/_version.py,sha256=81CUaJQe5sdAEotw-Iw_x1a6_T9N9hqEyhxln0y5u-M,23
4
4
  cognite/neat/app/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  cognite/neat/app/api/asgi/metrics.py,sha256=nxFy7L5cChTI0a-zkCiJ59Aq8yLuIJp5c9Dg0wRXtV0,152
6
6
  cognite/neat/app/api/configuration.py,sha256=L1DCtLZ1HZku8I2z-JWd5RDsXhIsboFsKwAMhkrm-bY,3600
@@ -40,7 +40,7 @@ cognite/neat/app/ui/neat-app/build/static/js/main.5a52cf09.js.map,sha256=Lf93Q5-
40
40
  cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg,sha256=EYf9q9JoVJ1L1np-XloeEZXCmaibzKmmpXCKn_44xzA,240334
41
41
  cognite/neat/config.py,sha256=MbYOvlibOjODEPcCHNKwZHVjg9ft8kZSojnW4gQCiHQ,10116
42
42
  cognite/neat/constants.py,sha256=kuAOxPWvv4RzBISgNGoeyEXrt4B_VgMfxexDIOUEdMA,877
43
- cognite/neat/exceptions.py,sha256=ltg5N7s1A6mrL8OGiOE2SlDsDOgmRdye2Ifu4rR5ePQ,4376
43
+ cognite/neat/exceptions.py,sha256=SwO2iBSRqvFV3Lyv70sCHTu4F2COmhrCptJ4BqhNkGo,4392
44
44
  cognite/neat/graph/__init__.py,sha256=J8JSJj3s4gFbuAexma__KGpBXPN8wuydPTKd6EwgKPA,65
45
45
  cognite/neat/graph/_shared.py,sha256=9QRETdm7hvqIeiHv_n1xi1DUq91Nq7oRRpnPKE0Pnag,181
46
46
  cognite/neat/graph/_tracking/__init__.py,sha256=pYj7c-YAUIP4hvN-4mlWnwaeZFerzL9_gM-oZhex7cE,91
@@ -65,12 +65,10 @@ cognite/neat/graph/extractors/_classic_cdf/_timeseries.py,sha256=zmVf5pO-G4ro3el
65
65
  cognite/neat/graph/extractors/_dexpi.py,sha256=Q3whJpEi3uFMzJGAAeUfgRnAzz6ZHmtuEdVBWqsZsTM,9384
66
66
  cognite/neat/graph/extractors/_mock_graph_generator.py,sha256=2qHh3fJxxAR9QdR6TPu-6DOvcjJkjHF4bwZN7lulziY,14678
67
67
  cognite/neat/graph/extractors/_rdf_file.py,sha256=ialMCLv9WH5k6v1YMfozfcmAYhz8OVo9jVhsKMyQkDA,763
68
- cognite/neat/graph/issues/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
- cognite/neat/graph/issues/loader.py,sha256=v8YDsehkUT1QUG61JM9BDV_lqowMUnDmGmbay0aFzN4,3085
70
68
  cognite/neat/graph/loaders/__init__.py,sha256=TbeJqifd16JLOglPVNOeb6pN_w060UYag50KquBM_r0,769
71
- cognite/neat/graph/loaders/_base.py,sha256=497Jc1Gu3SmBpafUNTQ6fCAJz6dKq8HkweecdUmDsu4,3651
72
- cognite/neat/graph/loaders/_rdf2asset.py,sha256=CqSXDcF4gVPSvE_9jy7yyuaCv-8HA9g0ld_2hqhnXug,17793
73
- cognite/neat/graph/loaders/_rdf2dms.py,sha256=7HdFAVMORLaHIWzxKbm1DDGi45TcvqxXZYXYnggLYBI,14596
69
+ cognite/neat/graph/loaders/_base.py,sha256=i5z0iRmYnoMZDwxgTWlZanbB58gdPBF1ya1IYtZM6zQ,3635
70
+ cognite/neat/graph/loaders/_rdf2asset.py,sha256=ws-OwdMEZC2SHQJD70Ab64C8thQTqySXXERcPseoyGs,17721
71
+ cognite/neat/graph/loaders/_rdf2dms.py,sha256=dWIvjpkHH0ZwkPxbENbwarMN85WQR8ae9NrmBOYmfaI,14786
74
72
  cognite/neat/graph/models.py,sha256=AtLgZh2qyRP6NRetjQCy9qLMuTQB0CH52Zsev-qa2sk,149
75
73
  cognite/neat/graph/queries/__init__.py,sha256=BgDd-037kvtWwAoGAy8eORVNMiZ5-E9sIV0txIpeaN4,50
76
74
  cognite/neat/graph/queries/_base.py,sha256=H1ypFF_Fjls_oViF_5rrfTZzFOjwA4AHnzPdnmLNdXM,8243
@@ -83,7 +81,19 @@ cognite/neat/graph/transformers/__init__.py,sha256=FMvlDEDJHrZL4Jb_H0AiJZO5uHXBC
83
81
  cognite/neat/graph/transformers/_base.py,sha256=b37Ek-9njuM5pTR_3XhnxCMrg_ip_2BMwM7ZhKpAAlw,328
84
82
  cognite/neat/graph/transformers/_classic_cdf.py,sha256=6xX-OBSJT5DAQrTJ-nuhCfGNaSk5Iktxn-WIMfzEIqo,13189
85
83
  cognite/neat/graph/transformers/_rdfpath.py,sha256=VLtGJvTPT5SWhV98fuGGt0pptTXfzOOQSNehypsPHug,1861
86
- cognite/neat/issues.py,sha256=C8DE2Zcb_mCeaC0PSAf7zD231ewFI0k7sRIar_XH3-4,4909
84
+ cognite/neat/issues/__init__.py,sha256=JRzTMFcVsy1l_TmJWvt_7RsH6GZ9ryVgHdKkYh19nXg,353
85
+ cognite/neat/issues/_base.py,sha256=akayIVA1RsZSn5ZDYl8-jz4Sp0UmNyH2XtCt8ac60ds,6994
86
+ cognite/neat/issues/errors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
+ cognite/neat/issues/errors/external.py,sha256=YmbuKxwvcRKo7qtZTkfgDyNuyjtCJU1F0xvGiICYDUk,548
88
+ cognite/neat/issues/errors/properties.py,sha256=zDx2f5m6K76wVUGpbvIRbt1sYl5NlRmLlAg1iYhiNOk,2558
89
+ cognite/neat/issues/errors/resources.py,sha256=-H6dsmQr4NsGBBKapRomfKjI41VEZJnFpjHufGZp1eM,3871
90
+ cognite/neat/issues/errors/schema.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
+ cognite/neat/issues/formatters.py,sha256=kICnowTeD-EzThvEyrG_HWly0j1MEWJNEteECspJkRw,3328
92
+ cognite/neat/issues/neat_warnings/__init__.py,sha256=D4Y877V1NlP6-QDA_mdlgUytDkatmnSzQcr97oGyGIk,190
93
+ cognite/neat/issues/neat_warnings/identifier.py,sha256=gBdWszuxc_6aPvzhyRnyta7ptIyUGTOA7YMy32bGKTc,810
94
+ cognite/neat/issues/neat_warnings/models.py,sha256=WpQYrm_eieRH2B7VAvO46u13RcP5UFD41V7_0AJWji8,645
95
+ cognite/neat/issues/neat_warnings/properties.py,sha256=SqCks6a1xWoOy-RLInRp9NiyWrWyi7pPR0IlbErWkvM,2712
96
+ cognite/neat/issues/neat_warnings/resources.py,sha256=iq6NeFlMTIsS14JcHwnJksEAvMBEUEaHl27qVduWd2w,4091
87
97
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
98
  cognite/neat/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
99
  cognite/neat/rules/_shared.py,sha256=G0bIu5XSrtEa93qqtOS5P0IDJUkU32gX5ypFhcV6t5c,216
@@ -95,35 +105,40 @@ cognite/neat/rules/examples/__init__.py,sha256=nxIwueAcHgZhkYriGxnDLQmIyiT8PByPH
95
105
  cognite/neat/rules/examples/wind-energy.owl,sha256=NuomCA9FuuLF0JlSuG3OKqD4VBcHgSjDKFLV17G1zV8,65934
96
106
  cognite/neat/rules/exporters/__init__.py,sha256=nRMUBUf7yr1QPjyITeX2rTLtLLawHv24hhRE39d2-e0,1109
97
107
  cognite/neat/rules/exporters/_base.py,sha256=vJXY7qdo4blDZemfDXuuYCkUt1cTa5PsOLMdll7OcGw,1896
98
- cognite/neat/rules/exporters/_rules2dms.py,sha256=e0x54Zqn4LLHN_uCKLTz9dRe5P7NAWcSQSshizr9ItE,14543
108
+ cognite/neat/rules/exporters/_rules2dms.py,sha256=S2LMwN6Pv9PKz4XRxdMmdxnSrD-9aZajdA-dA2TAQ-c,14659
99
109
  cognite/neat/rules/exporters/_rules2excel.py,sha256=bVYq0zmMLDEzSDD39_DQOL6rFGBgRMq5lE7xVMAg8i8,14328
100
110
  cognite/neat/rules/exporters/_rules2ontology.py,sha256=GjfZtS_BlxfBjyu9w-NNGWYWACt4N1Z8A0bGp6EDq0g,20678
101
111
  cognite/neat/rules/exporters/_rules2yaml.py,sha256=GA8eUYRxUfIU6IMvlyGO5JidkOD5eUKSbH3qAiFiaCg,3026
102
- cognite/neat/rules/exporters/_validation.py,sha256=E-vqVagQn6uhymy_-5GfGMnZ29mxinPE19IJNua8YQY,3787
103
- cognite/neat/rules/importers/__init__.py,sha256=Vxl2Iq1dMXUsI6Wb411xPI3rromdq50xZUci-S8faSw,1097
104
- cognite/neat/rules/importers/_base.py,sha256=EgXF2pmJ90LbmFs5rAMwh151wGX3PGkhTTF6rC-DzOg,4510
105
- cognite/neat/rules/importers/_dms2rules.py,sha256=Bk9vJT9Tdei2OE_1HaaFYjitBFp0omyGuqIQEblF_IE,19744
112
+ cognite/neat/rules/exporters/_validation.py,sha256=Qm5pXXjo_Vw1b4Awg70mXkknJweye35QkR0dBbdO8x0,3810
113
+ cognite/neat/rules/importers/__init__.py,sha256=z682_ktGKDjr52DIL6cPvOercZS6-TYD_ZDo-MGqtck,1207
114
+ cognite/neat/rules/importers/_base.py,sha256=0YqjWK2zjjDsnf6xYQvZXLxa2pEvKFgYIhIVLOqDFEg,4545
115
+ cognite/neat/rules/importers/_dms2rules.py,sha256=tgJX0VgVZnY7luTxjwGgJuUyMXUXfuo7gGgNgzK_IZI,20473
106
116
  cognite/neat/rules/importers/_dtdl2rules/__init__.py,sha256=CNR-sUihs2mnR1bPMKs3j3L4ds3vFTsrl6YycExZTfU,68
107
117
  cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py,sha256=wW4saKva61Q_i17guY0dc4OseJDQfqHy_QZBtm0OD6g,12134
108
- cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py,sha256=5ee8bD4iJ3Ndhx_S234XBCuBHxYjFkJnWiwnZwbTrXs,12432
109
- cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py,sha256=Psj3C2jembY_Wu7WWJIFIwrMawvjISjeqfBnoRy_csw,6740
118
+ cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py,sha256=BZIl01Ny6lbjPp094EPXN5Ke2HrKFRnA_Nncoxh4WG0,11934
119
+ cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py,sha256=zziddmL_WMhdPwPEvO_-iwLCMLPVqk7oP8HH4LozTEo,6758
110
120
  cognite/neat/rules/importers/_dtdl2rules/spec.py,sha256=tim_MfN1J0F3Oeqk3BMgIA82d_MZvhRuRMsLK3B4PYc,11897
111
- cognite/neat/rules/importers/_inference2rules.py,sha256=xaB3HGVF_TsSErzE9nPn8XTfFC8nWe5Wsz4U0qlTVlM,13848
112
- cognite/neat/rules/importers/_owl2rules/__init__.py,sha256=tdGcrgtozdQyST-pTlxIa4cLBNTLvtk1nNYR4vOdFSw,63
113
- cognite/neat/rules/importers/_owl2rules/_owl2classes.py,sha256=YaEsYYRM8H7EkPgHIUVosiNdhhl6rEl2P7EtvVOqoBM,7383
114
- cognite/neat/rules/importers/_owl2rules/_owl2metadata.py,sha256=XnE3aOVxd7ZyKln3o5k6cx3Sr92FHkLhRPWsHIgt0fY,7487
115
- cognite/neat/rules/importers/_owl2rules/_owl2properties.py,sha256=qVzEs6o6ARaz9lf6mKaAPL0fJbOotzSa8CINxSEbbw0,7341
116
- cognite/neat/rules/importers/_owl2rules/_owl2rules.py,sha256=41_wZFvt0A6TI55zlT04oQkvU7V73li4aGLgc4T4Lxo,6358
117
- cognite/neat/rules/importers/_spreadsheet2rules.py,sha256=1yEzoAZpad57zWyaVo0XnKCer68lIgR_a2vvOvVAdi0,13108
118
- cognite/neat/rules/importers/_yaml2rules.py,sha256=F0uksSz1A3po5OlRM2152_w5j8D9oYTLB9NFTkSMlWI,4275
119
- cognite/neat/rules/issues/__init__.py,sha256=c12m0HAHHzF6oR8lKbULE3TxOPimTi9s1O9IIrtgh0g,549
120
- cognite/neat/rules/issues/base.py,sha256=x2YLCfmqtPlFLoURq3qHaprXCpFaQdf0iWkql-EMyps,2446
121
- cognite/neat/rules/issues/dms.py,sha256=Z6KjZv8geAzAjVUNipJrkiJYHOyaDS5h0XKkawMugDU,25136
121
+ cognite/neat/rules/importers/_rdf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
122
+ cognite/neat/rules/importers/_rdf/_imf2rules/__init__.py,sha256=4ZuX81E-Tp4Vf6g_6Pb0iStzOCy7RJ83yxhvo4UddXY,63
123
+ cognite/neat/rules/importers/_rdf/_imf2rules/_imf2classes.py,sha256=FmY4wQQCm0U-2qPVwpFUHMB5IxhXbx9VmQir2iKvkpo,3464
124
+ cognite/neat/rules/importers/_rdf/_imf2rules/_imf2metadata.py,sha256=_z8z22-wS6gZHO4Gl-dJ-jhfUoAFgShIN303mFCL7uU,959
125
+ cognite/neat/rules/importers/_rdf/_imf2rules/_imf2properties.py,sha256=tLstxHJGQ9muWhGZ_he8zg0q-WtnqlJjVGa-ashcDI4,5671
126
+ cognite/neat/rules/importers/_rdf/_imf2rules/_imf2rules.py,sha256=vRCHYnkP5rfdlz8_DiamiPjZkH3JZqjmwVDVA-U7e2k,6556
127
+ cognite/neat/rules/importers/_rdf/_inference2rules.py,sha256=UqyELevhZhn9Sor4g9lHuC81FXax4UESAGbG9IHZlHQ,13842
128
+ cognite/neat/rules/importers/_rdf/_owl2rules/__init__.py,sha256=tdGcrgtozdQyST-pTlxIa4cLBNTLvtk1nNYR4vOdFSw,63
129
+ cognite/neat/rules/importers/_rdf/_owl2rules/_owl2classes.py,sha256=M8pybOsdkXjXTQoREJeiL3y5w8Zdn5oC3NFmiVZ7_os,1899
130
+ cognite/neat/rules/importers/_rdf/_owl2rules/_owl2metadata.py,sha256=3eTXm0irYJcjMV4H57xblP_iaNO_T0JErQuAYZfNaFA,2659
131
+ cognite/neat/rules/importers/_rdf/_owl2rules/_owl2properties.py,sha256=bBjDlUrsZFbLelytVjRibdCPrebO1lOElApnynmVcAA,2107
132
+ cognite/neat/rules/importers/_rdf/_owl2rules/_owl2rules.py,sha256=nj6fiYEG28dotkWoGGjgYduxw5O1854s3gx5YB_IjDA,2797
133
+ cognite/neat/rules/importers/_rdf/_shared.py,sha256=GpI5aGUh7KydeLFOC2KhWVV7xwYt1NNHw-2jPCaojhk,19894
134
+ cognite/neat/rules/importers/_spreadsheet2rules.py,sha256=wQFVGokKtN-uaq5tBcgWuGSXqHyYKLTPlZIM3rkKCsg,13102
135
+ cognite/neat/rules/importers/_yaml2rules.py,sha256=DdSDW1AllaN_vpLXHvMZkOBnnOkQ-NJr4Q3i_B3QFqI,4306
136
+ cognite/neat/rules/issues/__init__.py,sha256=ATpneE7eTBqrtDYqS1rWk8Z1MeSRQOD3hTmA2n-cqvU,459
137
+ cognite/neat/rules/issues/base.py,sha256=UpuFJMKSDb5jzfIE79JgnIAKxvWikzEFAQHG6XOaz4I,1626
138
+ cognite/neat/rules/issues/dms.py,sha256=5VPgfJone-HzlLzSer_14tPChESyEzxOl0LygD-Q-F8,20688
122
139
  cognite/neat/rules/issues/fileread.py,sha256=ao199mtvhPSW0IA8ZQZ0RzuLIIipYtL0jp6fLqxb4_c,5748
123
- cognite/neat/rules/issues/formatters.py,sha256=_ag2bJ9hncOj8pAGJvTTEPs9kTtxbD7vkqvS9Zcnizc,3385
124
- cognite/neat/rules/issues/importing.py,sha256=gkZR3ipR8LoURe1FFvAh9zhAEga72FmvTZLncdseRg4,13926
125
140
  cognite/neat/rules/issues/ontology.py,sha256=hbEd6IdA1Sc3OMmU2iTnyUn1jUK2NVlXPykvxn0TX-g,10857
126
- cognite/neat/rules/issues/spreadsheet.py,sha256=SYxVaNmVIg11aG0k_3SFF8wiN0bFS8GJzoQlp3bI3ms,19680
141
+ cognite/neat/rules/issues/spreadsheet.py,sha256=L4LBp90zyl2SYWqBhndLJQ4Ndiyhq-GdeSt3bTrUPvE,19671
127
142
  cognite/neat/rules/issues/spreadsheet_file.py,sha256=YCp0Pk_TsiqYuOPdWpjUpre-zvi2c5_MvrC_dxw10YY,4964
128
143
  cognite/neat/rules/issues/tables.py,sha256=_Ut5wel4-88XvkUxM4VFYDANDIl3lq_loeLlzAJhtgc,2381
129
144
  cognite/neat/rules/models/__init__.py,sha256=DHitrcmu9in2F8NqBE1O2J4UU_-MAlY6sB1MfigY4IU,887
@@ -131,30 +146,30 @@ cognite/neat/rules/models/_base.py,sha256=0wZgEDWLxKInQGw4ig3F_P_QP2FlUlMoanQvRM
131
146
  cognite/neat/rules/models/_constants.py,sha256=zPREgHT79_4FMg58QlaXc7A8XKRJrjP5SUgh63jDnTk,31
132
147
  cognite/neat/rules/models/_rdfpath.py,sha256=WY2vqe3oaIThsh01Eb6E4WexS8B8juAVceHLiglQNuA,11954
133
148
  cognite/neat/rules/models/_types/__init__.py,sha256=l1tGxzE7ezNHIL72AoEvNHN2IFuitxOLxiHJG__s6t4,305
134
- cognite/neat/rules/models/_types/_field.py,sha256=rvmN7ztrFPW2S_xWxbj8DamVFrjBQAlQK6vA3no-Aec,3026
149
+ cognite/neat/rules/models/_types/_field.py,sha256=3ZfrzyyuP7pB9LQAyxdxBYYLbomqyt-ISfQd-qOP5_4,3088
135
150
  cognite/neat/rules/models/asset/__init__.py,sha256=qNon0kHleCPo2eT82TmeBAfiDDdwdKNU-Xdewuz8JRA,231
136
151
  cognite/neat/rules/models/asset/_converter.py,sha256=PrTh9ZZkqSJBviiJE4xc3pClCsaWu2tTYOdgwg6_VOk,150
137
152
  cognite/neat/rules/models/asset/_rules.py,sha256=SWjl3_GmO15RQeXl2MPoGaIgobVQNpF0Ezr0oDOkw5E,6069
138
153
  cognite/neat/rules/models/asset/_rules_input.py,sha256=LiT-85CVgDz2ng65CtrRa77r4rnmg3E4Q6DC7-gv0dE,6257
139
154
  cognite/neat/rules/models/asset/_serializer.py,sha256=ixqRf9qEzvChgysRaDX4g_vHVDtRBCsPYC9sOn0-ShE,3365
140
- cognite/neat/rules/models/asset/_validation.py,sha256=7P46ksX2jkLbexfHX0ocYijFcxVShrzLnhTD4xDn224,1876
155
+ cognite/neat/rules/models/asset/_validation.py,sha256=yS2vWQw9KRgNk90m5-ipCBtWG7GnrWzIx2fkKlatPFQ,1865
141
156
  cognite/neat/rules/models/data_types.py,sha256=mHTjWh47VzLwrr0w6dRf59LW7pTTGRTgsxvtW9p0JWw,6020
142
157
  cognite/neat/rules/models/dms/__init__.py,sha256=Wzyqzz2ZIjpUbDg04CMuuIAw-f2A02DayNeqO9R-2Hw,491
143
158
  cognite/neat/rules/models/dms/_converter.py,sha256=2qiMsFKwVBi4K6ZnJPajUEtVSGYg_Wof1yGZLNMWrZ4,5869
144
159
  cognite/neat/rules/models/dms/_exporter.py,sha256=YfJXW4lTD9YZVq6-YBhzK9U83l9SMV-Pq-40rLGOTTc,25203
145
160
  cognite/neat/rules/models/dms/_rules.py,sha256=9sXEnx6Djy_uVagKn1j6WDGXNIGSmfFsLIJOWT6S6M0,20216
146
161
  cognite/neat/rules/models/dms/_rules_input.py,sha256=bGarQoDNZmBuSZh_l7ARsZH86_hVWmlX73GmyOI3zGE,13645
147
- cognite/neat/rules/models/dms/_schema.py,sha256=WmF4ektkA9LhHiz9QuQEx0fuxXyxeSsllpqQMkz2Epo,49523
162
+ cognite/neat/rules/models/dms/_schema.py,sha256=vvweSTRmr4I8MNfGQp28xmMZjCjFfApZorLIYM9r-54,50654
148
163
  cognite/neat/rules/models/dms/_serializer.py,sha256=iqp2zyyf8jEcU-R3PERuN8nu248xIqyxiWj4owAn92g,6406
149
- cognite/neat/rules/models/dms/_validation.py,sha256=5mk9L99FSwC8Ok7weEjnFJ_OZnmqMWUc6XFMTfkqfDw,14549
164
+ cognite/neat/rules/models/dms/_validation.py,sha256=sFhPXsU3YSFXsaDcxJnFNAS88nzmIJiKOtuL21QW_N0,14562
150
165
  cognite/neat/rules/models/domain.py,sha256=qG1387w6E4XIviOb7EwAjMaavUUQBweYlmYrZnj-FRI,2936
151
- cognite/neat/rules/models/entities.py,sha256=xYUNZ9nhU2y741xW6tqvF_JeQS1KsLi3YB-3zE0E79w,20771
166
+ cognite/neat/rules/models/entities.py,sha256=jImGRqBH9Ej43tOMNFKOqqDDqftIjW6zCqt_vCj6ylw,20903
152
167
  cognite/neat/rules/models/information/__init__.py,sha256=HR6g8xgyU53U7Ck8pPdbT70817Q4NC1r1pCRq5SA8iw,291
153
168
  cognite/neat/rules/models/information/_converter.py,sha256=J3mY5clqMY1PR_EmIT-GsTBJ16XCpHQG8EkQWvpqdnI,13930
154
169
  cognite/neat/rules/models/information/_rules.py,sha256=VFon-stz5QSAvol5PNeX6gjKeV-N-sS2wGicOTBVCJA,13575
155
170
  cognite/neat/rules/models/information/_rules_input.py,sha256=AOTslaehKZH67VJaJO5bu8tT-1iSQz2uwf9mWFpK_44,10580
156
171
  cognite/neat/rules/models/information/_serializer.py,sha256=yti9I_xJruxrib66YIBInhze___Io-oPTQH6uWDumPE,3503
157
- cognite/neat/rules/models/information/_validation.py,sha256=rkDGbRHCLKyoZ6ooBZBfjDslouVUu9GXmfBcCorwxt4,8216
172
+ cognite/neat/rules/models/information/_validation.py,sha256=jv0KoB-zU7C35WK1P3ZoRjrzYoZZVR1Su26AO6ZgsCg,8210
158
173
  cognite/neat/rules/models/wrapped_entities.py,sha256=ThhjnNNrpgz0HeORIQ8Q894trxP73P7T_TuZj6qH2CU,7157
159
174
  cognite/neat/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
175
  cognite/neat/utils/auth.py,sha256=k0sEfTpK_bamMjAkj7jN6n9yta8TaqHTFkZUjUgpwik,12770
@@ -193,8 +208,8 @@ cognite/neat/workflows/steps/lib/current/graph_extractor.py,sha256=CI12qMfG4qC7O
193
208
  cognite/neat/workflows/steps/lib/current/graph_loader.py,sha256=snHt-2czYLDsUfN9uWEkGh3IofVjUm2WuMXIfz1hyZw,1671
194
209
  cognite/neat/workflows/steps/lib/current/graph_store.py,sha256=VZpe6rfrmVfK4imZr42QVhGw98E2c71hQDzDDUg5xwM,1589
195
210
  cognite/neat/workflows/steps/lib/current/rules_exporter.py,sha256=1SKBYDnyDr975oMr9aOQVHExHjPQ0-whDDBNpTQ4K1A,23807
196
- cognite/neat/workflows/steps/lib/current/rules_importer.py,sha256=23dxamGHSbJoG7qUqL4KiGznSmDTVHw1EfqhLCeAwDM,14695
197
- cognite/neat/workflows/steps/lib/current/rules_validator.py,sha256=4fKlFpnNxgc435WRU1q3m_3TEA8M0iUzgAgCS7Bz1R8,4843
211
+ cognite/neat/workflows/steps/lib/current/rules_importer.py,sha256=Wfo-rnznvArXQ-mIgCnX6RRHycYMEPhC_j837KUB65Y,17717
212
+ cognite/neat/workflows/steps/lib/current/rules_validator.py,sha256=16OkkGE5h2fhwGKhrNbFjaPuRQCz7CsTAWkG6aXvRfQ,5108
198
213
  cognite/neat/workflows/steps/lib/io/__init__.py,sha256=k7IPbIq3ey19oRc5sA_15F99-O6dxzqbm1LihGRRo5A,32
199
214
  cognite/neat/workflows/steps/lib/io/io_steps.py,sha256=QAGypoi1vP32BRiIgBZ0B4qsbFMcwhzpRiVUUnWysLA,16874
200
215
  cognite/neat/workflows/steps/step_model.py,sha256=bYX0PhlW-B76fBksBPENGGf8foOT6gvJL-2aUO5JimY,2943
@@ -202,8 +217,8 @@ cognite/neat/workflows/steps_registry.py,sha256=85YtD6eW5SQ71pdr5-2EF3drwzjrL4aH
202
217
  cognite/neat/workflows/tasks.py,sha256=dqlJwKAb0jlkl7abbY8RRz3m7MT4SK8-7cntMWkOYjw,788
203
218
  cognite/neat/workflows/triggers.py,sha256=_BLNplzoz0iic367u1mhHMHiUrCwP-SLK6_CZzfODX0,7071
204
219
  cognite/neat/workflows/utils.py,sha256=gKdy3RLG7ctRhbCRwaDIWpL9Mi98zm56-d4jfHDqP1E,453
205
- cognite_neat-0.88.1.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
206
- cognite_neat-0.88.1.dist-info/METADATA,sha256=p4jZvdJndBOjwpadsKexZzA3t66jMHJeF_bFNvjN4mg,9441
207
- cognite_neat-0.88.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
208
- cognite_neat-0.88.1.dist-info/entry_points.txt,sha256=61FPqiWb25vbqB0KI7znG8nsg_ibLHBvTjYnkPvNFso,50
209
- cognite_neat-0.88.1.dist-info/RECORD,,
220
+ cognite_neat-0.88.2.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
221
+ cognite_neat-0.88.2.dist-info/METADATA,sha256=QDt7hekUMaqDC4q5OO7XeJ0rC1Dbmj221vqAiKz0q1U,9441
222
+ cognite_neat-0.88.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
223
+ cognite_neat-0.88.2.dist-info/entry_points.txt,sha256=61FPqiWb25vbqB0KI7znG8nsg_ibLHBvTjYnkPvNFso,50
224
+ cognite_neat-0.88.2.dist-info/RECORD,,
@@ -1,104 +0,0 @@
1
- from dataclasses import dataclass
2
- from typing import Any
3
-
4
- from cognite.neat.issues import NeatError, NeatWarning
5
-
6
- __all__ = [
7
- "FailedAuthorizationError",
8
- "MissingDataModelError",
9
- "FailedConvertError",
10
- "InvalidClassWarning",
11
- "InvalidInstanceError",
12
- ]
13
-
14
-
15
- @dataclass(frozen=True)
16
- class FailedAuthorizationError(NeatError):
17
- description = "Missing authorization for {action}: {reason}"
18
-
19
- action: str
20
- reason: str
21
-
22
- def message(self) -> str:
23
- return self.description.format(action=self.action, reason=self.reason)
24
-
25
- def dump(self) -> dict[str, Any]:
26
- output = super().dump()
27
- output["action"] = self.action
28
- output["reason"] = self.reason
29
- return output
30
-
31
-
32
- @dataclass(frozen=True)
33
- class MissingDataModelError(NeatError):
34
- description = "The data model with identifier {identifier} is missing: {reason}"
35
- fix = "Check the data model identifier and try again."
36
-
37
- identifier: str
38
- reason: str
39
-
40
- def message(self) -> str:
41
- return self.description.format(identifier=self.identifier, reason=self.reason)
42
-
43
- def dump(self) -> dict[str, Any]:
44
- output = super().dump()
45
- output["identifier"] = self.identifier
46
- output["reason"] = self.reason
47
- return output
48
-
49
-
50
- @dataclass(frozen=True)
51
- class FailedConvertError(NeatError):
52
- description = "Failed to convert the {identifier} to {target_format}: {reason}"
53
- fix = "Check the error message and correct the rules."
54
- identifier: str
55
- target_format: str
56
- reason: str
57
-
58
- def message(self) -> str:
59
- return self.description.format(identifier=self.identifier, target_format=self.target_format, reason=self.reason)
60
-
61
- def dump(self) -> dict[str, Any]:
62
- output = super().dump()
63
- output["identifier"] = self.identifier
64
- output["targetFormat"] = self.target_format
65
- output["reason"] = self.reason
66
- return output
67
-
68
-
69
- @dataclass(frozen=True)
70
- class InvalidClassWarning(NeatWarning):
71
- description = "The class {class_name} is invalid and will be skipped. {reason}"
72
- fix = "Check the error message and correct the class."
73
-
74
- class_name: str
75
- reason: str
76
-
77
- def message(self) -> str:
78
- return self.description.format(class_name=self.class_name, reason=self.reason)
79
-
80
- def dump(self) -> dict[str, Any]:
81
- output = super().dump()
82
- output["class_name"] = self.class_name
83
- output["reason"] = self.reason
84
- return output
85
-
86
-
87
- @dataclass(frozen=True)
88
- class InvalidInstanceError(NeatError):
89
- description = "The {type_} with identifier {identifier} is invalid and will be skipped. {reason}"
90
- fix = "Check the error message and correct the instance."
91
-
92
- type_: str
93
- identifier: str
94
- reason: str
95
-
96
- def message(self) -> str:
97
- return self.description.format(type_=self.type_, identifier=self.identifier, reason=self.reason)
98
-
99
- def dump(self) -> dict[str, Any]:
100
- output = super().dump()
101
- output["type"] = self.type_
102
- output["identifier"] = self.identifier
103
- output["reason"] = self.reason
104
- return output
@@ -1,215 +0,0 @@
1
- from typing import cast
2
-
3
- import numpy as np
4
- import pandas as pd
5
- from rdflib import OWL, Graph
6
-
7
- from cognite.neat.rules.models._base import MatchType
8
- from cognite.neat.utils.rdf_ import remove_namespace_from_uri
9
-
10
-
11
- def parse_owl_classes(graph: Graph, language: str = "en") -> list[dict]:
12
- """Parse owl classes from graph to pandas dataframe.
13
-
14
- Args:
15
- graph: Graph containing owl classes
16
- language: Language to use for parsing, by default "en"
17
-
18
- Returns:
19
- Dataframe containing owl classes
20
-
21
- !!! note "Compliant OWL classes"
22
- This makes the method very opinionated, but results in a compliant classes.
23
- """
24
-
25
- query = """
26
- SELECT ?class ?name ?description ?parentClass ?reference ?match ?comment
27
- WHERE {
28
- ?class a owl:Class .
29
- OPTIONAL {?class rdfs:subClassOf ?parentClass }.
30
- OPTIONAL {?class rdfs:label ?name }.
31
- OPTIONAL {?class rdfs:comment ?description} .
32
- FILTER (!isBlank(?class))
33
- FILTER (!bound(?parentClass) || !isBlank(?parentClass))
34
- FILTER (!bound(?name) || LANG(?name) = "" || LANGMATCHES(LANG(?name), "en"))
35
- FILTER (!bound(?description) || LANG(?description) = "" || LANGMATCHES(LANG(?description), "en"))
36
- }
37
- """
38
-
39
- # create raw dataframe
40
-
41
- raw_df = _parse_raw_dataframe(cast(list[tuple], list(graph.query(query.replace("en", language)))))
42
- if raw_df.empty:
43
- return []
44
-
45
- # group values and clean up
46
- processed_df = _clean_up_classes(raw_df)
47
-
48
- # make compliant
49
- processed_df = make_classes_compliant(processed_df)
50
-
51
- # Make Parent Class list elements into string joined with comma
52
- processed_df["Parent Class"] = processed_df["Parent Class"].apply(
53
- lambda x: ", ".join(x) if isinstance(x, list) and x else None
54
- )
55
-
56
- return processed_df.dropna(axis=0, how="all").replace(float("nan"), None).to_dict(orient="records")
57
-
58
-
59
- def _parse_raw_dataframe(query_results: list[tuple]) -> pd.DataFrame:
60
- df = pd.DataFrame(
61
- query_results,
62
- columns=["Class", "Name", "Description", "Parent Class", "Reference", "Match", "Comment"],
63
- )
64
- if df.empty:
65
- return df
66
-
67
- # # remove NaNs
68
- df.replace(np.nan, "", regex=True, inplace=True)
69
-
70
- df.Reference = df.Class
71
- df.Class = df.Class.apply(lambda x: remove_namespace_from_uri(x))
72
- df["Match Type"] = len(df) * [MatchType.exact]
73
- df["Comment"] = len(df) * [None]
74
- df["Parent Class"] = df["Parent Class"].apply(lambda x: remove_namespace_from_uri(x))
75
-
76
- return df
77
-
78
-
79
- def _clean_up_classes(df: pd.DataFrame) -> pd.DataFrame:
80
- clean_list = [
81
- {
82
- "Class": class_,
83
- "Name": group_df["Name"].unique()[0],
84
- "Description": "\n".join(list(group_df.Description.unique())),
85
- "Parent Class": ", ".join(list(group_df["Parent Class"].unique())),
86
- "Reference": group_df["Reference"].unique()[0],
87
- "Match Type": group_df["Match Type"].unique()[0],
88
- "Comment": group_df["Comment"].unique()[0],
89
- }
90
- for class_, group_df in df.groupby("Class")
91
- ]
92
-
93
- df = pd.DataFrame(clean_list)
94
-
95
- # bring NaNs back
96
- df.replace("", None, inplace=True)
97
-
98
- # split Parent Class column back into list
99
- df["Parent Class"] = df["Parent Class"].apply(lambda x: x.split(", ") if isinstance(x, str) else None)
100
-
101
- return df
102
-
103
-
104
- def make_classes_compliant(classes: pd.DataFrame) -> pd.DataFrame:
105
- """Make classes compliant.
106
-
107
- Returns:
108
- Dataframe containing compliant classes
109
-
110
- !!! note "About the compliant classes"
111
- The compliant classes are based on the OWL base ontology, but adapted to NEAT and use in CDF.
112
- One thing to note is that this method would not be able to fix issues with class ids which
113
- are not compliant with the CDF naming convention. For example, if a class id contains a space,
114
- starts with a number, etc. This will cause issues when trying to create the class in CDF.
115
- """
116
-
117
- # Replace empty or non-string values in "Match" column with "exact"
118
- classes["Match Type"] = classes["Match Type"].fillna(MatchType.exact)
119
- classes["Match Type"] = classes["Match Type"].apply(
120
- lambda x: MatchType.exact if not isinstance(x, str) or len(x) == 0 else x
121
- )
122
-
123
- # Replace empty or non-string values in "Comment" column with a default value
124
- classes["Comment"] = classes["Comment"].fillna("Imported from Ontology by NEAT")
125
- classes["Comment"] = classes["Comment"].apply(
126
- lambda x: "Imported from Ontology by NEAT" if not isinstance(x, str) or len(x) == 0 else x
127
- )
128
-
129
- # Add _object_property_class, _data_type_property_class, _thing_class to the dataframe
130
- classes = pd.concat(
131
- [classes, pd.DataFrame([_object_property_class(), _data_type_property_class(), _thing_class()])],
132
- ignore_index=True,
133
- )
134
-
135
- # Reduce length of elements in the "Description" column to 1024 characters
136
- classes["Description"] = classes["Description"].apply(lambda x: x[:1024] if isinstance(x, str) else None)
137
-
138
- # Add missing parent classes to the dataframe
139
- classes = pd.concat(
140
- [classes, pd.DataFrame(_add_parent_class(classes))],
141
- ignore_index=True,
142
- )
143
-
144
- return classes
145
-
146
-
147
- def _object_property_class() -> dict:
148
- return {
149
- "Class": "ObjectProperty",
150
- "Name": None,
151
- "Description": "The class of object properties.",
152
- "Parent Class": None,
153
- "Reference": OWL.ObjectProperty,
154
- "Match Type": MatchType.exact,
155
- "Comment": "Added by NEAT based on owl:ObjectProperty but adapted to NEAT and use in CDF.",
156
- }
157
-
158
-
159
- def _data_type_property_class() -> dict:
160
- return {
161
- "Class": "DatatypeProperty",
162
- "Name": None,
163
- "Description": "The class of data properties.",
164
- "Parent Class": None,
165
- "Reference": OWL.DatatypeProperty,
166
- "Match Type": MatchType.exact,
167
- "Comment": "Added by NEAT based on owl:DatatypeProperty but adapted to NEAT and use in CDF.",
168
- }
169
-
170
-
171
- def _thing_class() -> dict:
172
- return {
173
- "Class": "Thing",
174
- "Name": None,
175
- "Description": "The class of holding class individuals.",
176
- "Parent Class": None,
177
- "Reference": OWL.Thing,
178
- "Match Type": MatchType.exact,
179
- "Comment": (
180
- "Added by NEAT. "
181
- "Imported from OWL base ontology, it is meant for use as a default"
182
- " value type for object properties which miss a declared range."
183
- ),
184
- }
185
-
186
-
187
- def _add_parent_class(df: pd.DataFrame) -> list[dict]:
188
- parent_set = {
189
- item
190
- for sublist in df["Parent Class"].tolist()
191
- if sublist
192
- for item in sublist
193
- if item != "" and item is not None
194
- }
195
- class_set = set(df["Class"].tolist())
196
-
197
- rows = []
198
- for missing_parent_class in parent_set.difference(class_set):
199
- rows += [
200
- {
201
- "Class": missing_parent_class,
202
- "Name": None,
203
- "Description": None,
204
- "Parent Class": None,
205
- "Reference": None,
206
- "Match Type": None,
207
- "Comment": (
208
- "Added by NEAT. "
209
- "This is a parent class that is missing in the ontology. "
210
- "It is added by NEAT to make the ontology compliant with CDF."
211
- ),
212
- }
213
- ]
214
-
215
- return rows