cognite-neat 0.119.9__py3-none-any.whl → 0.120.0__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/__init__.py +3 -2
- cognite/neat/_version.py +1 -1
- cognite/neat/{_client → core/_client}/_api/data_modeling_loaders.py +5 -5
- cognite/neat/{_client → core/_client}/_api/neat_instances.py +1 -1
- cognite/neat/{_client → core/_client}/_api/schema.py +9 -5
- cognite/neat/{_client → core/_client}/_api_client.py +1 -1
- cognite/neat/{_client → core/_client}/data_classes/schema.py +4 -4
- cognite/neat/{_client → core/_client}/testing.py +1 -1
- cognite/neat/{_constants.py → core/_constants.py} +27 -8
- cognite/neat/{_graph → core/_graph}/_tracking/base.py +1 -1
- cognite/neat/{_graph → core/_graph}/_tracking/log.py +1 -1
- cognite/neat/{_graph → core/_graph}/extractors/__init__.py +1 -1
- cognite/neat/{_graph → core/_graph}/extractors/_base.py +6 -6
- cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_base.py +23 -7
- cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_classic.py +16 -12
- cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_relationships.py +5 -3
- cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_sequences.py +7 -2
- cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_timeseries.py +10 -3
- cognite/neat/{_graph → core/_graph}/extractors/_dict.py +2 -2
- cognite/neat/{_graph → core/_graph}/extractors/_dms.py +6 -6
- cognite/neat/{_graph → core/_graph}/extractors/_dms_graph.py +15 -11
- cognite/neat/{_graph → core/_graph}/extractors/_mock_graph_generator.py +10 -10
- cognite/neat/{_graph → core/_graph}/extractors/_raw.py +3 -3
- cognite/neat/{_graph → core/_graph}/extractors/_rdf_file.py +10 -7
- cognite/neat/{_graph → core/_graph}/loaders/_base.py +5 -5
- cognite/neat/{_graph → core/_graph}/loaders/_rdf2dms.py +31 -18
- cognite/neat/{_graph → core/_graph}/queries/_select.py +3 -3
- cognite/neat/{_graph → core/_graph}/queries/_update.py +1 -1
- cognite/neat/{_graph → core/_graph}/transformers/_base.py +8 -4
- cognite/neat/{_graph → core/_graph}/transformers/_classic_cdf.py +6 -6
- cognite/neat/{_graph → core/_graph}/transformers/_prune_graph.py +4 -4
- cognite/neat/{_graph → core/_graph}/transformers/_rdfpath.py +1 -1
- cognite/neat/{_graph → core/_graph}/transformers/_value_type.py +8 -4
- cognite/neat/{_issues → core/_issues}/_base.py +12 -5
- cognite/neat/{_issues → core/_issues}/_contextmanagers.py +1 -1
- cognite/neat/{_issues → core/_issues}/_factory.py +2 -2
- cognite/neat/{_issues → core/_issues}/errors/__init__.py +1 -1
- cognite/neat/{_issues → core/_issues}/errors/_external.py +1 -1
- cognite/neat/{_issues → core/_issues}/errors/_general.py +1 -1
- cognite/neat/{_issues → core/_issues}/errors/_properties.py +1 -1
- cognite/neat/{_issues → core/_issues}/errors/_resources.py +7 -2
- cognite/neat/{_issues → core/_issues}/errors/_wrapper.py +2 -2
- cognite/neat/{_issues → core/_issues}/warnings/__init__.py +1 -1
- cognite/neat/{_issues → core/_issues}/warnings/_external.py +1 -1
- cognite/neat/{_issues → core/_issues}/warnings/_general.py +1 -1
- cognite/neat/{_issues → core/_issues}/warnings/_models.py +2 -2
- cognite/neat/{_issues → core/_issues}/warnings/_properties.py +2 -2
- cognite/neat/{_issues → core/_issues}/warnings/_resources.py +6 -1
- cognite/neat/{_issues → core/_issues}/warnings/user_modeling.py +1 -1
- cognite/neat/{_rules → core/_rules}/_shared.py +6 -4
- cognite/neat/{_rules → core/_rules}/analysis/_base.py +15 -8
- cognite/neat/{_rules → core/_rules}/exporters/_base.py +7 -7
- cognite/neat/{_rules → core/_rules}/exporters/_rules2dms.py +15 -9
- cognite/neat/{_rules → core/_rules}/exporters/_rules2excel.py +219 -163
- cognite/neat/{_rules → core/_rules}/exporters/_rules2instance_template.py +4 -4
- cognite/neat/{_rules → core/_rules}/exporters/_rules2ontology.py +10 -10
- cognite/neat/{_rules → core/_rules}/exporters/_rules2yaml.py +1 -1
- cognite/neat/{_rules → core/_rules}/exporters/_validation.py +2 -2
- cognite/neat/{_rules → core/_rules}/importers/_base.py +5 -5
- cognite/neat/{_rules → core/_rules}/importers/_dms2rules.py +20 -12
- cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/dtdl_converter.py +15 -7
- cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/dtdl_importer.py +13 -9
- cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/spec.py +1 -1
- cognite/neat/{_rules → core/_rules}/importers/_rdf/_base.py +12 -12
- cognite/neat/{_rules → core/_rules}/importers/_rdf/_imf2rules.py +5 -2
- cognite/neat/{_rules → core/_rules}/importers/_rdf/_inference2rules.py +14 -14
- cognite/neat/{_rules → core/_rules}/importers/_rdf/_owl2rules.py +5 -2
- cognite/neat/{_rules → core/_rules}/importers/_rdf/_shared.py +4 -4
- cognite/neat/{_rules → core/_rules}/importers/_spreadsheet2rules.py +7 -7
- cognite/neat/{_rules → core/_rules}/importers/_yaml2rules.py +5 -5
- cognite/neat/{_rules → core/_rules}/models/__init__.py +5 -3
- cognite/neat/{_rules → core/_rules}/models/_base_rules.py +9 -6
- cognite/neat/{_rules → core/_rules}/models/_types.py +5 -5
- cognite/neat/{_rules → core/_rules}/models/data_types.py +9 -3
- cognite/neat/{_rules → core/_rules}/models/dms/__init__.py +1 -1
- cognite/neat/{_rules → core/_rules}/models/dms/_exporter.py +15 -8
- cognite/neat/{_rules → core/_rules}/models/dms/_rules.py +9 -9
- cognite/neat/{_rules → core/_rules}/models/dms/_rules_input.py +10 -7
- cognite/neat/{_rules → core/_rules}/models/dms/_validation.py +14 -14
- cognite/neat/{_rules → core/_rules}/models/entities/_loaders.py +2 -2
- cognite/neat/{_rules → core/_rules}/models/entities/_multi_value.py +2 -2
- cognite/neat/{_rules → core/_rules}/models/entities/_single_value.py +3 -3
- cognite/neat/{_rules → core/_rules}/models/information/_rules.py +11 -9
- cognite/neat/{_rules → core/_rules}/models/information/_rules_input.py +5 -5
- cognite/neat/{_rules → core/_rules}/models/information/_validation.py +10 -10
- cognite/neat/{_rules → core/_rules}/models/mapping/_classic2core.py +5 -5
- cognite/neat/{_rules → core/_rules}/transformers/_base.py +4 -4
- cognite/neat/{_rules → core/_rules}/transformers/_converters.py +52 -26
- cognite/neat/{_rules → core/_rules}/transformers/_mapping.py +15 -7
- cognite/neat/{_rules → core/_rules}/transformers/_verification.py +7 -7
- cognite/neat/{_store → core/_store}/_graph_store.py +13 -10
- cognite/neat/{_store → core/_store}/_provenance.py +3 -3
- cognite/neat/{_store → core/_store}/_rules_store.py +19 -12
- cognite/neat/{_store → core/_store}/exceptions.py +4 -4
- cognite/neat/core/_utils/__init__.py +0 -0
- cognite/neat/{_utils → core/_utils}/auth.py +1 -1
- cognite/neat/{_utils → core/_utils}/auxiliary.py +1 -1
- cognite/neat/{_utils → core/_utils}/collection_.py +2 -2
- cognite/neat/{_utils → core/_utils}/graph_transformations_report.py +1 -1
- cognite/neat/{_utils → core/_utils}/rdf_.py +1 -1
- cognite/neat/{_utils → core/_utils}/reader/_base.py +1 -1
- cognite/neat/{_utils → core/_utils}/spreadsheet.py +11 -4
- cognite/neat/{_utils → core/_utils}/text.py +1 -1
- cognite/neat/{_utils → core/_utils}/upload.py +3 -3
- cognite/neat/{_session → session}/_base.py +10 -10
- cognite/neat/{_session → session}/_collector.py +1 -1
- cognite/neat/{_session → session}/_drop.py +3 -3
- cognite/neat/{_session → session}/_explore.py +2 -2
- cognite/neat/{_session → session}/_fix.py +2 -2
- cognite/neat/{_session → session}/_inspect.py +7 -3
- cognite/neat/{_session → session}/_mapping.py +3 -3
- cognite/neat/{_session → session}/_prepare.py +8 -8
- cognite/neat/{_session → session}/_read.py +73 -16
- cognite/neat/{_session → session}/_set.py +8 -8
- cognite/neat/{_session → session}/_show.py +5 -5
- cognite/neat/{_session → session}/_state.py +8 -8
- cognite/neat/{_session → session}/_subset.py +7 -4
- cognite/neat/{_session → session}/_template.py +22 -14
- cognite/neat/{_session → session}/_to.py +12 -12
- cognite/neat/{_session → session}/_wizard.py +1 -1
- cognite/neat/{_session → session}/engine/_load.py +1 -1
- cognite/neat/{_session → session}/exceptions.py +4 -4
- {cognite_neat-0.119.9.dist-info → cognite_neat-0.120.0.dist-info}/METADATA +1 -1
- cognite_neat-0.120.0.dist-info/RECORD +187 -0
- cognite_neat-0.119.9.dist-info/RECORD +0 -186
- /cognite/neat/{_client/_api → core}/__init__.py +0 -0
- /cognite/neat/{_client → core/_client}/__init__.py +0 -0
- /cognite/neat/{_client/data_classes → core/_client/_api}/__init__.py +0 -0
- /cognite/neat/{_graph → core/_client/data_classes}/__init__.py +0 -0
- /cognite/neat/{_client → core/_client}/data_classes/data_modeling.py +0 -0
- /cognite/neat/{_client → core/_client}/data_classes/neat_sequence.py +0 -0
- /cognite/neat/{_config.py → core/_config.py} +0 -0
- /cognite/neat/{_graph/extractors/_classic_cdf → core/_graph}/__init__.py +0 -0
- /cognite/neat/{_graph → core/_graph}/_shared.py +0 -0
- /cognite/neat/{_graph → core/_graph}/_tracking/__init__.py +0 -0
- /cognite/neat/{_graph → core/_graph}/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- /cognite/neat/{_graph → core/_graph}/examples/Knowledge-Graph-Nordic44.xml +0 -0
- /cognite/neat/{_graph → core/_graph}/examples/__init__.py +0 -0
- /cognite/neat/{_graph → core/_graph}/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- /cognite/neat/{_rules → core/_graph/extractors/_classic_cdf}/__init__.py +0 -0
- /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_assets.py +0 -0
- /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_data_sets.py +0 -0
- /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_events.py +0 -0
- /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_files.py +0 -0
- /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_labels.py +0 -0
- /cognite/neat/{_graph → core/_graph}/loaders/__init__.py +0 -0
- /cognite/neat/{_graph → core/_graph}/queries/__init__.py +0 -0
- /cognite/neat/{_graph → core/_graph}/queries/_base.py +0 -0
- /cognite/neat/{_graph → core/_graph}/queries/_queries.py +0 -0
- /cognite/neat/{_graph → core/_graph}/transformers/__init__.py +0 -0
- /cognite/neat/{_issues → core/_issues}/__init__.py +0 -0
- /cognite/neat/{_issues → core/_issues}/formatters.py +0 -0
- /cognite/neat/{_utils → core/_rules}/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/_constants.py +0 -0
- /cognite/neat/{_rules → core/_rules}/analysis/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/catalog/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/catalog/classic_model.xlsx +0 -0
- /cognite/neat/{_rules → core/_rules}/catalog/hello_world_pump.xlsx +0 -0
- /cognite/neat/{_rules → core/_rules}/catalog/info-rules-imf.xlsx +0 -0
- /cognite/neat/{_rules → core/_rules}/exporters/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/importers/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/_unit_lookup.py +0 -0
- /cognite/neat/{_rules → core/_rules}/importers/_rdf/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/_base_input.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/entities/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/entities/_constants.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/entities/_types.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/entities/_wrapped.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/information/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/mapping/__init__.py +0 -0
- /cognite/neat/{_rules → core/_rules}/models/mapping/_classic2core.yaml +0 -0
- /cognite/neat/{_rules → core/_rules}/transformers/__init__.py +0 -0
- /cognite/neat/{_shared.py → core/_shared.py} +0 -0
- /cognite/neat/{_store → core/_store}/__init__.py +0 -0
- /cognite/neat/{_utils → core/_utils}/io_.py +0 -0
- /cognite/neat/{_utils → core/_utils}/reader/__init__.py +0 -0
- /cognite/neat/{_utils → core/_utils}/time_.py +0 -0
- /cognite/neat/{_utils → core/_utils}/xml_.py +0 -0
- /cognite/neat/{_session → session}/__init__.py +0 -0
- /cognite/neat/{_alpha.py → session/_experimental.py} +0 -0
- /cognite/neat/{_state → session/_state}/README.md +0 -0
- /cognite/neat/{_session → session}/engine/__init__.py +0 -0
- /cognite/neat/{_session → session}/engine/_import.py +0 -0
- /cognite/neat/{_session → session}/engine/_interface.py +0 -0
- {cognite_neat-0.119.9.dist-info → cognite_neat-0.120.0.dist-info}/WHEEL +0 -0
- {cognite_neat-0.119.9.dist-info → cognite_neat-0.120.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -19,35 +19,48 @@ from cognite.client.exceptions import CogniteAPIError
|
|
|
19
19
|
from pydantic import BaseModel, ValidationInfo, create_model, field_validator
|
|
20
20
|
from rdflib import RDF, URIRef
|
|
21
21
|
|
|
22
|
-
from cognite.neat._client import NeatClient
|
|
23
|
-
from cognite.neat._client._api_client import SchemaAPI
|
|
24
|
-
from cognite.neat._constants import
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
from cognite.neat.core._client import NeatClient
|
|
23
|
+
from cognite.neat.core._client._api_client import SchemaAPI
|
|
24
|
+
from cognite.neat.core._constants import (
|
|
25
|
+
DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT,
|
|
26
|
+
is_readonly_property,
|
|
27
|
+
)
|
|
28
|
+
from cognite.neat.core._issues import IssueList, NeatError, NeatIssue, catch_issues
|
|
29
|
+
from cognite.neat.core._issues.errors import (
|
|
27
30
|
AuthorizationError,
|
|
28
31
|
ResourceCreationError,
|
|
29
32
|
ResourceDuplicatedError,
|
|
30
33
|
ResourceNotFoundError,
|
|
31
34
|
)
|
|
32
|
-
from cognite.neat._issues.warnings import (
|
|
35
|
+
from cognite.neat.core._issues.warnings import (
|
|
33
36
|
NeatValueWarning,
|
|
34
37
|
PropertyDirectRelationLimitWarning,
|
|
35
38
|
PropertyMultipleValueWarning,
|
|
36
39
|
PropertyTypeNotSupportedWarning,
|
|
37
40
|
ResourceNeatWarning,
|
|
38
41
|
)
|
|
39
|
-
from cognite.neat._rules.analysis import RulesAnalysis
|
|
40
|
-
from cognite.neat._rules.analysis._base import ViewQuery, ViewQueryDict
|
|
41
|
-
from cognite.neat._rules.models import DMSRules
|
|
42
|
-
from cognite.neat._rules.models.data_types import
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
from cognite.neat.
|
|
48
|
-
from cognite.neat.
|
|
49
|
-
from cognite.neat.
|
|
50
|
-
from cognite.neat._utils.
|
|
42
|
+
from cognite.neat.core._rules.analysis import RulesAnalysis
|
|
43
|
+
from cognite.neat.core._rules.analysis._base import ViewQuery, ViewQueryDict
|
|
44
|
+
from cognite.neat.core._rules.models import DMSRules
|
|
45
|
+
from cognite.neat.core._rules.models.data_types import (
|
|
46
|
+
_DATA_TYPE_BY_DMS_TYPE,
|
|
47
|
+
Json,
|
|
48
|
+
String,
|
|
49
|
+
)
|
|
50
|
+
from cognite.neat.core._rules.models.information._rules import InformationRules
|
|
51
|
+
from cognite.neat.core._shared import InstanceType
|
|
52
|
+
from cognite.neat.core._store import NeatGraphStore
|
|
53
|
+
from cognite.neat.core._utils.auxiliary import create_sha256_hash
|
|
54
|
+
from cognite.neat.core._utils.collection_ import (
|
|
55
|
+
iterate_progress_bar_if_above_config_threshold,
|
|
56
|
+
)
|
|
57
|
+
from cognite.neat.core._utils.rdf_ import (
|
|
58
|
+
namespace_as_space,
|
|
59
|
+
remove_namespace_from_uri,
|
|
60
|
+
split_uri,
|
|
61
|
+
)
|
|
62
|
+
from cognite.neat.core._utils.text import NamingStandardization
|
|
63
|
+
from cognite.neat.core._utils.upload import UploadResult
|
|
51
64
|
|
|
52
65
|
from ._base import _END_OF_CLASS, _START_OF_CLASS, CDFLoader
|
|
53
66
|
|
|
@@ -7,9 +7,9 @@ from rdflib import RDF, XSD, Namespace, URIRef
|
|
|
7
7
|
from rdflib import Literal as RdfLiteral
|
|
8
8
|
from rdflib.query import ResultRow
|
|
9
9
|
|
|
10
|
-
from cognite.neat._constants import NEAT
|
|
11
|
-
from cognite.neat._shared import InstanceType
|
|
12
|
-
from cognite.neat._utils.rdf_ import remove_namespace_from_uri
|
|
10
|
+
from cognite.neat.core._constants import NEAT
|
|
11
|
+
from cognite.neat.core._shared import InstanceType
|
|
12
|
+
from cognite.neat.core._utils.rdf_ import remove_namespace_from_uri
|
|
13
13
|
|
|
14
14
|
from ._base import BaseQuery
|
|
15
15
|
|
|
@@ -7,10 +7,14 @@ from typing import ClassVar, TypeAlias, cast
|
|
|
7
7
|
from rdflib import Graph
|
|
8
8
|
from rdflib.query import ResultRow
|
|
9
9
|
|
|
10
|
-
from cognite.neat._issues.warnings import NeatValueWarning
|
|
11
|
-
from cognite.neat._shared import Triple
|
|
12
|
-
from cognite.neat._utils.collection_ import
|
|
13
|
-
|
|
10
|
+
from cognite.neat.core._issues.warnings import NeatValueWarning
|
|
11
|
+
from cognite.neat.core._shared import Triple
|
|
12
|
+
from cognite.neat.core._utils.collection_ import (
|
|
13
|
+
iterate_progress_bar_if_above_config_threshold,
|
|
14
|
+
)
|
|
15
|
+
from cognite.neat.core._utils.graph_transformations_report import (
|
|
16
|
+
GraphTransformationResult,
|
|
17
|
+
)
|
|
14
18
|
|
|
15
19
|
To_Add_Triples: TypeAlias = set[Triple]
|
|
16
20
|
To_Remove_Triples: TypeAlias = set[Triple]
|
|
@@ -8,12 +8,12 @@ from typing import cast
|
|
|
8
8
|
from rdflib import RDF, Graph, Literal, Namespace, URIRef
|
|
9
9
|
from rdflib.query import ResultRow
|
|
10
10
|
|
|
11
|
-
from cognite.neat._constants import CLASSIC_CDF_NAMESPACE, DEFAULT_NAMESPACE
|
|
12
|
-
from cognite.neat._graph import extractors
|
|
13
|
-
from cognite.neat._issues.errors import NeatValueError
|
|
14
|
-
from cognite.neat._issues.warnings import ResourceNotFoundWarning
|
|
15
|
-
from cognite.neat._utils.collection_ import iterate_progress_bar
|
|
16
|
-
from cognite.neat._utils.rdf_ import (
|
|
11
|
+
from cognite.neat.core._constants import CLASSIC_CDF_NAMESPACE, DEFAULT_NAMESPACE
|
|
12
|
+
from cognite.neat.core._graph import extractors
|
|
13
|
+
from cognite.neat.core._issues.errors import NeatValueError
|
|
14
|
+
from cognite.neat.core._issues.warnings import ResourceNotFoundWarning
|
|
15
|
+
from cognite.neat.core._utils.collection_ import iterate_progress_bar
|
|
16
|
+
from cognite.neat.core._utils.rdf_ import (
|
|
17
17
|
Triple,
|
|
18
18
|
add_triples_in_batch,
|
|
19
19
|
get_namespace,
|
|
@@ -3,10 +3,10 @@ from typing import Any, cast
|
|
|
3
3
|
from rdflib import Graph, Namespace, URIRef
|
|
4
4
|
from rdflib.query import ResultRow
|
|
5
5
|
|
|
6
|
-
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
7
|
-
from cognite.neat._shared import Triple
|
|
8
|
-
from cognite.neat._utils.rdf_ import as_neat_compliant_uri
|
|
9
|
-
from cognite.neat._utils.text import sentence_or_string_to_camel
|
|
6
|
+
from cognite.neat.core._constants import DEFAULT_NAMESPACE
|
|
7
|
+
from cognite.neat.core._shared import Triple
|
|
8
|
+
from cognite.neat.core._utils.rdf_ import as_neat_compliant_uri
|
|
9
|
+
from cognite.neat.core._utils.text import sentence_or_string_to_camel
|
|
10
10
|
|
|
11
11
|
from ._base import BaseTransformer, BaseTransformerStandardised, RowTransformationOutput
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@ from urllib.parse import quote
|
|
|
4
4
|
from rdflib import Namespace, URIRef
|
|
5
5
|
from rdflib.query import ResultRow
|
|
6
6
|
|
|
7
|
-
from cognite.neat._utils.rdf_ import get_namespace, remove_namespace_from_uri
|
|
7
|
+
from cognite.neat.core._utils.rdf_ import get_namespace, remove_namespace_from_uri
|
|
8
8
|
|
|
9
9
|
from ._base import BaseTransformerStandardised, RowTransformationOutput
|
|
10
10
|
|
|
@@ -7,10 +7,14 @@ import rdflib
|
|
|
7
7
|
from rdflib import RDF, RDFS, Graph, Literal, Namespace, URIRef
|
|
8
8
|
from rdflib.query import ResultRow
|
|
9
9
|
|
|
10
|
-
from cognite.neat._constants import NEAT
|
|
11
|
-
from cognite.neat._issues.warnings import PropertyDataTypeConversionWarning
|
|
12
|
-
from cognite.neat._utils.auxiliary import string_to_ideal_type
|
|
13
|
-
from cognite.neat._utils.rdf_ import
|
|
10
|
+
from cognite.neat.core._constants import NEAT
|
|
11
|
+
from cognite.neat.core._issues.warnings import PropertyDataTypeConversionWarning
|
|
12
|
+
from cognite.neat.core._utils.auxiliary import string_to_ideal_type
|
|
13
|
+
from cognite.neat.core._utils.rdf_ import (
|
|
14
|
+
Triple,
|
|
15
|
+
get_namespace,
|
|
16
|
+
remove_namespace_from_uri,
|
|
17
|
+
)
|
|
14
18
|
|
|
15
19
|
from ._base import BaseTransformerStandardised, RowTransformationOutput
|
|
16
20
|
|
|
@@ -16,7 +16,11 @@ from cognite.client.data_classes.data_modeling import (
|
|
|
16
16
|
ViewId,
|
|
17
17
|
)
|
|
18
18
|
|
|
19
|
-
from cognite.neat._utils.text import
|
|
19
|
+
from cognite.neat.core._utils.text import (
|
|
20
|
+
humanize_collection,
|
|
21
|
+
to_camel_case,
|
|
22
|
+
to_snake_case,
|
|
23
|
+
)
|
|
20
24
|
|
|
21
25
|
if sys.version_info < (3, 11):
|
|
22
26
|
from exceptiongroup import ExceptionGroup
|
|
@@ -115,7 +119,7 @@ class NeatIssue:
|
|
|
115
119
|
|
|
116
120
|
@classmethod
|
|
117
121
|
def _dump_value(cls, value: Any) -> list | int | bool | float | str | dict:
|
|
118
|
-
from cognite.neat._rules.models.entities import Entity
|
|
122
|
+
from cognite.neat.core._rules.models.entities import Entity
|
|
119
123
|
|
|
120
124
|
if isinstance(value, str | int | bool | float):
|
|
121
125
|
return value
|
|
@@ -140,8 +144,11 @@ class NeatIssue:
|
|
|
140
144
|
@classmethod
|
|
141
145
|
def load(cls, data: dict[str, Any]) -> "NeatIssue":
|
|
142
146
|
"""Create an instance of the issue from a dictionary."""
|
|
143
|
-
from cognite.neat._issues.errors import
|
|
144
|
-
|
|
147
|
+
from cognite.neat.core._issues.errors import (
|
|
148
|
+
_NEAT_ERRORS_BY_NAME,
|
|
149
|
+
NeatValueError,
|
|
150
|
+
)
|
|
151
|
+
from cognite.neat.core._issues.warnings import _NEAT_WARNINGS_BY_NAME
|
|
145
152
|
|
|
146
153
|
if "NeatIssue" not in data:
|
|
147
154
|
raise NeatValueError("The data does not contain a NeatIssue key.")
|
|
@@ -166,7 +173,7 @@ class NeatIssue:
|
|
|
166
173
|
|
|
167
174
|
@classmethod
|
|
168
175
|
def _load_value(cls, type_: Any, value: Any) -> Any:
|
|
169
|
-
from cognite.neat._rules.models.entities import Entity
|
|
176
|
+
from cognite.neat.core._rules.models.entities import Entity
|
|
170
177
|
|
|
171
178
|
if isinstance(type_, UnionType) or get_origin(type_) is UnionType:
|
|
172
179
|
args = get_args(type_)
|
|
@@ -4,7 +4,7 @@ from contextlib import contextmanager
|
|
|
4
4
|
|
|
5
5
|
from pydantic import ValidationError
|
|
6
6
|
|
|
7
|
-
from cognite.neat._utils.spreadsheet import SpreadsheetRead
|
|
7
|
+
from cognite.neat.core._utils.spreadsheet import SpreadsheetRead
|
|
8
8
|
|
|
9
9
|
from ._base import IssueList, MultiValueError, NeatError
|
|
10
10
|
from ._factory import from_pydantic_errors, from_warning
|
|
@@ -3,8 +3,8 @@ from warnings import WarningMessage
|
|
|
3
3
|
|
|
4
4
|
from pydantic_core import ErrorDetails
|
|
5
5
|
|
|
6
|
-
from cognite.neat._issues._base import NeatError, NeatWarning
|
|
7
|
-
from cognite.neat._utils.spreadsheet import SpreadsheetRead
|
|
6
|
+
from cognite.neat.core._issues._base import NeatError, NeatWarning
|
|
7
|
+
from cognite.neat.core._utils.spreadsheet import SpreadsheetRead
|
|
8
8
|
|
|
9
9
|
from .errors import NeatValueError, SpreadsheetError
|
|
10
10
|
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Generic
|
|
3
3
|
|
|
4
|
-
from cognite.neat._issues._base import
|
|
5
|
-
|
|
4
|
+
from cognite.neat.core._issues._base import (
|
|
5
|
+
NeatError,
|
|
6
|
+
ResourceType,
|
|
7
|
+
T_Identifier,
|
|
8
|
+
T_ReferenceIdentifier,
|
|
9
|
+
)
|
|
10
|
+
from cognite.neat.core._utils.text import humanize_collection
|
|
6
11
|
|
|
7
12
|
|
|
8
13
|
@dataclass(unsafe_hash=True)
|
|
@@ -2,8 +2,8 @@ from abc import ABC
|
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from typing import ClassVar, cast
|
|
4
4
|
|
|
5
|
-
from cognite.neat._issues import NeatError
|
|
6
|
-
from cognite.neat._utils.spreadsheet import SpreadsheetRead
|
|
5
|
+
from cognite.neat.core._issues import NeatError
|
|
6
|
+
from cognite.neat.core._utils.spreadsheet import SpreadsheetRead
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
@dataclass(unsafe_hash=True)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
conflicts with the built-in Python warnings module. However, it is expected to always be used in an absolute
|
|
3
3
|
import, and should thus not cause a naming conflict."""
|
|
4
4
|
|
|
5
|
-
from cognite.neat._issues._base import NeatWarning, _get_subclasses
|
|
5
|
+
from cognite.neat.core._issues._base import NeatWarning, _get_subclasses
|
|
6
6
|
|
|
7
7
|
from . import user_modeling
|
|
8
8
|
from ._external import (
|
|
@@ -4,8 +4,8 @@ from typing import ClassVar
|
|
|
4
4
|
|
|
5
5
|
from cognite.client.data_classes.data_modeling import DataModelId, ViewId
|
|
6
6
|
|
|
7
|
-
from cognite.neat._constants import DMS_VIEW_CONTAINER_SIZE_LIMIT
|
|
8
|
-
from cognite.neat._issues import NeatWarning
|
|
7
|
+
from cognite.neat.core._constants import DMS_VIEW_CONTAINER_SIZE_LIMIT
|
|
8
|
+
from cognite.neat.core._issues import NeatWarning
|
|
9
9
|
|
|
10
10
|
_BASE_URL = "https://cognite-neat.readthedocs-hosted.com/en/latest/data-modeling-principles.html"
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Generic
|
|
3
3
|
|
|
4
|
-
from cognite.neat._constants import DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT
|
|
5
|
-
from cognite.neat._issues._base import ResourceType
|
|
4
|
+
from cognite.neat.core._constants import DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT
|
|
5
|
+
from cognite.neat.core._issues._base import ResourceType
|
|
6
6
|
|
|
7
7
|
from ._resources import ResourceNeatWarning, T_Identifier, T_ReferenceIdentifier
|
|
8
8
|
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Generic
|
|
3
3
|
|
|
4
|
-
from cognite.neat._issues._base import
|
|
4
|
+
from cognite.neat.core._issues._base import (
|
|
5
|
+
NeatWarning,
|
|
6
|
+
ResourceType,
|
|
7
|
+
T_Identifier,
|
|
8
|
+
T_ReferenceIdentifier,
|
|
9
|
+
)
|
|
5
10
|
|
|
6
11
|
|
|
7
12
|
# Name ResourceNeatWarning to avoid conflicts with the built-in ResourceWarning
|
|
@@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|
|
7
7
|
|
|
8
8
|
from cognite.client.data_classes.data_modeling import ContainerId, ViewId
|
|
9
9
|
|
|
10
|
-
from cognite.neat._constants import DMS_CONTAINER_PROPERTY_SIZE_LIMIT
|
|
10
|
+
from cognite.neat.core._constants import DMS_CONTAINER_PROPERTY_SIZE_LIMIT
|
|
11
11
|
|
|
12
12
|
from ._models import UserModelingWarning
|
|
13
13
|
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Generic, TypeAlias, TypeVar
|
|
3
3
|
|
|
4
|
-
from cognite.neat._rules.models import (
|
|
4
|
+
from cognite.neat.core._rules.models import (
|
|
5
5
|
DMSRules,
|
|
6
6
|
InformationRules,
|
|
7
7
|
)
|
|
8
|
-
from cognite.neat._rules.models.dms._rules_input import DMSInputRules
|
|
9
|
-
from cognite.neat._rules.models.information._rules_input import
|
|
10
|
-
|
|
8
|
+
from cognite.neat.core._rules.models.dms._rules_input import DMSInputRules
|
|
9
|
+
from cognite.neat.core._rules.models.information._rules_input import (
|
|
10
|
+
InformationInputRules,
|
|
11
|
+
)
|
|
12
|
+
from cognite.neat.core._utils.spreadsheet import SpreadsheetRead
|
|
11
13
|
|
|
12
14
|
VerifiedRules: TypeAlias = InformationRules | DMSRules
|
|
13
15
|
|
|
@@ -11,16 +11,23 @@ import pandas as pd
|
|
|
11
11
|
from cognite.client import data_modeling as dm
|
|
12
12
|
from rdflib import URIRef
|
|
13
13
|
|
|
14
|
-
from cognite.neat._issues.errors import NeatValueError
|
|
15
|
-
from cognite.neat._issues.warnings import NeatValueWarning
|
|
16
|
-
from cognite.neat._rules.models import DMSRules, InformationRules
|
|
17
|
-
from cognite.neat._rules.models.dms import DMSProperty
|
|
18
|
-
from cognite.neat._rules.models.dms._rules import DMSView
|
|
19
|
-
from cognite.neat._rules.models.entities import
|
|
20
|
-
|
|
14
|
+
from cognite.neat.core._issues.errors import NeatValueError
|
|
15
|
+
from cognite.neat.core._issues.warnings import NeatValueWarning
|
|
16
|
+
from cognite.neat.core._rules.models import DMSRules, InformationRules
|
|
17
|
+
from cognite.neat.core._rules.models.dms import DMSProperty
|
|
18
|
+
from cognite.neat.core._rules.models.dms._rules import DMSView
|
|
19
|
+
from cognite.neat.core._rules.models.entities import (
|
|
20
|
+
ClassEntity,
|
|
21
|
+
MultiValueTypeInfo,
|
|
22
|
+
ViewEntity,
|
|
23
|
+
)
|
|
24
|
+
from cognite.neat.core._rules.models.entities._single_value import (
|
|
21
25
|
UnknownEntity,
|
|
22
26
|
)
|
|
23
|
-
from cognite.neat._rules.models.information import
|
|
27
|
+
from cognite.neat.core._rules.models.information import (
|
|
28
|
+
InformationClass,
|
|
29
|
+
InformationProperty,
|
|
30
|
+
)
|
|
24
31
|
|
|
25
32
|
T_Hashable = TypeVar("T_Hashable", bound=Hashable)
|
|
26
33
|
|
|
@@ -5,14 +5,14 @@ from pathlib import Path
|
|
|
5
5
|
from types import UnionType
|
|
6
6
|
from typing import TYPE_CHECKING, Generic, TypeVar, Union, get_args, get_origin
|
|
7
7
|
|
|
8
|
-
from cognite.neat._client import NeatClient
|
|
9
|
-
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
10
|
-
from cognite.neat._rules._shared import T_VerifiedRules
|
|
11
|
-
from cognite.neat._utils.auxiliary import class_html_doc
|
|
12
|
-
from cognite.neat._utils.upload import UploadResult, UploadResultList
|
|
8
|
+
from cognite.neat.core._client import NeatClient
|
|
9
|
+
from cognite.neat.core._constants import DEFAULT_NAMESPACE
|
|
10
|
+
from cognite.neat.core._rules._shared import T_VerifiedRules
|
|
11
|
+
from cognite.neat.core._utils.auxiliary import class_html_doc
|
|
12
|
+
from cognite.neat.core._utils.upload import UploadResult, UploadResultList
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
|
-
from cognite.neat._store._provenance import Agent as ProvenanceAgent
|
|
15
|
+
from cognite.neat.core._store._provenance import Agent as ProvenanceAgent
|
|
16
16
|
|
|
17
17
|
T_Export = TypeVar("T_Export")
|
|
18
18
|
|
|
@@ -36,7 +36,7 @@ class BaseExporter(ABC, Generic[T_VerifiedRules, T_Export]):
|
|
|
36
36
|
@property
|
|
37
37
|
def agent(self) -> "ProvenanceAgent":
|
|
38
38
|
"""Provenance agent for the importer."""
|
|
39
|
-
from cognite.neat._store._provenance import Agent as ProvenanceAgent
|
|
39
|
+
from cognite.neat.core._store._provenance import Agent as ProvenanceAgent
|
|
40
40
|
|
|
41
41
|
return ProvenanceAgent(id_=DEFAULT_NAMESPACE[f"agent/{type(self).__name__}"])
|
|
42
42
|
|
|
@@ -18,18 +18,24 @@ from cognite.client.data_classes.data_modeling import (
|
|
|
18
18
|
)
|
|
19
19
|
from cognite.client.exceptions import CogniteAPIError
|
|
20
20
|
|
|
21
|
-
from cognite.neat._client import DataModelingLoader, NeatClient
|
|
22
|
-
from cognite.neat._client._api.data_modeling_loaders import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
from cognite.neat.
|
|
21
|
+
from cognite.neat.core._client import DataModelingLoader, NeatClient
|
|
22
|
+
from cognite.neat.core._client._api.data_modeling_loaders import (
|
|
23
|
+
MultiCogniteAPIError,
|
|
24
|
+
T_WritableCogniteResourceList,
|
|
25
|
+
)
|
|
26
|
+
from cognite.neat.core._client.data_classes.data_modeling import (
|
|
27
|
+
Component,
|
|
28
|
+
ViewApplyDict,
|
|
29
|
+
)
|
|
30
|
+
from cognite.neat.core._client.data_classes.schema import DMSSchema
|
|
31
|
+
from cognite.neat.core._issues import IssueList
|
|
32
|
+
from cognite.neat.core._issues.warnings import (
|
|
27
33
|
PrincipleOneModelOneSpaceWarning,
|
|
28
34
|
ResourceRetrievalWarning,
|
|
29
35
|
)
|
|
30
|
-
from cognite.neat._rules.models.dms import DMSRules
|
|
31
|
-
from cognite.neat._shared import T_ID
|
|
32
|
-
from cognite.neat._utils.upload import UploadResult
|
|
36
|
+
from cognite.neat.core._rules.models.dms import DMSRules
|
|
37
|
+
from cognite.neat.core._shared import T_ID
|
|
38
|
+
from cognite.neat.core._utils.upload import UploadResult
|
|
33
39
|
|
|
34
40
|
from ._base import CDFExporter
|
|
35
41
|
|