cognite-neat 0.123.16__py3-none-any.whl → 0.123.17__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.
- cognite/neat/_version.py +1 -1
- cognite/neat/core/_data_model/analysis/_base.py +4 -0
- cognite/neat/core/_data_model/exporters/_data_model2ontology.py +0 -17
- cognite/neat/core/_data_model/models/conceptual/_validation.py +1 -12
- {cognite_neat-0.123.16.dist-info → cognite_neat-0.123.17.dist-info}/METADATA +1 -1
- {cognite_neat-0.123.16.dist-info → cognite_neat-0.123.17.dist-info}/RECORD +8 -8
- {cognite_neat-0.123.16.dist-info → cognite_neat-0.123.17.dist-info}/WHEEL +0 -0
- {cognite_neat-0.123.16.dist-info → cognite_neat-0.123.17.dist-info}/licenses/LICENSE +0 -0
cognite/neat/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.123.
|
|
1
|
+
__version__ = "0.123.17"
|
|
2
2
|
__engine__ = "^2.0.4"
|
|
@@ -348,6 +348,10 @@ class DataModelAnalysis:
|
|
|
348
348
|
properties_by_view = self.properties_by_view(include_ancestors)
|
|
349
349
|
return {prop.view for prop in itertools.chain.from_iterable(properties_by_view.values())}
|
|
350
350
|
|
|
351
|
+
def concepts(self) -> set[ConceptEntity]:
|
|
352
|
+
"""Returns all concepts defined Concepts in the data model."""
|
|
353
|
+
return {concept.concept for concept in self.conceptual.concepts}
|
|
354
|
+
|
|
351
355
|
def defined_concepts(
|
|
352
356
|
self,
|
|
353
357
|
include_ancestors: bool = False,
|
|
@@ -17,10 +17,8 @@ from cognite.neat.core._data_model.models.conceptual import (
|
|
|
17
17
|
ConceptualMetadata,
|
|
18
18
|
ConceptualProperty,
|
|
19
19
|
)
|
|
20
|
-
from cognite.neat.core._data_model.models.conceptual._validation import duplicated_properties
|
|
21
20
|
from cognite.neat.core._data_model.models.data_types import DataType
|
|
22
21
|
from cognite.neat.core._data_model.models.entities import ConceptEntity
|
|
23
|
-
from cognite.neat.core._issues import MultiValueError
|
|
24
22
|
from cognite.neat.core._issues.errors import (
|
|
25
23
|
PropertyDefinitionDuplicatedError,
|
|
26
24
|
)
|
|
@@ -106,21 +104,6 @@ class Ontology(OntologyModel):
|
|
|
106
104
|
Returns:
|
|
107
105
|
An instance of Ontology.
|
|
108
106
|
"""
|
|
109
|
-
if duplicates := duplicated_properties(data_model.properties):
|
|
110
|
-
errors = []
|
|
111
|
-
for (concept, property_), definitions in duplicates.items():
|
|
112
|
-
errors.append(
|
|
113
|
-
PropertyDefinitionDuplicatedError(
|
|
114
|
-
concept,
|
|
115
|
-
"concept",
|
|
116
|
-
property_,
|
|
117
|
-
frozenset({str(definition[1].value_type) for definition in definitions}),
|
|
118
|
-
tuple(definition[0] for definition in definitions),
|
|
119
|
-
"rows",
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
raise MultiValueError(errors)
|
|
123
|
-
|
|
124
107
|
analysis = DataModelAnalysis(data_model)
|
|
125
108
|
concept_by_suffix = analysis.concept_by_suffix()
|
|
126
109
|
return cls(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import itertools
|
|
2
2
|
from collections import Counter, defaultdict
|
|
3
|
-
from collections.abc import Iterable
|
|
4
3
|
|
|
5
4
|
from cognite.neat.core._constants import get_base_concepts
|
|
6
5
|
from cognite.neat.core._data_model._constants import PATTERNS, EntityTypes
|
|
@@ -24,7 +23,7 @@ from cognite.neat.core._issues.warnings._resources import (
|
|
|
24
23
|
from cognite.neat.core._utils.spreadsheet import SpreadsheetRead
|
|
25
24
|
from cognite.neat.core._utils.text import humanize_collection
|
|
26
25
|
|
|
27
|
-
from ._verified import ConceptualDataModel
|
|
26
|
+
from ._verified import ConceptualDataModel
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
class ConceptualValidation:
|
|
@@ -176,7 +175,6 @@ class ConceptualValidation:
|
|
|
176
175
|
"""Check if the value types of object properties are defined as concepts."""
|
|
177
176
|
|
|
178
177
|
concepts = {concept.concept for concept in self._concepts}
|
|
179
|
-
|
|
180
178
|
# We remove UnknownEntity from the concepts to avoid false positives
|
|
181
179
|
# as `UnknownEntity` is used as a placeholder when the value type is not defined.
|
|
182
180
|
value_types = {
|
|
@@ -286,12 +284,3 @@ class ConceptualValidation:
|
|
|
286
284
|
"\nMake sure that each unique namespace is assigned to a unique prefix"
|
|
287
285
|
)
|
|
288
286
|
)
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
def duplicated_properties(
|
|
292
|
-
properties: Iterable[ConceptualProperty],
|
|
293
|
-
) -> dict[tuple[ConceptEntity, str], list[tuple[int, ConceptualProperty]]]:
|
|
294
|
-
concept_properties_by_id: dict[tuple[ConceptEntity, str], list[tuple[int, ConceptualProperty]]] = defaultdict(list)
|
|
295
|
-
for prop_no, prop in enumerate(properties):
|
|
296
|
-
concept_properties_by_id[(prop.concept, prop.property_)].append((prop_no, prop))
|
|
297
|
-
return {k: v for k, v in concept_properties_by_id.items() if len(v) > 1}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.123.
|
|
3
|
+
Version: 0.123.17
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
|
|
6
6
|
Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
cognite/neat/__init__.py,sha256=12StS1dzH9_MElqxGvLWrNsxCJl9Hv8A2a9D0E5OD_U,193
|
|
2
|
-
cognite/neat/_version.py,sha256=
|
|
2
|
+
cognite/neat/_version.py,sha256=nARB9jowN_gs06K1t0WopgFGE_qMSierhZAYDq08tNM,47
|
|
3
3
|
cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
cognite/neat/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cognite/neat/core/_config.py,sha256=WT1BS8uADcFvGoUYOOfwFOVq_VBl472TisdoA3wLick,280
|
|
@@ -22,7 +22,7 @@ cognite/neat/core/_data_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
22
22
|
cognite/neat/core/_data_model/_constants.py,sha256=ssiOprhd4bamglQnLTNjmqYn9mCBW-VOUbn08qDBbsM,5857
|
|
23
23
|
cognite/neat/core/_data_model/_shared.py,sha256=gLEEMofI9prZLRNjHpwQe0uX9WoKd5qUt5pT1i_KAYo,2072
|
|
24
24
|
cognite/neat/core/_data_model/analysis/__init__.py,sha256=v3hSfz7AEEqcmdjL71I09tP8Hl-gPZYOiDYMp_CW4vg,70
|
|
25
|
-
cognite/neat/core/_data_model/analysis/_base.py,sha256=
|
|
25
|
+
cognite/neat/core/_data_model/analysis/_base.py,sha256=VT1orVf0xSSZrKnJoc-cJR1F1mtMn9Ybjk7UDO71aFA,24448
|
|
26
26
|
cognite/neat/core/_data_model/catalog/__init__.py,sha256=zWG1-GONe8m05lV3gLAK_Xp7EJvcy6qLLl2B-RHHBjw,260
|
|
27
27
|
cognite/neat/core/_data_model/catalog/classic_model.xlsx,sha256=YkocpkKypizjsWYwOdn5yzIz_BSl8T8SQLxgm4GIjLQ,15014
|
|
28
28
|
cognite/neat/core/_data_model/catalog/conceptual-imf-data-model.xlsx,sha256=vrE5g8vBtsGpwJqygxG3t9I3x4SUAyQsi1vtWfZ8QW4,53682
|
|
@@ -32,7 +32,7 @@ cognite/neat/core/_data_model/exporters/_base.py,sha256=PHKTUiio4PmiEjWP9E9tJiOk
|
|
|
32
32
|
cognite/neat/core/_data_model/exporters/_data_model2dms.py,sha256=gFSWvYV71LSzDVYsGlJ_mMxhLuKK0nwBvBiwRJhbvTE,19891
|
|
33
33
|
cognite/neat/core/_data_model/exporters/_data_model2excel.py,sha256=88ReyrsRqoIRJcF7ezZGtsZ_0FBL0Wq7UsGI1uCXgJ4,25457
|
|
34
34
|
cognite/neat/core/_data_model/exporters/_data_model2instance_template.py,sha256=9k8A70b1paeOHjvJRtbl6Xror1GD8AIMdo3cCx5aejE,6103
|
|
35
|
-
cognite/neat/core/_data_model/exporters/_data_model2ontology.py,sha256=
|
|
35
|
+
cognite/neat/core/_data_model/exporters/_data_model2ontology.py,sha256=sZRxvbnv2reav3xUUZl6NIX-KqngoKr4qLmzTUvkhYk,22615
|
|
36
36
|
cognite/neat/core/_data_model/exporters/_data_model2yaml.py,sha256=1dlb-v4sV8BArnX_6J4wpjQT7r-FinFAvoPDoMNkHYw,3284
|
|
37
37
|
cognite/neat/core/_data_model/importers/__init__.py,sha256=5KqFRDz69FlXRcmqu7ejQl3YVXrpLXx-Q-HpwAeDbfA,1184
|
|
38
38
|
cognite/neat/core/_data_model/importers/_base.py,sha256=pKe2OK86Wdj6CTj5bUgjY33ejZhRfD2eJbjcCapHD58,2013
|
|
@@ -52,7 +52,7 @@ cognite/neat/core/_data_model/models/_types.py,sha256=70E8fiLdZkVF2sDUGPuDhzXNA5
|
|
|
52
52
|
cognite/neat/core/_data_model/models/data_types.py,sha256=uQ_u9KxCetLjxo-VtFzOXSxQuuf97Kg-9lfTTGzY6hc,10150
|
|
53
53
|
cognite/neat/core/_data_model/models/conceptual/__init__.py,sha256=9A6myEV8s0-LqdXejaljqPj8S0pIpUL75rNdRDZzyR8,585
|
|
54
54
|
cognite/neat/core/_data_model/models/conceptual/_unverified.py,sha256=VswgnTSjSCRzBX3z5HvintBGaWBPexxIs-7z7S4J57c,6298
|
|
55
|
-
cognite/neat/core/_data_model/models/conceptual/_validation.py,sha256=
|
|
55
|
+
cognite/neat/core/_data_model/models/conceptual/_validation.py,sha256=wO8wTeQIPQ45B4OXf-okJaEyQs4eE2D0lvn24pFromQ,12882
|
|
56
56
|
cognite/neat/core/_data_model/models/conceptual/_verified.py,sha256=BUB4Ur4kpBoWiwTf57tjxJ2l0tDTSbY7zGrg1g0yVNQ,13716
|
|
57
57
|
cognite/neat/core/_data_model/models/entities/__init__.py,sha256=UsW-_6fwd-TW0WcnShPKf40h75l1elVn80VurUwRAic,1567
|
|
58
58
|
cognite/neat/core/_data_model/models/entities/_constants.py,sha256=GXRzVfArwxF3C67VCkzy0JWTZRkRJUYXBQaaecrqcWc,351
|
|
@@ -187,7 +187,7 @@ cognite/neat/session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4dvc
|
|
|
187
187
|
cognite/neat/session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
|
|
188
188
|
cognite/neat/session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
|
|
189
189
|
cognite/neat/session/engine/_load.py,sha256=g52uYakQM03VqHt_RDHtpHso1-mFFifH5M4T2ScuH8A,5198
|
|
190
|
-
cognite_neat-0.123.
|
|
191
|
-
cognite_neat-0.123.
|
|
192
|
-
cognite_neat-0.123.
|
|
193
|
-
cognite_neat-0.123.
|
|
190
|
+
cognite_neat-0.123.17.dist-info/METADATA,sha256=KFgvomIBfB9edOObzS4g19zDqvyiDKcfte_8AP6FRnQ,9172
|
|
191
|
+
cognite_neat-0.123.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
192
|
+
cognite_neat-0.123.17.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
|
|
193
|
+
cognite_neat-0.123.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|