cognite-neat 0.76.0__tar.gz → 0.76.2__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 (280) hide show
  1. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/PKG-INFO +1 -1
  2. cognite_neat-0.76.2/cognite/neat/_version.py +1 -0
  3. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/routers/core.py +1 -1
  4. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/routers/rules.py +1 -1
  5. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/extractors/_mock_graph_generator.py +2 -2
  6. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/_shared.py +1 -1
  7. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/analysis/_information_rules.py +3 -3
  8. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/_base.py +1 -1
  9. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/_rules2dms.py +8 -49
  10. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/_rules2excel.py +9 -3
  11. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/_rules2ontology.py +2 -2
  12. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/_rules2yaml.py +1 -1
  13. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/_validation.py +2 -2
  14. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_base.py +1 -1
  15. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_dms2rules.py +93 -108
  16. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +1 -1
  17. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +2 -3
  18. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +1 -1
  19. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +2 -2
  20. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +1 -1
  21. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +1 -1
  22. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_spreadsheet2rules.py +10 -4
  23. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_yaml2rules.py +3 -3
  24. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/base.py +5 -0
  25. cognite_neat-0.76.2/cognite/neat/rules/models/__init__.py +27 -0
  26. cognite_neat-0.76.2/cognite/neat/rules/models/dms/__init__.py +18 -0
  27. cognite_neat-0.76.2/cognite/neat/rules/models/dms/_converter.py +140 -0
  28. cognite_neat-0.76.2/cognite/neat/rules/models/dms/_exporter.py +405 -0
  29. cognite_neat-0.76.2/cognite/neat/rules/models/dms/_rules.py +379 -0
  30. cognite_neat-0.76.0/cognite/neat/rules/models/rules/_dms_rules_write.py → cognite_neat-0.76.2/cognite/neat/rules/models/dms/_rules_input.py +65 -57
  31. cognite_neat-0.76.0/cognite/neat/rules/models/rules/_dms_schema.py → cognite_neat-0.76.2/cognite/neat/rules/models/dms/_schema.py +10 -4
  32. cognite_neat-0.76.2/cognite/neat/rules/models/dms/_serializer.py +126 -0
  33. cognite_neat-0.76.2/cognite/neat/rules/models/dms/_validation.py +255 -0
  34. cognite_neat-0.76.2/cognite/neat/rules/models/information/__init__.py +3 -0
  35. cognite_neat-0.76.2/cognite/neat/rules/models/information/_converter.py +193 -0
  36. cognite_neat-0.76.0/cognite/neat/rules/models/rules/_information_rules.py → cognite_neat-0.76.2/cognite/neat/rules/models/information/_rules.py +35 -202
  37. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/data_contracts.py +1 -1
  38. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +9 -3
  39. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/current/rules_importer.py +1 -1
  40. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/current/rules_validator.py +1 -2
  41. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/pyproject.toml +1 -1
  42. cognite_neat-0.76.0/cognite/neat/_version.py +0 -1
  43. cognite_neat-0.76.0/cognite/neat/rules/models/rules/__init__.py +0 -14
  44. cognite_neat-0.76.0/cognite/neat/rules/models/rules/_dms_architect_rules.py +0 -1255
  45. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/LICENSE +0 -0
  46. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/README.md +0 -0
  47. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/__init__.py +0 -0
  48. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/__init__.py +0 -0
  49. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/asgi/metrics.py +0 -0
  50. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/configuration.py +0 -0
  51. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/context_manager/__init__.py +0 -0
  52. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/context_manager/manager.py +0 -0
  53. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/data_classes/__init__.py +0 -0
  54. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/data_classes/rest.py +0 -0
  55. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/explorer.py +0 -0
  56. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/routers/configuration.py +0 -0
  57. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/routers/crud.py +0 -0
  58. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/routers/data_exploration.py +0 -0
  59. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/routers/metrics.py +0 -0
  60. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/routers/workflows.py +0 -0
  61. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/utils/__init__.py +0 -0
  62. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/utils/data_mapping.py +0 -0
  63. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/utils/logging.py +0 -0
  64. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/api/utils/query_templates.py +0 -0
  65. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/main.py +0 -0
  66. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/monitoring/__init__.py +0 -0
  67. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/monitoring/metrics.py +0 -0
  68. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/index.html +0 -0
  69. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
  70. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/README.md +0 -0
  71. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
  72. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
  73. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
  74. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
  75. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
  76. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
  77. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
  78. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
  79. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
  80. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
  81. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
  82. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
  83. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
  84. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
  85. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
  86. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/config.py +0 -0
  87. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/constants.py +0 -0
  88. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/exceptions.py +0 -0
  89. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/__init__.py +0 -0
  90. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  91. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  92. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/examples/__init__.py +0 -0
  93. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  94. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/exceptions.py +0 -0
  95. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/extractors/__init__.py +0 -0
  96. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/extractors/_base.py +0 -0
  97. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/models.py +0 -0
  98. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/stores/__init__.py +0 -0
  99. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/stores/_base.py +0 -0
  100. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
  101. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/stores/_memory_store.py +0 -0
  102. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
  103. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
  104. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
  105. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/__init__.py +0 -0
  106. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/__init__.py +0 -0
  107. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  108. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  109. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
  110. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  111. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/exceptions.py +0 -0
  112. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
  113. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
  114. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
  115. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
  116. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
  117. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
  118. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
  119. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
  120. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
  121. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
  122. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
  123. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
  124. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
  125. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
  126. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
  127. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
  128. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/models.py +0 -0
  129. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
  130. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/stores/_base.py +0 -0
  131. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
  132. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
  133. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
  134. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
  135. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
  136. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
  137. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
  138. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
  139. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
  140. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
  141. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/__init__.py +0 -0
  142. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/analysis.py +0 -0
  143. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
  144. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
  145. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
  146. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
  147. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
  148. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
  149. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
  150. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
  151. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
  152. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
  153. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
  154. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exceptions.py +0 -0
  155. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
  156. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
  157. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
  158. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
  159. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
  160. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
  161. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
  162. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
  163. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
  164. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
  165. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
  166. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
  167. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
  168. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_base.py +0 -0
  169. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
  170. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
  171. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
  172. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
  173. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
  174. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
  175. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  176. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
  177. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
  178. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
  179. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
  180. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
  181. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/models/__init__.py +0 -0
  182. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/models/_base.py +0 -0
  183. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
  184. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
  185. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/models/rules.py +0 -0
  186. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/models/tables.py +0 -0
  187. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/rules/models/value_types.py +0 -0
  188. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
  189. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  190. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  191. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  192. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
  193. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  194. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  195. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  196. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  197. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  198. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/py.typed +0 -0
  199. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/__init__.py +0 -0
  200. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/analysis/__init__.py +0 -0
  201. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/analysis/_base.py +0 -0
  202. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/examples/__init__.py +0 -0
  203. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/examples/wind-energy.owl +0 -0
  204. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exceptions.py +0 -0
  205. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/__init__.py +0 -0
  206. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/exporters/_models.py +0 -0
  207. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/__init__.py +0 -0
  208. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
  209. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  210. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
  211. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
  212. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/__init__.py +0 -0
  213. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/dms.py +0 -0
  214. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/fileread.py +0 -0
  215. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/formatters.py +0 -0
  216. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/importing.py +0 -0
  217. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/spreadsheet.py +0 -0
  218. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
  219. {cognite_neat-0.76.0/cognite/neat/rules/models/rules → cognite_neat-0.76.2/cognite/neat/rules/models}/_base.py +0 -0
  220. /cognite_neat-0.76.0/cognite/neat/rules/models/rdfpath.py → /cognite_neat-0.76.2/cognite/neat/rules/models/_rdfpath.py +0 -0
  221. {cognite_neat-0.76.0/cognite/neat/rules/models/rules → cognite_neat-0.76.2/cognite/neat/rules/models}/_types/__init__.py +0 -0
  222. {cognite_neat-0.76.0/cognite/neat/rules/models/rules → cognite_neat-0.76.2/cognite/neat/rules/models}/_types/_base.py +0 -0
  223. {cognite_neat-0.76.0/cognite/neat/rules/models/rules → cognite_neat-0.76.2/cognite/neat/rules/models}/_types/_field.py +0 -0
  224. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/models/data_types.py +0 -0
  225. /cognite_neat-0.76.0/cognite/neat/rules/models/rules/_domain_rules.py → /cognite_neat-0.76.2/cognite/neat/rules/models/domain.py +0 -0
  226. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/models/entities.py +0 -0
  227. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/rules/models/wrapped_entities.py +0 -0
  228. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/__init__.py +0 -0
  229. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/auxiliary.py +0 -0
  230. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/cdf.py +0 -0
  231. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
  232. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
  233. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
  234. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
  235. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
  236. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/exceptions.py +0 -0
  237. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/spreadsheet.py +0 -0
  238. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/text.py +0 -0
  239. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/utils.py +0 -0
  240. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/utils/xml.py +0 -0
  241. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/__init__.py +0 -0
  242. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/_exceptions.py +0 -0
  243. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/base.py +0 -0
  244. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/cdf_store.py +0 -0
  245. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
  246. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  247. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  248. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  249. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
  250. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  251. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  252. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  253. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  254. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  255. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/manager.py +0 -0
  256. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/migration/__init__.py +0 -0
  257. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/migration/steps.py +0 -0
  258. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
  259. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/model.py +0 -0
  260. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/__init__.py +0 -0
  261. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
  262. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
  263. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
  264. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
  265. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
  266. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
  267. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
  268. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
  269. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
  270. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
  271. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
  272. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
  273. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
  274. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
  275. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
  276. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps/step_model.py +0 -0
  277. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/steps_registry.py +0 -0
  278. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/tasks.py +0 -0
  279. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/cognite/neat/workflows/triggers.py +0 -0
  280. {cognite_neat-0.76.0 → cognite_neat-0.76.2}/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.76.0
3
+ Version: 0.76.2
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.76.2"
@@ -9,7 +9,7 @@ from fastapi import APIRouter, UploadFile
9
9
 
10
10
  from cognite.neat.app.api.configuration import NEAT_APP
11
11
  from cognite.neat.rules import exporters, importers
12
- from cognite.neat.rules.models.rules import DMSRules, RoleTypes
12
+ from cognite.neat.rules.models import DMSRules, RoleTypes
13
13
 
14
14
  router = APIRouter()
15
15
 
@@ -12,7 +12,7 @@ from cognite.neat.legacy.rules import importers as legacy_importers
12
12
  from cognite.neat.legacy.rules.models._base import EntityTypes
13
13
  from cognite.neat.legacy.rules.models.rules import Class, Classes, Metadata, Properties, Property, Rules
14
14
  from cognite.neat.rules import importers
15
- from cognite.neat.rules.models.rules import RoleTypes
15
+ from cognite.neat.rules.models import RoleTypes
16
16
  from cognite.neat.workflows.steps.data_contracts import RulesData
17
17
  from cognite.neat.workflows.steps.lib.current.rules_exporter import RulesToExcel
18
18
  from cognite.neat.workflows.steps.lib.current.rules_importer import ExcelToRules
@@ -14,10 +14,10 @@ from rdflib import RDF, Literal, Namespace, URIRef
14
14
 
15
15
  from cognite.neat.graph.models import Triple
16
16
  from cognite.neat.rules.analysis import InformationArchitectRulesAnalysis
17
+ from cognite.neat.rules.models import DMSRules, InformationRules
17
18
  from cognite.neat.rules.models.data_types import DataType
18
19
  from cognite.neat.rules.models.entities import ClassEntity, EntityTypes
19
- from cognite.neat.rules.models.rules import DMSRules, InformationRules
20
- from cognite.neat.rules.models.rules._information_rules import InformationProperty
20
+ from cognite.neat.rules.models.information import InformationProperty
21
21
  from cognite.neat.utils.utils import remove_namespace
22
22
 
23
23
  from ._base import BaseExtractor
@@ -1,5 +1,5 @@
1
1
  from typing import TypeAlias
2
2
 
3
- from cognite.neat.rules.models.rules import DMSRules, DomainRules, InformationRules
3
+ from cognite.neat.rules.models import DMSRules, DomainRules, InformationRules
4
4
 
5
5
  Rules: TypeAlias = DomainRules | InformationRules | DMSRules
@@ -7,10 +7,10 @@ from typing import Any, cast
7
7
  import pandas as pd
8
8
  from pydantic import ValidationError
9
9
 
10
+ from cognite.neat.rules.models import SchemaCompleteness
11
+ from cognite.neat.rules.models._rdfpath import TransformationRuleType
10
12
  from cognite.neat.rules.models.entities import ClassEntity, EntityTypes, ParentClassEntity, ReferenceEntity
11
- from cognite.neat.rules.models.rdfpath import TransformationRuleType
12
- from cognite.neat.rules.models.rules._base import SchemaCompleteness
13
- from cognite.neat.rules.models.rules._information_rules import InformationClass, InformationProperty, InformationRules
13
+ from cognite.neat.rules.models.information import InformationClass, InformationProperty, InformationRules
14
14
  from cognite.neat.utils.utils import get_inheritance_path
15
15
 
16
16
  from ._base import BaseAnalysis, DataModelingScenario
@@ -6,7 +6,7 @@ from typing import Generic, TypeVar
6
6
  from cognite.client import CogniteClient
7
7
 
8
8
  from cognite.neat.rules._shared import Rules
9
- from cognite.neat.rules.models.rules import DMSRules, InformationRules, RoleTypes
9
+ from cognite.neat.rules.models import DMSRules, InformationRules, RoleTypes
10
10
 
11
11
  from ._models import UploadResult
12
12
 
@@ -11,10 +11,8 @@ from cognite.client.exceptions import CogniteAPIError
11
11
  from cognite.neat.rules import issues
12
12
  from cognite.neat.rules._shared import Rules
13
13
  from cognite.neat.rules.issues import IssueList
14
- from cognite.neat.rules.models.rules import InformationRules
15
- from cognite.neat.rules.models.rules._base import ExtensionCategory, SheetList
16
- from cognite.neat.rules.models.rules._dms_architect_rules import DMSContainer, DMSRules
17
- from cognite.neat.rules.models.rules._dms_schema import DMSSchema, PipelineSchema
14
+ from cognite.neat.rules.models import InformationRules
15
+ from cognite.neat.rules.models.dms import DMSRules, DMSSchema, PipelineSchema
18
16
  from cognite.neat.utils.cdf_loaders import (
19
17
  ContainerLoader,
20
18
  DataModelingLoader,
@@ -116,47 +114,9 @@ class DMSExporter(CDFExporter[DMSSchema]):
116
114
  dms_rules = rules.as_dms_architect_rules()
117
115
  else:
118
116
  raise ValueError(f"{type(rules).__name__} cannot be exported to DMS")
119
-
120
- is_solution_model = (
121
- dms_rules.reference and dms_rules.metadata.external_id != dms_rules.reference.metadata.external_id
117
+ return dms_rules.as_schema(
118
+ include_ref=True, include_pipeline=self.export_pipeline, instance_space=self.instance_space
122
119
  )
123
- is_new_model = dms_rules.reference is None
124
- if is_new_model or is_solution_model:
125
- return dms_rules.as_schema(False, self.export_pipeline, self.instance_space)
126
-
127
- # This is an extension of an existing model.
128
- reference_rules = cast(DMSRules, dms_rules.reference).model_copy(deep=True)
129
- reference_schema = reference_rules.as_schema(include_ref=False, include_pipeline=self.export_pipeline)
130
-
131
- # Todo Move this to an appropriate location
132
- # Merging Reference with User Rules
133
- combined_rules = dms_rules.model_copy(deep=True)
134
- existing_containers = {container.class_ for container in combined_rules.containers or []}
135
- if combined_rules.containers is None:
136
- combined_rules.containers = SheetList[DMSContainer](data=[])
137
- for container in reference_rules.containers or []:
138
- if container.class_ not in existing_containers:
139
- container.reference = None
140
- combined_rules.containers.append(container)
141
- existing_views = {view.class_ for view in combined_rules.views}
142
- for view in reference_rules.views:
143
- if view.class_ not in existing_views:
144
- view.reference = None
145
- combined_rules.views.append(view)
146
- existing_properties = {(property_.class_, property_.property_) for property_ in combined_rules.properties}
147
- for property_ in reference_rules.properties:
148
- if (property_.class_, property_.property_) not in existing_properties:
149
- property_.reference = None
150
- combined_rules.properties.append(property_)
151
-
152
- schema = combined_rules.as_schema(True, self.export_pipeline, self.instance_space)
153
-
154
- if dms_rules.metadata.extension in (ExtensionCategory.addition, ExtensionCategory.reshape):
155
- # We do not freeze views as they might be changed, even for addition,
156
- # in case, for example, new properties are added. The validation will catch this.
157
- schema.frozen_ids.update(set(reference_schema.containers.as_ids()))
158
- schema.frozen_ids.update(set(reference_schema.node_types.as_ids()))
159
- return schema
160
120
 
161
121
  def delete_from_cdf(self, rules: Rules, client: CogniteClient, dry_run: bool = False) -> Iterable[UploadResult]:
162
122
  schema, to_export = self._prepare_schema_and_exporters(rules, client)
@@ -165,8 +125,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
165
125
  # as they are sorted in the order of creation and we need to delete them in reverse order
166
126
  for all_items, loader in reversed(to_export):
167
127
  all_item_ids = loader.get_ids(all_items)
168
- skipped = sum(1 for item_id in all_item_ids if item_id in schema.frozen_ids)
169
- item_ids = [item_id for item_id in all_item_ids if item_id not in schema.frozen_ids]
128
+ item_ids = [item_id for item_id in all_item_ids]
170
129
  cdf_items = loader.retrieve(item_ids)
171
130
  cdf_item_by_id = {loader.get_id(item): item for item in cdf_items}
172
131
  items = [item for item in all_items if loader.get_id(item) in item_ids]
@@ -200,7 +159,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
200
159
  yield UploadResult(
201
160
  name=loader.resource_name,
202
161
  deleted=deleted,
203
- skipped=skipped,
162
+ skipped=0,
204
163
  failed_deleted=failed_deleted,
205
164
  error_messages=error_messages,
206
165
  )
@@ -215,8 +174,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
215
174
  for all_items, loader in to_export:
216
175
  issue_list = IssueList()
217
176
  all_item_ids = loader.get_ids(all_items)
218
- skipped = sum(1 for item_id in all_item_ids if item_id in schema.frozen_ids)
219
- item_ids = [item_id for item_id in all_item_ids if item_id not in schema.frozen_ids]
177
+ item_ids = [item_id for item_id in all_item_ids]
220
178
  cdf_items = loader.retrieve(item_ids)
221
179
  cdf_item_by_id = {loader.get_id(item): item for item in cdf_items}
222
180
  items = [item for item in all_items if loader.get_id(item) in item_ids]
@@ -243,6 +201,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
243
201
 
244
202
  created = len(to_create)
245
203
  failed_created = 0
204
+ skipped = 0
246
205
 
247
206
  if self.existing_handling in ["update", "force"]:
248
207
  changed = len(to_update)
@@ -12,8 +12,14 @@ from openpyxl.styles import Alignment, Border, Font, PatternFill, Side
12
12
  from openpyxl.worksheet.worksheet import Worksheet
13
13
 
14
14
  from cognite.neat.rules._shared import Rules
15
- from cognite.neat.rules.models.rules import DMSRules, DomainRules, InformationRules
16
- from cognite.neat.rules.models.rules._base import RoleTypes, SchemaCompleteness, SheetEntity
15
+ from cognite.neat.rules.models import (
16
+ DMSRules,
17
+ DomainRules,
18
+ InformationRules,
19
+ RoleTypes,
20
+ SchemaCompleteness,
21
+ SheetEntity,
22
+ )
17
23
 
18
24
  from ._base import BaseExporter
19
25
 
@@ -113,7 +119,7 @@ class ExcelExporter(BaseExporter[Workbook]):
113
119
 
114
120
  def _write_sheets(self, workbook: Workbook, dumped_rules: dict[str, Any], rules: Rules, is_reference: bool = False):
115
121
  for sheet_name, headers in rules.headers_by_sheet(by_alias=True).items():
116
- if sheet_name in ("Metadata", "prefixes", "Reference", "is_reference"):
122
+ if sheet_name in ("Metadata", "prefixes", "Reference", "Last"):
117
123
  continue
118
124
  if is_reference:
119
125
  sheet = workbook.create_sheet(f"Ref{sheet_name}")
@@ -11,10 +11,10 @@ from rdflib.collection import Collection as GraphCollection
11
11
  from cognite.neat.constants import DEFAULT_NAMESPACE as NEAT_NAMESPACE
12
12
  from cognite.neat.rules import exceptions
13
13
  from cognite.neat.rules.analysis import InformationArchitectRulesAnalysis
14
+ from cognite.neat.rules.models import DMSRules
14
15
  from cognite.neat.rules.models.data_types import DataType
15
16
  from cognite.neat.rules.models.entities import ClassEntity, EntityTypes
16
- from cognite.neat.rules.models.rules import DMSRules
17
- from cognite.neat.rules.models.rules._information_rules import (
17
+ from cognite.neat.rules.models.information import (
18
18
  InformationClass,
19
19
  InformationMetadata,
20
20
  InformationProperty,
@@ -6,7 +6,7 @@ from typing import Literal, get_args
6
6
  import yaml
7
7
 
8
8
  from cognite.neat.rules._shared import Rules
9
- from cognite.neat.rules.models.rules._base import RoleTypes
9
+ from cognite.neat.rules.models import RoleTypes
10
10
 
11
11
  from ._base import BaseExporter
12
12
 
@@ -4,8 +4,8 @@ from typing import Literal, overload
4
4
 
5
5
  from cognite.neat.exceptions import wrangle_warnings
6
6
  from cognite.neat.rules import exceptions
7
- from cognite.neat.rules.models.rules import InformationRules
8
- from cognite.neat.rules.models.rules._types._base import DMS_PROPERTY_ID_COMPLIANCE_REGEX, VIEW_ID_COMPLIANCE_REGEX
7
+ from cognite.neat.rules.models import InformationRules
8
+ from cognite.neat.rules.models._types._base import DMS_PROPERTY_ID_COMPLIANCE_REGEX, VIEW_ID_COMPLIANCE_REGEX
9
9
 
10
10
 
11
11
  @overload
@@ -11,7 +11,7 @@ from rdflib import Namespace
11
11
 
12
12
  from cognite.neat.rules._shared import Rules
13
13
  from cognite.neat.rules.issues.base import IssueList, NeatValidationError, ValidationWarning
14
- from cognite.neat.rules.models.rules import DMSRules, InformationRules, RoleTypes
14
+ from cognite.neat.rules.models import DMSRules, InformationRules, RoleTypes
15
15
 
16
16
 
17
17
  class BaseImporter(ABC):
@@ -2,7 +2,7 @@ from collections import Counter
2
2
  from collections.abc import Sequence
3
3
  from datetime import datetime
4
4
  from pathlib import Path
5
- from typing import Literal, cast, overload
5
+ from typing import Any, Literal, cast, overload
6
6
 
7
7
  from cognite.client import CogniteClient
8
8
  from cognite.client import data_modeling as dm
@@ -20,7 +20,22 @@ from cognite.client.utils import ms_to_datetime
20
20
  from cognite.neat.rules import issues
21
21
  from cognite.neat.rules.importers._base import BaseImporter, Rules, _handle_issues
22
22
  from cognite.neat.rules.issues import IssueList, ValidationIssue
23
+ from cognite.neat.rules.models import (
24
+ DataModelType,
25
+ DMSRules,
26
+ DMSSchema,
27
+ ExtensionCategory,
28
+ RoleTypes,
29
+ SchemaCompleteness,
30
+ SheetList,
31
+ )
23
32
  from cognite.neat.rules.models.data_types import DataType
33
+ from cognite.neat.rules.models.dms import (
34
+ DMSContainer,
35
+ DMSMetadata,
36
+ DMSProperty,
37
+ DMSView,
38
+ )
24
39
  from cognite.neat.rules.models.entities import (
25
40
  ClassEntity,
26
41
  ContainerEntity,
@@ -29,15 +44,6 @@ from cognite.neat.rules.models.entities import (
29
44
  ViewEntity,
30
45
  ViewPropertyEntity,
31
46
  )
32
- from cognite.neat.rules.models.rules import DMSRules, DMSSchema, RoleTypes
33
- from cognite.neat.rules.models.rules._base import DataModelType, ExtensionCategory, SchemaCompleteness
34
- from cognite.neat.rules.models.rules._dms_architect_rules import (
35
- DMSContainer,
36
- DMSMetadata,
37
- DMSProperty,
38
- DMSView,
39
- SheetList,
40
- )
41
47
 
42
48
 
43
49
  class DMSImporter(BaseImporter):
@@ -47,10 +53,17 @@ class DMSImporter(BaseImporter):
47
53
  read_issues: Sequence[ValidationIssue] | None = None,
48
54
  metadata: DMSMetadata | None = None,
49
55
  ):
50
- self.schema = schema
56
+ # Calling this root schema to distinguish it from
57
+ # * User Schema
58
+ # * Reference Schema
59
+ self.root_schema = schema
51
60
  self.metadata = metadata
52
61
  self.issue_list = IssueList(read_issues)
53
- self._container_by_id = {container.as_id(): container for container in schema.containers}
62
+ self._all_containers_by_id = {container.as_id(): container for container in schema.containers}
63
+ if self.root_schema.reference:
64
+ self._all_containers_by_id.update(
65
+ {container.as_id(): container for container in self.root_schema.reference.containers}
66
+ )
54
67
 
55
68
  @classmethod
56
69
  def from_data_model_id(cls, client: CogniteClient, data_model_id: DataModelIdentifier) -> "DMSImporter":
@@ -134,130 +147,102 @@ class DMSImporter(BaseImporter):
134
147
  # In case there were errors during the import, the to_rules method will return None
135
148
  return self._return_or_raise(self.issue_list, errors)
136
149
 
137
- if len(self.schema.data_models) == 0:
150
+ if len(self.root_schema.data_models) == 0:
138
151
  self.issue_list.append(issues.importing.NoDataModelError("No data model found."))
139
152
  return self._return_or_raise(self.issue_list, errors)
140
153
 
141
- if len(self.schema.data_models) > 2:
154
+ with _handle_issues(
155
+ self.issue_list,
156
+ ) as future:
157
+ schema_completeness = SchemaCompleteness.complete
158
+ data_model_type = DataModelType.enterprise
159
+ reference: DMSRules | None = None
160
+ if ref_schema := self.root_schema.reference:
161
+ # Reference should always be an enterprise model.
162
+ reference = DMSRules(
163
+ **self._create_rule_components(
164
+ ref_schema, self._create_default_metadata(ref_schema.views), DataModelType.enterprise
165
+ )
166
+ )
167
+ schema_completeness = SchemaCompleteness.extended
168
+ data_model_type = DataModelType.solution
169
+
170
+ user_rules = DMSRules(
171
+ **self._create_rule_components(self.root_schema, self.metadata, data_model_type, schema_completeness),
172
+ reference=reference,
173
+ )
174
+
175
+ if future.result == "failure" or self.issue_list.has_errors:
176
+ return self._return_or_raise(self.issue_list, errors)
177
+
178
+ return self._to_output(user_rules, self.issue_list, errors, role)
179
+
180
+ def _create_rule_components(
181
+ self,
182
+ schema: DMSSchema,
183
+ metadata: DMSMetadata | None = None,
184
+ data_model_type: DataModelType | None = None,
185
+ schema_completeness: SchemaCompleteness | None = None,
186
+ ) -> dict[str, Any]:
187
+ if len(schema.data_models) > 2:
142
188
  # Creating a DataModelEntity to convert the data model id to a string.
143
189
  self.issue_list.append(
144
190
  issues.importing.MultipleDataModelsWarning(
145
- [str(DataModelEntity.from_id(model.as_id())) for model in self.schema.data_models]
191
+ [str(DataModelEntity.from_id(model.as_id())) for model in schema.data_models]
146
192
  )
147
193
  )
148
194
 
149
- data_model = self.schema.data_models[0]
195
+ data_model = schema.data_models[0]
150
196
 
151
197
  properties = SheetList[DMSProperty]()
152
- ref_properties = SheetList[DMSProperty]()
153
- for view in self.schema.views:
198
+ for view in schema.views:
154
199
  view_id = view.as_id()
155
200
  view_entity = ViewEntity.from_id(view_id)
156
201
  class_entity = view_entity.as_class()
157
202
  for prop_id, prop in (view.properties or {}).items():
158
203
  dms_property = self._create_dms_property(prop_id, prop, view_entity, class_entity)
159
204
  if dms_property is not None:
160
- if view_id in self.schema.frozen_ids:
161
- ref_properties.append(dms_property)
162
- else:
163
- properties.append(dms_property)
205
+ properties.append(dms_property)
164
206
 
165
207
  data_model_view_ids: set[dm.ViewId] = {
166
208
  view.as_id() if isinstance(view, dm.View | dm.ViewApply) else view for view in data_model.views or []
167
209
  }
168
210
 
169
- metadata = self.metadata or DMSMetadata.from_data_model(data_model)
170
- metadata.data_model_type = self._infer_data_model_type(metadata.space)
171
- if ref_properties:
172
- metadata.schema_ = SchemaCompleteness.extended
173
-
174
- with _handle_issues(
175
- self.issue_list,
176
- ) as future:
177
- user_rules = DMSRules(
178
- metadata=metadata,
179
- properties=properties,
180
- containers=SheetList[DMSContainer](
181
- data=[
182
- DMSContainer.from_container(container)
183
- for container in self.schema.containers
184
- if container.as_id() not in self.schema.frozen_ids
185
- ]
186
- ),
187
- views=SheetList[DMSView](
188
- data=[
189
- DMSView.from_view(view, in_model=view.as_id() in data_model_view_ids)
190
- for view in self.schema.views
191
- if view.as_id() not in self.schema.frozen_ids
192
- ]
193
- ),
194
- reference=self._create_reference_rules(ref_properties),
195
- )
196
-
197
- if future.result == "failure" or self.issue_list.has_errors:
198
- return self._return_or_raise(self.issue_list, errors)
199
-
200
- return self._to_output(user_rules, self.issue_list, errors, role)
201
-
202
- def _create_reference_rules(self, properties: SheetList[DMSProperty]) -> DMSRules | None:
203
- if not properties:
204
- return None
205
-
206
- if len(self.schema.data_models) == 2:
207
- data_model = self.schema.data_models[1]
208
- data_model_view_ids: set[dm.ViewId] = {
209
- view.as_id() if isinstance(view, dm.View | dm.ViewApply) else view for view in data_model.views or []
210
- }
211
- metadata = self._create_metadata_from_model(data_model)
212
- else:
213
- data_model_view_ids = set()
214
- now = datetime.now().replace(microsecond=0)
215
- space = Counter(prop.view.space for prop in properties).most_common(1)[0][0]
216
- metadata = DMSMetadata(
217
- schema_=SchemaCompleteness.complete,
218
- extension=ExtensionCategory.addition,
219
- space=space,
220
- external_id="Unknown",
221
- version="0.1.0",
222
- creator=["Unknown"],
223
- created=now,
224
- updated=now,
225
- )
226
-
227
- metadata.data_model_type = DataModelType.enterprise
228
- return DMSRules(
211
+ metadata = metadata or DMSMetadata.from_data_model(data_model)
212
+ if data_model_type is not None:
213
+ metadata.data_model_type = data_model_type
214
+ if schema_completeness is not None:
215
+ metadata.schema_ = schema_completeness
216
+ return dict(
229
217
  metadata=metadata,
230
218
  properties=properties,
231
- views=SheetList[DMSView](
232
- data=[
233
- DMSView.from_view(view, in_model=not data_model_view_ids or (view.as_id() in data_model_view_ids))
234
- for view in self.schema.views
235
- if view.as_id() in self.schema.frozen_ids
236
- ]
237
- ),
238
219
  containers=SheetList[DMSContainer](
239
- data=[
240
- DMSContainer.from_container(container)
241
- for container in self.schema.containers
242
- if container.as_id() in self.schema.frozen_ids
243
- ]
220
+ data=[DMSContainer.from_container(container) for container in schema.containers]
221
+ ),
222
+ views=SheetList[DMSView](
223
+ data=[DMSView.from_view(view, in_model=view.as_id() in data_model_view_ids) for view in schema.views]
244
224
  ),
245
- reference=None,
246
225
  )
247
226
 
248
- def _infer_data_model_type(self, space: str) -> DataModelType:
249
- if self.schema.referenced_spaces() - {space}:
250
- # If the data model has containers, views, node types in another space
251
- # we assume it is a solution model.
252
- return DataModelType.solution
253
- else:
254
- # All containers, views, node types are in the same space as the data model
255
- return DataModelType.enterprise
227
+ @classmethod
228
+ def _create_default_metadata(cls, views: Sequence[dm.View | dm.ViewApply]) -> DMSMetadata:
229
+ now = datetime.now().replace(microsecond=0)
230
+ space = Counter(view.space for view in views).most_common(1)[0][0]
231
+ return DMSMetadata(
232
+ schema_=SchemaCompleteness.complete,
233
+ extension=ExtensionCategory.addition,
234
+ space=space,
235
+ external_id="Unknown",
236
+ version="0.1.0",
237
+ creator=["Unknown"],
238
+ created=now,
239
+ updated=now,
240
+ )
256
241
 
257
242
  def _create_dms_property(
258
243
  self, prop_id: str, prop: ViewPropertyApply, view_entity: ViewEntity, class_entity: ClassEntity
259
244
  ) -> DMSProperty | None:
260
- if isinstance(prop, dm.MappedPropertyApply) and prop.container not in self._container_by_id:
245
+ if isinstance(prop, dm.MappedPropertyApply) and prop.container not in self._all_containers_by_id:
261
246
  self.issue_list.append(
262
247
  issues.importing.MissingContainerWarning(
263
248
  view_id=str(view_entity),
@@ -268,7 +253,7 @@ class DMSImporter(BaseImporter):
268
253
  return None
269
254
  if (
270
255
  isinstance(prop, dm.MappedPropertyApply)
271
- and prop.container_property_identifier not in self._container_by_id[prop.container].properties
256
+ and prop.container_property_identifier not in self._all_containers_by_id[prop.container].properties
272
257
  ):
273
258
  self.issue_list.append(
274
259
  issues.importing.MissingContainerPropertyWarning(
@@ -315,7 +300,7 @@ class DMSImporter(BaseImporter):
315
300
 
316
301
  def _container_prop_unsafe(self, prop: dm.MappedPropertyApply) -> dm.ContainerProperty:
317
302
  """This method assumes you have already checked that the container with property exists."""
318
- return self._container_by_id[prop.container].properties[prop.container_property_identifier]
303
+ return self._all_containers_by_id[prop.container].properties[prop.container_property_identifier]
319
304
 
320
305
  def _get_relation_type(self, prop: ViewPropertyApply) -> Literal["edge", "reverse", "direct"] | None:
321
306
  if isinstance(prop, SingleEdgeConnectionApply | MultiEdgeConnectionApply) and prop.direction == "outwards":
@@ -380,7 +365,7 @@ class DMSImporter(BaseImporter):
380
365
  def _get_index(self, prop: ViewPropertyApply, prop_id) -> list[str] | None:
381
366
  if not isinstance(prop, dm.MappedPropertyApply):
382
367
  return None
383
- container = self._container_by_id[prop.container]
368
+ container = self._all_containers_by_id[prop.container]
384
369
  index: list[str] = []
385
370
  for index_name, index_obj in (container.indexes or {}).items():
386
371
  if isinstance(index_obj, BTreeIndex | InvertedIndex) and prop_id in index_obj.properties:
@@ -390,7 +375,7 @@ class DMSImporter(BaseImporter):
390
375
  def _get_constraint(self, prop: ViewPropertyApply, prop_id: str) -> list[str] | None:
391
376
  if not isinstance(prop, dm.MappedPropertyApply):
392
377
  return None
393
- container = self._container_by_id[prop.container]
378
+ container = self._all_containers_by_id[prop.container]
394
379
  unique_constraints: list[str] = []
395
380
  for constraint_name, constraint_obj in (container.constraints or {}).items():
396
381
  if isinstance(constraint_obj, dm.RequiresConstraint):
@@ -23,7 +23,7 @@ from cognite.neat.rules.importers._dtdl2rules.spec import (
23
23
  from cognite.neat.rules.issues import IssueList, ValidationIssue
24
24
  from cognite.neat.rules.models.data_types import _DATA_TYPE_BY_NAME, DataType, Json, String
25
25
  from cognite.neat.rules.models.entities import ClassEntity, ParentClassEntity
26
- from cognite.neat.rules.models.rules._information_rules import InformationClass, InformationProperty
26
+ from cognite.neat.rules.models.information import InformationClass, InformationProperty
27
27
 
28
28
 
29
29
  class _DTDLConverter:
@@ -12,9 +12,8 @@ from cognite.neat.rules.importers._base import BaseImporter, _handle_issues
12
12
  from cognite.neat.rules.importers._dtdl2rules.dtdl_converter import _DTDLConverter
13
13
  from cognite.neat.rules.importers._dtdl2rules.spec import DTDL_CLS_BY_TYPE_BY_SPEC, DTDLBase, Interface
14
14
  from cognite.neat.rules.issues import IssueList, ValidationIssue
15
- from cognite.neat.rules.models.rules import InformationRules, RoleTypes
16
- from cognite.neat.rules.models.rules._base import SchemaCompleteness, SheetList
17
- from cognite.neat.rules.models.rules._information_rules import InformationClass, InformationProperty
15
+ from cognite.neat.rules.models import InformationRules, RoleTypes, SchemaCompleteness, SheetList
16
+ from cognite.neat.rules.models.information import InformationClass, InformationProperty
18
17
  from cognite.neat.utils.text import to_pascal
19
18
 
20
19
 
@@ -4,7 +4,7 @@ import numpy as np
4
4
  import pandas as pd
5
5
  from rdflib import OWL, Graph
6
6
 
7
- from cognite.neat.rules.models.rules._base import MatchType
7
+ from cognite.neat.rules.models._base import MatchType
8
8
  from cognite.neat.utils.utils import remove_namespace
9
9
 
10
10
 
@@ -4,8 +4,8 @@ import re
4
4
  from rdflib import Graph, Namespace
5
5
 
6
6
  from cognite.neat.constants import DEFAULT_NAMESPACE
7
- from cognite.neat.rules.models.rules._base import RoleTypes, SchemaCompleteness
8
- from cognite.neat.rules.models.rules._types._base import (
7
+ from cognite.neat.rules.models import RoleTypes, SchemaCompleteness
8
+ from cognite.neat.rules.models._types._base import (
9
9
  PREFIX_COMPLIANCE_REGEX,
10
10
  VERSION_COMPLIANCE_REGEX,
11
11
  )
@@ -4,7 +4,7 @@ import numpy as np
4
4
  import pandas as pd
5
5
  from rdflib import Graph
6
6
 
7
- from cognite.neat.rules.models.rules._base import MatchType
7
+ from cognite.neat.rules.models._base import MatchType
8
8
  from cognite.neat.utils.utils import remove_namespace
9
9
 
10
10
  from ._owl2classes import _data_type_property_class, _object_property_class, _thing_class
@@ -10,8 +10,8 @@ from rdflib import DC, DCTERMS, OWL, RDF, RDFS, SKOS, Graph
10
10
 
11
11
  from cognite.neat.rules.importers._base import BaseImporter, Rules
12
12
  from cognite.neat.rules.issues import IssueList
13
+ from cognite.neat.rules.models import InformationRules, RoleTypes
13
14
  from cognite.neat.rules.models.data_types import _XSD_TYPES
14
- from cognite.neat.rules.models.rules import InformationRules, RoleTypes
15
15
 
16
16
  from ._owl2classes import parse_owl_classes
17
17
  from ._owl2metadata import parse_owl_metadata
@@ -13,9 +13,15 @@ from pandas import ExcelFile
13
13
 
14
14
  from cognite.neat.rules import issues
15
15
  from cognite.neat.rules.issues import IssueList
16
- from cognite.neat.rules.models.rules import RULES_PER_ROLE, DMSRules, DomainRules, InformationRules
17
- from cognite.neat.rules.models.rules._base import RoleTypes, SchemaCompleteness
18
- from cognite.neat.rules.models.rules._dms_rules_write import DMSRulesWrite
16
+ from cognite.neat.rules.models import (
17
+ RULES_PER_ROLE,
18
+ DMSRules,
19
+ DomainRules,
20
+ InformationRules,
21
+ RoleTypes,
22
+ SchemaCompleteness,
23
+ )
24
+ from cognite.neat.rules.models.dms import DMSRulesInput
19
25
  from cognite.neat.utils.auxiliary import local_import
20
26
  from cognite.neat.utils.spreadsheet import SpreadsheetRead, read_individual_sheet
21
27
 
@@ -227,7 +233,7 @@ class ExcelImporter(BaseImporter):
227
233
  ) as future:
228
234
  rules: Rules
229
235
  if rules_cls is DMSRules:
230
- rules = DMSRulesWrite.load(sheets).as_read()
236
+ rules = DMSRulesInput.load(sheets).as_rules()
231
237
  else:
232
238
  rules = rules_cls.model_validate(sheets) # type: ignore[attr-defined]
233
239