cognite-neat 0.78.1__tar.gz → 0.78.3__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 (283) hide show
  1. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/PKG-INFO +1 -1
  2. cognite_neat-0.78.3/cognite/neat/_version.py +1 -0
  3. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/_rules2ontology.py +10 -6
  4. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_inference2rules.py +52 -56
  5. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +3 -6
  6. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +3 -8
  7. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +2 -4
  8. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +12 -17
  9. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/entities.py +71 -6
  10. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/information/_rules.py +8 -1
  11. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/information/_rules_input.py +15 -3
  12. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/current/rules_importer.py +2 -23
  13. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/pyproject.toml +1 -1
  14. cognite_neat-0.78.1/cognite/neat/_version.py +0 -1
  15. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/LICENSE +0 -0
  16. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/README.md +0 -0
  17. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/__init__.py +0 -0
  18. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/__init__.py +0 -0
  19. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/asgi/metrics.py +0 -0
  20. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/configuration.py +0 -0
  21. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/context_manager/__init__.py +0 -0
  22. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/context_manager/manager.py +0 -0
  23. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/data_classes/__init__.py +0 -0
  24. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/data_classes/rest.py +0 -0
  25. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/explorer.py +0 -0
  26. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/routers/configuration.py +0 -0
  27. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/routers/core.py +0 -0
  28. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/routers/crud.py +0 -0
  29. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/routers/data_exploration.py +0 -0
  30. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/routers/metrics.py +0 -0
  31. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/routers/rules.py +0 -0
  32. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/routers/workflows.py +0 -0
  33. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/utils/__init__.py +0 -0
  34. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/utils/data_mapping.py +0 -0
  35. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/utils/logging.py +0 -0
  36. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/api/utils/query_templates.py +0 -0
  37. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/main.py +0 -0
  38. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/monitoring/__init__.py +0 -0
  39. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/monitoring/metrics.py +0 -0
  40. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/index.html +0 -0
  41. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
  42. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/README.md +0 -0
  43. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
  44. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
  45. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
  46. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
  47. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
  48. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
  49. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
  50. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
  51. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
  52. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
  53. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
  54. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
  55. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
  56. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
  57. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
  58. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/config.py +0 -0
  59. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/constants.py +0 -0
  60. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/exceptions.py +0 -0
  61. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/__init__.py +0 -0
  62. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  63. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  64. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/examples/__init__.py +0 -0
  65. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  66. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/exceptions.py +0 -0
  67. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/extractors/__init__.py +0 -0
  68. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/extractors/_base.py +0 -0
  69. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
  70. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/models.py +0 -0
  71. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/stores/__init__.py +0 -0
  72. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/stores/_base.py +0 -0
  73. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
  74. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/stores/_memory_store.py +0 -0
  75. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
  76. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
  77. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
  78. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/__init__.py +0 -0
  79. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/__init__.py +0 -0
  80. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  81. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  82. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
  83. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  84. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/exceptions.py +0 -0
  85. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
  86. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
  87. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
  88. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
  89. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
  90. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
  91. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
  92. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
  93. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
  94. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
  95. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
  96. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
  97. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
  98. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
  99. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
  100. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
  101. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/models.py +0 -0
  102. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
  103. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/stores/_base.py +0 -0
  104. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
  105. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
  106. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
  107. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
  108. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
  109. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
  110. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
  111. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
  112. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
  113. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
  114. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/__init__.py +0 -0
  115. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/analysis.py +0 -0
  116. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
  117. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
  118. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
  119. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
  120. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
  121. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
  122. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
  123. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
  124. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
  125. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
  126. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
  127. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exceptions.py +0 -0
  128. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
  129. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
  130. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
  131. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
  132. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
  133. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
  134. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
  135. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
  136. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
  137. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
  138. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
  139. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
  140. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
  141. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_base.py +0 -0
  142. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
  143. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
  144. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
  145. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
  146. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
  147. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
  148. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  149. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
  150. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
  151. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
  152. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
  153. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
  154. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/models/__init__.py +0 -0
  155. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/models/_base.py +0 -0
  156. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
  157. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
  158. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/models/rules.py +0 -0
  159. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/models/tables.py +0 -0
  160. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/rules/models/value_types.py +0 -0
  161. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
  162. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  163. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  164. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  165. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
  166. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  167. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  168. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  169. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  170. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  171. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/py.typed +0 -0
  172. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/__init__.py +0 -0
  173. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/_shared.py +0 -0
  174. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/analysis/__init__.py +0 -0
  175. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/analysis/_base.py +0 -0
  176. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/analysis/_information_rules.py +0 -0
  177. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/examples/__init__.py +0 -0
  178. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/examples/wind-energy.owl +0 -0
  179. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exceptions.py +0 -0
  180. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/__init__.py +0 -0
  181. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/_base.py +0 -0
  182. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/_models.py +0 -0
  183. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/_rules2dms.py +0 -0
  184. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
  185. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
  186. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/exporters/_validation.py +0 -0
  187. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/__init__.py +0 -0
  188. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_base.py +0 -0
  189. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_dms2rules.py +0 -0
  190. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
  191. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  192. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
  193. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
  194. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
  195. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
  196. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_spreadsheet2rules.py +0 -0
  197. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
  198. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/__init__.py +0 -0
  199. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/base.py +0 -0
  200. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/dms.py +0 -0
  201. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/fileread.py +0 -0
  202. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/formatters.py +0 -0
  203. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/importing.py +0 -0
  204. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/spreadsheet.py +0 -0
  205. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
  206. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/__init__.py +0 -0
  207. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/_base.py +0 -0
  208. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/_rdfpath.py +0 -0
  209. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/_types/__init__.py +0 -0
  210. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/_types/_base.py +0 -0
  211. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/_types/_field.py +0 -0
  212. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/data_types.py +0 -0
  213. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/__init__.py +0 -0
  214. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/_converter.py +0 -0
  215. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/_exporter.py +0 -0
  216. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/_rules.py +0 -0
  217. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
  218. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/_schema.py +0 -0
  219. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/_serializer.py +0 -0
  220. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/dms/_validation.py +0 -0
  221. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/domain.py +0 -0
  222. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/information/__init__.py +0 -0
  223. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/information/_converter.py +0 -0
  224. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/information/_serializer.py +0 -0
  225. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/information/_validation.py +0 -0
  226. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/rules/models/wrapped_entities.py +0 -0
  227. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/__init__.py +0 -0
  228. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/auxiliary.py +0 -0
  229. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/cdf.py +0 -0
  230. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/cdf_classes.py +0 -0
  231. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
  232. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
  233. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
  234. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
  235. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
  236. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/exceptions.py +0 -0
  237. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/spreadsheet.py +0 -0
  238. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/text.py +0 -0
  239. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/utils.py +0 -0
  240. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/utils/xml.py +0 -0
  241. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/__init__.py +0 -0
  242. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/_exceptions.py +0 -0
  243. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/base.py +0 -0
  244. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/cdf_store.py +0 -0
  245. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
  246. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  247. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  248. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  249. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
  250. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  251. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  252. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  253. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  254. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  255. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/manager.py +0 -0
  256. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/migration/__init__.py +0 -0
  257. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/migration/steps.py +0 -0
  258. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
  259. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/model.py +0 -0
  260. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/__init__.py +0 -0
  261. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/data_contracts.py +0 -0
  262. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
  263. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
  264. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
  265. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
  266. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
  267. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
  268. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
  269. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
  270. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
  271. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
  272. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
  273. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
  274. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
  275. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
  276. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
  277. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
  278. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
  279. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps/step_model.py +0 -0
  280. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/steps_registry.py +0 -0
  281. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/tasks.py +0 -0
  282. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/cognite/neat/workflows/triggers.py +0 -0
  283. {cognite_neat-0.78.1 → cognite_neat-0.78.3}/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.78.1
3
+ Version: 0.78.3
4
4
  Summary: Knowledge graph transformation
5
5
  Home-page: https://cognite-neat.readthedocs-hosted.com/
6
6
  License: Apache-2.0
@@ -0,0 +1 @@
1
+ __version__ = "0.78.3"
@@ -331,7 +331,7 @@ class OWLProperty(OntologyModel):
331
331
  elif isinstance(definition.value_type, ClassEntity):
332
332
  owl_property.range_.add(namespace[str(definition.value_type.suffix)])
333
333
  else:
334
- raise ValueError(f"Value type {definition.value_type} is not supported")
334
+ raise ValueError(f"Value type {definition.value_type.type_} is not supported")
335
335
  owl_property.domain.add(namespace[str(definition.class_.suffix)])
336
336
  owl_property.label.add(definition.name or definition.property_)
337
337
  if definition.description:
@@ -549,15 +549,19 @@ class SHACLPropertyShape(OntologyModel):
549
549
 
550
550
  @classmethod
551
551
  def from_property(cls, definition: InformationProperty, namespace: Namespace) -> "SHACLPropertyShape":
552
+ # TODO requires PR to fix MultiValueType and UnknownValueType
553
+ if isinstance(definition.value_type, ClassEntity):
554
+ expected_value_type = namespace[f"{definition.value_type.suffix}Shape"]
555
+ elif isinstance(definition.value_type, DataType):
556
+ expected_value_type = XSD[definition.value_type.xsd]
557
+ else:
558
+ raise ValueError(f"Value type {definition.value_type.type_} is not supported")
559
+
552
560
  return cls(
553
561
  id_=BNode(),
554
562
  path=namespace[definition.property_],
555
563
  node_kind=SHACL.IRI if definition.type_ == EntityTypes.object_property else SHACL.Literal,
556
- expected_value_type=(
557
- namespace[f"{definition.value_type.suffix}Shape"]
558
- if isinstance(definition.value_type, ClassEntity)
559
- else XSD[definition.value_type.xsd]
560
- ),
564
+ expected_value_type=expected_value_type,
561
565
  min_count=definition.min_count,
562
566
  max_count=(
563
567
  int(definition.max_count) if definition.max_count and definition.max_count != float("inf") else None
@@ -1,3 +1,4 @@
1
+ import re
1
2
  from datetime import datetime
2
3
  from pathlib import Path
3
4
  from typing import Literal, cast, overload
@@ -12,12 +13,11 @@ from cognite.neat.rules.importers._base import BaseImporter, Rules, _handle_issu
12
13
  from cognite.neat.rules.issues import IssueList
13
14
  from cognite.neat.rules.models import InformationRules, RoleTypes
14
15
  from cognite.neat.rules.models._base import MatchType
15
- from cognite.neat.rules.models.entities import ClassEntity
16
16
  from cognite.neat.rules.models.information import (
17
17
  InformationMetadata,
18
18
  InformationRulesInput,
19
19
  )
20
- from cognite.neat.utils.utils import get_namespace, remove_namespace, replace_non_alphanumeric_with_underscore
20
+ from cognite.neat.utils.utils import get_namespace, remove_namespace
21
21
 
22
22
  ORDERED_CLASSES_QUERY = """SELECT ?class (count(?s) as ?instances )
23
23
  WHERE { ?s a ?class . }
@@ -39,29 +39,21 @@ class InferenceImporter(BaseImporter):
39
39
  issue_list: Issue list to store issues
40
40
  graph: Knowledge graph
41
41
  max_number_of_instance: Maximum number of instances to be used in inference
42
- make_compliant: If True, NEAT will attempt to make the imported rules compliant with CDF
43
42
  """
44
43
 
45
- def __init__(
46
- self, issue_list: IssueList, graph: Graph, make_compliant: bool = False, max_number_of_instance: int = -1
47
- ):
44
+ def __init__(self, issue_list: IssueList, graph: Graph, max_number_of_instance: int = -1):
48
45
  self.issue_list = issue_list
49
46
  self.graph = graph
50
47
  self.max_number_of_instance = max_number_of_instance
51
- self.make_compliant = make_compliant
52
48
 
53
49
  @classmethod
54
- def from_graph_store(
55
- cls, store: NeatGraphStoreBase, make_compliant: bool = False, max_number_of_instance: int = -1
56
- ):
50
+ def from_graph_store(cls, store: NeatGraphStoreBase, max_number_of_instance: int = -1):
57
51
  issue_list = IssueList(title="Inferred from graph store")
58
52
 
59
- return cls(
60
- issue_list, store.graph, make_compliant=make_compliant, max_number_of_instance=max_number_of_instance
61
- )
53
+ return cls(issue_list, store.graph, max_number_of_instance=max_number_of_instance)
62
54
 
63
55
  @classmethod
64
- def from_rdf_file(cls, filepath: Path, make_compliant: bool = False, max_number_of_instance: int = -1):
56
+ def from_rdf_file(cls, filepath: Path, max_number_of_instance: int = -1):
65
57
  issue_list = IssueList(title=f"'{filepath.name}'")
66
58
 
67
59
  graph = Graph()
@@ -70,18 +62,18 @@ class InferenceImporter(BaseImporter):
70
62
  except Exception:
71
63
  issue_list.append(issues.fileread.FileReadError(filepath))
72
64
 
73
- return cls(issue_list, graph, make_compliant=make_compliant, max_number_of_instance=max_number_of_instance)
65
+ return cls(issue_list, graph, max_number_of_instance=max_number_of_instance)
74
66
 
75
67
  @classmethod
76
- def from_json_file(cls, filepath: Path, make_compliant: bool = False, max_number_of_instance: int = -1):
68
+ def from_json_file(cls, filepath: Path, max_number_of_instance: int = -1):
77
69
  raise NotImplementedError("JSON file format is not supported yet.")
78
70
 
79
71
  @classmethod
80
- def from_yaml_file(cls, filepath: Path, make_compliant: bool = False, max_number_of_instance: int = -1):
72
+ def from_yaml_file(cls, filepath: Path, max_number_of_instance: int = -1):
81
73
  raise NotImplementedError("YAML file format is not supported yet.")
82
74
 
83
75
  @classmethod
84
- def from_xml_file(cls, filepath: Path, make_compliant: bool = False, max_number_of_instance: int = -1):
76
+ def from_xml_file(cls, filepath: Path, max_number_of_instance: int = -1):
85
77
  raise NotImplementedError("JSON file format is not supported yet.")
86
78
 
87
79
  @overload
@@ -117,9 +109,6 @@ class InferenceImporter(BaseImporter):
117
109
  if future.result == "failure" or self.issue_list.has_errors:
118
110
  return self._return_or_raise(self.issue_list, errors)
119
111
 
120
- if self.make_compliant and rules:
121
- self._make_dms_compliant_rules(rules)
122
-
123
112
  return self._to_output(
124
113
  rules,
125
114
  self.issue_list,
@@ -155,7 +144,7 @@ class InferenceImporter(BaseImporter):
155
144
  "class_": class_id,
156
145
  "reference": class_uri,
157
146
  "match_type": MatchType.exact,
158
- "comment": f"Inferred from knowledge graph, where this class has {no_instances} instances",
147
+ "comment": f"Inferred from knowledge graph, where this class has <{no_instances}> instances",
159
148
  }
160
149
 
161
150
  # Infers all the properties of the class
@@ -179,7 +168,7 @@ class InferenceImporter(BaseImporter):
179
168
 
180
169
  self._add_uri_namespace_to_prefixes(cast(URIRef, value_type_uri), prefixes)
181
170
  value_type_id = remove_namespace(value_type_uri)
182
- id_ = f"{class_id}:{property_id}:{value_type_id}"
171
+ id_ = f"{class_id}:{property_id}"
183
172
 
184
173
  definition = {
185
174
  "class_": class_id,
@@ -187,15 +176,41 @@ class InferenceImporter(BaseImporter):
187
176
  "max_count": cast(RdfLiteral, occurrence).value,
188
177
  "value_type": value_type_id,
189
178
  "reference": property_uri,
179
+ "comment": (
180
+ f"Class <{class_id}> has property <{property_id}> with "
181
+ f"value type <{value_type_id}> which occurs <1> times in the graph"
182
+ ),
190
183
  }
191
184
 
192
185
  # USE CASE 1: If property is not present in properties
193
186
  if id_ not in properties:
194
187
  properties[id_] = definition
195
- # USE CASE 2: If property is present in properties but with different max count
196
- elif id_ in properties and not (properties[id_]["max_count"] == definition["max_count"]):
188
+
189
+ # USE CASE 2: first time redefinition, value type change to multi
190
+ elif id_ in properties and definition["value_type"] not in properties[id_]["value_type"]:
191
+ properties[id_]["value_type"] = properties[id_]["value_type"] + " | " + definition["value_type"]
192
+ properties[id_]["comment"] = (
193
+ properties[id_]["comment"] + ", with" + definition["comment"].split("with")[1]
194
+ )
195
+
196
+ # USE CASE 3: existing but max count is different
197
+ elif (
198
+ id_ in properties
199
+ and definition["value_type"] in properties[id_]["value_type"]
200
+ and not (properties[id_]["max_count"] == definition["max_count"])
201
+ ):
197
202
  properties[id_]["max_count"] = max(properties[id_]["max_count"], definition["max_count"])
198
203
 
204
+ properties[id_]["comment"] = self._update_value_type_occurrence_in_comment(
205
+ definition["value_type"], properties[id_]["comment"]
206
+ )
207
+
208
+ # USE CASE 4: Just update the comment with occurrence
209
+ else:
210
+ properties[id_]["comment"] = self._update_value_type_occurrence_in_comment(
211
+ definition["value_type"], properties[id_]["comment"]
212
+ )
213
+
199
214
  return {
200
215
  "metadata": self._default_metadata().model_dump(),
201
216
  "classes": list(classes.values()),
@@ -228,36 +243,17 @@ class InferenceImporter(BaseImporter):
228
243
  )
229
244
 
230
245
  @classmethod
231
- def _make_dms_compliant_rules(cls, rules: InformationRules) -> None:
232
- cls._fix_property_redefinition(rules)
233
- cls._fix_naming_of_entities(rules)
234
-
235
- @classmethod
236
- def _fix_property_redefinition(cls, rules: InformationRules) -> None:
237
- seen = set()
238
- for i, property_ in enumerate(rules.properties.data):
239
- prop_id = f"{property_.class_}.{property_.property_}"
240
- if prop_id in seen:
241
- property_.property_ = f"{property_.property_}_{i+1}"
242
- seen.add(f"{property_.class_}.{property_.property_}")
243
- else:
244
- seen.add(prop_id)
246
+ def _update_value_type_occurrence_in_comment(cls, value_type: str, comment: str) -> str:
247
+ occurrence = cls._read_value_type_occurrence_from_comment(value_type, comment)
248
+ return comment.replace(
249
+ f"with value type <{value_type}> which occurs <{occurrence}> times in the graph",
250
+ f"with value type <{value_type}> which occurs <{occurrence+1}> times in the graph",
251
+ )
245
252
 
246
253
  @classmethod
247
- def _fix_naming_of_entities(cls, rules: InformationRules) -> None:
248
- # Fixing class ids
249
- for class_ in rules.classes:
250
- class_.class_ = class_.class_.as_dms_compliant_entity()
251
- class_.parent = [parent.as_dms_compliant_entity() for parent in class_.parent] if class_.parent else None
252
-
253
- # Fixing property definitions
254
- for property_ in rules.properties:
255
- # fix class id
256
- property_.class_ = property_.class_.as_dms_compliant_entity()
257
-
258
- # fix property id
259
- property_.property_ = replace_non_alphanumeric_with_underscore(property_.property_)
260
-
261
- # fix value type
262
- if isinstance(property_.value_type, ClassEntity):
263
- property_.value_type = property_.value_type.as_dms_compliant_entity()
254
+ def _read_value_type_occurrence_from_comment(cls, value_type: str, comment: str) -> int:
255
+ return int(
256
+ cast(
257
+ re.Match, re.search(rf"with value type <{value_type}> which occurs <(\d+)> times in the graph", comment)
258
+ ).group(1)
259
+ )
@@ -8,19 +8,17 @@ from cognite.neat.rules.models._base import MatchType
8
8
  from cognite.neat.utils.utils import remove_namespace
9
9
 
10
10
 
11
- def parse_owl_classes(graph: Graph, make_compliant: bool = False, language: str = "en") -> list[dict]:
11
+ def parse_owl_classes(graph: Graph, language: str = "en") -> list[dict]:
12
12
  """Parse owl classes from graph to pandas dataframe.
13
13
 
14
14
  Args:
15
15
  graph: Graph containing owl classes
16
- make_compliant: Flag for generating compliant classes, by default False
17
16
  language: Language to use for parsing, by default "en"
18
17
 
19
18
  Returns:
20
19
  Dataframe containing owl classes
21
20
 
22
- !!! note "make_compliant"
23
- If `make_compliant` is set to True, in presence of errors, default values will be used instead.
21
+ !!! note "Compliant OWL classes"
24
22
  This makes the method very opinionated, but results in a compliant classes.
25
23
  """
26
24
 
@@ -48,8 +46,7 @@ def parse_owl_classes(graph: Graph, make_compliant: bool = False, language: str
48
46
  processed_df = _clean_up_classes(raw_df)
49
47
 
50
48
  # make compliant
51
- if make_compliant:
52
- processed_df = make_classes_compliant(processed_df)
49
+ processed_df = make_classes_compliant(processed_df)
53
50
 
54
51
  # Make Parent Class list elements into string joined with comma
55
52
  processed_df["Parent Class"] = processed_df["Parent Class"].apply(
@@ -12,18 +12,16 @@ from cognite.neat.rules.models._types._base import (
12
12
  from cognite.neat.utils.utils import convert_rdflib_content, remove_none_elements_from_set
13
13
 
14
14
 
15
- def parse_owl_metadata(graph: Graph, make_compliant: bool = False) -> dict:
15
+ def parse_owl_metadata(graph: Graph) -> dict:
16
16
  """Parse owl metadata from graph to dict.
17
17
 
18
18
  Args:
19
19
  graph: Graph containing owl metadata
20
- make_compliant: Flag for generating compliant metadata, by default False
21
20
 
22
21
  Returns:
23
22
  Dictionary containing owl metadata
24
23
 
25
- !!! note "make_compliant"
26
- If `make_compliant` is set to True, in presence of errors, default values will be used instead.
24
+ !!! note "Compliant OWL metadata"
27
25
  This makes the method very opinionated, but results in a compliant metadata.
28
26
 
29
27
 
@@ -72,10 +70,7 @@ def parse_owl_metadata(graph: Graph, make_compliant: bool = False) -> dict:
72
70
  }
73
71
  )
74
72
 
75
- if make_compliant:
76
- return make_metadata_compliant(raw_metadata)
77
-
78
- return raw_metadata
73
+ return make_metadata_compliant(raw_metadata)
79
74
 
80
75
 
81
76
  def make_metadata_compliant(metadata: dict) -> dict:
@@ -10,12 +10,11 @@ from cognite.neat.utils.utils import remove_namespace
10
10
  from ._owl2classes import _data_type_property_class, _object_property_class, _thing_class
11
11
 
12
12
 
13
- def parse_owl_properties(graph: Graph, make_compliant: bool = False, language: str = "en") -> list[dict]:
13
+ def parse_owl_properties(graph: Graph, language: str = "en") -> list[dict]:
14
14
  """Parse owl properties from graph to pandas dataframe.
15
15
 
16
16
  Args:
17
17
  graph: Graph containing owl properties
18
- make_compliant: Flag for generating compliant properties, by default False
19
18
  language: Language to use for parsing, by default "en"
20
19
 
21
20
  Returns:
@@ -53,8 +52,7 @@ def parse_owl_properties(graph: Graph, make_compliant: bool = False, language: s
53
52
  processed_df = _clean_up_properties(raw_df)
54
53
 
55
54
  # make compliant
56
- if make_compliant:
57
- processed_df = make_properties_compliant(processed_df)
55
+ processed_df = make_properties_compliant(processed_df)
58
56
 
59
57
  # drop column _property_type, which was a helper column:
60
58
  processed_df.drop(columns=["_property_type"], inplace=True)
@@ -21,25 +21,21 @@ class OWLImporter(BaseImporter):
21
21
 
22
22
  Args:
23
23
  filepath: Path to OWL ontology
24
- make_compliant: If True, NEAT will attempt to make the imported rules compliant with CDF
25
24
 
26
25
  !!! Note
27
- OWL Ontologies typically lacks some information that is required for making a complete
28
- data model. This means that the methods .to_rules() will typically fail. Instead, it is recommended
29
- that you use the .to_spreadsheet() method to generate an Excel file, and then manually add the missing
30
- information to the Excel file. The Excel file can then be converted to a `Rules` object.
26
+ OWL Ontologies are information models which completeness varies. As such, constructing functional
27
+ data model directly will often be impossible, therefore the produced Rules object will be ill formed.
28
+ To avoid this, neat will automatically attempt to make the imported rules compliant by adding default
29
+ values for missing information, attaching dangling properties to default containers based on the
30
+ property type, etc.
31
31
 
32
- Alternatively, one can set the `make_compliant` parameter to True to allow neat to attempt to make
33
- the imported rules compliant by adding default values for missing information, attaching dangling
34
- properties to default containers based on the property type, etc. One has to be aware
35
- that NEAT will be opinionated about how to make the ontology compliant, and that the resulting
36
- rules may not be what you expect.
32
+ One has to be aware that NEAT will be opinionated about how to make the ontology
33
+ compliant, and that the resulting rules may not be what you expect.
37
34
 
38
35
  """
39
36
 
40
- def __init__(self, filepath: Path, make_compliant: bool = False):
37
+ def __init__(self, filepath: Path):
41
38
  self.owl_filepath = filepath
42
- self.make_compliant = make_compliant
43
39
 
44
40
  @overload
45
41
  def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules: ...
@@ -67,13 +63,12 @@ class OWLImporter(BaseImporter):
67
63
  graph.bind("skos", SKOS)
68
64
 
69
65
  components = {
70
- "Metadata": parse_owl_metadata(graph, make_compliant=self.make_compliant),
71
- "Classes": parse_owl_classes(graph, make_compliant=self.make_compliant),
72
- "Properties": parse_owl_properties(graph, make_compliant=self.make_compliant),
66
+ "Metadata": parse_owl_metadata(graph),
67
+ "Classes": parse_owl_classes(graph),
68
+ "Properties": parse_owl_properties(graph),
73
69
  }
74
70
 
75
- if self.make_compliant:
76
- components = make_components_compliant(components)
71
+ components = make_components_compliant(components)
77
72
 
78
73
  rules = InformationRules.model_validate(components)
79
74
  return self._to_output(rules, IssueList(), errors, role)
@@ -5,8 +5,17 @@ from functools import total_ordering
5
5
  from typing import Annotated, Any, ClassVar, Generic, TypeVar, cast
6
6
 
7
7
  from cognite.client.data_classes.data_modeling.ids import ContainerId, DataModelId, NodeId, PropertyId, ViewId
8
- from pydantic import AnyHttpUrl, BaseModel, BeforeValidator, Field, PlainSerializer, model_serializer, model_validator
8
+ from pydantic import (
9
+ AnyHttpUrl,
10
+ BaseModel,
11
+ BeforeValidator,
12
+ Field,
13
+ PlainSerializer,
14
+ model_serializer,
15
+ model_validator,
16
+ )
9
17
 
18
+ from cognite.neat.rules.models.data_types import DataType
10
19
  from cognite.neat.utils.utils import replace_non_alphanumeric_with_underscore
11
20
 
12
21
  if sys.version_info >= (3, 11):
@@ -38,6 +47,7 @@ class EntityTypes(StrEnum):
38
47
  container = "container"
39
48
  datamodel = "datamodel"
40
49
  undefined = "undefined"
50
+ multi_value_type = "multi_value_type"
41
51
 
42
52
 
43
53
  # ALLOWED
@@ -58,6 +68,7 @@ _CLASS_ID_REGEX_COMPILED = re.compile(rf"^{_CLASS_ID_REGEX}$")
58
68
  _PROPERTY_ID_REGEX = rf"\((?P<{EntityTypes.property_}>{_ENTITY_ID_REGEX})\)"
59
69
 
60
70
  _ENTITY_PATTERN = re.compile(r"^(?P<prefix>.*?):?(?P<suffix>[^(:]*)(\((?P<content>[^)]+)\))?$")
71
+ _MULTI_VALUE_TYPE_PATTERN = re.compile(r"^(?P<types>.*?)(\((?P<content>[^)]+)\))?$")
61
72
 
62
73
 
63
74
  class _UndefinedType(BaseModel): ...
@@ -238,11 +249,6 @@ class ClassEntity(Entity):
238
249
  space = default_space if isinstance(self.prefix, _UndefinedType) else self.prefix
239
250
  return ContainerEntity(space=space, externalId=str(self.suffix))
240
251
 
241
- def as_dms_compliant_entity(self) -> "Self":
242
- new_entity = self.model_copy(deep=True)
243
- new_entity.suffix = replace_non_alphanumeric_with_underscore(new_entity.suffix)
244
- return new_entity
245
-
246
252
 
247
253
  class ParentClassEntity(ClassEntity):
248
254
  type_: ClassVar[EntityTypes] = EntityTypes.parent_class
@@ -264,6 +270,60 @@ class UnknownEntity(ClassEntity):
264
270
  T_ID = TypeVar("T_ID", bound=ContainerId | ViewId | DataModelId | PropertyId | NodeId | None)
265
271
 
266
272
 
273
+ class MultiValueTypeInfo(BaseModel):
274
+ type_: ClassVar[EntityTypes] = EntityTypes.multi_value_type
275
+ types: list[DataType | ClassEntity]
276
+
277
+ def __str__(self) -> str:
278
+ return " | ".join([str(t) for t in self.types])
279
+
280
+ @model_serializer(when_used="unless-none", return_type=str)
281
+ def as_str(self) -> str:
282
+ return str(self)
283
+
284
+ @classmethod
285
+ def load(cls, data: Any) -> "MultiValueTypeInfo":
286
+ # already instance of MultiValueTypeInfo
287
+ if isinstance(data, cls):
288
+ return data
289
+
290
+ # it is a raw string that needs to be parsed
291
+ elif isinstance(data, str):
292
+ return cls.model_validate({_PARSE: data})
293
+
294
+ # it is dict that needs to be parsed
295
+ else:
296
+ return cls.model_validate(data)
297
+
298
+ @model_validator(mode="before")
299
+ def _load(cls, data: Any) -> "dict | MultiValueTypeInfo":
300
+ if isinstance(data, dict) and _PARSE in data:
301
+ data = data[_PARSE]
302
+ elif isinstance(data, dict):
303
+ return data
304
+ else:
305
+ raise ValueError(f"Cannot load {cls.__name__} from {data}")
306
+
307
+ result = cls._parse(data)
308
+ return result
309
+
310
+ @classmethod
311
+ def _parse(cls, raw: str) -> dict:
312
+ if not (types := [type_.strip() for type_ in raw.split("|")]):
313
+ return {"types": [UnknownEntity()]}
314
+ else:
315
+ return {
316
+ "types": [
317
+ DataType.load(type_) if DataType.is_data_type(type_) else ClassEntity.load(type_) for type_ in types
318
+ ]
319
+ }
320
+
321
+ def set_default_prefix(self, prefix: str):
322
+ for type_ in self.types:
323
+ if isinstance(type_, ClassEntity) and type_.prefix is Undefined:
324
+ type_.prefix = prefix
325
+
326
+
267
327
  class DMSEntity(Entity, Generic[T_ID], ABC):
268
328
  type_: ClassVar[EntityTypes] = EntityTypes.undefined
269
329
  prefix: str = Field(alias="space")
@@ -297,6 +357,11 @@ class DMSEntity(Entity, Generic[T_ID], ABC):
297
357
  def as_class(self) -> ClassEntity:
298
358
  return ClassEntity(prefix=self.space, suffix=self.external_id)
299
359
 
360
+ def as_dms_compliant_entity(self) -> "Self":
361
+ new_entity = self.model_copy(deep=True)
362
+ new_entity.suffix = replace_non_alphanumeric_with_underscore(new_entity.suffix)
363
+ return new_entity
364
+
300
365
 
301
366
  T_DMSEntity = TypeVar("T_DMSEntity", bound=DMSEntity)
302
367
 
@@ -44,6 +44,7 @@ from cognite.neat.rules.models.domain import DomainRules
44
44
  from cognite.neat.rules.models.entities import (
45
45
  ClassEntity,
46
46
  EntityTypes,
47
+ MultiValueTypeInfo,
47
48
  ParentClassEntity,
48
49
  ParentEntityList,
49
50
  ReferenceEntity,
@@ -162,7 +163,9 @@ class InformationProperty(SheetEntity):
162
163
  property_: PropertyType = Field(alias="Property")
163
164
  name: str | None = Field(alias="Name", default=None)
164
165
  description: str | None = Field(alias="Description", default=None)
165
- value_type: DataType | ClassEntity | UnknownEntity = Field(alias="Value Type", union_mode="left_to_right")
166
+ value_type: DataType | ClassEntity | MultiValueTypeInfo | UnknownEntity = Field(
167
+ alias="Value Type", union_mode="left_to_right"
168
+ )
166
169
  min_count: int | None = Field(alias="Min Count", default=None)
167
170
  max_count: int | float | None = Field(alias="Max Count", default=None)
168
171
  default: Any | None = Field(alias="Default", default=None)
@@ -277,6 +280,10 @@ class InformationRules(BaseRules):
277
280
  for property_ in self.properties:
278
281
  if isinstance(property_.value_type, ClassEntity) and property_.value_type.prefix is Undefined:
279
282
  property_.value_type.prefix = self.metadata.prefix
283
+
284
+ if isinstance(property_.value_type, MultiValueTypeInfo):
285
+ property_.value_type.set_default_prefix(self.metadata.prefix)
286
+
280
287
  if property_.class_.prefix is Undefined:
281
288
  property_.class_.prefix = self.metadata.prefix
282
289
 
@@ -7,7 +7,13 @@ from rdflib import Namespace
7
7
 
8
8
  from cognite.neat.rules.models._base import DataModelType, ExtensionCategory, SchemaCompleteness, _add_alias
9
9
  from cognite.neat.rules.models.data_types import DataType
10
- from cognite.neat.rules.models.entities import ClassEntity, ParentClassEntity, Unknown, UnknownEntity
10
+ from cognite.neat.rules.models.entities import (
11
+ ClassEntity,
12
+ MultiValueTypeInfo,
13
+ ParentClassEntity,
14
+ Unknown,
15
+ UnknownEntity,
16
+ )
11
17
 
12
18
  from ._rules import InformationClass, InformationMetadata, InformationProperty, InformationRules
13
19
 
@@ -121,10 +127,15 @@ class InformationPropertyInput:
121
127
  )
122
128
 
123
129
  def dump(self, default_prefix: str) -> dict[str, Any]:
124
- value_type: DataType | ClassEntity | UnknownEntity
130
+ value_type: MultiValueTypeInfo | DataType | ClassEntity | UnknownEntity
125
131
 
126
132
  # property holding xsd data type
127
- if DataType.is_data_type(self.value_type):
133
+ # check if it is multi value type
134
+ if "|" in self.value_type:
135
+ value_type = MultiValueTypeInfo.load(self.value_type)
136
+ value_type.set_default_prefix(default_prefix)
137
+
138
+ elif DataType.is_data_type(self.value_type):
128
139
  value_type = DataType.load(self.value_type)
129
140
 
130
141
  # unknown value type
@@ -257,6 +268,7 @@ class InformationRulesInput:
257
268
  elif isinstance(self.last, InformationRules):
258
269
  # We need to load through the InformationRulesInput to set the correct default space and version
259
270
  last = InformationRulesInput.load(self.last.model_dump()).dump()
271
+
260
272
  return dict(
261
273
  Metadata=self.metadata.dump(),
262
274
  Properties=[prop.dump(default_prefix) for prop in self.properties],
@@ -119,15 +119,6 @@ class OntologyToRules(Step):
119
119
  label="For what role Rules are intended?",
120
120
  options=["infer", *RoleTypes.__members__.keys()],
121
121
  ),
122
- Configurable(
123
- name="Make compliant",
124
- value="True",
125
- label=(
126
- "Attempt to make the imported Rules compliant, by converting "
127
- "the information model provided in the ontology to data model."
128
- ),
129
- options=["True", "False"],
130
- ),
131
122
  ]
132
123
 
133
124
  def run(self, flow_message: FlowMessage) -> (FlowMessage, MultiRuleData): # type: ignore[syntax, override]
@@ -136,7 +127,6 @@ class OntologyToRules(Step):
136
127
 
137
128
  file_name = self.configs.get("File name", None)
138
129
  full_path = flow_message.payload.get("full_path", None) if flow_message.payload else None
139
- make_compliant = self.configs.get("Make compliant", "True") == "True"
140
130
 
141
131
  if file_name:
142
132
  rules_file_path = self.config.rules_store_path / file_name
@@ -152,7 +142,7 @@ class OntologyToRules(Step):
152
142
  if role != "infer" and role is not None:
153
143
  role_enum = RoleTypes[role]
154
144
 
155
- ontology_importer = importers.OWLImporter(filepath=rules_file_path, make_compliant=make_compliant)
145
+ ontology_importer = importers.OWLImporter(filepath=rules_file_path)
156
146
  rules, issues = ontology_importer.to_rules(errors="continue", role=role_enum)
157
147
 
158
148
  if rules is None:
@@ -286,16 +276,6 @@ class RulesInferenceFromRdfFile(Step):
286
276
  label="For what role Rules are intended?",
287
277
  options=["infer", *RoleTypes.__members__.keys()],
288
278
  ),
289
- Configurable(
290
- name="Make compliant",
291
- value="True",
292
- label=(
293
- "Attempt to make the imported Rules compliant, by fixing "
294
- "redefinition of properties and by making ids of entities compliant with"
295
- " CDF-allowed set of characters ."
296
- ),
297
- options=["True", "False"],
298
- ),
299
279
  Configurable(
300
280
  name="Maximum number of instances to process",
301
281
  value="-1",
@@ -312,7 +292,6 @@ class RulesInferenceFromRdfFile(Step):
312
292
 
313
293
  file_path = self.configs.get("File path", None)
314
294
  full_path = flow_message.payload.get("full_path", None) if flow_message.payload else None
315
- make_compliant = self.configs.get("Make compliant", "True") == "True"
316
295
 
317
296
  try:
318
297
  max_number_of_instance = int(self.configs.get("Maximum number of instances to process", -1))
@@ -335,7 +314,7 @@ class RulesInferenceFromRdfFile(Step):
335
314
  role_enum = RoleTypes[role]
336
315
 
337
316
  inference_importer = importers.InferenceImporter.from_rdf_file(
338
- rdf_file_path, make_compliant=make_compliant, max_number_of_instance=max_number_of_instance
317
+ rdf_file_path, max_number_of_instance=max_number_of_instance
339
318
  )
340
319
  rules, issues = inference_importer.to_rules(errors="continue", role=role_enum)
341
320
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cognite-neat"
3
- version = "0.78.1"
3
+ version = "0.78.3"
4
4
  readme = "README.md"
5
5
  description = "Knowledge graph transformation"
6
6
  authors = [
@@ -1 +0,0 @@
1
- __version__ = "0.78.1"
File without changes
File without changes