cognite-neat 0.123.28__py3-none-any.whl → 0.123.29__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.
- cognite/neat/_version.py +1 -1
- cognite/neat/core/_client/_api/data_modeling_loaders.py +2 -1
- cognite/neat/core/_data_model/importers/_dms2data_model.py +2 -0
- cognite/neat/core/_data_model/models/data_types.py +10 -0
- cognite/neat/core/_data_model/models/physical/_exporter.py +3 -1
- {cognite_neat-0.123.28.dist-info → cognite_neat-0.123.29.dist-info}/METADATA +2 -2
- {cognite_neat-0.123.28.dist-info → cognite_neat-0.123.29.dist-info}/RECORD +9 -9
- {cognite_neat-0.123.28.dist-info → cognite_neat-0.123.29.dist-info}/WHEEL +0 -0
- {cognite_neat-0.123.28.dist-info → cognite_neat-0.123.29.dist-info}/licenses/LICENSE +0 -0
cognite/neat/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.123.
|
|
1
|
+
__version__ = "0.123.29"
|
|
2
2
|
__engine__ = "^2.0.4"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import itertools
|
|
1
2
|
import re
|
|
2
3
|
import warnings
|
|
3
4
|
from abc import ABC, abstractmethod
|
|
@@ -238,7 +239,7 @@ class ResourceLoader(
|
|
|
238
239
|
try:
|
|
239
240
|
return self._update(items)
|
|
240
241
|
except CogniteAPIError as e:
|
|
241
|
-
failed_ids = {self.get_id(failed) for failed in e.failed
|
|
242
|
+
failed_ids = {self.get_id(failed) for failed in itertools.chain(e.failed, e.unknown)}
|
|
242
243
|
success_ids = [self.get_id(success) for success in e.successful]
|
|
243
244
|
success_ = self.retrieve(success_ids)
|
|
244
245
|
if success is None:
|
|
@@ -446,6 +446,8 @@ class DMSImporter(BaseImporter[UnverifiedPhysicalDataModel]):
|
|
|
446
446
|
return ViewEntity.from_id(prop.source)
|
|
447
447
|
elif isinstance(prop_type, PropertyTypeWithUnit) and prop_type.unit:
|
|
448
448
|
return DataType.load(f"{prop_type._type}(unit={prop_type.unit.external_id})")
|
|
449
|
+
elif isinstance(prop_type, dm.Text) and prop_type.max_text_size is not None:
|
|
450
|
+
return DataType.load(f"{prop_type._type}(maxTextSize={prop_type.max_text_size})")
|
|
449
451
|
elif isinstance(prop_type, DMSEnum):
|
|
450
452
|
if enum_collection_by_container_property is None:
|
|
451
453
|
return String()
|
|
@@ -246,6 +246,11 @@ class String(DataType):
|
|
|
246
246
|
sql = "STRING"
|
|
247
247
|
|
|
248
248
|
name: typing.Literal["string"] = "string"
|
|
249
|
+
max_text_size: int | None = Field(
|
|
250
|
+
None,
|
|
251
|
+
alias="maxTextSize",
|
|
252
|
+
description="Specifies the maximum size in bytes of the text property, when encoded with utf-8.",
|
|
253
|
+
)
|
|
249
254
|
|
|
250
255
|
|
|
251
256
|
class LangString(DataType):
|
|
@@ -256,6 +261,11 @@ class LangString(DataType):
|
|
|
256
261
|
sql = "STRING"
|
|
257
262
|
|
|
258
263
|
name: typing.Literal["langString"] = "langString"
|
|
264
|
+
max_text_size: int | None = Field(
|
|
265
|
+
None,
|
|
266
|
+
alias="maxTextSize",
|
|
267
|
+
description="Specifies the maximum size in bytes of the text property, when encoded with utf-8.",
|
|
268
|
+
)
|
|
259
269
|
|
|
260
270
|
|
|
261
271
|
class AnyURI(DataType):
|
|
@@ -25,7 +25,7 @@ from cognite.neat.core._constants import (
|
|
|
25
25
|
DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT,
|
|
26
26
|
DMS_PRIMITIVE_LIST_DEFAULT_LIMIT,
|
|
27
27
|
)
|
|
28
|
-
from cognite.neat.core._data_model.models.data_types import DataType, Double, Enum, Float
|
|
28
|
+
from cognite.neat.core._data_model.models.data_types import DataType, Double, Enum, Float, LangString, String
|
|
29
29
|
from cognite.neat.core._data_model.models.entities import (
|
|
30
30
|
ConceptEntity,
|
|
31
31
|
ContainerEntity,
|
|
@@ -347,6 +347,8 @@ class _DMSExporter:
|
|
|
347
347
|
args["max_list_size"] = prop.max_count
|
|
348
348
|
if isinstance(prop.value_type, Double | Float) and isinstance(prop.value_type.unit, UnitEntity):
|
|
349
349
|
args["unit"] = prop.value_type.unit.as_reference()
|
|
350
|
+
if isinstance(prop.value_type, String | LangString) and prop.value_type.max_text_size is not None:
|
|
351
|
+
args["max_text_size"] = prop.value_type.max_text_size
|
|
350
352
|
if isinstance(prop.value_type, Enum):
|
|
351
353
|
if prop.value_type.collection not in enum_values_by_collection:
|
|
352
354
|
raise ResourceNotFoundError(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.123.
|
|
3
|
+
Version: 0.123.29
|
|
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/
|
|
@@ -11,7 +11,7 @@ License-Expression: Apache-2.0
|
|
|
11
11
|
License-File: LICENSE
|
|
12
12
|
Requires-Python: >=3.10
|
|
13
13
|
Requires-Dist: backports-strenum<2.0.0,>=1.2; python_version < '3.11'
|
|
14
|
-
Requires-Dist: cognite-sdk<8.0.0,>=7.
|
|
14
|
+
Requires-Dist: cognite-sdk<8.0.0,>=7.83.0
|
|
15
15
|
Requires-Dist: elementpath<5.0.0,>=4.0.0
|
|
16
16
|
Requires-Dist: exceptiongroup<2.0.0,>=1.1.3; python_version < '3.11'
|
|
17
17
|
Requires-Dist: jsonpath-python<2.0.0,>=1.0.6
|
|
@@ -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=XvrbF0Q-YDaW-QxSx3EOVq_H4nfGBw62MvL7elHSYzU,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
|
|
@@ -9,7 +9,7 @@ cognite/neat/core/_client/__init__.py,sha256=RQ7MwL8mwGqGHokRzsPqO3XStDzmI4-c12_
|
|
|
9
9
|
cognite/neat/core/_client/_api_client.py,sha256=CqgG4kEArI9jiKAh82YrRZv_SzeMKA5guIZOvDg2R5I,860
|
|
10
10
|
cognite/neat/core/_client/testing.py,sha256=rZGd-TFwNtfUqT8LV0u3FT0kHwNrjnvDNZU_Mcd5yx4,1329
|
|
11
11
|
cognite/neat/core/_client/_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
cognite/neat/core/_client/_api/data_modeling_loaders.py,sha256=
|
|
12
|
+
cognite/neat/core/_client/_api/data_modeling_loaders.py,sha256=y0QbkawjS-Fmstltt0rVDXEQRJagg2z6eXVrgT3qDM8,43827
|
|
13
13
|
cognite/neat/core/_client/_api/neat_instances.py,sha256=8HcQO1sp8zjXdnRBRQ4yeQzt1O906HNSrDDCgrgTe8A,4805
|
|
14
14
|
cognite/neat/core/_client/_api/schema.py,sha256=lbA8Cka_7K_RjmaxdeqkVkIwKPfWeDvpYvvEOGI07xo,6967
|
|
15
15
|
cognite/neat/core/_client/_api/statistics.py,sha256=M0JpCHD6WMfggoe-HyXfeigwRCvZJjVF-xNB9CgB4UE,3796
|
|
@@ -38,7 +38,7 @@ cognite/neat/core/_data_model/importers/__init__.py,sha256=jkDKSGv5VdJgl44lmn7VQ
|
|
|
38
38
|
cognite/neat/core/_data_model/importers/_base.py,sha256=pKe2OK86Wdj6CTj5bUgjY33ejZhRfD2eJbjcCapHD58,2013
|
|
39
39
|
cognite/neat/core/_data_model/importers/_base_file_reader.py,sha256=m7CwMujEybYMfHWbTQOb7wBvLl2X1TmROkPelJMSaDA,1621
|
|
40
40
|
cognite/neat/core/_data_model/importers/_dict2data_model.py,sha256=GEAD0Gs69rH-i-TjHV3Px-7Wo1Z7PfUqESsZt_58xUU,4705
|
|
41
|
-
cognite/neat/core/_data_model/importers/_dms2data_model.py,sha256=
|
|
41
|
+
cognite/neat/core/_data_model/importers/_dms2data_model.py,sha256=s_DGq57oU-kOwQuHVwTGMN1_iTZxCVAuFG7Yh2TXFQQ,29321
|
|
42
42
|
cognite/neat/core/_data_model/importers/_graph2data_model.py,sha256=yWi6Vlrc8rrcFM8hxHOVesr9D3etwJ0rbL6TJULrW9U,13684
|
|
43
43
|
cognite/neat/core/_data_model/importers/_spreadsheet2data_model.py,sha256=wPb1ie_nmWNuHO0X6NW53pvqUDYGvNkHLvT8_UKFJIw,12079
|
|
44
44
|
cognite/neat/core/_data_model/importers/_rdf/__init__.py,sha256=1yOjV2PKCxwH7uCTXVZhSdxtn5etmFX40cksvwtKcZ8,199
|
|
@@ -51,7 +51,7 @@ cognite/neat/core/_data_model/models/_base_unverified.py,sha256=1Wfbp-tJaEF6hd1b
|
|
|
51
51
|
cognite/neat/core/_data_model/models/_base_verified.py,sha256=nzPrlj7ZvYull_Fdh2zeDXz98hux-eQOdTGy9jhUtYA,15127
|
|
52
52
|
cognite/neat/core/_data_model/models/_import_contexts.py,sha256=LAQbgwTbyIAY3at2hk6OksfK_CKavBwgwPcRFcszJcc,3436
|
|
53
53
|
cognite/neat/core/_data_model/models/_types.py,sha256=70E8fiLdZkVF2sDUGPuDhzXNA5niVECkVDI7YN0NF60,5488
|
|
54
|
-
cognite/neat/core/_data_model/models/data_types.py,sha256=
|
|
54
|
+
cognite/neat/core/_data_model/models/data_types.py,sha256=S21snCN0hEDNAP0Na8ULc91YYbrRHLuKsQ4CUWFnm4o,10538
|
|
55
55
|
cognite/neat/core/_data_model/models/conceptual/__init__.py,sha256=9A6myEV8s0-LqdXejaljqPj8S0pIpUL75rNdRDZzyR8,585
|
|
56
56
|
cognite/neat/core/_data_model/models/conceptual/_unverified.py,sha256=2Ju_LJS0xH8Ao-AxZMLwAZwHjg6ITyn4tBwTfzy2Wic,6524
|
|
57
57
|
cognite/neat/core/_data_model/models/conceptual/_validation.py,sha256=CF1jYALTCQFAr5KUwplAzOLdxJGknIeJo-HpxVZsgMY,13859
|
|
@@ -68,7 +68,7 @@ cognite/neat/core/_data_model/models/mapping/__init__.py,sha256=T68Hf7rhiXa7b03h
|
|
|
68
68
|
cognite/neat/core/_data_model/models/mapping/_classic2core.py,sha256=FRDpYP_CX-CfptdFCZmfqsbKCYQ9BQPUbKoifTICe30,1415
|
|
69
69
|
cognite/neat/core/_data_model/models/mapping/_classic2core.yaml,sha256=ei-nuivNWVW9HmvzDBKIPF6ZdgaMq64XHw_rKm0CMxg,22584
|
|
70
70
|
cognite/neat/core/_data_model/models/physical/__init__.py,sha256=ONE_xLw1cxfw88rICG_RtbjCYUZm8yS2kBQ4Di3EGnA,987
|
|
71
|
-
cognite/neat/core/_data_model/models/physical/_exporter.py,sha256=
|
|
71
|
+
cognite/neat/core/_data_model/models/physical/_exporter.py,sha256=qVQjo4jLzrAMHpIRhEFy24YepaFgVD22CCVAiKJ76_k,30292
|
|
72
72
|
cognite/neat/core/_data_model/models/physical/_unverified.py,sha256=8Sg0-tfSJ6glc5h1yNDlY29sajAOv3xoi9j-Q-Md6ZY,20116
|
|
73
73
|
cognite/neat/core/_data_model/models/physical/_validation.py,sha256=AuBAecOTAVRbGh9VXZ6W91HsU7-B75ko7oaxlX4Mmqw,41140
|
|
74
74
|
cognite/neat/core/_data_model/models/physical/_verified.py,sha256=4_7XUj6-x74DhL8qe-duXhlNnq6ANmShB7UpICjbQW4,26783
|
|
@@ -196,7 +196,7 @@ cognite/neat/session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4dvc
|
|
|
196
196
|
cognite/neat/session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
|
|
197
197
|
cognite/neat/session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
|
|
198
198
|
cognite/neat/session/engine/_load.py,sha256=g52uYakQM03VqHt_RDHtpHso1-mFFifH5M4T2ScuH8A,5198
|
|
199
|
-
cognite_neat-0.123.
|
|
200
|
-
cognite_neat-0.123.
|
|
201
|
-
cognite_neat-0.123.
|
|
202
|
-
cognite_neat-0.123.
|
|
199
|
+
cognite_neat-0.123.29.dist-info/METADATA,sha256=PS-Oqu3Fi4re8fE-LYGOgFDd9Un3QCe5L9iGWf83jOc,9166
|
|
200
|
+
cognite_neat-0.123.29.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
201
|
+
cognite_neat-0.123.29.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
|
|
202
|
+
cognite_neat-0.123.29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|