cognite-neat 0.113.2__py3-none-any.whl → 0.113.4__py3-none-any.whl

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.

@@ -481,9 +481,9 @@ class RulesAnalysis:
481
481
 
482
482
  return query_configs
483
483
 
484
- def _dms_di_graph(self, format: Literal["data-model", "implements"] = "data-model") -> nx.DiGraph:
485
- """Generate a DiGraph from the DMS rules."""
486
- di_graph = nx.DiGraph()
484
+ def _dms_di_graph(self, format: Literal["data-model", "implements"] = "data-model") -> nx.MultiDiGraph:
485
+ """Generate a MultiDiGraph from the DMS rules."""
486
+ di_graph = nx.MultiDiGraph()
487
487
 
488
488
  rules = self.dms
489
489
 
@@ -515,11 +515,11 @@ class RulesAnalysis:
515
515
 
516
516
  return di_graph
517
517
 
518
- def _info_di_graph(self, format: Literal["data-model", "implements"] = "data-model") -> nx.DiGraph:
519
- """Generate DiGraph representing information data model."""
518
+ def _info_di_graph(self, format: Literal["data-model", "implements"] = "data-model") -> nx.MultiDiGraph:
519
+ """Generate MultiDiGraph representing information data model."""
520
520
 
521
521
  rules = self.information
522
- di_graph = nx.DiGraph()
522
+ di_graph = nx.MultiDiGraph()
523
523
 
524
524
  # Add nodes and edges from Views sheet
525
525
  for class_ in rules.classes:
@@ -2,7 +2,6 @@ import warnings
2
2
  from collections import Counter, defaultdict
3
3
  from collections.abc import Mapping
4
4
  from functools import lru_cache
5
- from typing import ClassVar
6
5
 
7
6
  from cognite.client import data_modeling as dm
8
7
  from cognite.client.data_classes.data_modeling import ContainerList, ViewId, ViewList
@@ -59,10 +58,6 @@ class DMSValidation:
59
58
  """This class does all the validation of the DMS rules that have dependencies between
60
59
  components."""
61
60
 
62
- # When checking for changes extension=addition, we need to check if the new view has changed.
63
- # For example, changing the filter is allowed, but changing the properties is not.
64
- changeable_view_attributes: ClassVar[set[str]] = {"filter"}
65
-
66
61
  def __init__(
67
62
  self,
68
63
  rules: DMSRules,
@@ -96,6 +91,11 @@ class DMSValidation:
96
91
  imported_views.add(prop.view)
97
92
  view_with_properties.add(prop.view)
98
93
 
94
+ for container in self._containers or []:
95
+ for required in container.constraint or []:
96
+ if required not in existing_containers:
97
+ imported_containers.add(required)
98
+
99
99
  if include_views_with_no_properties:
100
100
  extra_views = existing_views - view_with_properties
101
101
  imported_views.update({view for view in extra_views})
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.113.2"
1
+ __version__ = "0.113.4"
2
2
  __engine__ = "^2.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cognite-neat
3
- Version: 0.113.2
3
+ Version: 0.113.4
4
4
  Summary: Knowledge graph transformation
5
5
  License: Apache-2.0
6
6
  Author: Nikola Vasiljevic
@@ -76,7 +76,7 @@ cognite/neat/_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
76
76
  cognite/neat/_rules/_constants.py,sha256=XRcbXDyVlm9WkcMyJJUi8SfpLDWZTqERU7RMgZo3TSk,5922
77
77
  cognite/neat/_rules/_shared.py,sha256=XPC1NhkzYoSew0_F7JC_J6chNFLaC_rjfPpfcMcYzfc,1349
78
78
  cognite/neat/_rules/analysis/__init__.py,sha256=0Y7KiXpzrwOIU7GVlC3zlizj1TXe6sodAJzMh1rTZLE,62
79
- cognite/neat/_rules/analysis/_base.py,sha256=naqyccPPbRFQdzwpR-sNvRgbeJzzFcJdCQJ5xwmLYxU,23404
79
+ cognite/neat/_rules/analysis/_base.py,sha256=t9NBxZoM95_7UqOa9coWzsH0Kv6neKcb0dtebTV2KnI,23434
80
80
  cognite/neat/_rules/catalog/__init__.py,sha256=dwDB8b-5GKZuwVyPuiwsH0EaK2FY9-wJrkTjKoL8KE4,250
81
81
  cognite/neat/_rules/catalog/classic_model.xlsx,sha256=YkocpkKypizjsWYwOdn5yzIz_BSl8T8SQLxgm4GIjLQ,15014
82
82
  cognite/neat/_rules/catalog/hello_world_pump.xlsx,sha256=4Fv9qyv7ARHBXSIh-PiOUHcYrtgznKyR2PZCdEBlA0o,17071
@@ -114,7 +114,7 @@ cognite/neat/_rules/models/dms/__init__.py,sha256=fRaUH0IwG0YwWd_DNKM6j-jHHFyiIV
114
114
  cognite/neat/_rules/models/dms/_exporter.py,sha256=tQeRZg0xHSTjG4BGB1BxNdewWaPVIi_8cAp0Mh0Isa4,27894
115
115
  cognite/neat/_rules/models/dms/_rules.py,sha256=dY4JYAtoy_TbYf1DIi1RYWjqoYxpR9FeVTXRJe9IfC0,21509
116
116
  cognite/neat/_rules/models/dms/_rules_input.py,sha256=a7Wfq6KR-L3yjc9J_aX1PUQZSJ7JISuOxziaqcKx0vY,13722
117
- cognite/neat/_rules/models/dms/_validation.py,sha256=gkNwiOuSEXdWAXS4WupdOSqBht7mO0-AYjirAO668fk,32227
117
+ cognite/neat/_rules/models/dms/_validation.py,sha256=Uh6DaCywdpTljy3trmVGaHrRI1wqZSAHRBpSi1hemsU,32165
118
118
  cognite/neat/_rules/models/entities/__init__.py,sha256=Hlucp3LyV6ncLl79aqRTbSy2qgiGzoyN8x54D_zaJCY,1469
119
119
  cognite/neat/_rules/models/entities/_constants.py,sha256=g52-pFP_Qghp86NYk76pLDM52b3T4MXMztxhpeDW3Oc,344
120
120
  cognite/neat/_rules/models/entities/_loaders.py,sha256=OQDbz5ANMQ_7ZcdMIBdTR94BoCpWrBA2KBH3fCW0JQo,2728
@@ -176,10 +176,10 @@ cognite/neat/_utils/text.py,sha256=BFJoEOQBFgpelysL92FdF0OVRVFl0q9tRNoz-oRanNc,7
176
176
  cognite/neat/_utils/time_.py,sha256=O30LUiDH9TdOYz8_a9pFqTtJdg8vEjC3qHCk8xZblG8,345
177
177
  cognite/neat/_utils/upload.py,sha256=xWtM6mFuD2QYQHaZ7zCAuGptbEpPIxcH-raWQu93-Ug,5845
178
178
  cognite/neat/_utils/xml_.py,sha256=FQkq84u35MUsnKcL6nTMJ9ajtG9D5i1u4VBnhGqP2DQ,1710
179
- cognite/neat/_version.py,sha256=V1axNMeW9jJrHGL6pgVYLUSuJlRf3pSUZW2Jdu7dFYE,46
179
+ cognite/neat/_version.py,sha256=RgYJlYuZWJ4AGQ8aEyYVRuBsd3VI07oMBCTfsSdQgSU,46
180
180
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
181
- cognite_neat-0.113.2.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
182
- cognite_neat-0.113.2.dist-info/METADATA,sha256=Zr5iNVRwFkiIRyhv8hMfcHa89rAImVCaZvK_F9WUuMg,5361
183
- cognite_neat-0.113.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
184
- cognite_neat-0.113.2.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
185
- cognite_neat-0.113.2.dist-info/RECORD,,
181
+ cognite_neat-0.113.4.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
182
+ cognite_neat-0.113.4.dist-info/METADATA,sha256=s_Mm72zCib4vTlsFct0YGHieFEldwejLZYe2qx5bbKM,5361
183
+ cognite_neat-0.113.4.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
184
+ cognite_neat-0.113.4.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
185
+ cognite_neat-0.113.4.dist-info/RECORD,,