cognite-neat 0.75.5__tar.gz → 0.75.7__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.
Files changed (260) hide show
  1. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/PKG-INFO +1 -1
  2. cognite_neat-0.75.7/cognite/neat/_version.py +1 -0
  3. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/_models.py +6 -1
  4. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/_rules2dms.py +71 -18
  5. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/_rules2excel.py +8 -1
  6. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_base.py +3 -10
  7. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_dms2rules.py +3 -7
  8. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +4 -7
  9. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +4 -7
  10. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_spreadsheet2rules.py +10 -20
  11. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_yaml2rules.py +4 -7
  12. cognite_neat-0.75.7/cognite/neat/rules/models/data_types.py +259 -0
  13. cognite_neat-0.75.7/cognite/neat/rules/models/entities.py +299 -0
  14. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_dms_architect_rules.py +2 -5
  15. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_domain_rules.py +1 -2
  16. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_information_rules.py +1 -3
  17. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/cdf_loaders/_data_modeling.py +4 -2
  18. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/rules_exporter.py +97 -0
  19. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/rules_importer.py +3 -12
  20. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/pyproject.toml +1 -1
  21. cognite_neat-0.75.5/cognite/neat/_version.py +0 -1
  22. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/LICENSE +0 -0
  23. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/README.md +0 -0
  24. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/__init__.py +0 -0
  25. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/__init__.py +0 -0
  26. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/asgi/metrics.py +0 -0
  27. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/configuration.py +0 -0
  28. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/context_manager/__init__.py +0 -0
  29. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/context_manager/manager.py +0 -0
  30. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/data_classes/__init__.py +0 -0
  31. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/data_classes/configuration.py +0 -0
  32. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/data_classes/rest.py +0 -0
  33. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/explorer.py +0 -0
  34. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/routers/configuration.py +0 -0
  35. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/routers/core.py +0 -0
  36. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/routers/crud.py +0 -0
  37. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/routers/data_exploration.py +0 -0
  38. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/routers/metrics.py +0 -0
  39. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/routers/rules.py +0 -0
  40. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/routers/workflows.py +0 -0
  41. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/utils/__init__.py +0 -0
  42. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/utils/data_mapping.py +0 -0
  43. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/utils/logging.py +0 -0
  44. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/api/utils/query_templates.py +0 -0
  45. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/main.py +0 -0
  46. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/monitoring/__init__.py +0 -0
  47. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/monitoring/metrics.py +0 -0
  48. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/index.html +0 -0
  49. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
  50. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/README.md +0 -0
  51. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
  52. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
  53. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
  54. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
  55. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
  56. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
  57. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
  58. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
  59. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
  60. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
  61. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
  62. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/static/js/main.4345d42f.js +0 -0
  63. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/static/js/main.4345d42f.js.LICENSE.txt +0 -0
  64. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/static/js/main.4345d42f.js.map +0 -0
  65. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
  66. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/config.py +0 -0
  67. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/constants.py +0 -0
  68. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/exceptions.py +0 -0
  69. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/__init__.py +0 -0
  70. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  71. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  72. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/examples/__init__.py +0 -0
  73. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  74. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/exceptions.py +0 -0
  75. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/extractors/__init__.py +0 -0
  76. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/extractors/_base.py +0 -0
  77. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
  78. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/models.py +0 -0
  79. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/stores/__init__.py +0 -0
  80. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/stores/_base.py +0 -0
  81. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
  82. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/stores/_memory_store.py +0 -0
  83. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
  84. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
  85. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
  86. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/__init__.py +0 -0
  87. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/__init__.py +0 -0
  88. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  89. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  90. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
  91. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  92. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/exceptions.py +0 -0
  93. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
  94. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
  95. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
  96. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
  97. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
  98. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
  99. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
  100. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
  101. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
  102. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
  103. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
  104. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
  105. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
  106. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
  107. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
  108. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
  109. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/models.py +0 -0
  110. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
  111. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/stores/_base.py +0 -0
  112. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
  113. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
  114. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
  115. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
  116. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
  117. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
  118. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
  119. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
  120. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
  121. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
  122. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/__init__.py +0 -0
  123. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/analysis.py +0 -0
  124. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
  125. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
  126. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
  127. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
  128. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
  129. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
  130. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
  131. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
  132. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
  133. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
  134. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
  135. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exceptions.py +0 -0
  136. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
  137. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
  138. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
  139. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
  140. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
  141. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
  142. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
  143. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
  144. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
  145. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
  146. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
  147. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
  148. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
  149. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_base.py +0 -0
  150. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
  151. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
  152. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
  153. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
  154. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
  155. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
  156. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  157. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
  158. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
  159. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
  160. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
  161. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
  162. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/models/__init__.py +0 -0
  163. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/models/_base.py +0 -0
  164. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
  165. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
  166. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/models/rules.py +0 -0
  167. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/models/tables.py +0 -0
  168. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/legacy/rules/models/value_types.py +0 -0
  169. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/py.typed +0 -0
  170. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/__init__.py +0 -0
  171. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/_shared.py +0 -0
  172. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/analysis/__init__.py +0 -0
  173. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/analysis/_base.py +0 -0
  174. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/analysis/_information_rules.py +0 -0
  175. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/examples/__init__.py +0 -0
  176. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/examples/wind-energy.owl +0 -0
  177. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exceptions.py +0 -0
  178. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/__init__.py +0 -0
  179. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/_base.py +0 -0
  180. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
  181. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
  182. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/exporters/_validation.py +0 -0
  183. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/__init__.py +0 -0
  184. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
  185. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  186. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
  187. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
  188. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
  189. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
  190. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  191. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
  192. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/__init__.py +0 -0
  193. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/base.py +0 -0
  194. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/dms.py +0 -0
  195. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/fileread.py +0 -0
  196. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/formatters.py +0 -0
  197. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/importing.py +0 -0
  198. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/spreadsheet.py +0 -0
  199. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
  200. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/_entity.py +0 -0
  201. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rdfpath.py +0 -0
  202. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/__init__.py +0 -0
  203. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_base.py +0 -0
  204. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_dms_schema.py +0 -0
  205. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_types/__init__.py +0 -0
  206. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_types/_base.py +0 -0
  207. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_types/_field.py +0 -0
  208. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/rules/models/rules/_types/_value.py +0 -0
  209. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/__init__.py +0 -0
  210. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/auxiliary.py +0 -0
  211. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/cdf.py +0 -0
  212. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
  213. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
  214. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
  215. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
  216. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/exceptions.py +0 -0
  217. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/spreadsheet.py +0 -0
  218. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/text.py +0 -0
  219. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/utils.py +0 -0
  220. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/utils/xml.py +0 -0
  221. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/__init__.py +0 -0
  222. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/_exceptions.py +0 -0
  223. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/base.py +0 -0
  224. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/cdf_store.py +0 -0
  225. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
  226. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  227. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  228. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
  229. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
  230. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  231. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  232. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  233. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  234. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  235. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/manager.py +0 -0
  236. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/migration/__init__.py +0 -0
  237. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/migration/steps.py +0 -0
  238. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
  239. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/model.py +0 -0
  240. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/__init__.py +0 -0
  241. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/data_contracts.py +0 -0
  242. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
  243. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/graph_extractor.py +0 -0
  244. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/graph_loader.py +0 -0
  245. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/graph_store.py +0 -0
  246. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/io_steps.py +0 -0
  247. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/rules_validator.py +0 -0
  248. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/__init__.py +0 -0
  249. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/graph_contextualization.py +0 -0
  250. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/graph_extractor.py +0 -0
  251. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/graph_loader.py +0 -0
  252. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/graph_store.py +0 -0
  253. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/graph_transformer.py +0 -0
  254. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/rules_exporter.py +0 -0
  255. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/lib/v1/rules_importer.py +0 -0
  256. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps/step_model.py +0 -0
  257. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/steps_registry.py +0 -0
  258. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/tasks.py +0 -0
  259. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/cognite/neat/workflows/triggers.py +0 -0
  260. {cognite_neat-0.75.5 → cognite_neat-0.75.7}/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.75.5
3
+ Version: 0.75.7
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.75.7"
@@ -30,6 +30,7 @@ class UploadResult(UploadResultCore):
30
30
  skipped: int = 0
31
31
  failed_created: int = 0
32
32
  failed_changed: int = 0
33
+ failed_deleted: int = 0
33
34
  error_messages: list[str] = field(default_factory=list)
34
35
 
35
36
  @property
@@ -38,7 +39,7 @@ class UploadResult(UploadResultCore):
38
39
 
39
40
  @property
40
41
  def failed(self) -> int:
41
- return self.failed_created + self.failed_changed
42
+ return self.failed_created + self.failed_changed + self.failed_deleted
42
43
 
43
44
  def as_report_str(self) -> str:
44
45
  line = []
@@ -50,9 +51,13 @@ class UploadResult(UploadResultCore):
50
51
  line.append(f"skipped {self.skipped}")
51
52
  if self.unchanged:
52
53
  line.append(f"unchanged {self.unchanged}")
54
+ if self.deleted:
55
+ line.append(f"deleted {self.deleted}")
53
56
  if self.failed_created:
54
57
  line.append(f"failed to create {self.failed_created}")
55
58
  if self.failed_changed:
56
59
  line.append(f"failed to update {self.failed_changed}")
60
+ if self.failed_deleted:
61
+ line.append(f"failed to delete {self.failed_deleted}")
57
62
 
58
63
  return f"{self.name.title()}: {', '.join(line)}"
@@ -27,7 +27,7 @@ from cognite.neat.utils.cdf_loaders import (
27
27
  from ._base import CDFExporter
28
28
  from ._models import UploadResult
29
29
 
30
- Component: TypeAlias = Literal["all", "spaces", "data_models", "views", "containers"]
30
+ Component: TypeAlias = Literal["all", "spaces", "data_models", "views", "containers", "node_types"]
31
31
 
32
32
 
33
33
  class DMSExporter(CDFExporter[DMSSchema]):
@@ -99,7 +99,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
99
99
  if "all" in self.export_components:
100
100
  exclude = set()
101
101
  else:
102
- exclude = {"spaces", "data_models", "views", "containers"} - self.export_components
102
+ exclude = {"spaces", "data_models", "views", "containers", "node_types"} - self.export_components
103
103
  return exclude
104
104
 
105
105
  def export(self, rules: Rules) -> DMSSchema:
@@ -118,12 +118,12 @@ class DMSExporter(CDFExporter[DMSSchema]):
118
118
  return dms_rules.as_schema(self.export_pipeline, self.instance_space)
119
119
 
120
120
  # This is an extension of an existing model.
121
- reference_rules = cast(DMSRules, dms_rules.reference).copy(deep=True)
121
+ reference_rules = cast(DMSRules, dms_rules.reference).model_copy(deep=True)
122
122
  reference_schema = reference_rules.as_schema(self.export_pipeline)
123
123
 
124
124
  # Todo Move this to an appropriate location
125
125
  # Merging Reference with User Rules
126
- combined_rules = dms_rules.copy(deep=True)
126
+ combined_rules = dms_rules.model_copy(deep=True)
127
127
  existing_containers = {container.class_ for container in combined_rules.containers or []}
128
128
  if combined_rules.containers is None:
129
129
  combined_rules.containers = SheetList[DMSContainer](data=[])
@@ -151,21 +151,55 @@ class DMSExporter(CDFExporter[DMSSchema]):
151
151
  schema.frozen_ids.update(set(reference_schema.node_types.as_ids()))
152
152
  return schema
153
153
 
154
+ def delete_from_cdf(self, rules: Rules, client: CogniteClient, dry_run: bool = False) -> Iterable[UploadResult]:
155
+ schema, to_export = self._prepare_schema_and_exporters(rules, client)
156
+
157
+ # we need to reverse order in which we are picking up the items to delete
158
+ # as they are sorted in the order of creation and we need to delete them in reverse order
159
+ for all_items, loader in reversed(to_export):
160
+ all_item_ids = loader.get_ids(all_items)
161
+ skipped = sum(1 for item_id in all_item_ids if item_id in schema.frozen_ids)
162
+ item_ids = [item_id for item_id in all_item_ids if item_id not in schema.frozen_ids]
163
+ cdf_items = loader.retrieve(item_ids)
164
+ cdf_item_by_id = {loader.get_id(item): item for item in cdf_items}
165
+ items = [item for item in all_items if loader.get_id(item) in item_ids]
166
+ to_delete = []
167
+
168
+ for item in items:
169
+ if (
170
+ isinstance(loader, DataModelingLoader)
171
+ and self.include_space is not None
172
+ and not loader.in_space(item, self.include_space)
173
+ ):
174
+ continue
175
+
176
+ cdf_item = cdf_item_by_id.get(loader.get_id(item))
177
+ if cdf_item:
178
+ to_delete.append(cdf_item)
179
+
180
+ deleted = len(to_delete)
181
+ failed_deleted = 0
182
+
183
+ error_messages: list[str] = []
184
+ if not dry_run:
185
+ if to_delete:
186
+ try:
187
+ loader.delete(to_delete)
188
+ except CogniteAPIError as e:
189
+ failed_deleted = len(e.failed) + len(e.unknown)
190
+ deleted -= failed_deleted
191
+ error_messages.append(f"Failed delete: {e.message}")
192
+
193
+ yield UploadResult(
194
+ name=loader.resource_name,
195
+ deleted=deleted,
196
+ skipped=skipped,
197
+ failed_deleted=failed_deleted,
198
+ error_messages=error_messages,
199
+ )
200
+
154
201
  def export_to_cdf(self, rules: Rules, client: CogniteClient, dry_run: bool = False) -> Iterable[UploadResult]:
155
- schema = self.export(rules)
156
- to_export: list[tuple[CogniteResourceList, ResourceLoader]] = []
157
- if self.export_components.intersection({"all", "spaces"}):
158
- to_export.append((schema.spaces, SpaceLoader(client)))
159
- if self.export_components.intersection({"all", "containers"}):
160
- to_export.append((schema.containers, ContainerLoader(client)))
161
- if self.export_components.intersection({"all", "views"}):
162
- to_export.append((schema.views, ViewLoader(client, self.existing_handling)))
163
- if self.export_components.intersection({"all", "data_models"}):
164
- to_export.append((schema.data_models, DataModelLoader(client)))
165
- if isinstance(schema, PipelineSchema):
166
- to_export.append((schema.databases, RawDatabaseLoader(client)))
167
- to_export.append((schema.raw_tables, RawTableLoader(client)))
168
- to_export.append((schema.transformations, TransformationLoader(client)))
202
+ schema, to_export = self._prepare_schema_and_exporters(rules, client)
169
203
 
170
204
  # The conversion from DMS to GraphQL does not seem to be triggered even if the views
171
205
  # are changed. This is a workaround to force the conversion.
@@ -254,3 +288,22 @@ class DMSExporter(CDFExporter[DMSSchema]):
254
288
 
255
289
  if loader.resource_name == "views" and (created or changed) and not redeploy_data_model:
256
290
  redeploy_data_model = True
291
+
292
+ def _prepare_schema_and_exporters(
293
+ self, rules, client
294
+ ) -> tuple[DMSSchema, list[tuple[CogniteResourceList, ResourceLoader]]]:
295
+ schema = self.export(rules)
296
+ to_export: list[tuple[CogniteResourceList, ResourceLoader]] = []
297
+ if self.export_components.intersection({"all", "spaces"}):
298
+ to_export.append((schema.spaces, SpaceLoader(client)))
299
+ if self.export_components.intersection({"all", "containers"}):
300
+ to_export.append((schema.containers, ContainerLoader(client)))
301
+ if self.export_components.intersection({"all", "views"}):
302
+ to_export.append((schema.views, ViewLoader(client, self.existing_handling)))
303
+ if self.export_components.intersection({"all", "data_models"}):
304
+ to_export.append((schema.data_models, DataModelLoader(client)))
305
+ if isinstance(schema, PipelineSchema):
306
+ to_export.append((schema.databases, RawDatabaseLoader(client)))
307
+ to_export.append((schema.raw_tables, RawTableLoader(client)))
308
+ to_export.append((schema.transformations, TransformationLoader(client)))
309
+ return schema, to_export
@@ -29,6 +29,11 @@ class ExcelExporter(BaseExporter[Workbook]):
29
29
  new_model_id: The new model ID to use for the exported spreadsheet. This is only applicable if the input
30
30
  rules have 'is_reference' set. If provided, the model ID will be used to automatically create the
31
31
  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.
32
37
 
33
38
  The following styles are available:
34
39
 
@@ -54,6 +59,7 @@ class ExcelExporter(BaseExporter[Workbook]):
54
59
  styling: Style = "default",
55
60
  output_role: RoleTypes | None = None,
56
61
  new_model_id: tuple[str, str, str] | None = None,
62
+ is_reference: bool = False,
57
63
  ):
58
64
  if styling not in self.style_options:
59
65
  raise ValueError(f"Invalid styling: {styling}. Valid options are {self.style_options}")
@@ -61,6 +67,7 @@ class ExcelExporter(BaseExporter[Workbook]):
61
67
  self._styling_level = self.style_options.index(styling)
62
68
  self.output_role = output_role
63
69
  self.new_model_id = new_model_id
70
+ self.is_reference = is_reference
64
71
 
65
72
  def export_to_file(self, rules: Rules, filepath: Path) -> None:
66
73
  """Exports transformation rules to excel file."""
@@ -79,7 +86,7 @@ class ExcelExporter(BaseExporter[Workbook]):
79
86
 
80
87
  dumped_rules: dict[str, Any]
81
88
  dumped_reference_rules: dict[str, Any] | None = None
82
- if rules.is_reference:
89
+ if self.is_reference:
83
90
  # Writes empty reference sheets
84
91
  dumped_rules = {
85
92
  "Metadata": self._create_metadata_sheet_user_rules(rules),
@@ -20,21 +20,18 @@ class BaseImporter(ABC):
20
20
  """
21
21
 
22
22
  @overload
23
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None, is_reference: bool = False) -> Rules:
23
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
24
24
  ...
25
25
 
26
26
  @overload
27
27
  def to_rules(
28
- self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None, is_reference: bool = False
28
+ self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
29
29
  ) -> tuple[Rules | None, IssueList]:
30
30
  ...
31
31
 
32
32
  @abstractmethod
33
33
  def to_rules(
34
- self,
35
- errors: Literal["raise", "continue"] = "continue",
36
- role: RoleTypes | None = None,
37
- is_reference: bool = False,
34
+ self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
38
35
  ) -> tuple[Rules | None, IssueList] | Rules:
39
36
  """
40
37
  Creates `Rules` object from the data for target role.
@@ -48,7 +45,6 @@ class BaseImporter(ABC):
48
45
  issues: IssueList,
49
46
  errors: Literal["raise", "continue"] = "continue",
50
47
  role: RoleTypes | None = None,
51
- is_reference: bool = False,
52
48
  ) -> tuple[Rules | None, IssueList] | Rules:
53
49
  """Converts the rules to the output format."""
54
50
 
@@ -61,9 +57,6 @@ class BaseImporter(ABC):
61
57
  else:
62
58
  raise NotImplementedError(f"Role {role} is not supported for {type(rules).__name__} rules")
63
59
 
64
- if is_reference:
65
- output.is_reference = True
66
-
67
60
  if errors == "raise":
68
61
  return output
69
62
  else:
@@ -82,20 +82,17 @@ class DMSImporter(BaseImporter):
82
82
  return cls(DMSSchema.from_zip(zip_file))
83
83
 
84
84
  @overload
85
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None, is_reference: bool = False) -> Rules:
85
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
86
86
  ...
87
87
 
88
88
  @overload
89
89
  def to_rules(
90
- self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None, is_reference: bool = False
90
+ self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
91
91
  ) -> tuple[Rules | None, IssueList]:
92
92
  ...
93
93
 
94
94
  def to_rules(
95
- self,
96
- errors: Literal["raise", "continue"] = "continue",
97
- role: RoleTypes | None = None,
98
- is_reference: bool = False,
95
+ self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
99
96
  ) -> tuple[Rules | None, IssueList] | Rules:
100
97
  if role is RoleTypes.domain_expert:
101
98
  raise ValueError(f"Role {role} is not supported for DMSImporter")
@@ -210,7 +207,6 @@ class DMSImporter(BaseImporter):
210
207
  data=[DMSContainer.from_container(container) for container in self.schema.containers]
211
208
  ),
212
209
  views=SheetList[DMSView](data=[DMSView.from_view(view, data_model_view_ids) for view in self.schema.views]),
213
- is_reference=is_reference,
214
210
  )
215
211
  output_rules: Rules
216
212
  if role is RoleTypes.information_architect:
@@ -119,20 +119,17 @@ class DTDLImporter(BaseImporter):
119
119
  return cls(items, zip_file.stem, read_issues=issues)
120
120
 
121
121
  @overload
122
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None, is_reference: bool = False) -> Rules:
122
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
123
123
  ...
124
124
 
125
125
  @overload
126
126
  def to_rules(
127
- self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None, is_reference: bool = False
127
+ self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
128
128
  ) -> tuple[Rules | None, IssueList]:
129
129
  ...
130
130
 
131
131
  def to_rules(
132
- self,
133
- errors: Literal["raise", "continue"] = "continue",
134
- role: RoleTypes | None = None,
135
- is_reference: bool = False,
132
+ self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
136
133
  ) -> tuple[Rules | None, IssueList] | Rules:
137
134
  converter = _DTDLConverter(self._read_issues)
138
135
 
@@ -161,4 +158,4 @@ class DTDLImporter(BaseImporter):
161
158
  else:
162
159
  raise converter.issues.as_errors()
163
160
 
164
- return self._to_output(rules, converter.issues, errors, role, is_reference)
161
+ return self._to_output(rules, converter.issues, errors, role)
@@ -43,20 +43,17 @@ class OWLImporter(BaseImporter):
43
43
  self.make_compliant = make_compliant
44
44
 
45
45
  @overload
46
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None, is_reference: bool = False) -> Rules:
46
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
47
47
  ...
48
48
 
49
49
  @overload
50
50
  def to_rules(
51
- self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None, is_reference: bool = False
51
+ self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
52
52
  ) -> tuple[Rules | None, IssueList]:
53
53
  ...
54
54
 
55
55
  def to_rules(
56
- self,
57
- errors: Literal["raise", "continue"] = "continue",
58
- role: RoleTypes | None = None,
59
- is_reference: bool = False,
56
+ self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
60
57
  ) -> tuple[Rules | None, IssueList] | Rules:
61
58
  graph = Graph()
62
59
  try:
@@ -82,7 +79,7 @@ class OWLImporter(BaseImporter):
82
79
  components = make_components_compliant(components)
83
80
 
84
81
  rules = InformationRules.model_validate(components)
85
- return self._to_output(rules, IssueList(), errors, role, is_reference)
82
+ return self._to_output(rules, IssueList(), errors, role)
86
83
 
87
84
 
88
85
  def make_components_compliant(components: dict) -> dict:
@@ -152,7 +152,7 @@ class ExcelImporter(BaseImporter):
152
152
  self.filepath = filepath
153
153
 
154
154
  @overload
155
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None, is_reference: bool = False) -> Rules:
155
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
156
156
  ...
157
157
 
158
158
  @overload
@@ -160,29 +160,23 @@ class ExcelImporter(BaseImporter):
160
160
  self,
161
161
  errors: Literal["continue"] = "continue",
162
162
  role: RoleTypes | None = None,
163
- is_reference: bool = False,
164
163
  ) -> tuple[Rules | None, IssueList]:
165
164
  ...
166
165
 
167
166
  def to_rules(
168
- self,
169
- errors: Literal["raise", "continue"] = "continue",
170
- role: RoleTypes | None = None,
171
- is_reference: bool = False,
167
+ self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
172
168
  ) -> tuple[Rules | None, IssueList] | Rules:
173
169
  issue_list = IssueList(title=f"'{self.filepath.name}'")
174
170
  if not self.filepath.exists():
175
171
  issue_list.append(issues.spreadsheet_file.SpreadsheetNotFoundError(self.filepath))
176
172
  return self._return_or_raise(issue_list, errors)
177
173
 
178
- user_result: ReadResult | None = None
179
- if not is_reference:
180
- user_result = SpreadsheetReader(issue_list, is_reference=False).read(self.filepath)
181
- if user_result is None or issue_list.has_errors:
182
- return self._return_or_raise(issue_list, errors)
174
+ user_result = SpreadsheetReader(issue_list, is_reference=False).read(self.filepath)
175
+ if user_result is None or issue_list.has_errors:
176
+ return self._return_or_raise(issue_list, errors)
183
177
 
184
178
  reference_result: ReadResult | None = None
185
- if is_reference or (
179
+ if (
186
180
  user_result
187
181
  and user_result.role != RoleTypes.domain_expert
188
182
  and user_result.schema == SchemaCompleteness.extended
@@ -230,7 +224,6 @@ class ExcelImporter(BaseImporter):
230
224
  issue_list,
231
225
  errors=errors,
232
226
  role=role,
233
- is_reference=is_reference,
234
227
  )
235
228
 
236
229
  @classmethod
@@ -246,20 +239,17 @@ class GoogleSheetImporter(BaseImporter):
246
239
  self.skiprows = skiprows
247
240
 
248
241
  @overload
249
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None, is_reference: bool = False) -> Rules:
242
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
250
243
  ...
251
244
 
252
245
  @overload
253
246
  def to_rules(
254
- self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None, is_reference: bool = False
247
+ self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
255
248
  ) -> tuple[Rules | None, IssueList]:
256
249
  ...
257
250
 
258
251
  def to_rules(
259
- self,
260
- errors: Literal["raise", "continue"] = "continue",
261
- role: RoleTypes | None = None,
262
- is_reference: bool = False,
252
+ self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
263
253
  ) -> tuple[Rules | None, IssueList] | Rules:
264
254
  local_import("gspread", "google")
265
255
  import gspread # type: ignore[import]
@@ -284,4 +274,4 @@ class GoogleSheetImporter(BaseImporter):
284
274
  else:
285
275
  raise ValueError(f"Role {role} is not valid.")
286
276
 
287
- return self._to_output(output, IssueList(), errors=errors, role=role, is_reference=is_reference)
277
+ return self._to_output(output, IssueList(), errors=errors, role=role)
@@ -45,20 +45,17 @@ class YAMLImporter(BaseImporter):
45
45
  return cls(yaml.safe_load(filepath.read_text()), filepaths=[filepath])
46
46
 
47
47
  @overload
48
- def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None, is_reference: bool = False) -> Rules:
48
+ def to_rules(self, errors: Literal["raise"], role: RoleTypes | None = None) -> Rules:
49
49
  ...
50
50
 
51
51
  @overload
52
52
  def to_rules(
53
- self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None, is_reference: bool = False
53
+ self, errors: Literal["continue"] = "continue", role: RoleTypes | None = None
54
54
  ) -> tuple[Rules | None, IssueList]:
55
55
  ...
56
56
 
57
57
  def to_rules(
58
- self,
59
- errors: Literal["raise", "continue"] = "continue",
60
- role: RoleTypes | None = None,
61
- is_reference: bool = False,
58
+ self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
62
59
  ) -> tuple[Rules | None, IssueList] | Rules:
63
60
  if any(issue for issue in self._read_issues if isinstance(issue, NeatValidationError)) or not self.raw_data:
64
61
  if errors == "raise":
@@ -107,4 +104,4 @@ class YAMLImporter(BaseImporter):
107
104
  else:
108
105
  raise issue_list.as_errors()
109
106
 
110
- return self._to_output(rules, issue_list, errors, role, is_reference)
107
+ return self._to_output(rules, issue_list, errors, role)