cognite-neat 0.109.1__tar.gz → 0.109.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cognite-neat might be problematic. Click here for more details.

Files changed (185) hide show
  1. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/PKG-INFO +1 -1
  2. cognite_neat-0.109.3/cognite/neat/_alpha.py +15 -0
  3. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/testing.py +1 -1
  4. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/_base.py +33 -9
  5. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/errors/__init__.py +2 -10
  6. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/errors/_general.py +1 -1
  7. cognite_neat-0.109.3/cognite/neat/_issues/errors/_wrapper.py +11 -0
  8. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/_rules2excel.py +31 -1
  9. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/_rdfpath.py +2 -0
  10. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/_types.py +4 -2
  11. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/dms/_rules.py +0 -36
  12. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/entities/_constants.py +3 -0
  13. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/entities/_single_value.py +6 -1
  14. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/entities/_wrapped.py +3 -0
  15. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/transformers/__init__.py +4 -0
  16. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/transformers/_converters.py +221 -15
  17. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_base.py +7 -0
  18. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_collector.py +4 -1
  19. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_create.py +46 -12
  20. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_prepare.py +11 -3
  21. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_read.py +14 -2
  22. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_state.py +7 -3
  23. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_to.py +20 -5
  24. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/exceptions.py +16 -6
  25. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_store/_provenance.py +1 -0
  26. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_store/_rules_store.py +192 -127
  27. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/spreadsheet.py +10 -1
  28. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/text.py +40 -9
  29. cognite_neat-0.109.3/cognite/neat/_version.py +2 -0
  30. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/pyproject.toml +1 -1
  31. cognite_neat-0.109.1/cognite/neat/_issues/errors/_workflow.py +0 -36
  32. cognite_neat-0.109.1/cognite/neat/_version.py +0 -2
  33. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/LICENSE +0 -0
  34. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/README.md +0 -0
  35. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/__init__.py +0 -0
  36. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/__init__.py +0 -0
  37. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/_api/__init__.py +0 -0
  38. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/_api/data_modeling_loaders.py +0 -0
  39. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/_api/schema.py +0 -0
  40. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/_api_client.py +0 -0
  41. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/data_classes/__init__.py +0 -0
  42. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/data_classes/data_modeling.py +0 -0
  43. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/data_classes/neat_sequence.py +0 -0
  44. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_client/data_classes/schema.py +0 -0
  45. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_config.py +0 -0
  46. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_constants.py +0 -0
  47. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/__init__.py +0 -0
  48. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/_shared.py +0 -0
  49. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/_tracking/__init__.py +0 -0
  50. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/_tracking/base.py +0 -0
  51. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/_tracking/log.py +0 -0
  52. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  53. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  54. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/examples/__init__.py +0 -0
  55. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  56. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/__init__.py +0 -0
  57. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_base.py +0 -0
  58. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
  59. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
  60. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +0 -0
  61. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +0 -0
  62. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
  63. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
  64. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
  65. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
  66. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
  67. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
  68. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
  69. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
  70. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_dms.py +0 -0
  71. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_dms_graph.py +0 -0
  72. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_iodd.py +0 -0
  73. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
  74. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
  75. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/loaders/__init__.py +0 -0
  76. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/loaders/_base.py +0 -0
  77. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/loaders/_rdf2dms.py +0 -0
  78. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/queries/__init__.py +0 -0
  79. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/queries/_base.py +0 -0
  80. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/queries/_construct.py +0 -0
  81. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/queries/_shared.py +0 -0
  82. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/transformers/__init__.py +0 -0
  83. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/transformers/_base.py +0 -0
  84. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
  85. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/transformers/_iodd.py +0 -0
  86. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
  87. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/transformers/_rdfpath.py +0 -0
  88. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_graph/transformers/_value_type.py +0 -0
  89. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/__init__.py +0 -0
  90. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/errors/_external.py +0 -0
  91. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/errors/_properties.py +0 -0
  92. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/errors/_resources.py +0 -0
  93. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/formatters.py +0 -0
  94. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/warnings/__init__.py +0 -0
  95. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/warnings/_external.py +0 -0
  96. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/warnings/_general.py +0 -0
  97. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/warnings/_models.py +0 -0
  98. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/warnings/_properties.py +0 -0
  99. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/warnings/_resources.py +0 -0
  100. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
  101. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/__init__.py +0 -0
  102. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/_constants.py +0 -0
  103. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/_shared.py +0 -0
  104. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/analysis/__init__.py +0 -0
  105. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/analysis/_base.py +0 -0
  106. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/analysis/_dms.py +0 -0
  107. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/analysis/_information.py +0 -0
  108. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/catalog/__init__.py +0 -0
  109. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/catalog/classic_model.xlsx +0 -0
  110. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/catalog/hello_world_pump.xlsx +0 -0
  111. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
  112. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/__init__.py +0 -0
  113. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/_base.py +0 -0
  114. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
  115. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
  116. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
  117. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
  118. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/exporters/_validation.py +0 -0
  119. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/__init__.py +0 -0
  120. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_base.py +0 -0
  121. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_dms2rules.py +0 -0
  122. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
  123. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  124. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
  125. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
  126. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
  127. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
  128. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_rdf/_base.py +0 -0
  129. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_rdf/_imf2rules.py +0 -0
  130. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +0 -0
  131. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_rdf/_owl2rules.py +0 -0
  132. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
  133. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
  134. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
  135. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/__init__.py +0 -0
  136. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/_base_input.py +0 -0
  137. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/_base_rules.py +0 -0
  138. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/data_types.py +0 -0
  139. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/dms/__init__.py +0 -0
  140. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/dms/_exporter.py +0 -0
  141. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/dms/_rules_input.py +0 -0
  142. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/dms/_validation.py +0 -0
  143. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/entities/__init__.py +0 -0
  144. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
  145. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
  146. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/entities/_types.py +0 -0
  147. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/information/__init__.py +0 -0
  148. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/information/_rules.py +0 -0
  149. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/information/_rules_input.py +0 -0
  150. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/information/_validation.py +0 -0
  151. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
  152. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
  153. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/models/mapping/_classic2core.yaml +0 -0
  154. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/transformers/_base.py +0 -0
  155. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/transformers/_mapping.py +0 -0
  156. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_rules/transformers/_verification.py +0 -0
  157. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/__init__.py +0 -0
  158. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_drop.py +0 -0
  159. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_fix.py +0 -0
  160. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_inspect.py +0 -0
  161. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_mapping.py +0 -0
  162. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_set.py +0 -0
  163. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_show.py +0 -0
  164. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/_wizard.py +0 -0
  165. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/engine/__init__.py +0 -0
  166. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/engine/_import.py +0 -0
  167. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/engine/_interface.py +0 -0
  168. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_session/engine/_load.py +0 -0
  169. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_shared.py +0 -0
  170. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_store/__init__.py +0 -0
  171. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_store/_graph_store.py +0 -0
  172. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_store/exceptions.py +0 -0
  173. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/__init__.py +0 -0
  174. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/auth.py +0 -0
  175. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/auxiliary.py +0 -0
  176. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/collection_.py +0 -0
  177. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/graph_transformations_report.py +0 -0
  178. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/io_.py +0 -0
  179. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/rdf_.py +0 -0
  180. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/reader/__init__.py +0 -0
  181. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/reader/_base.py +0 -0
  182. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/time_.py +0 -0
  183. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/upload.py +0 -0
  184. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/_utils/xml_.py +0 -0
  185. {cognite_neat-0.109.1 → cognite_neat-0.109.3}/cognite/neat/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cognite-neat
3
- Version: 0.109.1
3
+ Version: 0.109.3
4
4
  Summary: Knowledge graph transformation
5
5
  License: Apache-2.0
6
6
  Author: Nikola Vasiljevic
@@ -0,0 +1,15 @@
1
+ import warnings
2
+
3
+
4
+ class AlphaWarning(UserWarning):
5
+ def __init__(self, feature_name: str):
6
+ super().__init__(f"Alpha feature '{feature_name}' is subject to change without notice")
7
+
8
+ def warn(self) -> None:
9
+ warnings.warn(self, stacklevel=2)
10
+
11
+
12
+ class AlphaFlags:
13
+ manual_rules_edit = AlphaWarning("enable_manual_edit")
14
+ same_space_properties_only_export = AlphaWarning("same-space-properties-only")
15
+ standardize_naming = AlphaWarning("standardize_naming")
@@ -19,7 +19,7 @@ class NeatClientMock(CogniteClientMock):
19
19
  def __init__(self, *args: Any, **kwargs: Any) -> None:
20
20
  if "parent" in kwargs:
21
21
  super().__init__(*args, **kwargs)
22
- return None
22
+ return
23
23
  super().__init__(*args, **kwargs)
24
24
  self.schema = SchemaAPI(self)
25
25
  self.loaders = DataModelLoaderAPI(self)
@@ -103,6 +103,8 @@ class NeatIssue:
103
103
  variables[name] = var_.as_posix()
104
104
  elif isinstance(var_, Collection):
105
105
  variables[name] = humanize_collection(var_)
106
+ elif isinstance(var_, NeatError):
107
+ variables[name] = var_.as_message(include_type=False)
106
108
  else:
107
109
  variables[name] = repr(var_)
108
110
  return variables, has_all_optional
@@ -138,6 +140,8 @@ class NeatIssue:
138
140
  return value.dump(camel_case=True)
139
141
  elif isinstance(value, DataModelId):
140
142
  return value.dump(camel_case=True, include_type=False)
143
+ elif isinstance(value, NeatError):
144
+ return value.dump()
141
145
  raise ValueError(f"Unsupported type: {type(value)}")
142
146
 
143
147
  @classmethod
@@ -192,6 +196,8 @@ class NeatIssue:
192
196
  return ContainerId.load(value)
193
197
  elif inspect.isclass(type_) and issubclass(type_, Entity):
194
198
  return type_.load(value)
199
+ elif type_ is NeatError:
200
+ return cls.load(value)
195
201
  return value
196
202
 
197
203
  def __lt__(self, other: "NeatIssue") -> bool:
@@ -227,22 +233,19 @@ class NeatError(NeatIssue, Exception):
227
233
  # Skip the error for SheetList, as it is not relevant for the user. This is an
228
234
  # internal class used to have helper methods for a lists as .to_pandas()
229
235
  continue
236
+
230
237
  neat_error: NeatError | None = None
231
238
  if isinstance(error, dict) and isinstance(ctx := error.get("ctx"), dict) and "error" in ctx:
232
239
  neat_error = ctx["error"]
233
240
  elif isinstance(error, NeatError | MultiValueError):
234
241
  neat_error = error
235
242
 
243
+ loc = error["loc"] if isinstance(error, dict) else tuple()
236
244
  if isinstance(neat_error, MultiValueError):
237
- if read_info_by_sheet:
238
- for caught_error in neat_error.errors:
239
- cls._adjust_row_numbers(caught_error, read_info_by_sheet) # type: ignore[arg-type]
240
- all_errors.extend(neat_error.errors) # type: ignore[arg-type]
245
+ all_errors.extend([cls._adjust_error(e, loc, read_info_by_sheet) for e in neat_error.errors])
241
246
  elif isinstance(neat_error, NeatError):
242
- if read_info_by_sheet:
243
- cls._adjust_row_numbers(neat_error, read_info_by_sheet)
244
- all_errors.append(neat_error)
245
- elif isinstance(error, dict) and len(error["loc"]) >= 4 and read_info_by_sheet:
247
+ all_errors.append(cls._adjust_error(neat_error, loc, read_info_by_sheet))
248
+ elif isinstance(error, dict) and len(loc) >= 4 and read_info_by_sheet:
246
249
  all_errors.append(RowError.from_pydantic_error(error, read_info_by_sheet))
247
250
  elif isinstance(error, dict):
248
251
  all_errors.append(DefaultPydanticError.from_pydantic_error(error))
@@ -251,6 +254,18 @@ class NeatError(NeatIssue, Exception):
251
254
  raise ValueError(f"Unsupported error type: {error}")
252
255
  return all_errors
253
256
 
257
+ @classmethod
258
+ def _adjust_error(
259
+ cls, error: "NeatError", loc: tuple[str | int, ...], read_info_by_sheet: dict[str, SpreadsheetRead] | None
260
+ ) -> "NeatError":
261
+ from .errors._wrapper import MetadataValueError
262
+
263
+ if read_info_by_sheet:
264
+ cls._adjust_row_numbers(error, read_info_by_sheet)
265
+ if len(loc) == 2 and isinstance(loc[0], str) and loc[0].casefold() == "metadata":
266
+ return MetadataValueError(field_name=str(loc[1]), error=error)
267
+ return error
268
+
254
269
  @staticmethod
255
270
  def _adjust_row_numbers(caught_error: "NeatError", read_info_by_sheet: dict[str, SpreadsheetRead]) -> None:
256
271
  from cognite.neat._issues.errors._properties import PropertyDefinitionDuplicatedError
@@ -288,7 +303,16 @@ class DefaultPydanticError(NeatError, ValueError):
288
303
  msg: str
289
304
 
290
305
  @classmethod
291
- def from_pydantic_error(cls, error: ErrorDetails) -> "DefaultPydanticError":
306
+ def from_pydantic_error(cls, error: ErrorDetails) -> "NeatError":
307
+ loc = error["loc"]
308
+ if len(loc) >= 2 and isinstance(loc[0], str) and loc[0].casefold() == "metadata":
309
+ from .errors._general import NeatValueError
310
+ from .errors._wrapper import MetadataValueError
311
+
312
+ return MetadataValueError(
313
+ field_name=str(loc[1]), error=NeatValueError(f"{error['msg']} got '{error['input']}'")
314
+ )
315
+
292
316
  return cls(
293
317
  type=error["type"],
294
318
  loc=error["loc"],
@@ -31,12 +31,7 @@ from ._resources import (
31
31
  ResourceNotFoundError,
32
32
  ResourceRetrievalError,
33
33
  )
34
- from ._workflow import (
35
- WorkflowConfigurationNotSetError,
36
- WorkFlowMissingDataError,
37
- WorkflowStepNotInitializedError,
38
- WorkflowStepOutputError,
39
- )
34
+ from ._wrapper import MetadataValueError
40
35
 
41
36
  __all__ = [
42
37
  "AuthorizationError",
@@ -47,6 +42,7 @@ __all__ = [
47
42
  "FileNotFoundNeatError",
48
43
  "FileReadError",
49
44
  "FileTypeUnexpectedError",
45
+ "MetadataValueError",
50
46
  "NeatError",
51
47
  "NeatImportError",
52
48
  "NeatTypeError",
@@ -70,10 +66,6 @@ __all__ = [
70
66
  "ResourceRetrievalError",
71
67
  "ReversedConnectionNotFeasibleError",
72
68
  "RowError",
73
- "WorkFlowMissingDataError",
74
- "WorkflowConfigurationNotSetError",
75
- "WorkflowStepNotInitializedError",
76
- "WorkflowStepOutputError",
77
69
  ]
78
70
 
79
71
  _NEAT_ERRORS_BY_NAME = {error.__name__: error for error in _get_subclasses(NeatError, include_base=True)}
@@ -19,7 +19,7 @@ class NeatTypeError(NeatError, TypeError):
19
19
 
20
20
  @dataclass(unsafe_hash=True)
21
21
  class RegexViolationError(NeatError, ValueError):
22
- """Value, {value} in {location} failed regex, {regex}, validation.
22
+ """The value '{value}' failed regex, {regex}, validation in {location}.
23
23
  Make sure that the name follows the regex pattern."""
24
24
 
25
25
  value: str
@@ -0,0 +1,11 @@
1
+ from dataclasses import dataclass
2
+
3
+ from cognite.neat._issues import NeatError
4
+
5
+
6
+ @dataclass(unsafe_hash=True)
7
+ class MetadataValueError(NeatError, ValueError):
8
+ """Field {field_name} - {error}"""
9
+
10
+ field_name: str
11
+ error: NeatError
@@ -22,6 +22,7 @@ from cognite.neat._rules.models import (
22
22
  from cognite.neat._rules.models.dms import DMSMetadata
23
23
  from cognite.neat._rules.models.information import InformationMetadata
24
24
  from cognite.neat._rules.models.information._rules import InformationRules
25
+ from cognite.neat._utils.spreadsheet import find_column_with_value
25
26
 
26
27
  from ._base import BaseExporter
27
28
 
@@ -63,12 +64,22 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
63
64
  style_options = get_args(Style)
64
65
  dump_options = get_args(DumpOptions)
65
66
 
67
+ _internal_columns: ClassVar[list[str]] = [
68
+ "physical",
69
+ "logical",
70
+ "conceptual",
71
+ "Neat ID",
72
+ ]
73
+
66
74
  def __init__(
67
75
  self,
68
76
  styling: Style = "default",
69
77
  new_model_id: tuple[str, str] | None = None,
70
78
  sheet_prefix: str | None = None,
71
79
  reference_rules_with_prefix: tuple[VerifiedRules, str] | None = None,
80
+ add_empty_rows: bool = False,
81
+ hide_internal_columns: bool = True,
82
+ include_properties: Literal["same-space", "all"] = "all",
72
83
  ):
73
84
  self.sheet_prefix = sheet_prefix or ""
74
85
  if styling not in self.style_options:
@@ -77,6 +88,9 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
77
88
  self._styling_level = self.style_options.index(styling)
78
89
  self.new_model_id = new_model_id
79
90
  self.reference_rules_with_prefix = reference_rules_with_prefix
91
+ self.add_empty_rows = add_empty_rows
92
+ self.hide_internal_columns = hide_internal_columns
93
+ self.include_properties = include_properties
80
94
 
81
95
  @property
82
96
  def description(self) -> str:
@@ -112,6 +126,16 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
112
126
  if self._styling_level > 0:
113
127
  self._adjust_column_widths(workbook)
114
128
 
129
+ if self.hide_internal_columns:
130
+ for sheet in workbook.sheetnames:
131
+ if sheet.lower() == "metadata":
132
+ continue
133
+ ws = workbook[sheet]
134
+ for col in self._internal_columns:
135
+ column_letter = find_column_with_value(ws, col)
136
+ if column_letter:
137
+ ws.column_dimensions[column_letter].hidden = True
138
+
115
139
  return workbook
116
140
 
117
141
  def _write_sheets(
@@ -149,13 +173,19 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
149
173
  is_properties = sheet_name == "Properties"
150
174
  is_new_class = class_ != last_class and last_class is not None
151
175
  if self._styling_level > 2 and is_new_class and is_properties:
152
- sheet.append([""] * len(headers))
176
+ if self.add_empty_rows:
177
+ sheet.append([""] * len(headers))
153
178
  for cell in sheet[sheet.max_row]:
154
179
  cell.fill = PatternFill(fgColor=fill_color, patternType="solid")
155
180
  side = Side(style="thin", color="000000")
156
181
  cell.border = Border(left=side, right=side, top=side, bottom=side)
157
182
  fill_color = next(fill_colors)
158
183
 
184
+ if is_properties and self.include_properties == "same-space":
185
+ space = class_.split(":")[0] if ":" in class_ else rules.metadata.space
186
+ if space != rules.metadata.space:
187
+ continue
188
+
159
189
  sheet.append(row)
160
190
  if self._styling_level > 2 and is_properties:
161
191
  for cell in sheet[sheet.max_row]:
@@ -2,6 +2,7 @@
2
2
 
3
3
  import re
4
4
  import sys
5
+ import urllib.parse
5
6
  from collections import Counter
6
7
  from functools import total_ordering
7
8
  from typing import ClassVar, Literal
@@ -327,6 +328,7 @@ def parse_table_lookup(raw: str) -> TableLookup:
327
328
 
328
329
 
329
330
  def parse_rule(rule_raw: str, rule_type: TransformationRuleType | None) -> RDFPath:
331
+ rule_raw = urllib.parse.unquote(rule_raw)
330
332
  match rule_type:
331
333
  case TransformationRuleType.rdfpath:
332
334
  rule_raw = rule_raw.replace(" ", "")
@@ -38,7 +38,9 @@ def _custom_error(exc_factory: Callable[[str | None, Exception], Any]) -> Any:
38
38
  def _validator(value: Any, next_: Any, ctx: ValidationInfo) -> Any:
39
39
  try:
40
40
  return next_(value, ctx)
41
- except Exception:
41
+ except ValueError as e:
42
+ if value is None:
43
+ raise e
42
44
  raise exc_factory(ctx.field_name, value) from None
43
45
 
44
46
  return WrapValidator(_validator)
@@ -130,7 +132,7 @@ def _external_id_validation_factory(entity_type: EntityTypes, location: str):
130
132
 
131
133
  SpaceType = Annotated[
132
134
  str,
133
- AfterValidator(_external_id_validation_factory(EntityTypes.space, "space entry in metadata")),
135
+ AfterValidator(_external_id_validation_factory(EntityTypes.space, "")),
134
136
  ]
135
137
 
136
138
  InformationPropertyType = Annotated[
@@ -1,4 +1,3 @@
1
- import warnings
2
1
  from collections.abc import Hashable
3
2
  from typing import TYPE_CHECKING, Any, ClassVar, Literal
4
3
 
@@ -8,11 +7,7 @@ from pydantic import Field, field_serializer, field_validator, model_validator
8
7
  from pydantic_core.core_schema import SerializationInfo, ValidationInfo
9
8
 
10
9
  from cognite.neat._client.data_classes.schema import DMSSchema
11
- from cognite.neat._constants import COGNITE_SPACES
12
10
  from cognite.neat._issues.errors import NeatValueError
13
- from cognite.neat._issues.warnings import (
14
- PrincipleMatchingSpaceAndVersionWarning,
15
- )
16
11
  from cognite.neat._rules.models._base_rules import (
17
12
  BaseMetadata,
18
13
  BaseRules,
@@ -407,37 +402,6 @@ class DMSRules(BaseRules):
407
402
  None, alias="Nodes", description="Contains the definition of the node types."
408
403
  )
409
404
 
410
- @field_validator("views")
411
- def matching_version_and_space(cls, value: SheetList[DMSView], info: ValidationInfo) -> SheetList[DMSView]:
412
- if not (metadata := info.data.get("metadata")):
413
- return value
414
- model_version = metadata.version
415
- if different_version := [
416
- view.view.as_id()
417
- for view in value
418
- if view.view.version != model_version and view.view.space not in COGNITE_SPACES
419
- ]:
420
- for view_id in different_version:
421
- warnings.warn(
422
- PrincipleMatchingSpaceAndVersionWarning(
423
- f"The view {view_id!r} has a different version than the data model version, {model_version}",
424
- ),
425
- stacklevel=2,
426
- )
427
- if different_space := [
428
- view.view.as_id()
429
- for view in value
430
- if view.view.space != metadata.space and view.view.space not in COGNITE_SPACES
431
- ]:
432
- for view_id in different_space:
433
- warnings.warn(
434
- PrincipleMatchingSpaceAndVersionWarning(
435
- f"The view {view_id!r} is in a different space than the data model space, {metadata.space}",
436
- ),
437
- stacklevel=2,
438
- )
439
- return value
440
-
441
405
  @model_validator(mode="after")
442
406
  def set_neat_id(self) -> "DMSRules":
443
407
  namespace = self.metadata.namespace
@@ -8,6 +8,9 @@ class _UnknownType(BaseModel):
8
8
  def __str__(self) -> str:
9
9
  return "#N/A"
10
10
 
11
+ def __hash__(self):
12
+ return hash(str(self))
13
+
11
14
 
12
15
  # This is a trick to make Undefined and Unknown singletons
13
16
  Undefined = _UndefinedType()
@@ -134,7 +134,12 @@ class Entity(BaseModel, extra="ignore"):
134
134
  content = result.group("content")
135
135
  if content is None:
136
136
  return dict(prefix=prefix, suffix=suffix)
137
- extra_args = dict(SPLIT_ON_EQUAL_PATTERN.split(pair.strip()) for pair in SPLIT_ON_COMMA_PATTERN.split(content))
137
+ try:
138
+ extra_args = dict(
139
+ SPLIT_ON_EQUAL_PATTERN.split(pair.strip()) for pair in SPLIT_ON_COMMA_PATTERN.split(content)
140
+ )
141
+ except ValueError:
142
+ raise NeatValueError(f"Invalid {cls.type_.value} entity: {raw!r}") from None
138
143
  expected_args = {
139
144
  field_.alias or field_name: field_.annotation for field_name, field_ in cls.model_fields.items()
140
145
  }
@@ -201,3 +201,6 @@ class RawFilter(DMSFilter):
201
201
 
202
202
  def __repr__(self) -> str:
203
203
  return self.filter
204
+
205
+ def __str__(self):
206
+ return f"{self.name}({self.filter})"
@@ -13,10 +13,12 @@ from ._converters import (
13
13
  MergeInformationRules,
14
14
  PrefixEntities,
15
15
  SetIDDMSModel,
16
+ StandardizeNaming,
16
17
  ToCompliantEntities,
17
18
  ToDataProductModel,
18
19
  ToEnterpriseModel,
19
20
  ToExtensionModel,
21
+ ToInformationCompliantEntities,
20
22
  ToSolutionModel,
21
23
  )
22
24
  from ._mapping import AsParentPropertyId, MapOneToOne, RuleMapper
@@ -40,10 +42,12 @@ __all__ = [
40
42
  "RuleMapper",
41
43
  "RulesTransformer",
42
44
  "SetIDDMSModel",
45
+ "StandardizeNaming",
43
46
  "ToCompliantEntities",
44
47
  "ToDataProductModel",
45
48
  "ToEnterpriseModel",
46
49
  "ToExtensionModel",
50
+ "ToInformationCompliantEntities",
47
51
  "ToSolutionModel",
48
52
  "VerifiedRulesTransformer",
49
53
  "VerifyAnyRules",