cognite-neat 0.76.1__tar.gz → 0.76.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 (280) hide show
  1. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/PKG-INFO +1 -1
  2. cognite_neat-0.76.3/cognite/neat/_version.py +1 -0
  3. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/routers/core.py +1 -1
  4. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/routers/rules.py +1 -1
  5. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/extractors/_mock_graph_generator.py +2 -2
  6. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/_shared.py +1 -1
  7. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/analysis/_information_rules.py +3 -3
  8. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/_base.py +1 -1
  9. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/_rules2dms.py +8 -49
  10. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/_rules2excel.py +71 -40
  11. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/_rules2ontology.py +2 -2
  12. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/_rules2yaml.py +1 -1
  13. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/_validation.py +2 -2
  14. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_base.py +1 -1
  15. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_dms2rules.py +93 -108
  16. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +1 -1
  17. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +2 -3
  18. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +1 -1
  19. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +2 -2
  20. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +1 -1
  21. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +1 -1
  22. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_spreadsheet2rules.py +87 -62
  23. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_yaml2rules.py +3 -3
  24. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/base.py +5 -0
  25. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/dms.py +65 -0
  26. cognite_neat-0.76.3/cognite/neat/rules/models/__init__.py +27 -0
  27. cognite_neat-0.76.3/cognite/neat/rules/models/dms/__init__.py +18 -0
  28. cognite_neat-0.76.3/cognite/neat/rules/models/dms/_converter.py +140 -0
  29. cognite_neat-0.76.3/cognite/neat/rules/models/dms/_exporter.py +405 -0
  30. cognite_neat-0.76.3/cognite/neat/rules/models/dms/_rules.py +379 -0
  31. cognite_neat-0.76.1/cognite/neat/rules/models/rules/_dms_rules_write.py → cognite_neat-0.76.3/cognite/neat/rules/models/dms/_rules_input.py +42 -33
  32. cognite_neat-0.76.1/cognite/neat/rules/models/rules/_dms_schema.py → cognite_neat-0.76.3/cognite/neat/rules/models/dms/_schema.py +36 -4
  33. cognite_neat-0.76.3/cognite/neat/rules/models/dms/_serializer.py +126 -0
  34. cognite_neat-0.76.3/cognite/neat/rules/models/dms/_validation.py +288 -0
  35. cognite_neat-0.76.1/cognite/neat/rules/models/rules/_domain_rules.py → cognite_neat-0.76.3/cognite/neat/rules/models/domain.py +1 -0
  36. cognite_neat-0.76.3/cognite/neat/rules/models/information/__init__.py +3 -0
  37. cognite_neat-0.76.3/cognite/neat/rules/models/information/_converter.py +195 -0
  38. cognite_neat-0.76.1/cognite/neat/rules/models/rules/_information_rules.py → cognite_neat-0.76.3/cognite/neat/rules/models/information/_rules.py +35 -202
  39. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/data_contracts.py +1 -1
  40. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +10 -3
  41. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/current/rules_importer.py +1 -1
  42. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/current/rules_validator.py +1 -2
  43. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/pyproject.toml +1 -1
  44. cognite_neat-0.76.1/cognite/neat/_version.py +0 -1
  45. cognite_neat-0.76.1/cognite/neat/rules/models/rules/__init__.py +0 -14
  46. cognite_neat-0.76.1/cognite/neat/rules/models/rules/_dms_architect_rules.py +0 -1255
  47. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/LICENSE +0 -0
  48. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/README.md +0 -0
  49. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/__init__.py +0 -0
  50. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/__init__.py +0 -0
  51. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/asgi/metrics.py +0 -0
  52. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/configuration.py +0 -0
  53. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/context_manager/__init__.py +0 -0
  54. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/context_manager/manager.py +0 -0
  55. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/data_classes/__init__.py +0 -0
  56. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/data_classes/rest.py +0 -0
  57. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/explorer.py +0 -0
  58. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/routers/configuration.py +0 -0
  59. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/routers/crud.py +0 -0
  60. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/routers/data_exploration.py +0 -0
  61. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/routers/metrics.py +0 -0
  62. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/routers/workflows.py +0 -0
  63. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/utils/__init__.py +0 -0
  64. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/utils/data_mapping.py +0 -0
  65. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/utils/logging.py +0 -0
  66. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/api/utils/query_templates.py +0 -0
  67. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/main.py +0 -0
  68. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/monitoring/__init__.py +0 -0
  69. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/monitoring/metrics.py +0 -0
  70. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/index.html +0 -0
  71. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
  72. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/README.md +0 -0
  73. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
  74. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
  75. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
  76. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
  77. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
  78. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
  79. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
  80. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
  81. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
  82. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
  83. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
  84. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
  85. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
  86. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
  87. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
  88. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/config.py +0 -0
  89. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/constants.py +0 -0
  90. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/exceptions.py +0 -0
  91. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/__init__.py +0 -0
  92. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  93. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  94. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/examples/__init__.py +0 -0
  95. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  96. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/exceptions.py +0 -0
  97. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/extractors/__init__.py +0 -0
  98. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/extractors/_base.py +0 -0
  99. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/models.py +0 -0
  100. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/stores/__init__.py +0 -0
  101. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/stores/_base.py +0 -0
  102. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
  103. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/stores/_memory_store.py +0 -0
  104. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
  105. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
  106. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
  107. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/__init__.py +0 -0
  108. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/__init__.py +0 -0
  109. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  110. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  111. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
  112. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  113. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/exceptions.py +0 -0
  114. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
  115. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
  116. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
  117. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
  118. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
  119. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
  120. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
  121. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
  122. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
  123. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
  124. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
  125. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
  126. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
  127. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
  128. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
  129. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
  130. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/models.py +0 -0
  131. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
  132. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/stores/_base.py +0 -0
  133. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
  134. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
  135. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
  136. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
  137. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
  138. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
  139. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
  140. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
  141. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
  142. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
  143. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/__init__.py +0 -0
  144. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/analysis.py +0 -0
  145. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
  146. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
  147. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
  148. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
  149. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
  150. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
  151. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
  152. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
  153. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
  154. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
  155. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
  156. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exceptions.py +0 -0
  157. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
  158. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
  159. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
  160. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
  161. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
  162. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
  163. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
  164. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
  165. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
  166. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
  167. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
  168. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
  169. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
  170. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_base.py +0 -0
  171. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
  172. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
  173. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
  174. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
  175. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
  176. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
  177. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  178. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
  179. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
  180. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
  181. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
  182. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
  183. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/models/__init__.py +0 -0
  184. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/models/_base.py +0 -0
  185. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
  186. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
  187. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/models/rules.py +0 -0
  188. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/models/tables.py +0 -0
  189. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/rules/models/value_types.py +0 -0
  190. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
  191. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  192. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  193. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  194. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
  195. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  196. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  197. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  198. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  199. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  200. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/py.typed +0 -0
  201. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/__init__.py +0 -0
  202. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/analysis/__init__.py +0 -0
  203. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/analysis/_base.py +0 -0
  204. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/examples/__init__.py +0 -0
  205. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/examples/wind-energy.owl +0 -0
  206. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exceptions.py +0 -0
  207. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/__init__.py +0 -0
  208. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/exporters/_models.py +0 -0
  209. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/__init__.py +0 -0
  210. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
  211. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  212. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
  213. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
  214. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/__init__.py +0 -0
  215. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/fileread.py +0 -0
  216. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/formatters.py +0 -0
  217. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/importing.py +0 -0
  218. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/spreadsheet.py +0 -0
  219. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
  220. {cognite_neat-0.76.1/cognite/neat/rules/models/rules → cognite_neat-0.76.3/cognite/neat/rules/models}/_base.py +0 -0
  221. /cognite_neat-0.76.1/cognite/neat/rules/models/rdfpath.py → /cognite_neat-0.76.3/cognite/neat/rules/models/_rdfpath.py +0 -0
  222. {cognite_neat-0.76.1/cognite/neat/rules/models/rules → cognite_neat-0.76.3/cognite/neat/rules/models}/_types/__init__.py +0 -0
  223. {cognite_neat-0.76.1/cognite/neat/rules/models/rules → cognite_neat-0.76.3/cognite/neat/rules/models}/_types/_base.py +0 -0
  224. {cognite_neat-0.76.1/cognite/neat/rules/models/rules → cognite_neat-0.76.3/cognite/neat/rules/models}/_types/_field.py +0 -0
  225. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/models/data_types.py +0 -0
  226. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/models/entities.py +0 -0
  227. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/rules/models/wrapped_entities.py +0 -0
  228. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/__init__.py +0 -0
  229. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/auxiliary.py +0 -0
  230. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/cdf.py +0 -0
  231. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
  232. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
  233. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
  234. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
  235. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
  236. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/exceptions.py +0 -0
  237. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/spreadsheet.py +0 -0
  238. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/text.py +0 -0
  239. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/utils.py +0 -0
  240. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/utils/xml.py +0 -0
  241. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/__init__.py +0 -0
  242. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/_exceptions.py +0 -0
  243. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/base.py +0 -0
  244. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/cdf_store.py +0 -0
  245. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
  246. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  247. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  248. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  249. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
  250. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  251. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  252. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  253. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  254. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  255. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/manager.py +0 -0
  256. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/migration/__init__.py +0 -0
  257. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/migration/steps.py +0 -0
  258. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
  259. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/model.py +0 -0
  260. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/__init__.py +0 -0
  261. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
  262. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
  263. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
  264. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
  265. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
  266. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
  267. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
  268. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
  269. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
  270. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
  271. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
  272. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
  273. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
  274. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
  275. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
  276. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps/step_model.py +0 -0
  277. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/steps_registry.py +0 -0
  278. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/tasks.py +0 -0
  279. {cognite_neat-0.76.1 → cognite_neat-0.76.3}/cognite/neat/workflows/triggers.py +0 -0
  280. {cognite_neat-0.76.1 → cognite_neat-0.76.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.76.1
3
+ Version: 0.76.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.76.3"
@@ -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,16 @@ 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
+ DataModelType,
17
+ DMSRules,
18
+ DomainRules,
19
+ ExtensionCategory,
20
+ InformationRules,
21
+ RoleTypes,
22
+ SchemaCompleteness,
23
+ SheetEntity,
24
+ )
17
25
 
18
26
  from ._base import BaseExporter
19
27
 
@@ -29,11 +37,18 @@ class ExcelExporter(BaseExporter[Workbook]):
29
37
  new_model_id: The new model ID to use for the exported spreadsheet. This is only applicable if the input
30
38
  rules have 'is_reference' set. If provided, the model ID will be used to automatically create the
31
39
  new metadata sheet in the Excel file.
32
- is_reference: If True, the rules are considered to be a reference model. The exported Excel file will
33
- then contain empty sheets for the main rules and this data model will be dumped to the reference sheets.
34
- This is useful when you are building a solution model based on an Enterprise model, then the
35
- Enterprise model will serve as the reference model. It is also useful when you are extending an existing
36
- model, then the existing model will serve as the reference model. Defaults to False.
40
+ dump_as: This determines how the rules are written to the Excel file. An Excel file has up to three sets of
41
+ sheets: user, last, and reference. The user sheets are used for inputting rules from a user. The last sheets
42
+ are used for the last version of the same model as the user, while the reference sheets are used for
43
+ the model the user is building on. The options are:
44
+ * "user": The rules are written to the user sheets. This is used when you want to modify the rules
45
+ directly and potentially change the model. This is useful when you have imported the data model
46
+ from outside CDF and you want to modify it before you write it to CDF.
47
+ * "last": The rules are written to the last sheets. This is used when you want to extend the rules,
48
+ but have validation that you are not breaking the existing model. This is used when you want to
49
+ change a model that has already been published to CDF and that model is in production.
50
+ * "reference": The rules are written to the reference sheets. This is typically used when you want to build
51
+ a new solution on top of an enterprise model.
37
52
 
38
53
  The following styles are available:
39
54
 
@@ -45,7 +60,7 @@ class ExcelExporter(BaseExporter[Workbook]):
45
60
  """
46
61
 
47
62
  Style = Literal["none", "minimal", "default", "maximal"]
48
-
63
+ DumpOptions = Literal["user", "last", "reference"]
49
64
  _main_header_by_sheet_name: ClassVar[dict[str, str]] = {
50
65
  "Properties": "Definition of Properties per Class",
51
66
  "Classes": "Definition of Classes",
@@ -53,21 +68,24 @@ class ExcelExporter(BaseExporter[Workbook]):
53
68
  "Containers": "Definition of Containers",
54
69
  }
55
70
  style_options = get_args(Style)
71
+ dump_options = get_args(DumpOptions)
56
72
 
57
73
  def __init__(
58
74
  self,
59
75
  styling: Style = "default",
60
76
  output_role: RoleTypes | None = None,
61
77
  new_model_id: tuple[str, str, str] | None = None,
62
- is_reference: bool = False,
78
+ dump_as: DumpOptions = "user",
63
79
  ):
64
80
  if styling not in self.style_options:
65
81
  raise ValueError(f"Invalid styling: {styling}. Valid options are {self.style_options}")
82
+ if dump_as not in self.dump_options:
83
+ raise ValueError(f"Invalid dump_as: {dump_as}. Valid options are {self.dump_options}")
66
84
  self.styling = styling
67
85
  self._styling_level = self.style_options.index(styling)
68
86
  self.output_role = output_role
69
87
  self.new_model_id = new_model_id
70
- self.is_reference = is_reference
88
+ self.dump_as = dump_as
71
89
 
72
90
  def export_to_file(self, rules: Rules, filepath: Path) -> None:
73
91
  """Exports transformation rules to excel file."""
@@ -84,41 +102,48 @@ class ExcelExporter(BaseExporter[Workbook]):
84
102
  # Remove default sheet named "Sheet"
85
103
  workbook.remove(workbook["Sheet"])
86
104
 
87
- dumped_rules: dict[str, Any]
105
+ dumped_user_rules: dict[str, Any]
106
+ dumped_last_rules: dict[str, Any] | None = None
88
107
  dumped_reference_rules: dict[str, Any] | None = None
89
- if self.is_reference:
108
+ if self.dump_as != "user":
90
109
  # Writes empty reference sheets
91
- dumped_rules = {
110
+ dumped_user_rules = {
92
111
  "Metadata": self._create_metadata_sheet_user_rules(rules),
93
112
  }
94
- dumped_rules["Metadata"]["role"] = (
95
- self.output_role and self.output_role.value
96
- ) or rules.metadata.role.value
97
- dumped_reference_rules = rules.reference_self().model_dump(by_alias=True)
113
+
114
+ if self.dump_as == "last":
115
+ dumped_last_rules = rules.model_dump(by_alias=True)
116
+ if rules.reference:
117
+ dumped_reference_rules = rules.reference.model_dump(by_alias=True)
118
+ elif self.dump_as == "reference":
119
+ dumped_reference_rules = rules.reference_self().model_dump(by_alias=True)
98
120
  else:
99
- dumped_rules = rules.model_dump(by_alias=True)
121
+ dumped_user_rules = rules.model_dump(by_alias=True)
122
+ if rules.last:
123
+ dumped_last_rules = rules.last.model_dump(by_alias=True)
100
124
  if rules.reference:
101
125
  dumped_reference_rules = rules.reference.model_dump(by_alias=True)
102
126
 
103
- self._write_metadata_sheet(workbook, dumped_rules["Metadata"])
104
- self._write_sheets(workbook, dumped_rules, rules)
127
+ self._write_metadata_sheet(workbook, dumped_user_rules["Metadata"])
128
+ self._write_sheets(workbook, dumped_user_rules, rules)
129
+ if dumped_last_rules:
130
+ self._write_sheets(workbook, dumped_last_rules, rules, sheet_prefix="Last")
131
+
105
132
  if dumped_reference_rules:
106
- self._write_sheets(workbook, dumped_reference_rules, rules, is_reference=True)
107
- self._write_metadata_sheet(workbook, dumped_reference_rules["Metadata"], is_reference=True)
133
+ prefix = "Ref"
134
+ self._write_sheets(workbook, dumped_reference_rules, rules, sheet_prefix=prefix)
135
+ self._write_metadata_sheet(workbook, dumped_reference_rules["Metadata"], sheet_prefix=prefix)
108
136
 
109
137
  if self._styling_level > 0:
110
138
  self._adjust_column_widths(workbook)
111
139
 
112
140
  return workbook
113
141
 
114
- def _write_sheets(self, workbook: Workbook, dumped_rules: dict[str, Any], rules: Rules, is_reference: bool = False):
142
+ def _write_sheets(self, workbook: Workbook, dumped_rules: dict[str, Any], rules: Rules, sheet_prefix: str = ""):
115
143
  for sheet_name, headers in rules.headers_by_sheet(by_alias=True).items():
116
- if sheet_name in ("Metadata", "prefixes", "Reference", "is_reference"):
144
+ if sheet_name in ("Metadata", "prefixes", "Reference", "Last"):
117
145
  continue
118
- if is_reference:
119
- sheet = workbook.create_sheet(f"Ref{sheet_name}")
120
- else:
121
- sheet = workbook.create_sheet(sheet_name)
146
+ sheet = workbook.create_sheet(f"{sheet_prefix}{sheet_name}")
122
147
 
123
148
  main_header = self._main_header_by_sheet_name[sheet_name]
124
149
  sheet.append([main_header] + [""] * (len(headers) - 1))
@@ -164,17 +189,14 @@ class ExcelExporter(BaseExporter[Workbook]):
164
189
  for cell in sheet["2"]:
165
190
  cell.font = Font(bold=True, size=14)
166
191
 
167
- def _write_metadata_sheet(self, workbook: Workbook, metadata: dict[str, Any], is_reference: bool = False) -> None:
192
+ def _write_metadata_sheet(self, workbook: Workbook, metadata: dict[str, Any], sheet_prefix: str = "") -> None:
168
193
  # Excel does not support timezone in datetime strings
169
194
  if isinstance(metadata.get("created"), datetime):
170
195
  metadata["created"] = metadata["created"].replace(tzinfo=None)
171
196
  if isinstance(metadata.get("updated"), datetime):
172
197
  metadata["updated"] = metadata["updated"].replace(tzinfo=None)
173
198
 
174
- if is_reference:
175
- metadata_sheet = workbook.create_sheet("RefMetadata")
176
- else:
177
- metadata_sheet = workbook.create_sheet("Metadata")
199
+ metadata_sheet = workbook.create_sheet(f"{sheet_prefix}Metadata")
178
200
  for key, value in metadata.items():
179
201
  metadata_sheet.append([key, value])
180
202
 
@@ -235,25 +257,29 @@ class ExcelExporter(BaseExporter[Workbook]):
235
257
  # Excel does not support timezone in datetime strings
236
258
  now_iso = datetime.now().replace(tzinfo=None).isoformat()
237
259
  is_info = isinstance(rules, InformationRules)
238
- is_dms = not is_info
239
- is_extension = self.new_model_id is not None
240
- is_solution = is_extension and self.new_model_id != existing_model_id
260
+ is_dms = isinstance(rules, DMSRules)
261
+ is_extension = self.new_model_id is not None or rules.reference is not None
262
+ is_solution = rules.metadata.data_model_type == DataModelType.solution
241
263
 
242
- if is_solution:
264
+ if is_solution and self.new_model_id:
243
265
  metadata["prefix" if is_info else "space"] = self.new_model_id[0] # type: ignore[index]
244
266
  metadata["title" if is_info else "externalId"] = self.new_model_id[1] # type: ignore[index]
245
267
  metadata["version"] = self.new_model_id[2] # type: ignore[index]
268
+ elif is_solution and self.dump_as == "reference" and rules.reference:
269
+ metadata["prefix" if is_info else "space"] = "YOUR_PREFIX"
270
+ metadata["title" if is_info else "externalId"] = "YOUR_TITLE"
271
+ metadata["version"] = "1"
246
272
  else:
247
273
  metadata["prefix" if is_info else "space"] = existing_model_id[0]
248
274
  metadata["title" if is_info else "externalId"] = existing_model_id[1]
249
275
  metadata["version"] = existing_model_id[2]
250
276
 
251
- if is_solution and is_info:
277
+ if is_solution and is_info and self.new_model_id:
252
278
  metadata["namespace"] = f"http://purl.org/{self.new_model_id[0]}/" # type: ignore[index]
253
279
  elif is_info:
254
280
  metadata["namespace"] = existing_metadata["namespace"]
255
281
 
256
- if is_solution and is_dms:
282
+ if is_solution and is_dms and self.new_model_id:
257
283
  metadata["name"] = self.new_model_id[1] # type: ignore[index]
258
284
 
259
285
  if is_solution:
@@ -279,6 +305,11 @@ class ExcelExporter(BaseExporter[Workbook]):
279
305
  else:
280
306
  metadata["schema"] = SchemaCompleteness.complete.value
281
307
 
282
- metadata["extension"] = "addition"
308
+ if is_solution:
309
+ metadata["dataModelType"] = DataModelType.solution.value
310
+ else:
311
+ metadata["dataModelType"] = DataModelType.enterprise.value
283
312
 
313
+ metadata["extension"] = ExtensionCategory.addition.value
314
+ metadata["role"] = (self.output_role and self.output_role.value) or rules.metadata.role.value
284
315
  return metadata
@@ -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):