cognite-neat 0.80.1__tar.gz → 0.81.0__tar.gz

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 (300) hide show
  1. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/PKG-INFO +2 -2
  2. cognite_neat-0.81.0/cognite/neat/_version.py +1 -0
  3. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/__init__.py +3 -0
  4. cognite_neat-0.81.0/cognite/neat/graph/extractors/_dexpi.py +212 -0
  5. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/stores/_base.py +16 -6
  6. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/utils.py +7 -0
  7. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/current/rules_importer.py +1 -1
  8. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/pyproject.toml +2 -2
  9. cognite_neat-0.80.1/cognite/neat/_version.py +0 -1
  10. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/LICENSE +0 -0
  11. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/README.md +0 -0
  12. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/__init__.py +0 -0
  13. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/__init__.py +0 -0
  14. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/asgi/metrics.py +0 -0
  15. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/configuration.py +0 -0
  16. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/context_manager/__init__.py +0 -0
  17. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/context_manager/manager.py +0 -0
  18. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/data_classes/__init__.py +0 -0
  19. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/data_classes/rest.py +0 -0
  20. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/explorer.py +0 -0
  21. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/routers/configuration.py +0 -0
  22. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/routers/core.py +0 -0
  23. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/routers/crud.py +0 -0
  24. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/routers/data_exploration.py +0 -0
  25. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/routers/metrics.py +0 -0
  26. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/routers/rules.py +0 -0
  27. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/routers/workflows.py +0 -0
  28. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/utils/__init__.py +0 -0
  29. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/utils/data_mapping.py +0 -0
  30. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/utils/logging.py +0 -0
  31. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/api/utils/query_templates.py +0 -0
  32. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/main.py +0 -0
  33. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/monitoring/__init__.py +0 -0
  34. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/monitoring/metrics.py +0 -0
  35. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/index.html +0 -0
  36. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
  37. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/README.md +0 -0
  38. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
  39. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
  40. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
  41. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
  42. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
  43. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
  44. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
  45. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
  46. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
  47. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
  48. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
  49. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
  50. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
  51. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
  52. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
  53. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/config.py +0 -0
  54. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/constants.py +0 -0
  55. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/exceptions.py +0 -0
  56. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/__init__.py +0 -0
  57. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/_shared.py +0 -0
  58. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/_tracking/__init__.py +0 -0
  59. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/_tracking/base.py +0 -0
  60. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/_tracking/log.py +0 -0
  61. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  62. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  63. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/examples/__init__.py +0 -0
  64. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  65. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/exceptions.py +0 -0
  66. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_base.py +0 -0
  67. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/__init__.py +0 -0
  68. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/_assets.py +0 -0
  69. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/_events.py +0 -0
  70. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/_files.py +0 -0
  71. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/_labels.py +0 -0
  72. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/_relationships.py +0 -0
  73. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/_sequences.py +0 -0
  74. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_classic_cdf/_timeseries.py +0 -0
  75. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
  76. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/extractors/_rdf_file.py +0 -0
  77. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/issues/__init__.py +0 -0
  78. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/issues/loader.py +0 -0
  79. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/loaders/__init__.py +0 -0
  80. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/loaders/_base.py +0 -0
  81. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/loaders/_rdf2dms.py +0 -0
  82. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/models.py +0 -0
  83. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/stores/__init__.py +0 -0
  84. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
  85. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/graph/stores/_provenance.py +0 -0
  86. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/issues.py +0 -0
  87. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/__init__.py +0 -0
  88. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/__init__.py +0 -0
  89. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  90. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  91. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
  92. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  93. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/exceptions.py +0 -0
  94. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
  95. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
  96. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
  97. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
  98. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
  99. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
  100. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
  101. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
  102. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
  103. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
  104. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
  105. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
  106. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
  107. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
  108. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
  109. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
  110. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/models.py +0 -0
  111. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
  112. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/stores/_base.py +0 -0
  113. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
  114. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
  115. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
  116. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
  117. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
  118. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
  119. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
  120. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
  121. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
  122. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
  123. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/__init__.py +0 -0
  124. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/analysis.py +0 -0
  125. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
  126. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
  127. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
  128. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
  129. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
  130. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
  131. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
  132. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
  133. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
  134. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
  135. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
  136. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exceptions.py +0 -0
  137. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
  138. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
  139. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
  140. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
  141. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
  142. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
  143. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
  144. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
  145. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
  146. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
  147. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
  148. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
  149. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
  150. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_base.py +0 -0
  151. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
  152. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
  153. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
  154. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
  155. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
  156. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
  157. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  158. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
  159. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
  160. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
  161. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
  162. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
  163. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/models/__init__.py +0 -0
  164. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/models/_base.py +0 -0
  165. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
  166. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
  167. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/models/rules.py +0 -0
  168. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/models/tables.py +0 -0
  169. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/rules/models/value_types.py +0 -0
  170. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
  171. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  172. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  173. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  174. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
  175. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  176. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  177. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  178. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  179. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  180. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/py.typed +0 -0
  181. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/__init__.py +0 -0
  182. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/_shared.py +0 -0
  183. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/analysis/__init__.py +0 -0
  184. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/analysis/_base.py +0 -0
  185. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/analysis/_information_rules.py +0 -0
  186. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/examples/__init__.py +0 -0
  187. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/examples/wind-energy.owl +0 -0
  188. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exceptions.py +0 -0
  189. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exporters/__init__.py +0 -0
  190. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exporters/_base.py +0 -0
  191. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exporters/_rules2dms.py +0 -0
  192. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
  193. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
  194. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
  195. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/exporters/_validation.py +0 -0
  196. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/__init__.py +0 -0
  197. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_base.py +0 -0
  198. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_dms2rules.py +0 -0
  199. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
  200. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  201. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
  202. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
  203. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
  204. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_inference2rules.py +0 -0
  205. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
  206. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
  207. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  208. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
  209. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
  210. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_spreadsheet2rules.py +0 -0
  211. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
  212. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/__init__.py +0 -0
  213. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/base.py +0 -0
  214. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/dms.py +0 -0
  215. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/fileread.py +0 -0
  216. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/formatters.py +0 -0
  217. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/importing.py +0 -0
  218. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/spreadsheet.py +0 -0
  219. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
  220. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/__init__.py +0 -0
  221. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/_base.py +0 -0
  222. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/_rdfpath.py +0 -0
  223. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/_types/__init__.py +0 -0
  224. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/_types/_base.py +0 -0
  225. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/_types/_field.py +0 -0
  226. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/data_types.py +0 -0
  227. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/__init__.py +0 -0
  228. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/_converter.py +0 -0
  229. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/_exporter.py +0 -0
  230. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/_rules.py +0 -0
  231. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
  232. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/_schema.py +0 -0
  233. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/_serializer.py +0 -0
  234. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/dms/_validation.py +0 -0
  235. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/domain.py +0 -0
  236. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/entities.py +0 -0
  237. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/information/__init__.py +0 -0
  238. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/information/_converter.py +0 -0
  239. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/information/_rules.py +0 -0
  240. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/information/_rules_input.py +0 -0
  241. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/information/_serializer.py +0 -0
  242. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/information/_validation.py +0 -0
  243. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/rules/models/wrapped_entities.py +0 -0
  244. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/__init__.py +0 -0
  245. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/auxiliary.py +0 -0
  246. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/cdf.py +0 -0
  247. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/cdf_classes.py +0 -0
  248. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
  249. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
  250. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
  251. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
  252. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
  253. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/exceptions.py +0 -0
  254. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/spreadsheet.py +0 -0
  255. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/text.py +0 -0
  256. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/upload.py +0 -0
  257. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/utils/xml.py +0 -0
  258. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/__init__.py +0 -0
  259. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/_exceptions.py +0 -0
  260. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/base.py +0 -0
  261. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/cdf_store.py +0 -0
  262. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
  263. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  264. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  265. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  266. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
  267. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  268. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  269. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  270. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  271. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  272. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/manager.py +0 -0
  273. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/migration/__init__.py +0 -0
  274. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/migration/steps.py +0 -0
  275. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
  276. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/model.py +0 -0
  277. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/__init__.py +0 -0
  278. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/data_contracts.py +0 -0
  279. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
  280. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
  281. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
  282. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
  283. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
  284. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
  285. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
  286. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
  287. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
  288. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
  289. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
  290. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
  291. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
  292. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
  293. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
  294. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
  295. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
  296. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps/step_model.py +0 -0
  297. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/steps_registry.py +0 -0
  298. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/tasks.py +0 -0
  299. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/triggers.py +0 -0
  300. {cognite_neat-0.80.1 → cognite_neat-0.81.0}/cognite/neat/workflows/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cognite-neat
3
- Version: 0.80.1
3
+ Version: 0.81.0
4
4
  Summary: Knowledge graph transformation
5
5
  Home-page: https://cognite-neat.readthedocs-hosted.com/
6
6
  License: Apache-2.0
@@ -43,7 +43,7 @@ Requires-Dist: prometheus-client (>=0.20.0,<0.21.0)
43
43
  Requires-Dist: pydantic (>=2,<3)
44
44
  Requires-Dist: pymdown-extensions ; extra == "docs"
45
45
  Requires-Dist: pyoxigraph (==0.3.19)
46
- Requires-Dist: python-multipart (>=0.0.6,<0.0.7)
46
+ Requires-Dist: python-multipart (>=0,<1)
47
47
  Requires-Dist: rdflib
48
48
  Requires-Dist: requests
49
49
  Requires-Dist: schedule (>=1,<2)
@@ -0,0 +1 @@
1
+ __version__ = "0.81.0"
@@ -5,6 +5,7 @@ from ._classic_cdf._labels import LabelsExtractor
5
5
  from ._classic_cdf._relationships import RelationshipsExtractor
6
6
  from ._classic_cdf._sequences import SequencesExtractor
7
7
  from ._classic_cdf._timeseries import TimeSeriesExtractor
8
+ from ._dexpi import DexpiExtractor
8
9
  from ._mock_graph_generator import MockGraphGenerator
9
10
  from ._rdf_file import RdfFileExtractor
10
11
 
@@ -18,6 +19,7 @@ __all__ = [
18
19
  "FilesExtractor",
19
20
  "LabelsExtractor",
20
21
  "RdfFileExtractor",
22
+ "DexpiExtractor",
21
23
  ]
22
24
 
23
25
 
@@ -31,4 +33,5 @@ TripleExtractors = (
31
33
  | FilesExtractor
32
34
  | LabelsExtractor
33
35
  | RdfFileExtractor
36
+ | DexpiExtractor
34
37
  )
@@ -0,0 +1,212 @@
1
+ import xml.etree.ElementTree as ET
2
+ from collections import defaultdict
3
+ from collections.abc import Iterable
4
+ from pathlib import Path
5
+ from xml.etree.ElementTree import Element
6
+
7
+ from rdflib import RDF, RDFS, XSD, Literal, Namespace, URIRef
8
+
9
+ from cognite.neat.constants import DEFAULT_NAMESPACE
10
+ from cognite.neat.graph.extractors._base import BaseExtractor
11
+ from cognite.neat.graph.models import Triple
12
+ from cognite.neat.utils.utils import as_neat_compliant_uri
13
+ from cognite.neat.utils.xml import get_children, iterate_tree
14
+
15
+ DEXPI = Namespace("http://sandbox.dexpi.org/rdl/")
16
+
17
+
18
+ class DexpiExtractor(BaseExtractor):
19
+ """
20
+ DEXPI-XML extractor of RDF triples
21
+
22
+ Args:
23
+ root: XML root element of DEXPI file.
24
+ namespace: Optional custom namespace to use for extracted triples that define data
25
+ model instances. Defaults to DEFAULT_NAMESPACE.
26
+ """
27
+
28
+ def __init__(
29
+ self,
30
+ root: Element,
31
+ namespace: Namespace | None = None,
32
+ ):
33
+ self.root = root
34
+ self.namespace = namespace or DEFAULT_NAMESPACE
35
+
36
+ @classmethod
37
+ def from_file(cls, filepath: str | Path, namespace: Namespace | None = None):
38
+ return cls(ET.parse(filepath).getroot(), namespace)
39
+
40
+ @classmethod
41
+ def from_url(cls, url: str, namespace: Namespace | None = None):
42
+ from io import BytesIO
43
+
44
+ import requests
45
+
46
+ response = requests.get(url)
47
+ response.raise_for_status()
48
+ return cls(ET.parse(BytesIO(response.content)).getroot(), namespace)
49
+
50
+ def extract(self) -> Iterable[Triple]:
51
+ """Extracts RDF triples from DEXPI XML file."""
52
+
53
+ for element in iterate_tree(self.root):
54
+ yield from self._element2triples(element, self.namespace)
55
+
56
+ @classmethod
57
+ def _element2triples(cls, element: Element, namespace: Namespace) -> list[Triple]:
58
+ """Converts an element to triples."""
59
+ triples: list[Triple] = []
60
+
61
+ if (
62
+ "ComponentClass" in element.attrib
63
+ and element.attrib["ComponentClass"] != "Label"
64
+ and "ID" in element.attrib
65
+ ):
66
+ id_ = namespace[element.attrib["ID"]]
67
+
68
+ if node_triples := cls._element2node_triples(id_, element):
69
+ triples.extend(node_triples)
70
+
71
+ if edge_triples := cls._element2edge_triples(id_, element, namespace):
72
+ triples.extend(edge_triples)
73
+
74
+ return triples
75
+
76
+ @classmethod
77
+ def _element2edge_triples(cls, id_: URIRef, element: Element, namespace: Namespace) -> list[Triple]:
78
+ triples: list[Triple] = []
79
+
80
+ # connection triples
81
+ if connections := get_children(element, "Connection"):
82
+ for connection in connections:
83
+ if "FromID" in connection.attrib and "ToID" in connection.attrib:
84
+ triples.append(
85
+ (
86
+ namespace[connection.attrib["FromID"]],
87
+ DEXPI.connection,
88
+ namespace[connection.attrib["ToID"]],
89
+ )
90
+ )
91
+
92
+ # association triples
93
+ if associations := get_children(element, "Association"):
94
+ for association in associations:
95
+ if "Type" in association.attrib and "ItemID" in association.attrib:
96
+ association_type = cls._to_uri_friendly_association_type(association)
97
+
98
+ triples.append(
99
+ (
100
+ id_,
101
+ DEXPI[f"association/{association_type}"],
102
+ namespace[association.attrib["ItemID"]],
103
+ )
104
+ )
105
+
106
+ # children-parent triples
107
+ for child in element:
108
+ if "ID" in child.attrib and child.tag != "Label":
109
+ camel_case_property = child.tag[0].lower() + child.tag[1:]
110
+ triples.append(
111
+ (
112
+ id_,
113
+ DEXPI[f"children/{camel_case_property}"],
114
+ namespace[child.attrib["ID"]],
115
+ )
116
+ )
117
+
118
+ return triples
119
+
120
+ @classmethod
121
+ def _to_uri_friendly_association_type(cls, association: Element):
122
+ association_type = "".join(
123
+ [word.capitalize() if i != 0 else word for i, word in enumerate(association.attrib["Type"].split(" "))]
124
+ )
125
+
126
+ return association_type
127
+
128
+ @classmethod
129
+ def _element2node_triples(cls, id_: URIRef, element: Element) -> list[Triple]:
130
+ """Converts an XML element to triples."""
131
+ triples: list[Triple] = []
132
+
133
+ # adding tag triple if exists
134
+ if tag := element.tag:
135
+ triples.append((id_, DEXPI.tag, Literal(str(tag))))
136
+
137
+ # adding attributes triples
138
+ if attributes := element.attrib:
139
+ if component_class := attributes.get("ComponentClass", None):
140
+ triples.append((id_, DEXPI.ComponentClass, Literal(component_class)))
141
+ if component_name := attributes.get("ComponentName", None):
142
+ triples.append((id_, DEXPI.ComponentName, Literal(component_name)))
143
+ if type_ := attributes.get("ComponentClassURI", None):
144
+ triples.append((id_, RDF.type, URIRef(type_)))
145
+
146
+ # add label triple
147
+ if label := cls._get_element_label(element):
148
+ triples.append((id_, RDFS.label, Literal(label)))
149
+
150
+ # add generic attributes triples
151
+ if generic_attributes := cls._get_element_generic_attributes(element):
152
+ for attribute, value_definitions in generic_attributes.items():
153
+ predicate = as_neat_compliant_uri(attribute)
154
+ for value_definition in value_definitions:
155
+ if literal := cls._value_definition2literal(value_definition):
156
+ triples.append((id_, predicate, literal))
157
+
158
+ return triples
159
+
160
+ @classmethod
161
+ def _value_definition2literal(cls, definition: dict) -> Literal | None:
162
+ if "Value" not in definition or "Format" not in definition:
163
+ return None
164
+
165
+ # case: when language is present we create add language tag to the literal
166
+ elif "Language" in definition and "Value" in definition:
167
+ return Literal(definition["Value"], lang=definition["Language"])
168
+
169
+ # case: when ValueURI is present we use it instead of Value
170
+ # this would be candidate for ENUMs in CDF
171
+ elif "ValueURI" in definition:
172
+ return Literal(definition["ValueURI"], datatype=XSD[definition["Format"]])
173
+
174
+ # case: when Format is not string we make sure to add the datatype
175
+ elif definition["Format"].lower() != "string":
176
+ return Literal(definition["Value"], datatype=XSD[definition["Format"]])
177
+
178
+ # case: when Format is string we add the literal without datatype (easier to read triples, less noise)
179
+ else:
180
+ return Literal(definition["Value"])
181
+
182
+ @classmethod
183
+ def _get_element_label(cls, element: Element) -> str | None:
184
+ if children := get_children(element, "Label", 1):
185
+ if grandchildren := get_children(children[0], "Text", 1):
186
+ if "String" in grandchildren[0].attrib:
187
+ return grandchildren[0].attrib["String"]
188
+
189
+ # extension for schema version 3.3, where text is used to "label" without a <label> parent
190
+ elif children := get_children(element, "Text", 1):
191
+ if "String" in children[0].attrib:
192
+ return children[0].attrib["String"]
193
+
194
+ return None
195
+
196
+ @classmethod
197
+ def _get_element_generic_attributes(cls, element: Element) -> dict:
198
+ # TODO: This requires more work as there are multiple groupings of GenericAttributes
199
+
200
+ attributes = defaultdict(list)
201
+ if children := get_children(element, "GenericAttributes", 1):
202
+ if grandchildren := get_children(children[0], "GenericAttribute"):
203
+ for generic_attribute in grandchildren:
204
+ # extension for schema version 3.3, where "AttributeURI" is not included
205
+ if "AttributeURI" in generic_attribute.attrib:
206
+ if generic_attribute.attrib["AttributeURI"] not in attributes:
207
+ attributes[generic_attribute.attrib["AttributeURI"]] = [generic_attribute.attrib]
208
+
209
+ else:
210
+ attributes[generic_attribute.attrib["AttributeURI"]].append(generic_attribute.attrib)
211
+
212
+ return attributes
@@ -1,11 +1,10 @@
1
1
  import sys
2
2
  import warnings
3
3
  from collections.abc import Iterable
4
- from datetime import datetime
4
+ from datetime import datetime, timezone
5
5
  from pathlib import Path
6
6
  from typing import cast
7
7
 
8
- import pytz
9
8
  from rdflib import RDF, Graph, Namespace, URIRef
10
9
  from rdflib.plugins.stores.sparqlstore import SPARQLUpdateStore
11
10
  from rdflib.query import ResultRow
@@ -41,14 +40,14 @@ class NeatGraphStore:
41
40
  graph: Graph,
42
41
  rules: InformationRules | None = None,
43
42
  ):
44
- _start = datetime.now(pytz.utc)
43
+ _start = datetime.now(timezone.utc)
45
44
  self.graph = graph
46
45
  self.provenance = Provenance(
47
46
  [
48
47
  Change.record(
49
48
  activity=f"{type(self).__name__}.__init__",
50
49
  start=_start,
51
- end=datetime.now(pytz.utc),
50
+ end=datetime.now(timezone.utc),
52
51
  description=f"Initialize graph store as {type(self.graph.store).__name__}",
53
52
  )
54
53
  ]
@@ -62,7 +61,7 @@ class NeatGraphStore:
62
61
 
63
62
  def _upsert_prefixes(self, prefixes: dict[str, Namespace]) -> None:
64
63
  """Adds prefixes to the graph store."""
65
- _start = datetime.now(pytz.utc)
64
+ _start = datetime.now(timezone.utc)
66
65
  for prefix, namespace in prefixes.items():
67
66
  self.graph.bind(prefix, namespace)
68
67
 
@@ -70,7 +69,7 @@ class NeatGraphStore:
70
69
  Change.record(
71
70
  activity=f"{type(self).__name__}._upsert_prefixes",
72
71
  start=_start,
73
- end=datetime.now(pytz.utc),
72
+ end=datetime.now(timezone.utc),
74
73
  description="Upsert prefixes to graph store",
75
74
  )
76
75
  )
@@ -124,11 +123,22 @@ class NeatGraphStore:
124
123
  return cls(graph, rules)
125
124
 
126
125
  def write(self, extractor: TripleExtractors) -> None:
126
+ _start = datetime.now(timezone.utc)
127
+
127
128
  if isinstance(extractor, RdfFileExtractor):
128
129
  self._parse_file(extractor.filepath, extractor.mime_type, extractor.base_uri)
129
130
  else:
130
131
  self._add_triples(extractor.extract())
131
132
 
133
+ self.provenance.append(
134
+ Change.record(
135
+ activity=f"{type(extractor).__name__}",
136
+ start=_start,
137
+ end=datetime.now(timezone.utc),
138
+ description=f"Extracted triples to graph store using {type(extractor).__name__}",
139
+ )
140
+ )
141
+
132
142
  def _parse_file(
133
143
  self,
134
144
  filepath: Path,
@@ -147,6 +147,13 @@ def get_namespace(URI: URIRef, special_separator: str = "#_") -> str:
147
147
  return "/".join(URI.split("/")[:-1]) + "/"
148
148
 
149
149
 
150
+ def as_neat_compliant_uri(uri: URIRef) -> URIRef:
151
+ namespace = get_namespace(uri)
152
+ id_ = remove_namespace(uri)
153
+ compliant_uri = re.sub(r"[^a-zA-Z0-9-_.]", "", id_)
154
+ return URIRef(f"{namespace}{compliant_uri}")
155
+
156
+
150
157
  def convert_rdflib_content(content: Literal | URIRef | dict | list) -> Any:
151
158
  if isinstance(content, Literal) or isinstance(content, URIRef):
152
159
  return content.toPython()
@@ -178,7 +178,7 @@ class DMSToRules(Step):
178
178
  ),
179
179
  Configurable(
180
180
  name="Reference data model id",
181
- value=None,
181
+ value="",
182
182
  label="The ID of the Reference Data Model to import. Written at 'my_space:my_data_model(version=1)'. "
183
183
  "This is typically an enterprise data model when you want to import a solution model",
184
184
  type="string",
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cognite-neat"
3
- version = "0.80.1"
3
+ version = "0.81.0"
4
4
  readme = "README.md"
5
5
  description = "Knowledge graph transformation"
6
6
  authors = [
@@ -77,7 +77,7 @@ cognite-sdk = "^7.37.0"
77
77
  deepdiff = "*"
78
78
  fastapi = "^0"
79
79
  schedule = "^1"
80
- python-multipart = "^0.0.6"
80
+ python-multipart = "^0"
81
81
  oxrdflib = { version = "^0.3.3", optional = true, extras = ["oxigraph"] }
82
82
 
83
83
 
@@ -1 +0,0 @@
1
- __version__ = "0.80.1"
File without changes
File without changes