cognite-neat 0.87.6__tar.gz → 0.88.0__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 (320) hide show
  1. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/PKG-INFO +1 -1
  2. cognite_neat-0.88.0/cognite/neat/_version.py +1 -0
  3. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/data_classes/rest.py +0 -19
  4. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/explorer.py +6 -4
  5. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/routers/crud.py +11 -21
  6. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/routers/workflows.py +24 -94
  7. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/stores/_base.py +5 -0
  8. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_inference2rules.py +31 -35
  9. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/data_contracts.py +17 -43
  10. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +28 -24
  11. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/current/graph_loader.py +4 -21
  12. cognite_neat-0.88.0/cognite/neat/workflows/steps/lib/current/graph_store.py +48 -0
  13. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps_registry.py +5 -7
  14. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/pyproject.toml +1 -1
  15. cognite_neat-0.87.6/cognite/neat/_version.py +0 -1
  16. cognite_neat-0.87.6/cognite/neat/app/api/routers/core.py +0 -91
  17. cognite_neat-0.87.6/cognite/neat/app/api/routers/data_exploration.py +0 -336
  18. cognite_neat-0.87.6/cognite/neat/app/api/routers/rules.py +0 -203
  19. cognite_neat-0.87.6/cognite/neat/legacy/graph/__init__.py +0 -3
  20. cognite_neat-0.87.6/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -20182
  21. cognite_neat-0.87.6/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -20163
  22. cognite_neat-0.87.6/cognite/neat/legacy/graph/examples/__init__.py +0 -10
  23. cognite_neat-0.87.6/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  24. cognite_neat-0.87.6/cognite/neat/legacy/graph/exceptions.py +0 -90
  25. cognite_neat-0.87.6/cognite/neat/legacy/graph/extractors/__init__.py +0 -6
  26. cognite_neat-0.87.6/cognite/neat/legacy/graph/extractors/_base.py +0 -14
  27. cognite_neat-0.87.6/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -44
  28. cognite_neat-0.87.6/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -403
  29. cognite_neat-0.87.6/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -361
  30. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/__init__.py +0 -23
  31. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -511
  32. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/_base.py +0 -67
  33. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -85
  34. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/core/labels.py +0 -58
  35. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/core/models.py +0 -136
  36. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -1046
  37. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -559
  38. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -309
  39. cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/validator.py +0 -87
  40. cognite_neat-0.87.6/cognite/neat/legacy/graph/models.py +0 -6
  41. cognite_neat-0.87.6/cognite/neat/legacy/graph/stores/__init__.py +0 -13
  42. cognite_neat-0.87.6/cognite/neat/legacy/graph/stores/_base.py +0 -400
  43. cognite_neat-0.87.6/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -52
  44. cognite_neat-0.87.6/cognite/neat/legacy/graph/stores/_memory_store.py +0 -43
  45. cognite_neat-0.87.6/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -151
  46. cognite_neat-0.87.6/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -247
  47. cognite_neat-0.87.6/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -42
  48. cognite_neat-0.87.6/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -101
  49. cognite_neat-0.87.6/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -3
  50. cognite_neat-0.87.6/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -575
  51. cognite_neat-0.87.6/cognite/neat/legacy/graph/transformations/transformer.py +0 -322
  52. cognite_neat-0.87.6/cognite/neat/legacy/rules/analysis.py +0 -231
  53. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
  54. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/Rules-Nordic44.xlsx +0 -0
  55. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/__init__.py +0 -18
  56. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -124
  57. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
  58. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -224
  59. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
  60. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
  61. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
  62. cognite_neat-0.87.6/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
  63. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/__init__.py +0 -20
  64. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_base.py +0 -45
  65. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -5
  66. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -24
  67. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -885
  68. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -213
  69. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -183
  70. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -524
  71. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -748
  72. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -105
  73. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -38
  74. cognite_neat-0.87.6/cognite/neat/legacy/rules/exporters/_validation.py +0 -146
  75. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/__init__.py +0 -22
  76. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_base.py +0 -66
  77. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -158
  78. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -194
  79. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -308
  80. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_json2rules.py +0 -39
  81. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -239
  82. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -260
  83. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -217
  84. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -290
  85. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -45
  86. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -20
  87. cognite_neat-0.87.6/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -39
  88. cognite_neat-0.87.6/cognite/neat/legacy/rules/models/__init__.py +0 -5
  89. cognite_neat-0.87.6/cognite/neat/legacy/rules/models/_base.py +0 -151
  90. cognite_neat-0.87.6/cognite/neat/legacy/rules/models/raw_rules.py +0 -316
  91. cognite_neat-0.87.6/cognite/neat/legacy/rules/models/rdfpath.py +0 -237
  92. cognite_neat-0.87.6/cognite/neat/legacy/rules/models/rules.py +0 -1289
  93. cognite_neat-0.87.6/cognite/neat/legacy/rules/models/tables.py +0 -9
  94. cognite_neat-0.87.6/cognite/neat/legacy/rules/models/value_types.py +0 -118
  95. cognite_neat-0.87.6/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -89
  96. cognite_neat-0.87.6/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -270
  97. cognite_neat-0.87.6/cognite/neat/rules/examples/wind-energy.owl +0 -1511
  98. cognite_neat-0.87.6/cognite/neat/rules/exceptions.py +0 -2972
  99. cognite_neat-0.87.6/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -3
  100. cognite_neat-0.87.6/cognite/neat/utils/__init__.py +0 -0
  101. cognite_neat-0.87.6/cognite/neat/utils/cdf/__init__.py +0 -0
  102. cognite_neat-0.87.6/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -152
  103. cognite_neat-0.87.6/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -139
  104. cognite_neat-0.87.6/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -270
  105. cognite_neat-0.87.6/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -65
  106. cognite_neat-0.87.6/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -116
  107. cognite_neat-0.87.6/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -67
  108. cognite_neat-0.87.6/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -64
  109. cognite_neat-0.87.6/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -95
  110. cognite_neat-0.87.6/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -111
  111. cognite_neat-0.87.6/cognite/neat/workflows/migration/__init__.py +0 -0
  112. cognite_neat-0.87.6/cognite/neat/workflows/migration/steps.py +0 -91
  113. cognite_neat-0.87.6/cognite/neat/workflows/migration/wf_manifests.py +0 -33
  114. cognite_neat-0.87.6/cognite/neat/workflows/steps/__init__.py +0 -0
  115. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/__init__.py +0 -0
  116. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -164
  117. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -7
  118. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -82
  119. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -746
  120. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -606
  121. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -307
  122. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -58
  123. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -511
  124. cognite_neat-0.87.6/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -612
  125. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/LICENSE +0 -0
  126. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/README.md +0 -0
  127. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/__init__.py +0 -0
  128. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/_shared.py +0 -0
  129. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/__init__.py +0 -0
  130. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/asgi/metrics.py +0 -0
  131. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/configuration.py +0 -0
  132. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/context_manager/__init__.py +0 -0
  133. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/context_manager/manager.py +0 -0
  134. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/data_classes/__init__.py +0 -0
  135. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/routers/configuration.py +0 -0
  136. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/routers/metrics.py +0 -0
  137. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/utils/__init__.py +0 -0
  138. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/utils/data_mapping.py +0 -0
  139. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/utils/logging.py +0 -0
  140. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/api/utils/query_templates.py +0 -0
  141. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/main.py +0 -0
  142. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/monitoring/__init__.py +0 -0
  143. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/monitoring/metrics.py +0 -0
  144. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/index.html +0 -0
  145. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
  146. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/README.md +0 -0
  147. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
  148. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
  149. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
  150. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
  151. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
  152. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
  153. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
  154. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
  155. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
  156. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
  157. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
  158. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
  159. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
  160. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
  161. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
  162. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/config.py +0 -0
  163. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/constants.py +0 -0
  164. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/exceptions.py +0 -0
  165. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/__init__.py +0 -0
  166. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/_shared.py +0 -0
  167. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/_tracking/__init__.py +0 -0
  168. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/_tracking/base.py +0 -0
  169. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/_tracking/log.py +0 -0
  170. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  171. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  172. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/examples/__init__.py +0 -0
  173. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  174. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/exceptions.py +0 -0
  175. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/__init__.py +0 -0
  176. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_base.py +0 -0
  177. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/__init__.py +0 -0
  178. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/_assets.py +0 -0
  179. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/_events.py +0 -0
  180. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/_files.py +0 -0
  181. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/_labels.py +0 -0
  182. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/_relationships.py +0 -0
  183. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/_sequences.py +0 -0
  184. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_classic_cdf/_timeseries.py +0 -0
  185. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_dexpi.py +0 -0
  186. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
  187. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/extractors/_rdf_file.py +0 -0
  188. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/issues/__init__.py +0 -0
  189. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/issues/loader.py +0 -0
  190. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/loaders/__init__.py +0 -0
  191. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/loaders/_base.py +0 -0
  192. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/loaders/_rdf2asset.py +0 -0
  193. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/loaders/_rdf2dms.py +0 -0
  194. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/models.py +0 -0
  195. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/queries/__init__.py +0 -0
  196. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/queries/_base.py +0 -0
  197. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/queries/_construct.py +0 -0
  198. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/queries/_shared.py +0 -0
  199. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/stores/__init__.py +0 -0
  200. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
  201. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/stores/_provenance.py +0 -0
  202. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/transformers/__init__.py +0 -0
  203. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/transformers/_base.py +0 -0
  204. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/transformers/_classic_cdf.py +0 -0
  205. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/graph/transformers/_rdfpath.py +0 -0
  206. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/issues.py +0 -0
  207. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/py.typed +0 -0
  208. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat/rules}/__init__.py +0 -0
  209. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/_shared.py +0 -0
  210. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/analysis/__init__.py +0 -0
  211. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/analysis/_asset.py +0 -0
  212. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/analysis/_base.py +0 -0
  213. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/analysis/_information.py +0 -0
  214. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/examples/__init__.py +0 -0
  215. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/rules/examples/wind-energy.owl +0 -0
  216. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/rules/exceptions.py +0 -0
  217. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/exporters/__init__.py +0 -0
  218. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/exporters/_base.py +0 -0
  219. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/exporters/_rules2dms.py +0 -0
  220. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
  221. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
  222. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
  223. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/exporters/_validation.py +0 -0
  224. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/__init__.py +0 -0
  225. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_base.py +0 -0
  226. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_dms2rules.py +0 -0
  227. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
  228. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  229. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
  230. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
  231. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
  232. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/rules/importers/_owl2rules/__init__.py +0 -0
  233. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
  234. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
  235. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
  236. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
  237. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_spreadsheet2rules.py +0 -0
  238. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
  239. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/__init__.py +0 -0
  240. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/base.py +0 -0
  241. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/dms.py +0 -0
  242. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/fileread.py +0 -0
  243. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/formatters.py +0 -0
  244. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/importing.py +0 -0
  245. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/spreadsheet.py +0 -0
  246. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
  247. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/__init__.py +0 -0
  248. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/_base.py +0 -0
  249. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/_constants.py +0 -0
  250. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/_rdfpath.py +0 -0
  251. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/_types/__init__.py +0 -0
  252. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/_types/_base.py +0 -0
  253. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/_types/_field.py +0 -0
  254. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/asset/__init__.py +0 -0
  255. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/asset/_converter.py +0 -0
  256. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/asset/_rules.py +0 -0
  257. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/asset/_rules_input.py +0 -0
  258. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/asset/_serializer.py +0 -0
  259. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/asset/_validation.py +0 -0
  260. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/data_types.py +0 -0
  261. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/__init__.py +0 -0
  262. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/_converter.py +0 -0
  263. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/_exporter.py +0 -0
  264. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/_rules.py +0 -0
  265. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
  266. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/_schema.py +0 -0
  267. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/_serializer.py +0 -0
  268. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/dms/_validation.py +0 -0
  269. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/domain.py +0 -0
  270. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/entities.py +0 -0
  271. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/information/__init__.py +0 -0
  272. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/information/_converter.py +0 -0
  273. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/information/_rules.py +0 -0
  274. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/information/_rules_input.py +0 -0
  275. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/information/_serializer.py +0 -0
  276. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/information/_validation.py +0 -0
  277. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/rules/models/wrapped_entities.py +0 -0
  278. {cognite_neat-0.87.6/cognite/neat/legacy/graph/loaders/core → cognite_neat-0.88.0/cognite/neat/utils}/__init__.py +0 -0
  279. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/auth.py +0 -0
  280. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/auxiliary.py +0 -0
  281. {cognite_neat-0.87.6/cognite/neat/legacy/graph/transformations → cognite_neat-0.88.0/cognite/neat/utils/cdf}/__init__.py +0 -0
  282. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/cdf/data_classes.py +0 -0
  283. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/cdf/loaders/__init__.py +0 -0
  284. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/cdf/loaders/_base.py +0 -0
  285. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/cdf/loaders/_data_modeling.py +0 -0
  286. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/cdf/loaders/_ingestion.py +0 -0
  287. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/collection_.py +0 -0
  288. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/rdf_.py +0 -0
  289. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/spreadsheet.py +0 -0
  290. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/text.py +0 -0
  291. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/time_.py +0 -0
  292. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/upload.py +0 -0
  293. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/utils/xml_.py +0 -0
  294. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/__init__.py +0 -0
  295. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/_exceptions.py +0 -0
  296. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/base.py +0 -0
  297. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/cdf_store.py +0 -0
  298. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
  299. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
  300. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
  301. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Import_DMS/workflow.yaml +0 -0
  302. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
  303. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Validate_Rules/workflow.yaml +0 -0
  304. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
  305. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
  306. {cognite_neat-0.87.6/cognite/neat/legacy → cognite_neat-0.88.0/cognite/neat}/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
  307. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/manager.py +0 -0
  308. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/model.py +0 -0
  309. {cognite_neat-0.87.6/cognite/neat/legacy/rules → cognite_neat-0.88.0/cognite/neat/workflows/steps}/__init__.py +0 -0
  310. {cognite_neat-0.87.6/cognite/neat/rules → cognite_neat-0.88.0/cognite/neat/workflows/steps/lib}/__init__.py +0 -0
  311. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
  312. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
  313. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
  314. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
  315. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
  316. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
  317. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/steps/step_model.py +0 -0
  318. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/tasks.py +0 -0
  319. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/cognite/neat/workflows/triggers.py +0 -0
  320. {cognite_neat-0.87.6 → cognite_neat-0.88.0}/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.87.6
3
+ Version: 0.88.0
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.88.0"
@@ -16,25 +16,6 @@ class RuleRequest(BaseModel):
16
16
  rule: str
17
17
 
18
18
 
19
- class UploadToCdfRequest(BaseModel):
20
- file_name: str = ""
21
- file_type: str = "workflow"
22
- comments: str = ""
23
- author: str = ""
24
- tag: str = ""
25
-
26
-
27
- class DownloadFromCdfRequest(BaseModel):
28
- file_name: str = ""
29
- file_type: str = "workflow"
30
- version: str = ""
31
-
32
-
33
- class LoadGraphRequest(BaseModel):
34
- graph_source_template_name: str
35
- source_location: str
36
-
37
-
38
19
  class RunWorkflowRequest(BaseModel):
39
20
  name: str
40
21
  config: dict
@@ -10,7 +10,12 @@ from cognite import neat
10
10
  from cognite.neat.app.api.asgi.metrics import prometheus_app
11
11
  from cognite.neat.app.api.configuration import NEAT_APP, UI_PATH
12
12
  from cognite.neat.app.api.context_manager import lifespan
13
- from cognite.neat.app.api.routers import configuration, core, crud, data_exploration, metrics, rules, workflows
13
+ from cognite.neat.app.api.routers import (
14
+ configuration,
15
+ crud,
16
+ metrics,
17
+ workflows,
18
+ )
14
19
  from cognite.neat.app.api.utils.logging import EndpointFilter
15
20
 
16
21
  app = FastAPI(title="Neat", lifespan=lifespan)
@@ -45,10 +50,7 @@ app.mount("/data", StaticFiles(directory=NEAT_APP.config.data_store_path), name=
45
50
  app.include_router(configuration.router)
46
51
  app.include_router(metrics.router)
47
52
  app.include_router(workflows.router)
48
- app.include_router(rules.router)
49
53
  app.include_router(crud.router)
50
- app.include_router(data_exploration.router)
51
- app.include_router(core.router)
52
54
 
53
55
 
54
56
  # General routes
@@ -14,28 +14,13 @@ from cognite.neat.workflows.utils import get_file_hash
14
14
  router = APIRouter()
15
15
 
16
16
 
17
- @router.get("/api/cdf/neat-resources")
18
- def get_neat_resources(resource_type: str | None = None):
19
- if NEAT_APP.cdf_store is None:
20
- return {"error": "NeatApp is not initialized"}
21
- if resource_type is None:
22
- return {"error": "Resource type is not specified"}
23
- result = NEAT_APP.cdf_store.get_list_of_resources_from_cdf(resource_type=resource_type)
24
- logging.debug(f"Got {len(result)} resources")
25
- return {"result": result}
26
-
27
-
28
- @router.post("/api/cdf/init-neat-resources")
29
- def init_neat_cdf_resources(resource_type: str | None = None):
30
- if NEAT_APP.cdf_store is None:
31
- return {"error": "NeatApp is not initialized"}
32
- NEAT_APP.cdf_store.init_cdf_resources(resource_type=resource_type)
33
- return {"result": "ok"}
34
-
35
-
36
17
  @router.post("/api/file/upload/{workflow_name}/{file_type}/{step_id}/{action}")
37
18
  async def file_upload_handler(
38
- files: list[UploadFile], workflow_name: str, file_type: str, step_id: str, action: str
19
+ files: list[UploadFile],
20
+ workflow_name: str,
21
+ file_type: str,
22
+ step_id: str,
23
+ action: str,
39
24
  ) -> dict[str, str]:
40
25
  if NEAT_APP.cdf_store is None or NEAT_APP.workflow_manager is None:
41
26
  return {"error": "NeatApp is not initialized"}
@@ -91,7 +76,12 @@ async def file_upload_handler(
91
76
  if workflow is None:
92
77
  return {"error": f"Workflow {workflow_name} not found"}
93
78
  flow_msg = FlowMessage(
94
- payload={"file_name": file_name, "hash": file_version, "full_path": full_path, "file_type": file_type}
79
+ payload={
80
+ "file_name": file_name,
81
+ "hash": file_version,
82
+ "full_path": full_path,
83
+ "file_type": file_type,
84
+ }
95
85
  )
96
86
  start_step_id = None if step_id == "none" else step_id
97
87
 
@@ -1,20 +1,19 @@
1
1
  import logging
2
2
  import shutil
3
- from pathlib import Path
4
3
  from typing import cast
5
4
 
6
5
  from fastapi import APIRouter, Depends, HTTPException, Request, UploadFile
7
6
  from fastapi.responses import FileResponse, JSONResponse
8
7
 
9
8
  from cognite.neat.app.api.configuration import NEAT_APP
10
- from cognite.neat.app.api.data_classes.rest import DownloadFromCdfRequest, RunWorkflowRequest, UploadToCdfRequest
9
+ from cognite.neat.app.api.data_classes.rest import (
10
+ RunWorkflowRequest,
11
+ )
11
12
  from cognite.neat.workflows import WorkflowFullStateReport
12
13
  from cognite.neat.workflows.base import WorkflowDefinition
13
- from cognite.neat.workflows.migration.wf_manifests import migrate_wf_manifest
14
14
  from cognite.neat.workflows.model import FlowMessage
15
- from cognite.neat.workflows.steps.data_contracts import SolutionGraph, SourceGraph
15
+ from cognite.neat.workflows.steps.data_contracts import NeatGraph
16
16
  from cognite.neat.workflows.steps.step_model import DataContract
17
- from cognite.neat.workflows.utils import get_file_hash
18
17
 
19
18
  router = APIRouter()
20
19
 
@@ -27,7 +26,11 @@ def start_workflow(request: RunWorkflowRequest):
27
26
  start_status = NEAT_APP.workflow_manager.start_workflow_instance(
28
27
  request.name, sync=request.sync, flow_msg=FlowMessage()
29
28
  )
30
- result = {"workflow_instance": None, "is_success": start_status.is_success, "status_text": start_status.status_text}
29
+ result = {
30
+ "workflow_instance": None,
31
+ "is_success": start_status.is_success,
32
+ "status_text": start_status.status_text,
33
+ }
31
34
  return {"result": result}
32
35
 
33
36
 
@@ -58,25 +61,6 @@ def get_workflow_files(workflow_name: str):
58
61
  return {"files": workflow.get_list_of_workflow_artifacts()}
59
62
 
60
63
 
61
- @router.post("/api/workflow/package/{workflow_name}")
62
- def package_workflow(workflow_name: str):
63
- if NEAT_APP.cdf_store is None:
64
- return {"error": "NeatApp is not initialized"}
65
- package_file = NEAT_APP.cdf_store.package_workflow(workflow_name)
66
- hash_ = get_file_hash(NEAT_APP.config.workflows_store_path / package_file)
67
- return {"package": package_file, "hash": hash_}
68
-
69
-
70
- @router.post("/api/workflow/context-cleanup/{workflow_name}")
71
- def cleanup_workflow_data(workflow_name: str):
72
- if NEAT_APP.cdf_store is None:
73
- return {"error": "NeatApp is not initialized"}
74
- workflow = NEAT_APP.workflow_manager.get_workflow(workflow_name)
75
- if workflow is not None:
76
- workflow.cleanup_workflow_context()
77
- return {"result": "ok"}
78
-
79
-
80
64
  @router.post("/api/workflow/create")
81
65
  def create_new_workflow(request: WorkflowDefinition):
82
66
  if NEAT_APP.workflow_manager is None:
@@ -95,30 +79,24 @@ def delete_workflow(workflow_name: str):
95
79
  return {"result": "ok"}
96
80
 
97
81
 
98
- @router.get("/api/workflow/executions")
99
- def get_list_of_workflow_executions():
100
- return {"executions": NEAT_APP.cdf_store.get_list_of_workflow_executions_from_cdf()}
101
-
102
-
103
- @router.get("/api/workflow/detailed-execution-report/{execution_id}")
104
- def get_detailed_execution(execution_id: str):
105
- if NEAT_APP.cdf_store is None:
106
- return {"error": "NeatApp is not initialized"}
107
- return {"report": NEAT_APP.cdf_store.get_detailed_workflow_execution_report_from_cdf(execution_id)}
108
-
109
-
110
82
  @router.post("/api/workflow/reload-workflows")
111
83
  def reload_workflows():
112
84
  NEAT_APP.workflow_manager.load_workflows_from_storage()
113
85
  NEAT_APP.triggers_manager.reload_all_triggers()
114
- return {"result": "ok", "workflows": NEAT_APP.workflow_manager.get_list_of_workflows()}
86
+ return {
87
+ "result": "ok",
88
+ "workflows": NEAT_APP.workflow_manager.get_list_of_workflows(),
89
+ }
115
90
 
116
91
 
117
92
  @router.post("/api/workflow/reload-single-workflow/{workflow_name}")
118
93
  def reload_single_workflows(workflow_name: str):
119
94
  NEAT_APP.workflow_manager.load_single_workflow_from_storage(workflow_name)
120
95
  NEAT_APP.triggers_manager.reload_all_triggers()
121
- return {"result": "ok", "workflows": NEAT_APP.workflow_manager.get_list_of_workflows()}
96
+ return {
97
+ "result": "ok",
98
+ "workflows": NEAT_APP.workflow_manager.get_list_of_workflows(),
99
+ }
122
100
 
123
101
 
124
102
  @router.get("/api/workflow/workflow-definition/{workflow_name}")
@@ -152,58 +130,6 @@ def update_workflow_definition(workflow_name: str, request: WorkflowDefinition):
152
130
  return {"result": "ok"}
153
131
 
154
132
 
155
- @router.post("/api/workflow/upload-wf-to-cdf/{workflow_name}")
156
- def upload_workflow_to_cdf(workflow_name: str, request: UploadToCdfRequest):
157
- if NEAT_APP.cdf_store is None:
158
- return {"error": "NeatApp is not initialized"}
159
- NEAT_APP.cdf_store.save_workflow_to_cdf(
160
- workflow_name, changed_by=request.author, comments=request.comments, tag=request.tag
161
- )
162
- return {"result": "ok"}
163
-
164
-
165
- @router.post("/api/workflow/upload-rules-cdf/{workflow_name}")
166
- def upload_rules_to_cdf(workflow_name: str, request: UploadToCdfRequest):
167
- if NEAT_APP.cdf_store is None:
168
- return {"error": "NeatApp is not initialized"}
169
- file_path = Path(NEAT_APP.config.rules_store_path, request.file_name)
170
- NEAT_APP.cdf_store.save_resource_to_cdf(
171
- workflow_name, "neat-wf-rules", file_path, changed_by=request.author, comments=request.comments
172
- )
173
- return {"result": "ok"}
174
-
175
-
176
- @router.post("/api/workflow/download-wf-from-cdf")
177
- def download_wf_from_cdf(request: DownloadFromCdfRequest):
178
- if NEAT_APP.cdf_store is None:
179
- return {"error": "NeatApp is not initialized"}
180
- NEAT_APP.cdf_store.load_workflows_from_cdf(request.file_name, request.version)
181
- return {"result": "ok"}
182
-
183
-
184
- @router.post("/api/workflow/download-rules-from-cdf")
185
- def download_rules_to_cdf(request: DownloadFromCdfRequest):
186
- if NEAT_APP.cdf_store is None:
187
- return {"error": "NeatApp is not initialized"}
188
- NEAT_APP.cdf_store.load_rules_file_from_cdf(request.file_name, request.version)
189
- return {"file_name": request.file_name, "hash": request.version}
190
-
191
-
192
- @router.post("/api/workflow/migrate-workflow")
193
- def migrate_workflow():
194
- return migrate_wf_manifest(NEAT_APP.config.data_store_path)
195
-
196
-
197
- @router.get("/api/workflow/pre-cdf-assets/{workflow_name}")
198
- def get_pre_cdf_assets(workflow_name: str):
199
- if NEAT_APP.workflow_manager is None:
200
- return {"error": "Workflow Manager is not initialized"}
201
- workflow = NEAT_APP.workflow_manager.get_workflow(workflow_name)
202
- if workflow is None:
203
- return {"assets": []}
204
- return {"assets": workflow.data["CategorizedAssets"]}
205
-
206
-
207
133
  @router.get("/api/workflow/context/{workflow_name}")
208
134
  def get_context(workflow_name: str):
209
135
  if NEAT_APP.workflow_manager is None:
@@ -228,8 +154,8 @@ def get_context_object(workflow_name: str, object_name: str):
228
154
  if object_name not in context:
229
155
  return {"error": f"Item {object_name} is not found in workflow context"}
230
156
 
231
- if object_name == "SourceGraph" or object_name == "SolutionGraph":
232
- return {"object": cast(SourceGraph | SolutionGraph, context[object_name]).graph.diagnostic_report()}
157
+ if object_name == "NeatGraph":
158
+ return {"object": cast(NeatGraph, context[object_name]).graph.type_}
233
159
 
234
160
  cobject = context[object_name]
235
161
  if isinstance(cobject, DataContract):
@@ -285,7 +211,11 @@ def http_trigger_start_workflow(workflow_name: str, step_id: str, request: Reque
285
211
 
286
212
  @router.post("/api/workflow/{workflow_name}/resume/{step_id}/{instance_id}")
287
213
  def http_trigger_resume_workflow(
288
- workflow_name: str, step_id: str, instance_id: str, request: Request, body: bytes = fast_api_depends
214
+ workflow_name: str,
215
+ step_id: str,
216
+ instance_id: str,
217
+ request: Request,
218
+ body: bytes = fast_api_depends,
289
219
  ):
290
220
  if NEAT_APP.triggers_manager is None:
291
221
  return JSONResponse(content={"error": "Triggers Manager is not initialized"}, status_code=400)
@@ -66,6 +66,11 @@ class NeatGraphStore:
66
66
 
67
67
  self.queries = Queries(self.graph, self.rules)
68
68
 
69
+ @property
70
+ def type_(self) -> str:
71
+ "Return type of the graph store"
72
+ return type(self.graph.store).__name__
73
+
69
74
  def add_rules(self, rules: InformationRules) -> None:
70
75
  """This method is used to add rules to the graph store and it is the only correct
71
76
  way to add rules to the graph store, after the graph store has been initialized.
@@ -1,4 +1,4 @@
1
- import re
1
+ from collections import Counter, defaultdict
2
2
  from datetime import datetime
3
3
  from pathlib import Path
4
4
  from typing import Literal, cast, overload
@@ -201,6 +201,7 @@ class InferenceImporter(BaseImporter):
201
201
  classes: dict[str, dict] = {}
202
202
  properties: dict[str, dict] = {}
203
203
  prefixes: dict[str, Namespace] = get_default_prefixes()
204
+ count_by_value_type_by_property: dict[str, dict[str, int]] = defaultdict(Counter)
204
205
 
205
206
  query = INSTANCE_PROPERTIES_JSON_DEFINITION if self.check_for_json_string else INSTANCE_PROPERTIES_DEFINITION
206
207
  # Adds default namespace to prefixes
@@ -255,12 +256,10 @@ class InferenceImporter(BaseImporter):
255
256
  f"{uri_to_short_form(class_definition['reference'], prefixes)}"
256
257
  f"({uri_to_short_form(cast(URIRef, property_uri), prefixes)})"
257
258
  ),
258
- "comment": (
259
- f"Class <{class_id}> has property <{property_id}> with "
260
- f"value type <{value_type_id}> which occurs <1> times in the graph"
261
- ),
262
259
  }
263
260
 
261
+ count_by_value_type_by_property[id_][value_type_id] += 1
262
+
264
263
  # USE CASE 1: If property is not present in properties
265
264
  if id_ not in properties:
266
265
  properties[id_] = definition
@@ -268,27 +267,41 @@ class InferenceImporter(BaseImporter):
268
267
  # USE CASE 2: first time redefinition, value type change to multi
269
268
  elif id_ in properties and definition["value_type"] not in properties[id_]["value_type"]:
270
269
  properties[id_]["value_type"] = properties[id_]["value_type"] + " | " + definition["value_type"]
271
- properties[id_]["comment"] = (
272
- properties[id_]["comment"] + ", with" + definition["comment"].split("with")[1]
273
- )
274
270
 
275
271
  # USE CASE 3: existing but max count is different
276
272
  elif (
277
273
  id_ in properties
278
274
  and definition["value_type"] in properties[id_]["value_type"]
279
- and not (properties[id_]["max_count"] == definition["max_count"])
275
+ and properties[id_]["max_count"] != definition["max_count"]
280
276
  ):
281
277
  properties[id_]["max_count"] = max(properties[id_]["max_count"], definition["max_count"])
282
278
 
283
- properties[id_]["comment"] = self._update_value_type_occurrence_in_comment(
284
- definition["value_type"], properties[id_]["comment"]
285
- )
286
-
287
- # USE CASE 4: Just update the comment with occurrence
288
- else:
289
- properties[id_]["comment"] = self._update_value_type_occurrence_in_comment(
290
- definition["value_type"], properties[id_]["comment"]
291
- )
279
+ # Add comments
280
+ for id_, property_ in properties.items():
281
+ if id_ not in count_by_value_type_by_property:
282
+ continue
283
+
284
+ count_by_value_type = count_by_value_type_by_property[id_]
285
+ count_list = sorted(count_by_value_type.items(), key=lambda item: item[1], reverse=True)
286
+ # Make the comment more readable by adapting to the number of value types
287
+ base_string = "<{value_type}> which occurs <{count}> times"
288
+ if len(count_list) == 1:
289
+ type_, count = count_list[0]
290
+ counts_str = f"with value type {base_string.format(value_type=type_, count=count)} in the graph"
291
+ elif len(count_list) == 1:
292
+ first = base_string.format(value_type=count_list[0][0], count=count_list[0][1])
293
+ second = base_string.format(value_type=count_list[1][0], count=count_list[1][1])
294
+ counts_str = f"with value types {first} and {second} in the graph"
295
+ else:
296
+ first_part = ", ".join(
297
+ base_string.format(value_type=type_, count=count) for type_, count in count_list[:-1]
298
+ )
299
+ last = base_string.format(value_type=count_list[-1][0], count=count_list[-1][1])
300
+ counts_str = f"with value types {first_part} and {last} in the graph"
301
+
302
+ class_id = property_["class_"]
303
+ property_id = property_["property_"]
304
+ property_["comment"] = f"Class <{class_id}> has property <{property_id}> {counts_str}"
292
305
 
293
306
  return {
294
307
  "metadata": self._default_metadata().model_dump(),
@@ -319,20 +332,3 @@ class InferenceImporter(BaseImporter):
319
332
  prefix=self.prefix,
320
333
  namespace=DEFAULT_NAMESPACE,
321
334
  )
322
-
323
- @classmethod
324
- def _update_value_type_occurrence_in_comment(cls, value_type: str, comment: str) -> str:
325
- occurrence = cls._read_value_type_occurrence_from_comment(value_type, comment)
326
- return comment.replace(
327
- f"with value type <{value_type}> which occurs <{occurrence}> times in the graph",
328
- f"with value type <{value_type}> which occurs <{occurrence+1}> times in the graph",
329
- )
330
-
331
- @classmethod
332
- def _read_value_type_occurrence_from_comment(cls, value_type: str, comment: str) -> int:
333
- if result := re.search(
334
- rf"with value type <{value_type}> which occurs <(\d+)> times in the graph",
335
- comment,
336
- ):
337
- return int(result.group(1))
338
- return 0
@@ -1,27 +1,24 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from cognite.client import CogniteClient
4
- from cognite.client.data_classes import Asset, AssetUpdate, Relationship, RelationshipUpdate
4
+ from cognite.client.data_classes import (
5
+ Asset,
6
+ AssetUpdate,
7
+ Relationship,
8
+ RelationshipUpdate,
9
+ )
5
10
  from cognite.client.data_classes.data_modeling import EdgeApply, NodeApply
6
11
 
7
- from cognite.neat.legacy.graph.stores import NeatGraphStoreBase
8
- from cognite.neat.legacy.rules.exporters._rules2dms import DMSSchemaComponents
9
- from cognite.neat.legacy.rules.models.rules import Rules
10
- from cognite.neat.rules.models import AssetRules, DMSRules, DomainRules, InformationRules
12
+ from cognite.neat.graph.stores import NeatGraphStore
13
+ from cognite.neat.rules.models import (
14
+ AssetRules,
15
+ DMSRules,
16
+ DomainRules,
17
+ InformationRules,
18
+ )
11
19
  from cognite.neat.workflows.steps.step_model import DataContract
12
20
 
13
21
 
14
- class RulesData(DataContract):
15
- """
16
- This represents the TransformationRules object.
17
-
18
- Args:
19
- rules: The TransformationRules object.
20
- """
21
-
22
- rules: Rules
23
-
24
-
25
22
  class MultiRuleData(DataContract):
26
23
  domain: DomainRules | None = None
27
24
  information: InformationRules | None = None
@@ -53,27 +50,15 @@ class PathData(DataContract):
53
50
  excel_file_path: Path
54
51
 
55
52
 
56
- class SourceGraph(DataContract):
57
- """
58
- This represents the source graph.
59
-
60
- Args:
61
- graph: The source graph.
62
- """
63
-
64
- graph: NeatGraphStoreBase
65
-
66
-
67
- class SolutionGraph(DataContract):
53
+ class NeatGraph(DataContract):
68
54
  """
69
- This represents the solution graph.
55
+ This represents the neat graph.
70
56
 
71
57
  Args:
72
- graph (NeatGraphStoreBase): The solution graph.
73
-
58
+ graph: The neat graph store.
74
59
  """
75
60
 
76
- graph: NeatGraphStoreBase
61
+ graph: NeatGraphStore
77
62
 
78
63
 
79
64
  class ClientData(DataContract):
@@ -130,14 +115,3 @@ class Edges(DataContract):
130
115
  """
131
116
 
132
117
  edges: list[EdgeApply]
133
-
134
-
135
- class DMSSchemaComponentsData(DataContract):
136
- """
137
- This represents DMS Schema Model.
138
-
139
- Args:
140
- components: DMS Schema Components model.
141
- """
142
-
143
- components: DMSSchemaComponents
@@ -3,11 +3,15 @@ import logging
3
3
  from pathlib import Path
4
4
  from typing import ClassVar, cast
5
5
 
6
+ from rdflib import URIRef
7
+
8
+ from cognite.neat.constants import DEFAULT_NAMESPACE
9
+ from cognite.neat.graph.extractors import RdfFileExtractor
6
10
  from cognite.neat.graph.extractors._mock_graph_generator import MockGraphGenerator
7
11
  from cognite.neat.rules._shared import DMSRules, InformationRules
8
12
  from cognite.neat.workflows._exceptions import StepNotInitialized
9
13
  from cognite.neat.workflows.model import FlowMessage, StepExecutionStatus
10
- from cognite.neat.workflows.steps.data_contracts import MultiRuleData, SolutionGraph, SourceGraph
14
+ from cognite.neat.workflows.steps.data_contracts import MultiRuleData, NeatGraph
11
15
  from cognite.neat.workflows.steps.step_model import Configurable, Step
12
16
 
13
17
  __all__ = ["GraphFromRdfFile", "GraphFromMockData"]
@@ -29,11 +33,16 @@ class GraphFromMockData(Step):
29
33
  value="",
30
34
  label="Target number of instances for each class",
31
35
  ),
32
- Configurable(name="Graph", value="solution", label="The name of target graph.", options=["source", "solution"]),
36
+ Configurable(
37
+ name="Graph",
38
+ value="solution",
39
+ label="The name of target graph.",
40
+ options=["source", "solution"],
41
+ ),
33
42
  ]
34
43
 
35
44
  def run( # type: ignore[override, syntax]
36
- self, rules: MultiRuleData, graph_store: SolutionGraph | SourceGraph
45
+ self, rules: MultiRuleData, graph_store: NeatGraph
37
46
  ) -> FlowMessage:
38
47
  if self.configs is None:
39
48
  raise StepNotInitialized(type(self).__name__)
@@ -55,17 +64,12 @@ class GraphFromMockData(Step):
55
64
  step_execution_status=StepExecutionStatus.ABORT_AND_FAIL,
56
65
  )
57
66
 
58
- if self.configs["Graph"] == "solution":
59
- # Todo Anders: Why is the graph fetched from context when it is passed as an argument?
60
- graph_store = cast(SourceGraph | SolutionGraph, self.flow_context["SolutionGraph"])
61
- else:
62
- graph_store = cast(SourceGraph | SolutionGraph, self.flow_context["SourceGraph"])
63
-
64
- logging.info("Initiated generation of mock triples")
67
+ extractor = MockGraphGenerator(
68
+ cast(InformationRules | DMSRules, rules.information or rules.dms),
69
+ class_count,
70
+ )
65
71
 
66
- extractor = MockGraphGenerator(cast(InformationRules | DMSRules, rules.information or rules.dms), class_count)
67
-
68
- graph_store.graph.add_triples(extractor.extract())
72
+ NeatGraph.graph.write(extractor)
69
73
 
70
74
  return FlowMessage(output_text=f"Instances loaded to the {graph_store.__class__.__name__}")
71
75
 
@@ -104,20 +108,20 @@ class GraphFromRdfFile(Step):
104
108
  ),
105
109
  ]
106
110
 
107
- def run(self, source_graph: SourceGraph) -> FlowMessage: # type: ignore[override, syntax]
111
+ def run(self, graph_store: NeatGraph) -> FlowMessage: # type: ignore[override, syntax]
108
112
  if self.configs is None or self.data_store_path is None:
109
113
  raise StepNotInitialized(type(self).__name__)
110
- if source_graph.graph.rdf_store_type.lower() in ("memory", "oxigraph"):
111
- if source_file := self.configs["File path"]:
112
- source_graph.graph.import_from_file(
113
- self.data_store_path / Path(source_file),
114
+
115
+ if source_file := self.configs["File path"]:
116
+ NeatGraph.graph.write(
117
+ RdfFileExtractor( # type: ignore[abstract]
118
+ filepath=self.data_store_path / Path(source_file),
114
119
  mime_type=self.configs["MIME type"], # type: ignore[arg-type]
115
- add_base_iri=self.configs["Add base URI"] == "True",
120
+ base_uri=(URIRef(DEFAULT_NAMESPACE) if self.configs["Add base URI"] == "True" else None),
116
121
  )
117
- logging.info(f"Loaded {source_file} into source graph.")
118
- else:
119
- raise ValueError("You need a source_rdf_store.file specified for source_rdf_store.type=memory")
122
+ )
123
+
120
124
  else:
121
- raise NotImplementedError(f"Graph type {source_graph.graph.rdf_store_type} is not supported.")
125
+ raise ValueError("You need a valid file path to be specified")
122
126
 
123
- return FlowMessage(output_text="Instances loaded to source graph")
127
+ return FlowMessage(output_text="Instances loaded to NeatGraph!")
@@ -1,13 +1,10 @@
1
1
  import time
2
2
  from pathlib import Path
3
- from typing import ClassVar, cast
3
+ from typing import ClassVar
4
4
 
5
5
  from cognite.neat.workflows._exceptions import StepNotInitialized
6
6
  from cognite.neat.workflows.model import FlowMessage
7
- from cognite.neat.workflows.steps.data_contracts import (
8
- SolutionGraph,
9
- SourceGraph,
10
- )
7
+ from cognite.neat.workflows.steps.data_contracts import NeatGraph
11
8
  from cognite.neat.workflows.steps.step_model import Configurable, Step
12
9
 
13
10
  __all__ = [
@@ -26,12 +23,6 @@ class GraphToRdfFile(Step):
26
23
  category = CATEGORY
27
24
  version = "private-beta"
28
25
  configurables: ClassVar[list[Configurable]] = [
29
- Configurable(
30
- name="Graph",
31
- value="source",
32
- options=["source", "solution"],
33
- label=("The graph to be used for loading RDF File." " Supported options : source, solution"),
34
- ),
35
26
  Configurable(
36
27
  name="File path",
37
28
  value="staging/graph_export.ttl",
@@ -40,7 +31,7 @@ class GraphToRdfFile(Step):
40
31
  ]
41
32
 
42
33
  def run( # type: ignore[override, syntax]
43
- self, graph: SourceGraph | SolutionGraph
34
+ self, graph: NeatGraph
44
35
  ) -> FlowMessage: # type: ignore[syntax]
45
36
  if self.configs is None or self.data_store_path is None:
46
37
  raise StepNotInitialized(type(self).__name__)
@@ -48,15 +39,7 @@ class GraphToRdfFile(Step):
48
39
  storage_path = self.data_store_path / Path(self.configs["File path"])
49
40
  relative_graph_file_path = str(storage_path).split("/data/")[1]
50
41
 
51
- graph_name = self.configs["Graph"] or "source"
52
-
53
- if graph_name == "solution":
54
- # Todo Anders: Why is the graph fetched from context when it is passed as an argument?
55
- graph = cast(SourceGraph | SolutionGraph, self.flow_context["SolutionGraph"])
56
- else:
57
- graph = cast(SourceGraph | SolutionGraph, self.flow_context["SourceGraph"])
58
-
59
- graph.graph.serialize(str(storage_path), format="turtle")
42
+ graph.graph.graph.serialize(str(storage_path), format="turtle")
60
43
 
61
44
  output_text = (
62
45
  "<p></p>"