cognite-neat 0.111.2__tar.gz → 0.112.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 (185) hide show
  1. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/PKG-INFO +1 -1
  2. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +39 -7
  3. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +43 -1
  4. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/_rules2excel.py +115 -1
  5. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/spreadsheet.py +10 -0
  6. cognite_neat-0.112.0/cognite/neat/_version.py +2 -0
  7. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/pyproject.toml +1 -1
  8. cognite_neat-0.111.2/cognite/neat/_version.py +0 -2
  9. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/LICENSE +0 -0
  10. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/README.md +0 -0
  11. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/__init__.py +0 -0
  12. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_alpha.py +0 -0
  13. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/__init__.py +0 -0
  14. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/_api/__init__.py +0 -0
  15. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/_api/data_modeling_loaders.py +0 -0
  16. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/_api/schema.py +0 -0
  17. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/_api_client.py +0 -0
  18. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/data_classes/__init__.py +0 -0
  19. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/data_classes/data_modeling.py +0 -0
  20. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/data_classes/neat_sequence.py +0 -0
  21. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/data_classes/schema.py +0 -0
  22. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_client/testing.py +0 -0
  23. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_config.py +0 -0
  24. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_constants.py +0 -0
  25. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/__init__.py +0 -0
  26. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/_shared.py +0 -0
  27. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/_tracking/__init__.py +0 -0
  28. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/_tracking/base.py +0 -0
  29. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/_tracking/log.py +0 -0
  30. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  31. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
  32. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/examples/__init__.py +0 -0
  33. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  34. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/__init__.py +0 -0
  35. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_base.py +0 -0
  36. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
  37. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
  38. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
  39. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
  40. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
  41. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
  42. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
  43. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
  44. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
  45. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
  46. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_dict.py +0 -0
  47. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_dms.py +0 -0
  48. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_dms_graph.py +0 -0
  49. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_iodd.py +0 -0
  50. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
  51. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_raw.py +0 -0
  52. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
  53. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/loaders/__init__.py +0 -0
  54. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/loaders/_base.py +0 -0
  55. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/loaders/_rdf2dms.py +0 -0
  56. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/queries/__init__.py +0 -0
  57. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/queries/_base.py +0 -0
  58. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/transformers/__init__.py +0 -0
  59. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/transformers/_base.py +0 -0
  60. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
  61. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/transformers/_iodd.py +0 -0
  62. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
  63. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/transformers/_rdfpath.py +0 -0
  64. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_graph/transformers/_value_type.py +0 -0
  65. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/__init__.py +0 -0
  66. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/_base.py +0 -0
  67. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/_contextmanagers.py +0 -0
  68. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/_factory.py +0 -0
  69. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/errors/__init__.py +0 -0
  70. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/errors/_external.py +0 -0
  71. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/errors/_general.py +0 -0
  72. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/errors/_properties.py +0 -0
  73. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/errors/_resources.py +0 -0
  74. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/errors/_wrapper.py +0 -0
  75. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/formatters.py +0 -0
  76. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/warnings/__init__.py +0 -0
  77. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/warnings/_external.py +0 -0
  78. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/warnings/_general.py +0 -0
  79. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/warnings/_models.py +0 -0
  80. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/warnings/_properties.py +0 -0
  81. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/warnings/_resources.py +0 -0
  82. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
  83. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/__init__.py +0 -0
  84. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/_constants.py +0 -0
  85. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/_shared.py +0 -0
  86. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/analysis/__init__.py +0 -0
  87. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/analysis/_base.py +0 -0
  88. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/catalog/__init__.py +0 -0
  89. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/catalog/classic_model.xlsx +0 -0
  90. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/catalog/hello_world_pump.xlsx +0 -0
  91. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
  92. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/__init__.py +0 -0
  93. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/_base.py +0 -0
  94. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
  95. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
  96. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
  97. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
  98. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/exporters/_validation.py +0 -0
  99. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/__init__.py +0 -0
  100. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_base.py +0 -0
  101. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_dms2rules.py +0 -0
  102. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
  103. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
  104. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
  105. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
  106. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
  107. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
  108. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_rdf/_base.py +0 -0
  109. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_rdf/_imf2rules.py +0 -0
  110. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +0 -0
  111. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_rdf/_owl2rules.py +0 -0
  112. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
  113. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
  114. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
  115. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/__init__.py +0 -0
  116. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/_base_input.py +0 -0
  117. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/_base_rules.py +0 -0
  118. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/_types.py +0 -0
  119. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/data_types.py +0 -0
  120. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/dms/__init__.py +0 -0
  121. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/dms/_exporter.py +0 -0
  122. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/dms/_rules.py +0 -0
  123. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/dms/_rules_input.py +0 -0
  124. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/dms/_validation.py +0 -0
  125. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/entities/__init__.py +0 -0
  126. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/entities/_constants.py +0 -0
  127. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
  128. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
  129. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
  130. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/entities/_types.py +0 -0
  131. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
  132. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/information/__init__.py +0 -0
  133. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/information/_rules.py +0 -0
  134. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/information/_rules_input.py +0 -0
  135. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/information/_validation.py +0 -0
  136. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
  137. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
  138. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/models/mapping/_classic2core.yaml +0 -0
  139. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/transformers/__init__.py +0 -0
  140. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/transformers/_base.py +0 -0
  141. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/transformers/_converters.py +0 -0
  142. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/transformers/_mapping.py +0 -0
  143. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_rules/transformers/_verification.py +0 -0
  144. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/__init__.py +0 -0
  145. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_base.py +0 -0
  146. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_collector.py +0 -0
  147. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_create.py +0 -0
  148. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_drop.py +0 -0
  149. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_explore.py +0 -0
  150. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_fix.py +0 -0
  151. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_inspect.py +0 -0
  152. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_mapping.py +0 -0
  153. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_prepare.py +0 -0
  154. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_read.py +0 -0
  155. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_set.py +0 -0
  156. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_show.py +0 -0
  157. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_state.py +0 -0
  158. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_subset.py +0 -0
  159. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_to.py +0 -0
  160. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/_wizard.py +0 -0
  161. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/engine/__init__.py +0 -0
  162. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/engine/_import.py +0 -0
  163. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/engine/_interface.py +0 -0
  164. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/engine/_load.py +0 -0
  165. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_session/exceptions.py +0 -0
  166. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_shared.py +0 -0
  167. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_store/__init__.py +0 -0
  168. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_store/_graph_store.py +0 -0
  169. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_store/_provenance.py +0 -0
  170. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_store/_rules_store.py +0 -0
  171. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_store/exceptions.py +0 -0
  172. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/__init__.py +0 -0
  173. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/auth.py +0 -0
  174. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/auxiliary.py +0 -0
  175. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/collection_.py +0 -0
  176. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/graph_transformations_report.py +0 -0
  177. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/io_.py +0 -0
  178. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/rdf_.py +0 -0
  179. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/reader/__init__.py +0 -0
  180. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/reader/_base.py +0 -0
  181. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/text.py +0 -0
  182. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/time_.py +0 -0
  183. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/upload.py +0 -0
  184. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/_utils/xml_.py +0 -0
  185. {cognite_neat-0.111.2 → cognite_neat-0.112.0}/cognite/neat/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cognite-neat
3
- Version: 0.111.2
3
+ Version: 0.112.0
4
4
  Summary: Knowledge graph transformation
5
5
  License: Apache-2.0
6
6
  Author: Nikola Vasiljevic
@@ -8,7 +8,7 @@ from abc import ABC, abstractmethod
8
8
  from collections.abc import Callable, Iterable, Sequence, Set
9
9
  from datetime import datetime, timezone
10
10
  from pathlib import Path
11
- from typing import Any, Generic, TypeVar
11
+ from typing import Any, Generic, TypeVar, cast
12
12
 
13
13
  from cognite.client import CogniteClient
14
14
  from cognite.client.data_classes._base import WriteableCogniteResource
@@ -111,6 +111,8 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
111
111
  # Used by the ClassicGraphExtractor to log URIRefs
112
112
  self._log_urirefs = False
113
113
  self._uriref_by_external_id: dict[str, URIRef] = {}
114
+ self.asset_parent_uri_by_id: dict[int, URIRef] = {}
115
+ self.asset_parent_uri_by_external_id: dict[str, URIRef] = {}
114
116
 
115
117
  def extract(self) -> Iterable[Triple]:
116
118
  """Extracts an asset with the given asset_id."""
@@ -165,19 +167,36 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
165
167
  item = item.as_write()
166
168
  dumped = item.dump(self.camel_case)
167
169
  dumped.pop("id", None)
168
- # We have parentId so we don't need parentExternalId
169
- dumped.pop("parentExternalId", None)
170
+
170
171
  if "metadata" in dumped:
171
172
  triples.extend(self._metadata_to_triples(id_, dumped.pop("metadata")))
172
173
 
173
174
  triples.extend(self._item2triples_special_cases(id_, dumped))
174
175
 
176
+ parent_renaming = {"parent_external_id": "parent_id", "parentExternalId": "parentId"}
177
+ parent_key = set(parent_renaming.keys()) | set(parent_renaming.values())
178
+
175
179
  for key, value in dumped.items():
176
180
  if value is None or value == []:
177
181
  continue
178
182
  values = value if isinstance(value, Sequence) and not isinstance(value, str) else [value]
179
183
  for raw in values:
180
- triples.append((id_, self.namespace[key], self._as_object(raw, key)))
184
+ object_ = self._as_object(raw, key)
185
+ if object_ is None:
186
+ continue
187
+ if key in parent_key:
188
+ parent_id = cast(URIRef, object_)
189
+ if isinstance(raw, str):
190
+ self.asset_parent_uri_by_external_id[raw] = parent_id
191
+ elif isinstance(raw, int):
192
+ self.asset_parent_uri_by_id[raw] = parent_id
193
+ # We add a triple to include the parent. This is such that for example the parent
194
+ # externalID will remove the prefix when loading.
195
+ triples.append((parent_id, RDF.type, self.namespace[self._get_rdf_type()]))
196
+ # Parent external ID must be renamed to parent id to match the data model.
197
+ key = parent_renaming.get(key, key)
198
+
199
+ triples.append((id_, self.namespace[key], object_))
181
200
  return triples
182
201
 
183
202
  def _item2triples_special_cases(self, id_: URIRef, dumped: dict[str, Any]) -> list[Triple]:
@@ -186,7 +205,7 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
186
205
 
187
206
  @classmethod
188
207
  def _external_id_as_uri_suffix(cls, external_id: str | None) -> str:
189
- if external_id == "":
208
+ if external_id == "" or (isinstance(external_id, str) and external_id.strip() == ""):
190
209
  warnings.warn(NeatValueWarning(f"Empty external id in {cls._default_rdf_type}"), stacklevel=2)
191
210
  return "empty"
192
211
  elif external_id == "\x00":
@@ -223,7 +242,7 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
223
242
  type_ = f"{self.prefix}{type_}"
224
243
  return self._SPACE_PATTERN.sub("_", type_)
225
244
 
226
- def _as_object(self, raw: Any, key: str) -> Literal | URIRef:
245
+ def _as_object(self, raw: Any, key: str) -> Literal | URIRef | None:
227
246
  """Return properly formatted object part of s-p-o triple"""
228
247
  if key in {"data_set_id", "dataSetId"}:
229
248
  if self.identifier == "externalId" and self.lookup_dataset_external_id:
@@ -237,13 +256,26 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
237
256
  ]
238
257
  else:
239
258
  return self.namespace[f"{InstanceIdPrefix.data_set}{raw}"]
240
- elif key in {"assetId", "asset_id", "assetIds", "asset_ids", "parentId", "rootId", "parent_id", "root_id"}:
259
+ elif key in {"parentId", "parent_id", "parentExternalId", "parent_external_id"}:
260
+ if self.identifier == "id" and key in {"parent_id", "parentId"}:
261
+ return self.namespace[f"{InstanceIdPrefix.asset}{raw}"]
262
+ elif (
263
+ self.identifier == "externalId"
264
+ and key in {"parent_external_id", "parentExternalId"}
265
+ and isinstance(raw, str)
266
+ ):
267
+ return self.namespace[f"{InstanceIdPrefix.asset}{self._external_id_as_uri_suffix(raw)}"]
268
+ else:
269
+ # Skip it
270
+ return None
271
+ elif key in {"assetId", "asset_id", "assetIds", "asset_ids", "rootId", "root_id"}:
241
272
  if self.identifier == "id":
242
273
  return self.namespace[f"{InstanceIdPrefix.asset}{raw}"]
243
274
  else:
244
275
  try:
245
276
  asset_external_id = self._external_id_as_uri_suffix(self.asset_external_ids_by_id[raw])
246
277
  except KeyError:
278
+ warnings.warn(NeatValueWarning(f"Unknown asset id {raw}"), stacklevel=2)
247
279
  return Literal("Unknown asset", datatype=XSD.string)
248
280
  else:
249
281
  return self.namespace[f"{InstanceIdPrefix.asset}{asset_external_id}"]
@@ -7,7 +7,7 @@ from typing import ClassVar, NamedTuple, cast
7
7
 
8
8
  from cognite.client import CogniteClient
9
9
  from cognite.client.exceptions import CogniteAPIError
10
- from rdflib import Namespace, URIRef
10
+ from rdflib import Literal, Namespace, URIRef
11
11
 
12
12
  from cognite.neat._constants import CLASSIC_CDF_NAMESPACE, DEFAULT_NAMESPACE, get_default_prefixes_and_namespaces
13
13
  from cognite.neat._graph.extractors._base import KnowledgeGraphExtractor
@@ -136,6 +136,8 @@ class ClassicGraphExtractor(KnowledgeGraphExtractor):
136
136
  self._extracted_data_sets = False
137
137
  self._asset_external_ids_by_id: dict[int, str] = {}
138
138
  self._dataset_external_ids_by_id: dict[int, str] = {}
139
+ self._asset_parent_uri_by_id: dict[int, URIRef] = {}
140
+ self._asset_parent_uri_by_external_id: dict[str, URIRef] = {}
139
141
  self.neat_prefix_by_predicate_uri: dict[URIRef, str] = {
140
142
  self._namespace["dataSetId"]: InstanceIdPrefix.data_set,
141
143
  self._namespace["assetId"]: InstanceIdPrefix.asset,
@@ -197,6 +199,8 @@ class ClassicGraphExtractor(KnowledgeGraphExtractor):
197
199
  else:
198
200
  self._extracted_data_sets = True
199
201
 
202
+ yield from self._extract_asset_parent_data_sets()
203
+
200
204
  def get_information_rules(self) -> InformationRules:
201
205
  # To avoid circular imports
202
206
  from cognite.neat._rules.importers import ExcelImporter
@@ -288,6 +292,10 @@ class ClassicGraphExtractor(KnowledgeGraphExtractor):
288
292
  if self._identifier == "id":
289
293
  self._uris_by_external_id_by_type[core_node.resource_type].update(extractor._uriref_by_external_id)
290
294
 
295
+ if isinstance(extractor, AssetsExtractor):
296
+ self._asset_parent_uri_by_id.update(extractor.asset_parent_uri_by_id)
297
+ self._asset_parent_uri_by_external_id.update(extractor.asset_parent_uri_by_external_id)
298
+
291
299
  def _extract_start_node_relationships(self):
292
300
  for start_resource_type, source_external_ids in self._source_external_ids_by_type.items():
293
301
  start_type = start_resource_type.removesuffix("_")
@@ -325,6 +333,10 @@ class ClassicGraphExtractor(KnowledgeGraphExtractor):
325
333
  # the target nodes.
326
334
  self._relationship_subject_predicate_type_external_id.extend(extractor._target_triples)
327
335
 
336
+ if isinstance(extractor, AssetsExtractor):
337
+ self._asset_parent_uri_by_id.update(extractor.asset_parent_uri_by_id)
338
+ self._asset_parent_uri_by_external_id.update(extractor.asset_parent_uri_by_external_id)
339
+
328
340
  def _extract_core_end_nodes(self):
329
341
  for core_node in self._classic_node_types:
330
342
  target_external_ids = self._target_external_ids_by_type[core_node.resource_type]
@@ -372,6 +384,36 @@ class ClassicGraphExtractor(KnowledgeGraphExtractor):
372
384
  )
373
385
  yield from DataSetExtractor(data_set_iterator, **self._extractor_args).extract()
374
386
 
387
+ def _extract_asset_parent_data_sets(self):
388
+ if self._asset_parent_uri_by_id:
389
+ for chunk in self._chunk(
390
+ list(self._asset_parent_uri_by_id.keys()), description="Extracting asset parent data sets"
391
+ ):
392
+ assets = self._client.assets.retrieve_multiple(id=list(chunk), ignore_unknown_ids=True)
393
+ for asset in assets:
394
+ if asset.data_set_id is None:
395
+ continue
396
+ object_ = (
397
+ Literal(self._lookup_dataset(asset.data_set_id))
398
+ if self._identifier == "externalId"
399
+ else Literal(asset.data_set_id)
400
+ )
401
+ yield self._asset_parent_uri_by_id[asset.id], self._namespace.dataSetId, object_
402
+ if self._asset_parent_uri_by_external_id:
403
+ for chunk in self._chunk(
404
+ list(self._asset_parent_uri_by_external_id.keys()), description="Extracting asset parent data sets"
405
+ ):
406
+ assets = self._client.assets.retrieve_multiple(external_ids=list(chunk), ignore_unknown_ids=True)
407
+ for asset in assets:
408
+ if asset.data_set_id is None:
409
+ continue
410
+ object_ = (
411
+ Literal(self._lookup_dataset(asset.data_set_id))
412
+ if self._identifier == "externalId"
413
+ else Literal(asset.data_set_id)
414
+ )
415
+ yield self._asset_parent_uri_by_external_id[asset.external_id], self._namespace.dataSetId, object_
416
+
375
417
  def _extract_with_logging_label_dataset(
376
418
  self, extractor: ClassicCDFBaseExtractor, resource_type: InstanceIdPrefix | None = None
377
419
  ) -> Iterable[Triple]:
@@ -20,10 +20,15 @@ from cognite.neat._rules.models import (
20
20
  SchemaCompleteness,
21
21
  SheetRow,
22
22
  )
23
+ from cognite.neat._rules.models.data_types import _DATA_TYPE_BY_DMS_TYPE
23
24
  from cognite.neat._rules.models.dms import DMSMetadata
25
+ from cognite.neat._rules.models.dms._rules import DMSRules
24
26
  from cognite.neat._rules.models.information import InformationMetadata
25
27
  from cognite.neat._rules.models.information._rules import InformationRules
26
- from cognite.neat._utils.spreadsheet import find_column_with_value
28
+ from cognite.neat._utils.spreadsheet import (
29
+ find_column_with_value,
30
+ generate_data_validation,
31
+ )
27
32
 
28
33
  from ._base import BaseExporter
29
34
 
@@ -54,6 +59,7 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
54
59
 
55
60
  Style = Literal["none", "minimal", "default", "maximal"]
56
61
  DumpOptions = Literal["user", "last", "reference"]
62
+ _helper_sheet_name: str = "_helper"
57
63
  _main_header_by_sheet_name: ClassVar[dict[str, str]] = {
58
64
  "Properties": "Definition of Properties",
59
65
  "Classes": "Definition of Classes",
@@ -74,6 +80,7 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
74
80
  add_empty_rows: bool = False,
75
81
  hide_internal_columns: bool = True,
76
82
  include_properties: Literal["same-space", "all"] = "all",
83
+ add_drop_downs: bool = True,
77
84
  ):
78
85
  self.sheet_prefix = sheet_prefix or ""
79
86
  if styling not in self.style_options:
@@ -85,6 +92,7 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
85
92
  self.add_empty_rows = add_empty_rows
86
93
  self.hide_internal_columns = hide_internal_columns
87
94
  self.include_properties = include_properties
95
+ self.add_drop_downs = add_drop_downs
88
96
 
89
97
  @property
90
98
  def description(self) -> str:
@@ -130,8 +138,114 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
130
138
  if column_letter:
131
139
  ws.column_dimensions[column_letter].hidden = True
132
140
 
141
+ # Only add drop downs if the rules are DMSRules
142
+ if self.add_drop_downs and isinstance(rules, DMSRules):
143
+ self._add_drop_downs(workbook)
144
+
133
145
  return workbook
134
146
 
147
+ def _add_drop_downs(self, workbook: Workbook, no_rows: int = 100) -> None:
148
+ """Adds drop down menus to specific columns for fast and accurate data entry.
149
+
150
+ Args:
151
+ workbook: Workbook representation of the Excel file.
152
+ no_rows: number of rows to add drop down menus. Defaults to 100*100.
153
+
154
+ !!! note "Why no_rows=100?"
155
+ Maximum number of views per data model is 100, thus this value is set accordingly
156
+
157
+ !!! note "Why defining individual data validation per desired column?
158
+ This is due to the internal working of openpyxl. Adding same validation to
159
+ different column leads to unexpected behavior when the openpyxl workbook is exported
160
+ as and Excel file. Probably, the validation is not copied to the new column,
161
+ but instead reference to the data validation object is added.
162
+ """
163
+
164
+ self._make_helper_sheet(workbook)
165
+
166
+ # We need create individual data validation and cannot re-use the same one due
167
+ # the internals of openpyxl
168
+ dv_views = generate_data_validation(self._helper_sheet_name, "A", no_header_rows=0, no_rows=no_rows)
169
+ dv_containers = generate_data_validation(self._helper_sheet_name, "b", no_header_rows=0, no_rows=no_rows)
170
+ dv_value_types = generate_data_validation(self._helper_sheet_name, "C", no_header_rows=0, no_rows=no_rows)
171
+
172
+ dv_immutable = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
173
+ dv_nullable = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
174
+ dv_is_list = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
175
+ dv_in_model = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
176
+ dv_used_for = generate_data_validation(self._helper_sheet_name, "E", no_header_rows=0, no_rows=3)
177
+
178
+ workbook["Properties"].add_data_validation(dv_views)
179
+ workbook["Properties"].add_data_validation(dv_containers)
180
+ workbook["Properties"].add_data_validation(dv_value_types)
181
+ workbook["Properties"].add_data_validation(dv_nullable)
182
+ workbook["Properties"].add_data_validation(dv_is_list)
183
+ workbook["Properties"].add_data_validation(dv_immutable)
184
+ workbook["Views"].add_data_validation(dv_in_model)
185
+ workbook["Containers"].add_data_validation(dv_used_for)
186
+
187
+ # we multiply no_rows with 100 since a view can have max 100 properties per view
188
+ if column := find_column_with_value(workbook["Properties"], "View"):
189
+ dv_views.add(f"{column}{3}:{column}{no_rows * 100}")
190
+
191
+ if column := find_column_with_value(workbook["Properties"], "Container"):
192
+ dv_containers.add(f"{column}{3}:{column}{no_rows * 100}")
193
+
194
+ if column := find_column_with_value(workbook["Properties"], "Value Type"):
195
+ dv_value_types.add(f"{column}{3}:{column}{no_rows * 100}")
196
+
197
+ if column := find_column_with_value(workbook["Properties"], "Nullable"):
198
+ dv_nullable.add(f"{column}{3}:{column}{no_rows * 100}")
199
+
200
+ if column := find_column_with_value(workbook["Properties"], "Is List"):
201
+ dv_is_list.add(f"{column}{3}:{column}{no_rows * 100}")
202
+
203
+ if column := find_column_with_value(workbook["Properties"], "Immutable"):
204
+ dv_immutable.add(f"{column}{3}:{column}{no_rows * 100}")
205
+
206
+ if column := find_column_with_value(workbook["Views"], "In Model"):
207
+ dv_in_model.add(f"{column}{3}:{column}{no_rows}")
208
+
209
+ if column := find_column_with_value(workbook["Containers"], "Used For"):
210
+ dv_used_for.add(f"{column}{3}:{column}{no_rows}")
211
+
212
+ def _make_helper_sheet(self, workbook: Workbook) -> None:
213
+ """This helper sheet is used as source of data for drop down menus creation
214
+
215
+ !!! note "Why 100 rows?"
216
+ The number of rows is set to 100 since this is the maximum number of views
217
+ per data model.
218
+ """
219
+ workbook.create_sheet(title=self._helper_sheet_name)
220
+
221
+ for counter, dtype in enumerate(_DATA_TYPE_BY_DMS_TYPE):
222
+ workbook[self._helper_sheet_name].cell(row=counter + 1, column=3, value=dtype)
223
+
224
+ for i in range(100):
225
+ workbook[self._helper_sheet_name].cell(
226
+ row=i + 1,
227
+ column=1,
228
+ value=f'=IF(ISBLANK(Views!A{i + 3}), "", Views!A{i + 3})',
229
+ )
230
+ workbook[self._helper_sheet_name].cell(
231
+ row=i + 1,
232
+ column=2,
233
+ value=f'=IF(ISBLANK(Containers!A{i + 3}), "", Containers!A{i + 3})',
234
+ )
235
+ workbook[self._helper_sheet_name].cell(
236
+ row=counter + i + 2,
237
+ column=3,
238
+ value=f'=IF(ISBLANK(Views!A{i + 3}), "", Views!A{i + 3})',
239
+ )
240
+
241
+ for i, value in enumerate([True, False, ""]):
242
+ workbook[self._helper_sheet_name].cell(row=i + 1, column=4, value=cast(bool | str, value))
243
+
244
+ for i, value in enumerate(["node", "edge", "all"]):
245
+ workbook[self._helper_sheet_name].cell(row=i + 1, column=5, value=value)
246
+
247
+ workbook[self._helper_sheet_name].sheet_state = "hidden"
248
+
135
249
  def _write_sheets(
136
250
  self,
137
251
  workbook: Workbook,
@@ -3,6 +3,7 @@ from typing import Any, Literal, cast, overload
3
3
 
4
4
  import pandas as pd
5
5
  from openpyxl import load_workbook
6
+ from openpyxl.worksheet.datavalidation import DataValidation
6
7
  from openpyxl.worksheet.worksheet import Worksheet
7
8
 
8
9
  from cognite.neat._rules._constants import get_internal_properties
@@ -133,3 +134,12 @@ def find_column_with_value(sheet: Worksheet, value: Any) -> str | None:
133
134
  return cell.column_letter # type: ignore
134
135
 
135
136
  return None
137
+
138
+
139
+ def generate_data_validation(sheet: str, column: str, no_header_rows: int, no_rows: int) -> DataValidation:
140
+ "Creates openpyxl data validation object for a cell in a sheet"
141
+
142
+ return DataValidation(
143
+ type="list",
144
+ formula1=f"={sheet}!{column}${no_header_rows + 1}:{column}${no_rows}",
145
+ )
@@ -0,0 +1,2 @@
1
+ __version__ = "0.112.0"
2
+ __engine__ = "^2.0.4"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cognite-neat"
3
- version = "0.111.2"
3
+ version = "0.112.0"
4
4
  readme = "README.md"
5
5
  description = "Knowledge graph transformation"
6
6
  authors = [
@@ -1,2 +0,0 @@
1
- __version__ = "0.111.2"
2
- __engine__ = "^2.0.4"
File without changes
File without changes