cognite-neat 0.77.3__tar.gz → 0.77.5__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 (284) hide show
  1. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/PKG-INFO +1 -1
  2. cognite_neat-0.77.5/cognite/neat/_version.py +1 -0
  3. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/analysis/_information_rules.py +2 -12
  4. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2excel.py +10 -10
  5. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2yaml.py +3 -3
  6. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dms2rules.py +15 -6
  7. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +1 -0
  8. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_spreadsheet2rules.py +21 -8
  9. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/spreadsheet.py +60 -5
  10. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_base.py +29 -18
  11. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_converter.py +2 -0
  12. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_exporter.py +131 -17
  13. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_rules.py +43 -31
  14. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_rules_input.py +4 -11
  15. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_schema.py +5 -4
  16. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_serializer.py +26 -36
  17. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_validation.py +39 -61
  18. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/domain.py +2 -6
  19. cognite_neat-0.77.5/cognite/neat/rules/models/information/__init__.py +10 -0
  20. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/information/_converter.py +53 -14
  21. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/information/_rules.py +63 -106
  22. cognite_neat-0.77.5/cognite/neat/rules/models/information/_rules_input.py +266 -0
  23. cognite_neat-0.77.5/cognite/neat/rules/models/information/_serializer.py +73 -0
  24. cognite_neat-0.77.5/cognite/neat/rules/models/information/_validation.py +164 -0
  25. cognite_neat-0.77.5/cognite/neat/utils/cdf.py +59 -0
  26. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +30 -7
  27. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/rules_importer.py +21 -2
  28. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/pyproject.toml +1 -1
  29. cognite_neat-0.77.3/cognite/neat/_version.py +0 -1
  30. cognite_neat-0.77.3/cognite/neat/rules/models/information/__init__.py +0 -3
  31. cognite_neat-0.77.3/cognite/neat/utils/cdf.py +0 -24
  32. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/LICENSE +0 -0
  33. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/README.md +0 -0
  34. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/__init__.py +0 -0
  35. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/__init__.py +0 -0
  36. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/asgi/metrics.py +0 -0
  37. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/configuration.py +0 -0
  38. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/context_manager/__init__.py +0 -0
  39. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/context_manager/manager.py +0 -0
  40. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/data_classes/__init__.py +0 -0
  41. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/data_classes/rest.py +0 -0
  42. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/explorer.py +0 -0
  43. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/configuration.py +0 -0
  44. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/core.py +0 -0
  45. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/crud.py +0 -0
  46. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/data_exploration.py +0 -0
  47. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/metrics.py +0 -0
  48. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/rules.py +0 -0
  49. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/workflows.py +0 -0
  50. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/__init__.py +0 -0
  51. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/data_mapping.py +0 -0
  52. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/logging.py +0 -0
  53. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/query_templates.py +0 -0
  54. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/main.py +0 -0
  55. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/monitoring/__init__.py +0 -0
  56. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/monitoring/metrics.py +0 -0
  57. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/index.html +0 -0
  58. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
  59. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/README.md +0 -0
  60. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
  61. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
  62. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
  63. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
  64. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
  65. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
  66. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
  67. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
  68. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
  69. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
  70. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
  71. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
  72. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
  73. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
  74. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
  75. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/config.py +0 -0
  76. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/constants.py +0 -0
  77. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/exceptions.py +0 -0
  78. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/__init__.py +0 -0
  79. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  80. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  81. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/__init__.py +0 -0
  82. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  83. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/exceptions.py +0 -0
  84. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/extractors/__init__.py +0 -0
  85. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/extractors/_base.py +0 -0
  86. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
  87. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/models.py +0 -0
  88. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/__init__.py +0 -0
  89. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_base.py +0 -0
  90. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
  91. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_memory_store.py +0 -0
  92. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
  93. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
  94. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
  95. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/__init__.py +0 -0
  96. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/__init__.py +0 -0
  97. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  98. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  99. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
  100. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  101. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/exceptions.py +0 -0
  102. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
  103. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
  104. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
  105. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
  106. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
  107. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
  108. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
  109. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
  110. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
  111. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
  112. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
  113. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
  114. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
  115. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
  116. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
  117. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
  118. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/models.py +0 -0
  119. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
  120. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_base.py +0 -0
  121. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
  122. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
  123. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
  124. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
  125. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
  126. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
  127. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
  128. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
  129. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
  130. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
  131. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/__init__.py +0 -0
  132. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/analysis.py +0 -0
  133. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
  134. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
  135. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
  136. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
  137. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
  138. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
  139. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
  140. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
  141. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
  142. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
  143. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
  144. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exceptions.py +0 -0
  145. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
  146. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
  147. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
  148. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
  149. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
  150. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
  151. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
  152. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
  153. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
  154. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
  155. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
  156. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
  157. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
  158. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_base.py +0 -0
  159. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
  160. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
  161. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
  162. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
  163. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
  164. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
  165. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  166. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
  167. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
  168. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
  169. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
  170. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
  171. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/__init__.py +0 -0
  172. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/_base.py +0 -0
  173. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
  174. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
  175. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/rules.py +0 -0
  176. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/tables.py +0 -0
  177. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/value_types.py +0 -0
  178. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
  179. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  180. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  181. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  182. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
  183. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  184. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  185. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  186. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  187. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  188. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/py.typed +0 -0
  189. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/__init__.py +0 -0
  190. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/_shared.py +0 -0
  191. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/analysis/__init__.py +0 -0
  192. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/analysis/_base.py +0 -0
  193. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/examples/__init__.py +0 -0
  194. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/examples/wind-energy.owl +0 -0
  195. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exceptions.py +0 -0
  196. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/__init__.py +0 -0
  197. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_base.py +0 -0
  198. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_models.py +0 -0
  199. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2dms.py +0 -0
  200. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
  201. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_validation.py +0 -0
  202. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/__init__.py +0 -0
  203. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_base.py +0 -0
  204. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
  205. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  206. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
  207. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
  208. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
  209. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
  210. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  211. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
  212. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
  213. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
  214. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/__init__.py +0 -0
  215. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/base.py +0 -0
  216. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/dms.py +0 -0
  217. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/fileread.py +0 -0
  218. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/formatters.py +0 -0
  219. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/importing.py +0 -0
  220. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
  221. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/__init__.py +0 -0
  222. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_rdfpath.py +0 -0
  223. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_types/__init__.py +0 -0
  224. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_types/_base.py +0 -0
  225. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_types/_field.py +0 -0
  226. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/data_types.py +0 -0
  227. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/__init__.py +0 -0
  228. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/entities.py +0 -0
  229. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/wrapped_entities.py +0 -0
  230. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/__init__.py +0 -0
  231. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/auxiliary.py +0 -0
  232. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_classes.py +0 -0
  233. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
  234. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
  235. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
  236. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
  237. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
  238. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/exceptions.py +0 -0
  239. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/spreadsheet.py +0 -0
  240. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/text.py +0 -0
  241. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/utils.py +0 -0
  242. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/xml.py +0 -0
  243. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/__init__.py +0 -0
  244. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/_exceptions.py +0 -0
  245. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/base.py +0 -0
  246. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/cdf_store.py +0 -0
  247. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
  248. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  249. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  250. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  251. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
  252. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  253. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  254. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  255. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  256. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  257. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/manager.py +0 -0
  258. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/migration/__init__.py +0 -0
  259. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/migration/steps.py +0 -0
  260. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
  261. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/model.py +0 -0
  262. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/__init__.py +0 -0
  263. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/data_contracts.py +0 -0
  264. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
  265. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
  266. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
  267. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
  268. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
  269. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
  270. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
  271. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
  272. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
  273. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
  274. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
  275. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
  276. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
  277. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
  278. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
  279. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
  280. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/step_model.py +0 -0
  281. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps_registry.py +0 -0
  282. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/tasks.py +0 -0
  283. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/triggers.py +0 -0
  284. {cognite_neat-0.77.3 → cognite_neat-0.77.5}/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.77.3
3
+ Version: 0.77.5
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.77.5"
@@ -13,23 +13,13 @@ from cognite.neat.rules.models.entities import ClassEntity, EntityTypes, ParentC
13
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
- from ._base import BaseAnalysis, DataModelingScenario
16
+ from ._base import BaseAnalysis
17
17
 
18
18
 
19
19
  class InformationArchitectRulesAnalysis(BaseAnalysis):
20
20
  def __init__(self, rules: InformationRules):
21
21
  self.rules = rules
22
22
 
23
- @property
24
- def data_modeling_scenario(self) -> DataModelingScenario:
25
- if not self.rules.reference:
26
- return DataModelingScenario.from_scratch
27
-
28
- if self.rules.metadata.namespace == self.rules.reference.metadata.namespace:
29
- return DataModelingScenario.extend_reference
30
- else:
31
- return DataModelingScenario.build_solution
32
-
33
23
  @property
34
24
  def referred_classes(self) -> set[ClassEntity]:
35
25
  return self.directly_referred_classes.union(self.inherited_referred_classes)
@@ -362,7 +352,7 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
362
352
 
363
353
  rules = cast(InformationRules, self.rules.reference if use_reference else self.rules)
364
354
 
365
- if not rules.metadata.schema_ is not SchemaCompleteness.complete:
355
+ if rules.metadata.schema_ is not SchemaCompleteness.complete:
366
356
  raise ValueError("Rules are not complete cannot perform reduction!")
367
357
  class_as_dict = self.as_class_dict()
368
358
  class_parents_pairs = self.class_parent_pairs()
@@ -116,27 +116,27 @@ class ExcelExporter(BaseExporter[Workbook]):
116
116
  }
117
117
 
118
118
  if self.dump_as == "last":
119
- dumped_last_rules = rules.model_dump(by_alias=True)
119
+ dumped_last_rules = rules.dump(by_alias=True)
120
120
  if rules.reference:
121
- dumped_reference_rules = rules.reference.model_dump(by_alias=True)
121
+ dumped_reference_rules = rules.reference.dump(by_alias=True, as_reference=True)
122
122
  elif self.dump_as == "reference":
123
- dumped_reference_rules = rules.reference_self().model_dump(by_alias=True)
123
+ dumped_reference_rules = rules.dump(by_alias=True, as_reference=True)
124
124
  else:
125
- dumped_user_rules = rules.model_dump(by_alias=True)
125
+ dumped_user_rules = rules.dump(by_alias=True)
126
126
  if rules.last:
127
- dumped_last_rules = rules.last.model_dump(by_alias=True)
127
+ dumped_last_rules = rules.last.dump(by_alias=True)
128
128
  if rules.reference:
129
- dumped_reference_rules = rules.reference.model_dump(by_alias=True)
129
+ dumped_reference_rules = rules.reference.dump(by_alias=True, as_reference=True)
130
130
 
131
131
  self._write_metadata_sheet(workbook, dumped_user_rules["Metadata"])
132
132
  self._write_sheets(workbook, dumped_user_rules, rules)
133
133
  if dumped_last_rules:
134
134
  self._write_sheets(workbook, dumped_last_rules, rules, sheet_prefix="Last")
135
+ self._write_metadata_sheet(workbook, dumped_last_rules["Metadata"], sheet_prefix="Last")
135
136
 
136
137
  if dumped_reference_rules:
137
- prefix = "Ref"
138
- self._write_sheets(workbook, dumped_reference_rules, rules, sheet_prefix=prefix)
139
- self._write_metadata_sheet(workbook, dumped_reference_rules["Metadata"], sheet_prefix=prefix)
138
+ self._write_sheets(workbook, dumped_reference_rules, rules, sheet_prefix="Ref")
139
+ self._write_metadata_sheet(workbook, dumped_reference_rules["Metadata"], sheet_prefix="Ref")
140
140
 
141
141
  if self._styling_level > 0:
142
142
  self._adjust_column_widths(workbook)
@@ -291,7 +291,7 @@ class _MetadataCreator:
291
291
  prefix = self.new_model_id[0]
292
292
  return InformationMetadata(
293
293
  data_model_type=DataModelType.solution,
294
- schema_=SchemaCompleteness.extended,
294
+ schema_=SchemaCompleteness.complete,
295
295
  extension=ExtensionCategory.addition,
296
296
  prefix=prefix,
297
297
  namespace=f"http://purl.org/neat/{prefix}/", # type: ignore[arg-type]
@@ -69,10 +69,10 @@ class YAMLExporter(BaseExporter[str]):
69
69
  rules = self._convert_to_output_role(rules, self.output_role)
70
70
  # model_dump_json ensures that the output is in JSON format,
71
71
  # if we don't do this, we will get Enums and other types that are not serializable to YAML
72
- json_output = rules.model_dump_json()
72
+ json_output = rules.dump(mode="json")
73
73
  if self.output == "json":
74
- return json_output
74
+ return json.dumps(json_output)
75
75
  elif self.output == "yaml":
76
- return yaml.safe_dump(json.loads(json_output))
76
+ return yaml.safe_dump(json_output)
77
77
  else:
78
78
  raise ValueError(f"Invalid output: {self.output}. Valid options are {self.format_option}")
@@ -109,7 +109,7 @@ class DMSImporter(BaseImporter):
109
109
  if result.result == "failure" or issue_list.has_errors:
110
110
  return cls(DMSSchema(), issue_list)
111
111
 
112
- metadata = cls._create_metadata_from_model(user_model)
112
+ metadata = cls._create_metadata_from_model(user_model, has_reference=ref_model is not None)
113
113
  ref_metadata = cls._create_metadata_from_model(ref_model) if ref_model else None
114
114
 
115
115
  return cls(schema, issue_list, metadata, ref_metadata)
@@ -131,6 +131,7 @@ class DMSImporter(BaseImporter):
131
131
  def _create_metadata_from_model(
132
132
  cls,
133
133
  model: dm.DataModel[dm.View] | dm.DataModelApply,
134
+ has_reference: bool = False,
134
135
  ) -> DMSMetadata:
135
136
  description, creator = DMSMetadata._get_description_and_creator(model.description)
136
137
 
@@ -143,6 +144,7 @@ class DMSImporter(BaseImporter):
143
144
  updated = now
144
145
  return DMSMetadata(
145
146
  schema_=SchemaCompleteness.complete,
147
+ data_model_type=DataModelType.solution if has_reference else DataModelType.enterprise,
146
148
  extension=ExtensionCategory.addition,
147
149
  space=model.space,
148
150
  external_id=model.external_id,
@@ -202,16 +204,21 @@ class DMSImporter(BaseImporter):
202
204
  **self._create_rule_components(
203
205
  ref_model,
204
206
  ref_schema,
205
- self.ref_metadata or self._create_default_metadata(list(ref_schema.views.values())),
207
+ self.ref_metadata
208
+ or self._create_default_metadata(list(ref_schema.views.values()), is_ref=True),
206
209
  DataModelType.enterprise,
207
210
  )
208
211
  )
209
- schema_completeness = SchemaCompleteness.extended
210
212
  data_model_type = DataModelType.solution
211
213
 
212
214
  user_rules = DMSRules(
213
215
  **self._create_rule_components(
214
- model, self.root_schema, self.metadata, data_model_type, schema_completeness
216
+ model,
217
+ self.root_schema,
218
+ self.metadata,
219
+ data_model_type,
220
+ schema_completeness,
221
+ has_reference=reference is not None,
215
222
  ),
216
223
  reference=reference,
217
224
  )
@@ -228,6 +235,7 @@ class DMSImporter(BaseImporter):
228
235
  metadata: DMSMetadata | None = None,
229
236
  data_model_type: DataModelType | None = None,
230
237
  schema_completeness: SchemaCompleteness | None = None,
238
+ has_reference: bool = False,
231
239
  ) -> dict[str, Any]:
232
240
  properties = SheetList[DMSProperty]()
233
241
  for view_id, view in schema.views.items():
@@ -242,7 +250,7 @@ class DMSImporter(BaseImporter):
242
250
  view.as_id() if isinstance(view, dm.View | dm.ViewApply) else view for view in data_model.views or []
243
251
  }
244
252
 
245
- metadata = metadata or DMSMetadata.from_data_model(data_model)
253
+ metadata = metadata or DMSMetadata.from_data_model(data_model, has_reference)
246
254
  if data_model_type is not None:
247
255
  metadata.data_model_type = data_model_type
248
256
  if schema_completeness is not None:
@@ -262,12 +270,13 @@ class DMSImporter(BaseImporter):
262
270
  )
263
271
 
264
272
  @classmethod
265
- def _create_default_metadata(cls, views: Sequence[dm.View | dm.ViewApply]) -> DMSMetadata:
273
+ def _create_default_metadata(cls, views: Sequence[dm.View | dm.ViewApply], is_ref: bool = False) -> DMSMetadata:
266
274
  now = datetime.now().replace(microsecond=0)
267
275
  space = Counter(view.space for view in views).most_common(1)[0][0]
268
276
  return DMSMetadata(
269
277
  schema_=SchemaCompleteness.complete,
270
278
  extension=ExtensionCategory.addition,
279
+ data_model_type=DataModelType.enterprise if is_ref else DataModelType.solution,
271
280
  space=space,
272
281
  external_id="Unknown",
273
282
  version="0.1.0",
@@ -134,6 +134,7 @@ class DTDLImporter(BaseImporter):
134
134
 
135
135
  metadata = self._default_metadata()
136
136
  metadata["schema"] = self._schema_completeness.value
137
+
137
138
  if self.title:
138
139
  metadata["title"] = to_pascal(self.title)
139
140
  try:
@@ -22,6 +22,7 @@ from cognite.neat.rules.models import (
22
22
  SchemaCompleteness,
23
23
  )
24
24
  from cognite.neat.rules.models.dms import DMSRulesInput
25
+ from cognite.neat.rules.models.information import InformationRulesInput
25
26
  from cognite.neat.utils.auxiliary import local_import
26
27
  from cognite.neat.utils.spreadsheet import SpreadsheetRead, read_individual_sheet
27
28
 
@@ -110,17 +111,27 @@ class SpreadsheetReader:
110
111
  self.required = required
111
112
  self.metadata = metadata
112
113
  self._sheet_prefix = sheet_prefix
114
+ self._seen_files: set[Path] = set()
115
+ self._seen_sheets: set[str] = set()
113
116
 
114
117
  @property
115
118
  def metadata_sheet_name(self) -> str:
116
119
  return f"{self._sheet_prefix}Metadata"
117
120
 
121
+ @property
122
+ def seen_sheets(self) -> set[str]:
123
+ if not self._seen_files:
124
+ raise ValueError("No files have been read yet.")
125
+ return self._seen_sheets
126
+
118
127
  def sheet_names(self, role: RoleTypes) -> set[str]:
119
128
  names = MANDATORY_SHEETS_BY_ROLE[role]
120
129
  return {f"{self._sheet_prefix}{sheet_name}" for sheet_name in names if sheet_name != "Metadata"}
121
130
 
122
131
  def read(self, filepath: Path) -> None | ReadResult:
123
132
  with pd.ExcelFile(filepath) as excel_file:
133
+ self._seen_files.add(filepath)
134
+ self._seen_sheets.update(map(str, excel_file.sheet_names))
124
135
  metadata: MetadataRaw | None
125
136
  if self.metadata is not None:
126
137
  metadata = self.metadata
@@ -212,20 +223,20 @@ class ExcelImporter(BaseImporter):
212
223
  issue_list.append(issues.spreadsheet_file.SpreadsheetNotFoundError(self.filepath))
213
224
  return self._return_or_raise(issue_list, errors)
214
225
 
215
- user_read = SpreadsheetReader(issue_list).read(self.filepath)
226
+ user_reader = SpreadsheetReader(issue_list)
227
+ user_read = user_reader.read(self.filepath)
216
228
  if user_read is None or issue_list.has_errors:
217
229
  return self._return_or_raise(issue_list, errors)
218
230
 
219
231
  last_read: ReadResult | None = None
232
+ if any(sheet_name.startswith("Last") for sheet_name in user_reader.seen_sheets):
233
+ last_read = SpreadsheetReader(issue_list, required=False, sheet_prefix="Last").read(self.filepath)
220
234
  reference_read: ReadResult | None = None
221
- if user_read.schema == SchemaCompleteness.extended:
222
- # Last does not have its own metadata sheet. It is the same as the user's metadata sheet.
223
- last_read = SpreadsheetReader(
224
- issue_list, required=False, metadata=user_read.metadata, sheet_prefix="Last"
225
- ).read(self.filepath)
235
+ if any(sheet_name.startswith("Ref") for sheet_name in user_reader.seen_sheets):
226
236
  reference_read = SpreadsheetReader(issue_list, sheet_prefix="Ref").read(self.filepath)
227
- if issue_list.has_errors:
228
- return self._return_or_raise(issue_list, errors)
237
+
238
+ if issue_list.has_errors:
239
+ return self._return_or_raise(issue_list, errors)
229
240
 
230
241
  if reference_read and user_read.role != reference_read.role:
231
242
  issue_list.append(issues.spreadsheet_file.RoleMismatchError(self.filepath))
@@ -253,6 +264,8 @@ class ExcelImporter(BaseImporter):
253
264
  rules: Rules
254
265
  if rules_cls is DMSRules:
255
266
  rules = DMSRulesInput.load(sheets).as_rules()
267
+ elif rules_cls is InformationRules:
268
+ rules = InformationRulesInput.load(sheets).as_rules()
256
269
  else:
257
270
  rules = rules_cls.model_validate(sheets) # type: ignore[attr-defined]
258
271
 
@@ -10,7 +10,7 @@ from pydantic_core import ErrorDetails
10
10
 
11
11
  from cognite.neat.utils.spreadsheet import SpreadsheetRead
12
12
 
13
- from .base import DefaultPydanticError, MultiValueError, NeatValidationError, ValidationWarning
13
+ from .base import DefaultPydanticError, MultiValueError, NeatValidationError
14
14
 
15
15
  if sys.version_info >= (3, 11):
16
16
  from typing import Self
@@ -27,7 +27,7 @@ __all__ = [
27
27
  "InvalidRowUnknownSheetError",
28
28
  "NonExistingContainerError",
29
29
  "NonExistingViewError",
30
- "ClassNoPropertiesNoParentsWarning",
30
+ "ClassNoPropertiesNoParentError",
31
31
  "InconsistentContainerDefinitionError",
32
32
  "MultiValueTypeError",
33
33
  "MultiValueIsListError",
@@ -239,7 +239,26 @@ class NonExistingViewError(InvalidPropertyError):
239
239
 
240
240
 
241
241
  @dataclass(frozen=True)
242
- class ClassNoPropertiesNoParentsWarning(ValidationWarning):
242
+ class PropertiesDefinedForUndefinedClassesError(NeatValidationError):
243
+ description = "Properties are defined for undefined classes."
244
+ fix = "Make sure to define class in the Classes sheet."
245
+
246
+ classes: list[str]
247
+
248
+ def dump(self) -> dict[str, list[str]]:
249
+ output = super().dump()
250
+ output["classes"] = self.classes
251
+ return output
252
+
253
+ def message(self) -> str:
254
+ return (
255
+ f"Classes {', '.join(self.classes)} have properties assigned to them, but"
256
+ " they are not defined in the Classes sheet."
257
+ )
258
+
259
+
260
+ @dataclass(frozen=True)
261
+ class ClassNoPropertiesNoParentError(NeatValidationError):
243
262
  description = "Class has no properties and no parents."
244
263
  fix = "Check if the class should have properties or parents."
245
264
 
@@ -252,8 +271,44 @@ class ClassNoPropertiesNoParentsWarning(ValidationWarning):
252
271
 
253
272
  def message(self) -> str:
254
273
  if len(self.classes) > 1:
255
- return f"Classes {', '.join(self.classes)} have no properties and no parents. This may be a mistake."
256
- return f"Class {self.classes[0]} has no properties and no parents. This may be a mistake."
274
+ return f"Classes {', '.join(self.classes)} have no direct or inherited properties. This may be a mistake."
275
+ return f"Class {self.classes[0]} have no direct or inherited properties. This may be a mistake."
276
+
277
+
278
+ @dataclass(frozen=True)
279
+ class ParentClassesNotDefinedError(NeatValidationError):
280
+ description = "Parent classes are not defined."
281
+ fix = "Check if the parent classes are defined in Classes sheet."
282
+
283
+ classes: list[str]
284
+
285
+ def dump(self) -> dict[str, list[str]]:
286
+ output = super().dump()
287
+ output["classes"] = self.classes
288
+ return output
289
+
290
+ def message(self) -> str:
291
+ if len(self.classes) > 1:
292
+ return f"Parent classes {', '.join(self.classes)} are not defined. This may be a mistake."
293
+ return f"Parent classes {', '.join(self.classes[0])} are not defined. This may be a mistake."
294
+
295
+
296
+ @dataclass(frozen=True)
297
+ class ValueTypeNotDefinedError(NeatValidationError):
298
+ description = "Value types referred by properties are not defined in Rules."
299
+ fix = "Make sure that all value types are defined in Rules."
300
+
301
+ value_types: list[str]
302
+
303
+ def dump(self) -> dict[str, list[str]]:
304
+ output = super().dump()
305
+ output["classes"] = self.value_types
306
+ return output
307
+
308
+ def message(self) -> str:
309
+ if len(self.value_types) > 1:
310
+ return f"Value types {', '.join(self.value_types)} are not defined. This may be a mistake."
311
+ return f"Value types {', '.join(self.value_types[0])} are not defined. This may be a mistake."
257
312
 
258
313
 
259
314
  @dataclass(frozen=True)
@@ -7,10 +7,9 @@ from __future__ import annotations
7
7
  import math
8
8
  import sys
9
9
  import types
10
- from abc import abstractmethod
11
10
  from collections.abc import Callable, Iterator
12
11
  from functools import wraps
13
- from typing import Annotated, Any, ClassVar, Generic, TypeAlias, TypeVar
12
+ from typing import Annotated, Any, ClassVar, Generic, Literal, TypeAlias, TypeVar
14
13
 
15
14
  import pandas as pd
16
15
  from pydantic import (
@@ -26,18 +25,23 @@ from pydantic import (
26
25
  model_validator,
27
26
  )
28
27
  from pydantic.fields import FieldInfo
28
+ from pydantic.main import IncEx
29
29
 
30
30
  if sys.version_info >= (3, 11):
31
31
  from enum import StrEnum
32
- from typing import Self
33
32
  else:
34
33
  from backports.strenum import StrEnum
35
- from typing_extensions import Self
36
34
 
37
35
 
38
36
  METADATA_VALUE_MAX_LENGTH = 5120
39
37
 
40
38
 
39
+ def _add_alias(data: dict[str, Any], base_model: type[BaseModel]) -> None:
40
+ for field_name, field_ in base_model.model_fields.items():
41
+ if field_name not in data and field_.alias in data:
42
+ data[field_name] = data[field_.alias]
43
+
44
+
41
45
  def replace_nan_floats_with_default(values: dict, model_fields: dict[str, FieldInfo]) -> dict:
42
46
  output = {}
43
47
  for field_name, value in values.items():
@@ -253,26 +257,33 @@ class BaseRules(RuleModel):
253
257
 
254
258
  Args:
255
259
  metadata: Data model metadata
256
- classes: Classes defined in the data model
257
- properties: Class properties defined in the data model with accompanying transformation rules
258
- to transform data from source to target representation
259
- prefixes: Prefixes used in the data model. Defaults to PREFIXES
260
- instances: Instances defined in the data model. Defaults to None
261
260
  validators_to_skip: List of validators to skip. Defaults to []
262
261
  """
263
262
 
264
263
  metadata: BaseMetadata
265
264
 
266
- @abstractmethod
267
- def reference_self(self) -> Self:
268
- """
269
- Returns a copy of the rules with reference fields set to itself
270
-
271
- For example, if the rules have a property with a reference field, then
272
- the reference field will be set to the property itself. This is used when
273
- exporting a reference model.
265
+ def dump(
266
+ self,
267
+ mode: Literal["python", "json"] = "python",
268
+ by_alias: bool = False,
269
+ exclude: IncEx = None,
270
+ exclude_none: bool = False,
271
+ exclude_unset: bool = False,
272
+ exclude_defaults: bool = False,
273
+ as_reference: bool = False,
274
+ ) -> dict[str, Any]:
275
+ """Dump the model to a dictionary.
276
+
277
+ This is used in the Exporters to dump rules in the required format.
274
278
  """
275
- raise NotImplementedError
279
+ return self.model_dump(
280
+ mode=mode,
281
+ by_alias=by_alias,
282
+ exclude=exclude,
283
+ exclude_none=exclude_none,
284
+ exclude_unset=exclude_unset,
285
+ exclude_defaults=exclude_defaults,
286
+ )
276
287
 
277
288
 
278
289
  # An sheet entity is either a class or a property.
@@ -105,6 +105,8 @@ class _DMSRulesConverter:
105
105
  prefix = metadata.space
106
106
  return InformationMetadata(
107
107
  schema_=metadata.schema_,
108
+ data_model_type=metadata.data_model_type,
109
+ extension=metadata.extension,
108
110
  prefix=prefix,
109
111
  namespace=Namespace(f"https://purl.orgl/neat/{prefix}/"),
110
112
  version=metadata.version,