cognite-neat 0.123.2__py3-none-any.whl → 0.127.30__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/__init__.py +2 -2
- cognite/neat/_client/__init__.py +4 -0
- cognite/neat/_client/api.py +8 -0
- cognite/neat/_client/client.py +21 -0
- cognite/neat/_client/config.py +40 -0
- cognite/neat/_client/containers_api.py +125 -0
- cognite/neat/_client/data_classes.py +44 -0
- cognite/neat/_client/data_model_api.py +115 -0
- cognite/neat/_client/spaces_api.py +115 -0
- cognite/neat/_client/statistics_api.py +24 -0
- cognite/neat/_client/views_api.py +129 -0
- cognite/neat/_config.py +185 -0
- cognite/neat/_data_model/_analysis.py +196 -0
- cognite/neat/_data_model/_constants.py +67 -0
- cognite/neat/_data_model/_identifiers.py +61 -0
- cognite/neat/_data_model/_shared.py +41 -0
- cognite/neat/_data_model/deployer/_differ.py +140 -0
- cognite/neat/_data_model/deployer/_differ_container.py +360 -0
- cognite/neat/_data_model/deployer/_differ_data_model.py +54 -0
- cognite/neat/_data_model/deployer/_differ_space.py +9 -0
- cognite/neat/_data_model/deployer/_differ_view.py +299 -0
- cognite/neat/_data_model/deployer/data_classes.py +529 -0
- cognite/neat/_data_model/deployer/deployer.py +401 -0
- cognite/neat/_data_model/exporters/__init__.py +15 -0
- cognite/neat/_data_model/exporters/_api_exporter.py +37 -0
- cognite/neat/_data_model/exporters/_base.py +24 -0
- cognite/neat/_data_model/exporters/_table_exporter/exporter.py +128 -0
- cognite/neat/_data_model/exporters/_table_exporter/workbook.py +409 -0
- cognite/neat/_data_model/exporters/_table_exporter/writer.py +421 -0
- cognite/neat/_data_model/importers/__init__.py +5 -0
- cognite/neat/_data_model/importers/_api_importer.py +166 -0
- cognite/neat/_data_model/importers/_base.py +16 -0
- cognite/neat/_data_model/importers/_table_importer/data_classes.py +295 -0
- cognite/neat/_data_model/importers/_table_importer/importer.py +192 -0
- cognite/neat/_data_model/importers/_table_importer/reader.py +1063 -0
- cognite/neat/_data_model/importers/_table_importer/source.py +94 -0
- cognite/neat/_data_model/models/conceptual/_base.py +18 -0
- cognite/neat/_data_model/models/conceptual/_concept.py +67 -0
- cognite/neat/_data_model/models/conceptual/_data_model.py +51 -0
- cognite/neat/_data_model/models/conceptual/_properties.py +104 -0
- cognite/neat/_data_model/models/conceptual/_property.py +105 -0
- cognite/neat/_data_model/models/dms/__init__.py +206 -0
- cognite/neat/_data_model/models/dms/_base.py +31 -0
- cognite/neat/_data_model/models/dms/_constants.py +48 -0
- cognite/neat/_data_model/models/dms/_constraints.py +42 -0
- cognite/neat/_data_model/models/dms/_container.py +159 -0
- cognite/neat/_data_model/models/dms/_data_model.py +95 -0
- cognite/neat/_data_model/models/dms/_data_types.py +195 -0
- cognite/neat/_data_model/models/dms/_http.py +28 -0
- cognite/neat/_data_model/models/dms/_indexes.py +30 -0
- cognite/neat/_data_model/models/dms/_limits.py +96 -0
- cognite/neat/_data_model/models/dms/_references.py +135 -0
- cognite/neat/_data_model/models/dms/_schema.py +18 -0
- cognite/neat/_data_model/models/dms/_space.py +48 -0
- cognite/neat/_data_model/models/dms/_types.py +17 -0
- cognite/neat/_data_model/models/dms/_view_filter.py +282 -0
- cognite/neat/_data_model/models/dms/_view_property.py +235 -0
- cognite/neat/_data_model/models/dms/_views.py +210 -0
- cognite/neat/_data_model/models/entities/__init__.py +50 -0
- cognite/neat/_data_model/models/entities/_base.py +101 -0
- cognite/neat/_data_model/models/entities/_constants.py +22 -0
- cognite/neat/_data_model/models/entities/_data_types.py +144 -0
- cognite/neat/_data_model/models/entities/_identifiers.py +61 -0
- cognite/neat/_data_model/models/entities/_parser.py +226 -0
- cognite/neat/_data_model/validation/dms/__init__.py +75 -0
- cognite/neat/_data_model/validation/dms/_ai_readiness.py +364 -0
- cognite/neat/_data_model/validation/dms/_base.py +307 -0
- cognite/neat/_data_model/validation/dms/_connections.py +638 -0
- cognite/neat/_data_model/validation/dms/_consistency.py +57 -0
- cognite/neat/_data_model/validation/dms/_containers.py +174 -0
- cognite/neat/_data_model/validation/dms/_limits.py +420 -0
- cognite/neat/_data_model/validation/dms/_orchestrator.py +222 -0
- cognite/neat/_data_model/validation/dms/_views.py +103 -0
- cognite/neat/_exceptions.py +56 -0
- cognite/neat/_issues.py +68 -0
- cognite/neat/_session/__init__.py +3 -0
- cognite/neat/_session/_html/_render.py +30 -0
- cognite/neat/_session/_html/static/__init__.py +8 -0
- cognite/neat/_session/_html/static/deployment.css +303 -0
- cognite/neat/_session/_html/static/deployment.js +150 -0
- cognite/neat/_session/_html/static/issues.css +211 -0
- cognite/neat/_session/_html/static/issues.js +168 -0
- cognite/neat/_session/_html/static/shared.css +186 -0
- cognite/neat/_session/_html/templates/__init__.py +4 -0
- cognite/neat/_session/_html/templates/deployment.html +75 -0
- cognite/neat/_session/_html/templates/issues.html +45 -0
- cognite/neat/_session/_issues.py +81 -0
- cognite/neat/_session/_opt.py +35 -0
- cognite/neat/_session/_physical.py +261 -0
- cognite/neat/_session/_result.py +236 -0
- cognite/neat/_session/_session.py +88 -0
- cognite/neat/_session/_usage_analytics/__init__.py +0 -0
- cognite/neat/_session/_usage_analytics/_collector.py +131 -0
- cognite/neat/_session/_usage_analytics/_constants.py +23 -0
- cognite/neat/_session/_usage_analytics/_storage.py +240 -0
- cognite/neat/_session/_wrappers.py +82 -0
- cognite/neat/_state_machine/__init__.py +10 -0
- cognite/neat/_state_machine/_base.py +37 -0
- cognite/neat/_state_machine/_states.py +52 -0
- cognite/neat/_store/__init__.py +3 -0
- cognite/neat/_store/_provenance.py +81 -0
- cognite/neat/_store/_store.py +156 -0
- cognite/neat/_utils/__init__.py +0 -0
- cognite/neat/_utils/_reader.py +194 -0
- cognite/neat/_utils/auxiliary.py +39 -0
- cognite/neat/_utils/collection.py +11 -0
- cognite/neat/_utils/http_client/__init__.py +39 -0
- cognite/neat/_utils/http_client/_client.py +245 -0
- cognite/neat/_utils/http_client/_config.py +19 -0
- cognite/neat/_utils/http_client/_data_classes.py +294 -0
- cognite/neat/_utils/http_client/_tracker.py +31 -0
- cognite/neat/_utils/text.py +71 -0
- cognite/neat/_utils/useful_types.py +37 -0
- cognite/neat/_utils/validation.py +154 -0
- cognite/neat/_version.py +1 -1
- cognite/neat/v0/__init__.py +0 -0
- cognite/neat/v0/core/__init__.py +0 -0
- cognite/neat/v0/core/_client/_api/__init__.py +0 -0
- cognite/neat/{core → v0/core}/_client/_api/data_modeling_loaders.py +86 -7
- cognite/neat/{core → v0/core}/_client/_api/neat_instances.py +5 -5
- cognite/neat/{core → v0/core}/_client/_api/schema.py +5 -5
- cognite/neat/{core → v0/core}/_client/_api/statistics.py +3 -3
- cognite/neat/{core → v0/core}/_client/_api_client.py +1 -1
- cognite/neat/v0/core/_client/data_classes/__init__.py +0 -0
- cognite/neat/{core → v0/core}/_client/data_classes/schema.py +4 -4
- cognite/neat/{core → v0/core}/_client/testing.py +1 -1
- cognite/neat/{core → v0/core}/_constants.py +10 -3
- cognite/neat/v0/core/_data_model/__init__.py +0 -0
- cognite/neat/{core → v0/core}/_data_model/_constants.py +9 -6
- cognite/neat/{core → v0/core}/_data_model/_shared.py +5 -5
- cognite/neat/{core → v0/core}/_data_model/analysis/_base.py +12 -8
- cognite/neat/{core → v0/core}/_data_model/exporters/__init__.py +1 -2
- cognite/neat/{core → v0/core}/_data_model/exporters/_base.py +7 -7
- cognite/neat/{core → v0/core}/_data_model/exporters/_data_model2dms.py +9 -9
- cognite/neat/{core → v0/core}/_data_model/exporters/_data_model2excel.py +13 -13
- cognite/neat/{core → v0/core}/_data_model/exporters/_data_model2instance_template.py +4 -4
- cognite/neat/{core/_data_model/exporters/_data_model2ontology.py → v0/core/_data_model/exporters/_data_model2semantic_model.py} +126 -133
- cognite/neat/{core → v0/core}/_data_model/exporters/_data_model2yaml.py +1 -1
- cognite/neat/{core → v0/core}/_data_model/importers/__init__.py +4 -6
- cognite/neat/{core → v0/core}/_data_model/importers/_base.py +5 -5
- cognite/neat/{core → v0/core}/_data_model/importers/_base_file_reader.py +2 -2
- cognite/neat/{core → v0/core}/_data_model/importers/_dict2data_model.py +6 -6
- cognite/neat/{core → v0/core}/_data_model/importers/_dms2data_model.py +19 -16
- cognite/neat/v0/core/_data_model/importers/_graph2data_model.py +299 -0
- cognite/neat/v0/core/_data_model/importers/_rdf/__init__.py +4 -0
- cognite/neat/{core → v0/core}/_data_model/importers/_rdf/_base.py +13 -13
- cognite/neat/{core → v0/core}/_data_model/importers/_rdf/_inference2rdata_model.py +14 -14
- cognite/neat/v0/core/_data_model/importers/_rdf/_owl2data_model.py +144 -0
- cognite/neat/v0/core/_data_model/importers/_rdf/_shared.py +255 -0
- cognite/neat/{core → v0/core}/_data_model/importers/_spreadsheet2data_model.py +94 -13
- cognite/neat/{core → v0/core}/_data_model/models/__init__.py +3 -3
- cognite/neat/{core → v0/core}/_data_model/models/_base_verified.py +5 -5
- cognite/neat/v0/core/_data_model/models/_import_contexts.py +82 -0
- cognite/neat/{core → v0/core}/_data_model/models/_types.py +5 -5
- cognite/neat/{core → v0/core}/_data_model/models/conceptual/_unverified.py +18 -12
- cognite/neat/v0/core/_data_model/models/conceptual/_validation.py +308 -0
- cognite/neat/{core → v0/core}/_data_model/models/conceptual/_verified.py +13 -11
- cognite/neat/{core → v0/core}/_data_model/models/data_types.py +14 -4
- cognite/neat/{core → v0/core}/_data_model/models/entities/__init__.py +6 -0
- cognite/neat/v0/core/_data_model/models/entities/_loaders.py +155 -0
- cognite/neat/{core → v0/core}/_data_model/models/entities/_multi_value.py +2 -2
- cognite/neat/v0/core/_data_model/models/entities/_restrictions.py +230 -0
- cognite/neat/{core → v0/core}/_data_model/models/entities/_single_value.py +121 -16
- cognite/neat/{core → v0/core}/_data_model/models/entities/_types.py +10 -0
- cognite/neat/{core → v0/core}/_data_model/models/mapping/_classic2core.py +5 -5
- cognite/neat/{core → v0/core}/_data_model/models/physical/__init__.py +1 -1
- cognite/neat/{core → v0/core}/_data_model/models/physical/_exporter.py +28 -21
- cognite/neat/{core → v0/core}/_data_model/models/physical/_unverified.py +141 -38
- cognite/neat/{core → v0/core}/_data_model/models/physical/_validation.py +190 -24
- cognite/neat/{core → v0/core}/_data_model/models/physical/_verified.py +135 -15
- cognite/neat/{core → v0/core}/_data_model/transformers/__init__.py +2 -0
- cognite/neat/{core → v0/core}/_data_model/transformers/_base.py +4 -4
- cognite/neat/{core → v0/core}/_data_model/transformers/_converters.py +39 -32
- cognite/neat/{core → v0/core}/_data_model/transformers/_mapping.py +7 -7
- cognite/neat/v0/core/_data_model/transformers/_union_conceptual.py +208 -0
- cognite/neat/{core → v0/core}/_data_model/transformers/_verification.py +7 -7
- cognite/neat/v0/core/_instances/__init__.py +0 -0
- cognite/neat/{core → v0/core}/_instances/_tracking/base.py +1 -1
- cognite/neat/{core → v0/core}/_instances/_tracking/log.py +1 -1
- cognite/neat/{core → v0/core}/_instances/extractors/__init__.py +1 -1
- cognite/neat/{core → v0/core}/_instances/extractors/_base.py +6 -6
- cognite/neat/v0/core/_instances/extractors/_classic_cdf/__init__.py +0 -0
- cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_base.py +7 -7
- cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_classic.py +12 -12
- cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_relationships.py +3 -3
- cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_sequences.py +2 -2
- cognite/neat/{core → v0/core}/_instances/extractors/_dict.py +6 -3
- cognite/neat/{core → v0/core}/_instances/extractors/_dms.py +6 -6
- cognite/neat/{core → v0/core}/_instances/extractors/_dms_graph.py +11 -11
- cognite/neat/{core → v0/core}/_instances/extractors/_mock_graph_generator.py +10 -10
- cognite/neat/{core → v0/core}/_instances/extractors/_raw.py +3 -3
- cognite/neat/{core → v0/core}/_instances/extractors/_rdf_file.py +7 -7
- cognite/neat/{core → v0/core}/_instances/loaders/_base.py +5 -5
- cognite/neat/{core → v0/core}/_instances/loaders/_rdf2dms.py +17 -17
- cognite/neat/{core → v0/core}/_instances/loaders/_rdf_to_instance_space.py +11 -11
- cognite/neat/{core → v0/core}/_instances/queries/_select.py +29 -3
- cognite/neat/{core → v0/core}/_instances/queries/_update.py +1 -1
- cognite/neat/{core → v0/core}/_instances/transformers/_base.py +4 -4
- cognite/neat/{core → v0/core}/_instances/transformers/_classic_cdf.py +6 -6
- cognite/neat/{core → v0/core}/_instances/transformers/_prune_graph.py +4 -4
- cognite/neat/{core → v0/core}/_instances/transformers/_rdfpath.py +1 -1
- cognite/neat/{core → v0/core}/_instances/transformers/_value_type.py +4 -4
- cognite/neat/{core → v0/core}/_issues/_base.py +11 -6
- cognite/neat/{core → v0/core}/_issues/_contextmanagers.py +8 -6
- cognite/neat/{core → v0/core}/_issues/_factory.py +11 -8
- cognite/neat/{core → v0/core}/_issues/errors/__init__.py +3 -1
- cognite/neat/{core → v0/core}/_issues/errors/_external.py +1 -1
- cognite/neat/{core → v0/core}/_issues/errors/_general.py +1 -1
- cognite/neat/{core → v0/core}/_issues/errors/_properties.py +12 -1
- cognite/neat/{core → v0/core}/_issues/errors/_resources.py +2 -2
- cognite/neat/{core → v0/core}/_issues/errors/_wrapper.py +7 -3
- cognite/neat/{core → v0/core}/_issues/warnings/__init__.py +5 -1
- cognite/neat/{core → v0/core}/_issues/warnings/_external.py +1 -1
- cognite/neat/{core → v0/core}/_issues/warnings/_general.py +1 -1
- cognite/neat/{core → v0/core}/_issues/warnings/_models.py +39 -4
- cognite/neat/{core → v0/core}/_issues/warnings/_properties.py +13 -2
- cognite/neat/{core → v0/core}/_issues/warnings/_resources.py +1 -1
- cognite/neat/{core → v0/core}/_issues/warnings/user_modeling.py +1 -1
- cognite/neat/{core → v0/core}/_store/_data_model.py +13 -12
- cognite/neat/{core → v0/core}/_store/_instance.py +45 -12
- cognite/neat/{core → v0/core}/_store/_provenance.py +3 -3
- cognite/neat/{core → v0/core}/_store/exceptions.py +4 -4
- cognite/neat/v0/core/_utils/__init__.py +0 -0
- cognite/neat/{core → v0/core}/_utils/auth.py +1 -1
- cognite/neat/{core → v0/core}/_utils/auxiliary.py +7 -1
- cognite/neat/{core → v0/core}/_utils/collection_.py +2 -2
- cognite/neat/{core → v0/core}/_utils/graph_transformations_report.py +1 -1
- cognite/neat/{core → v0/core}/_utils/rdf_.py +38 -14
- cognite/neat/{core → v0/core}/_utils/reader/_base.py +1 -1
- cognite/neat/{core → v0/core}/_utils/spreadsheet.py +22 -4
- cognite/neat/v0/core/_utils/tarjan.py +44 -0
- cognite/neat/{core → v0/core}/_utils/text.py +1 -1
- cognite/neat/{core → v0/core}/_utils/upload.py +3 -3
- cognite/neat/v0/plugins/__init__.py +4 -0
- cognite/neat/v0/plugins/_base.py +9 -0
- cognite/neat/v0/plugins/_data_model.py +48 -0
- cognite/neat/{plugins → v0/plugins}/_issues.py +1 -1
- cognite/neat/{plugins → v0/plugins}/_manager.py +7 -16
- cognite/neat/{session → v0/session}/_base.py +13 -10
- cognite/neat/{session → v0/session}/_collector.py +1 -1
- cognite/neat/v0/session/_diff.py +51 -0
- cognite/neat/{session → v0/session}/_drop.py +3 -3
- cognite/neat/{session → v0/session}/_explore.py +2 -2
- cognite/neat/{session → v0/session}/_fix.py +2 -2
- cognite/neat/{session → v0/session}/_inspect.py +3 -3
- cognite/neat/{session → v0/session}/_mapping.py +3 -3
- cognite/neat/{session → v0/session}/_plugin.py +4 -5
- cognite/neat/{session → v0/session}/_prepare.py +8 -8
- cognite/neat/{session → v0/session}/_read.py +33 -43
- cognite/neat/{session → v0/session}/_set.py +8 -8
- cognite/neat/{session → v0/session}/_show.py +5 -5
- cognite/neat/{session → v0/session}/_state.py +22 -8
- cognite/neat/{session → v0/session}/_subset.py +4 -4
- cognite/neat/{session → v0/session}/_template.py +11 -11
- cognite/neat/{session → v0/session}/_to.py +12 -12
- cognite/neat/{session → v0/session}/_wizard.py +1 -1
- cognite/neat/{session → v0/session}/engine/_load.py +1 -1
- cognite/neat/{session → v0/session}/exceptions.py +5 -5
- cognite/neat/v1.py +3 -0
- {cognite_neat-0.123.2.dist-info → cognite_neat-0.127.30.dist-info}/METADATA +9 -8
- cognite_neat-0.127.30.dist-info/RECORD +319 -0
- {cognite_neat-0.123.2.dist-info → cognite_neat-0.127.30.dist-info}/WHEEL +1 -1
- cognite/neat/core/_data_model/importers/_dtdl2data_model/__init__.py +0 -3
- cognite/neat/core/_data_model/importers/_dtdl2data_model/_unit_lookup.py +0 -224
- cognite/neat/core/_data_model/importers/_dtdl2data_model/dtdl_converter.py +0 -320
- cognite/neat/core/_data_model/importers/_dtdl2data_model/dtdl_importer.py +0 -155
- cognite/neat/core/_data_model/importers/_dtdl2data_model/spec.py +0 -363
- cognite/neat/core/_data_model/importers/_rdf/__init__.py +0 -5
- cognite/neat/core/_data_model/importers/_rdf/_imf2data_model.py +0 -98
- cognite/neat/core/_data_model/importers/_rdf/_owl2data_model.py +0 -87
- cognite/neat/core/_data_model/importers/_rdf/_shared.py +0 -168
- cognite/neat/core/_data_model/models/conceptual/_validation.py +0 -294
- cognite/neat/core/_data_model/models/entities/_loaders.py +0 -75
- cognite/neat/plugins/__init__.py +0 -3
- cognite/neat/plugins/data_model/importers/__init__.py +0 -5
- cognite/neat/plugins/data_model/importers/_base.py +0 -28
- cognite_neat-0.123.2.dist-info/RECORD +0 -197
- /cognite/neat/{core → _data_model}/__init__.py +0 -0
- /cognite/neat/{core/_client/_api → _data_model/deployer}/__init__.py +0 -0
- /cognite/neat/{core/_client/data_classes → _data_model/exporters/_table_exporter}/__init__.py +0 -0
- /cognite/neat/{core/_data_model → _data_model/importers/_table_importer}/__init__.py +0 -0
- /cognite/neat/{core/_instances → _data_model/models}/__init__.py +0 -0
- /cognite/neat/{core/_instances/extractors/_classic_cdf → _data_model/models/conceptual}/__init__.py +0 -0
- /cognite/neat/{core/_utils → _data_model/validation}/__init__.py +0 -0
- /cognite/neat/{plugins/data_model → _session/_html}/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_client/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_client/data_classes/data_modeling.py +0 -0
- /cognite/neat/{core → v0/core}/_client/data_classes/neat_sequence.py +0 -0
- /cognite/neat/{core → v0/core}/_client/data_classes/statistics.py +0 -0
- /cognite/neat/{core → v0/core}/_config.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/analysis/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/catalog/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/catalog/classic_model.xlsx +0 -0
- /cognite/neat/{core → v0/core}/_data_model/catalog/conceptual-imf-data-model.xlsx +0 -0
- /cognite/neat/{core → v0/core}/_data_model/catalog/hello_world_pump.xlsx +0 -0
- /cognite/neat/{core → v0/core}/_data_model/models/_base_unverified.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/models/conceptual/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/models/entities/_constants.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/models/entities/_wrapped.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/models/mapping/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_data_model/models/mapping/_classic2core.yaml +0 -0
- /cognite/neat/{core → v0/core}/_instances/_shared.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/_tracking/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- /cognite/neat/{core → v0/core}/_instances/examples/Knowledge-Graph-Nordic44.xml +0 -0
- /cognite/neat/{core → v0/core}/_instances/examples/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- /cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_assets.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_data_sets.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_events.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_files.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_labels.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/extractors/_classic_cdf/_timeseries.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/loaders/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/queries/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/queries/_base.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/queries/_queries.py +0 -0
- /cognite/neat/{core → v0/core}/_instances/transformers/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_issues/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_issues/formatters.py +0 -0
- /cognite/neat/{core → v0/core}/_shared.py +0 -0
- /cognite/neat/{core → v0/core}/_store/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_utils/io_.py +0 -0
- /cognite/neat/{core → v0/core}/_utils/reader/__init__.py +0 -0
- /cognite/neat/{core → v0/core}/_utils/time_.py +0 -0
- /cognite/neat/{core → v0/core}/_utils/xml_.py +0 -0
- /cognite/neat/{session → v0/session}/__init__.py +0 -0
- /cognite/neat/{session → v0/session}/_experimental.py +0 -0
- /cognite/neat/{session → v0/session}/_state/README.md +0 -0
- /cognite/neat/{session → v0/session}/engine/__init__.py +0 -0
- /cognite/neat/{session → v0/session}/engine/_import.py +0 -0
- /cognite/neat/{session → v0/session}/engine/_interface.py +0 -0
- {cognite_neat-0.123.2.dist-info → cognite_neat-0.127.30.dist-info}/licenses/LICENSE +0 -0
|
@@ -8,9 +8,10 @@ from cognite.client import data_modeling as dm
|
|
|
8
8
|
from pydantic import Field, field_serializer, field_validator, model_validator
|
|
9
9
|
from pydantic_core.core_schema import SerializationInfo, ValidationInfo
|
|
10
10
|
|
|
11
|
-
from cognite.neat.core._client.data_classes.schema import DMSSchema
|
|
12
|
-
from cognite.neat.core._constants import DMS_CONTAINER_LIST_MAX_LIMIT
|
|
13
|
-
from cognite.neat.core._data_model.
|
|
11
|
+
from cognite.neat.v0.core._client.data_classes.schema import DMSSchema
|
|
12
|
+
from cognite.neat.v0.core._constants import DMS_CONTAINER_LIST_MAX_LIMIT
|
|
13
|
+
from cognite.neat.v0.core._data_model._constants import CONSTRAINT_ID_MAX_LENGTH
|
|
14
|
+
from cognite.neat.v0.core._data_model.models._base_verified import (
|
|
14
15
|
BaseVerifiedDataModel,
|
|
15
16
|
BaseVerifiedMetadata,
|
|
16
17
|
ContainerProperty,
|
|
@@ -21,17 +22,17 @@ from cognite.neat.core._data_model.models._base_verified import (
|
|
|
21
22
|
ViewProperty,
|
|
22
23
|
ViewRef,
|
|
23
24
|
)
|
|
24
|
-
from cognite.neat.core._data_model.models._types import (
|
|
25
|
+
from cognite.neat.v0.core._data_model.models._types import (
|
|
25
26
|
ConceptEntityType,
|
|
26
27
|
ContainerEntityType,
|
|
27
28
|
PhysicalPropertyType,
|
|
28
|
-
StrListType,
|
|
29
29
|
URIRefType,
|
|
30
30
|
ViewEntityType,
|
|
31
31
|
)
|
|
32
|
-
from cognite.neat.core._data_model.models.data_types import DataType
|
|
33
|
-
from cognite.neat.core._data_model.models.entities import (
|
|
32
|
+
from cognite.neat.v0.core._data_model.models.data_types import DataType
|
|
33
|
+
from cognite.neat.v0.core._data_model.models.entities import (
|
|
34
34
|
ConceptualEntity,
|
|
35
|
+
ContainerIndexEntity,
|
|
35
36
|
DMSNodeEntity,
|
|
36
37
|
EdgeEntity,
|
|
37
38
|
HasDataFilter,
|
|
@@ -40,15 +41,19 @@ from cognite.neat.core._data_model.models.entities import (
|
|
|
40
41
|
PhysicalUnknownEntity,
|
|
41
42
|
RawFilter,
|
|
42
43
|
ReverseConnectionEntity,
|
|
44
|
+
Undefined,
|
|
43
45
|
ViewEntity,
|
|
44
46
|
ViewEntityList,
|
|
45
47
|
)
|
|
46
|
-
from cognite.neat.core._data_model.models.entities._types import
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
from cognite.neat.v0.core._data_model.models.entities._types import (
|
|
49
|
+
ContainerConstraintListType,
|
|
50
|
+
ContainerIndexListType,
|
|
51
|
+
)
|
|
52
|
+
from cognite.neat.v0.core._issues.errors import NeatValueError
|
|
53
|
+
from cognite.neat.v0.core._issues.warnings import NeatValueWarning, PropertyDefinitionWarning
|
|
49
54
|
|
|
50
55
|
if TYPE_CHECKING:
|
|
51
|
-
from cognite.neat.core._data_model.models import ConceptualDataModel
|
|
56
|
+
from cognite.neat.v0.core._data_model.models import ConceptualDataModel
|
|
52
57
|
|
|
53
58
|
_DEFAULT_VERSION = "1"
|
|
54
59
|
|
|
@@ -147,7 +152,7 @@ class PhysicalProperty(SheetRow):
|
|
|
147
152
|
alias="Index",
|
|
148
153
|
description="The names of the indexes (comma separated) that should be created for the property.",
|
|
149
154
|
)
|
|
150
|
-
constraint:
|
|
155
|
+
constraint: ContainerConstraintListType | None = Field(
|
|
151
156
|
None,
|
|
152
157
|
alias="Constraint",
|
|
153
158
|
description="The names of the uniquness (comma separated) that should be created for the property.",
|
|
@@ -257,6 +262,86 @@ class PhysicalProperty(SheetRow):
|
|
|
257
262
|
)
|
|
258
263
|
return value
|
|
259
264
|
|
|
265
|
+
@field_validator("index", mode="after")
|
|
266
|
+
@classmethod
|
|
267
|
+
def index_set_correctly(cls, value: list[ContainerIndexEntity] | None, info: ValidationInfo) -> Any:
|
|
268
|
+
if value is None:
|
|
269
|
+
return value
|
|
270
|
+
|
|
271
|
+
container = info.data["container"]
|
|
272
|
+
container_property = info.data["container_property"]
|
|
273
|
+
|
|
274
|
+
if not container or not container_property:
|
|
275
|
+
raise ValueError("Container and container property must be set to use indexes")
|
|
276
|
+
max_count = info.data.get("max_count")
|
|
277
|
+
is_list = (
|
|
278
|
+
max_count is not None and (isinstance(max_count, int | float) and max_count > 1)
|
|
279
|
+
) or max_count is float("inf")
|
|
280
|
+
for index in value:
|
|
281
|
+
if index.prefix is Undefined:
|
|
282
|
+
message = f"The type of index is not defined. Please set 'inverted:{index!s}' or 'btree:{index!s}'."
|
|
283
|
+
warnings.warn(
|
|
284
|
+
PropertyDefinitionWarning(str(container), "container property", str(container_property), message),
|
|
285
|
+
stacklevel=2,
|
|
286
|
+
)
|
|
287
|
+
elif index.prefix == "inverted" and not is_list:
|
|
288
|
+
message = (
|
|
289
|
+
"It is not recommended to use inverted index on non-list properties. "
|
|
290
|
+
"Please consider using btree index instead."
|
|
291
|
+
)
|
|
292
|
+
warnings.warn(
|
|
293
|
+
PropertyDefinitionWarning(str(container), "container property", str(container_property), message),
|
|
294
|
+
stacklevel=2,
|
|
295
|
+
)
|
|
296
|
+
elif index.prefix == "btree" and is_list:
|
|
297
|
+
message = (
|
|
298
|
+
"It is not recommended to use btree index on list properties. "
|
|
299
|
+
"Please consider using inverted index instead."
|
|
300
|
+
)
|
|
301
|
+
warnings.warn(
|
|
302
|
+
PropertyDefinitionWarning(str(container), "container property", str(container_property), message),
|
|
303
|
+
stacklevel=2,
|
|
304
|
+
)
|
|
305
|
+
if index.prefix == "inverted" and (index.cursorable is not None or index.by_space is not None):
|
|
306
|
+
message = "Cursorable and bySpace are not supported for inverted indexes. These will be ignored."
|
|
307
|
+
warnings.warn(
|
|
308
|
+
PropertyDefinitionWarning(str(container), "container property", str(container_property), message),
|
|
309
|
+
stacklevel=2,
|
|
310
|
+
)
|
|
311
|
+
return value
|
|
312
|
+
|
|
313
|
+
@field_validator("constraint", mode="after")
|
|
314
|
+
@classmethod
|
|
315
|
+
def constraint_set_correctly(cls, value: ContainerConstraintListType | None, info: ValidationInfo) -> Any:
|
|
316
|
+
if value is None:
|
|
317
|
+
return value
|
|
318
|
+
|
|
319
|
+
container = info.data["container"]
|
|
320
|
+
container_property = info.data["container_property"]
|
|
321
|
+
|
|
322
|
+
if not container or not container_property:
|
|
323
|
+
raise ValueError("Container and container property must be set to use constraint")
|
|
324
|
+
|
|
325
|
+
for constraint in value:
|
|
326
|
+
if constraint.prefix is Undefined:
|
|
327
|
+
message = f"The type of constraint is not defined. Please set 'uniqueness:{constraint!s}'."
|
|
328
|
+
warnings.warn(
|
|
329
|
+
PropertyDefinitionWarning(str(container), "container property", str(container_property), message),
|
|
330
|
+
stacklevel=2,
|
|
331
|
+
)
|
|
332
|
+
elif constraint.prefix != "uniqueness":
|
|
333
|
+
message = (
|
|
334
|
+
f"Unsupported constraint type on container property"
|
|
335
|
+
f" '{constraint.prefix}'. Currently only 'uniqueness' is supported."
|
|
336
|
+
)
|
|
337
|
+
raise ValueError(message) from None
|
|
338
|
+
|
|
339
|
+
if len(constraint.suffix) > CONSTRAINT_ID_MAX_LENGTH:
|
|
340
|
+
message = f"Constraint id '{constraint.suffix}' exceeds maximum length of {CONSTRAINT_ID_MAX_LENGTH}."
|
|
341
|
+
raise ValueError(message) from None
|
|
342
|
+
|
|
343
|
+
return value
|
|
344
|
+
|
|
260
345
|
@field_serializer("value_type", when_used="always")
|
|
261
346
|
def as_dms_type(self, value_type: DataType | EdgeEntity | ViewEntity, info: SerializationInfo) -> str:
|
|
262
347
|
if isinstance(value_type, DataType):
|
|
@@ -303,13 +388,46 @@ class PhysicalContainer(SheetRow):
|
|
|
303
388
|
description: str | None = Field(
|
|
304
389
|
alias="Description", default=None, description="Short description of the node being defined."
|
|
305
390
|
)
|
|
306
|
-
constraint:
|
|
391
|
+
constraint: ContainerConstraintListType | None = Field(
|
|
307
392
|
None, alias="Constraint", description="List of required (comma separated) constraints for the container"
|
|
308
393
|
)
|
|
309
394
|
used_for: Literal["node", "edge", "all"] | None = Field(
|
|
310
395
|
"all", alias="Used For", description=" Whether the container is used for nodes, edges or all."
|
|
311
396
|
)
|
|
312
397
|
|
|
398
|
+
@field_validator("constraint", mode="after")
|
|
399
|
+
@classmethod
|
|
400
|
+
def constraint_set_correctly(cls, value: ContainerConstraintListType | None) -> Any:
|
|
401
|
+
if value is None:
|
|
402
|
+
return value
|
|
403
|
+
|
|
404
|
+
for constraint in value:
|
|
405
|
+
if constraint.prefix is Undefined:
|
|
406
|
+
message = f"The type of constraint is not defined. Please set 'requires:{constraint!s}'."
|
|
407
|
+
warnings.warn(
|
|
408
|
+
message,
|
|
409
|
+
stacklevel=2,
|
|
410
|
+
)
|
|
411
|
+
elif constraint.prefix != "requires":
|
|
412
|
+
message = (
|
|
413
|
+
f"Unsupported constraint type on container as "
|
|
414
|
+
f"the whole '{constraint.prefix}'. Currently only 'requires' is supported."
|
|
415
|
+
)
|
|
416
|
+
raise ValueError(message) from None
|
|
417
|
+
|
|
418
|
+
if len(constraint.suffix) > CONSTRAINT_ID_MAX_LENGTH:
|
|
419
|
+
message = f"Constraint id '{constraint.suffix}' exceeds maximum length of {CONSTRAINT_ID_MAX_LENGTH}."
|
|
420
|
+
raise ValueError(message) from None
|
|
421
|
+
|
|
422
|
+
if constraint.require is None:
|
|
423
|
+
message = (
|
|
424
|
+
f"Container constraint must have a container set. "
|
|
425
|
+
f"Please set 'requires:{constraint!s}(container=space:external_id)'."
|
|
426
|
+
)
|
|
427
|
+
raise ValueError(message) from None
|
|
428
|
+
|
|
429
|
+
return value
|
|
430
|
+
|
|
313
431
|
def _identifier(self) -> tuple[Hashable, ...]:
|
|
314
432
|
return (self.container,)
|
|
315
433
|
|
|
@@ -317,8 +435,10 @@ class PhysicalContainer(SheetRow):
|
|
|
317
435
|
container_id = self.container.as_id()
|
|
318
436
|
constraints: dict[str, dm.Constraint] = {}
|
|
319
437
|
for constraint in self.constraint or []:
|
|
320
|
-
|
|
321
|
-
|
|
438
|
+
if constraint.require is None:
|
|
439
|
+
continue
|
|
440
|
+
requires = dm.RequiresConstraint(constraint.require.as_id())
|
|
441
|
+
constraints[constraint.suffix] = requires
|
|
322
442
|
|
|
323
443
|
return dm.ContainerApply(
|
|
324
444
|
space=container_id.space,
|
|
@@ -26,6 +26,7 @@ from ._converters import (
|
|
|
26
26
|
ToSolutionModel,
|
|
27
27
|
)
|
|
28
28
|
from ._mapping import AsParentPropertyId, MapOneToOne, PhysicalDataModelMapper
|
|
29
|
+
from ._union_conceptual import UnionConceptualDataModel
|
|
29
30
|
from ._verification import (
|
|
30
31
|
VerifyAnyDataModel,
|
|
31
32
|
VerifyConceptualDataModel,
|
|
@@ -61,6 +62,7 @@ __all__ = [
|
|
|
61
62
|
"ToEnterpriseModel",
|
|
62
63
|
"ToExtensionModel",
|
|
63
64
|
"ToSolutionModel",
|
|
65
|
+
"UnionConceptualDataModel",
|
|
64
66
|
"VerifiedDataModelTransformer",
|
|
65
67
|
"VerifyAnyDataModel",
|
|
66
68
|
"VerifyConceptualDataModel",
|
|
@@ -4,17 +4,17 @@ from functools import lru_cache
|
|
|
4
4
|
from types import UnionType
|
|
5
5
|
from typing import Generic, TypeVar, Union, get_args, get_origin
|
|
6
6
|
|
|
7
|
-
from cognite.neat.core._constants import DEFAULT_NAMESPACE
|
|
8
|
-
from cognite.neat.core._data_model._shared import (
|
|
7
|
+
from cognite.neat.v0.core._constants import DEFAULT_NAMESPACE
|
|
8
|
+
from cognite.neat.v0.core._data_model._shared import (
|
|
9
9
|
DataModel,
|
|
10
10
|
ImportedDataModel,
|
|
11
11
|
VerifiedDataModel,
|
|
12
12
|
)
|
|
13
|
-
from cognite.neat.core._data_model.models import (
|
|
13
|
+
from cognite.neat.v0.core._data_model.models import (
|
|
14
14
|
UnverifiedConceptualDataModel,
|
|
15
15
|
UnverifiedPhysicalDataModel,
|
|
16
16
|
)
|
|
17
|
-
from cognite.neat.core._store._provenance import Agent as ProvenanceAgent
|
|
17
|
+
from cognite.neat.v0.core._store._provenance import Agent as ProvenanceAgent
|
|
18
18
|
|
|
19
19
|
T_DataModelIn = TypeVar("T_DataModelIn", bound=DataModel)
|
|
20
20
|
T_DataModelOut = TypeVar("T_DataModelOut", bound=DataModel)
|
|
@@ -16,12 +16,12 @@ from cognite.client.utils.useful_types import SequenceNotStr
|
|
|
16
16
|
from pydantic import ValidationError
|
|
17
17
|
from rdflib import Namespace
|
|
18
18
|
|
|
19
|
-
from cognite.neat.core._client import NeatClient
|
|
20
|
-
from cognite.neat.core._client.data_classes.data_modeling import (
|
|
19
|
+
from cognite.neat.v0.core._client import NeatClient
|
|
20
|
+
from cognite.neat.v0.core._client.data_classes.data_modeling import (
|
|
21
21
|
ContainerApplyDict,
|
|
22
22
|
ViewApplyDict,
|
|
23
23
|
)
|
|
24
|
-
from cognite.neat.core._constants import (
|
|
24
|
+
from cognite.neat.v0.core._constants import (
|
|
25
25
|
COGNITE_CONCEPTS,
|
|
26
26
|
COGNITE_MODELS,
|
|
27
27
|
COGNITE_SPACES,
|
|
@@ -29,15 +29,16 @@ from cognite.neat.core._constants import (
|
|
|
29
29
|
DMS_RESERVED_PROPERTIES,
|
|
30
30
|
get_default_prefixes_and_namespaces,
|
|
31
31
|
)
|
|
32
|
-
from cognite.neat.core._data_model._constants import PATTERNS, get_reserved_words
|
|
33
|
-
from cognite.neat.core._data_model._shared import (
|
|
32
|
+
from cognite.neat.v0.core._data_model._constants import CONSTRAINT_ID_MAX_LENGTH, PATTERNS, get_reserved_words
|
|
33
|
+
from cognite.neat.v0.core._data_model._shared import (
|
|
34
|
+
ImportContext,
|
|
34
35
|
ImportedDataModel,
|
|
35
36
|
ImportedUnverifiedDataModel,
|
|
36
37
|
VerifiedDataModel,
|
|
37
38
|
)
|
|
38
|
-
from cognite.neat.core._data_model.analysis import DataModelAnalysis
|
|
39
|
-
from cognite.neat.core._data_model.importers import DMSImporter
|
|
40
|
-
from cognite.neat.core._data_model.models import (
|
|
39
|
+
from cognite.neat.v0.core._data_model.analysis import DataModelAnalysis
|
|
40
|
+
from cognite.neat.v0.core._data_model.importers import DMSImporter
|
|
41
|
+
from cognite.neat.v0.core._data_model.models import (
|
|
41
42
|
ConceptualDataModel,
|
|
42
43
|
PhysicalDataModel,
|
|
43
44
|
SheetList,
|
|
@@ -45,14 +46,14 @@ from cognite.neat.core._data_model.models import (
|
|
|
45
46
|
UnverifiedPhysicalDataModel,
|
|
46
47
|
data_types,
|
|
47
48
|
)
|
|
48
|
-
from cognite.neat.core._data_model.models.conceptual import (
|
|
49
|
+
from cognite.neat.v0.core._data_model.models.conceptual import (
|
|
49
50
|
Concept,
|
|
50
51
|
ConceptualMetadata,
|
|
51
52
|
ConceptualProperty,
|
|
52
53
|
UnverifiedConcept,
|
|
53
54
|
UnverifiedConceptualProperty,
|
|
54
55
|
)
|
|
55
|
-
from cognite.neat.core._data_model.models.data_types import (
|
|
56
|
+
from cognite.neat.v0.core._data_model.models.data_types import (
|
|
56
57
|
AnyURI,
|
|
57
58
|
DataType,
|
|
58
59
|
Enum,
|
|
@@ -60,7 +61,7 @@ from cognite.neat.core._data_model.models.data_types import (
|
|
|
60
61
|
String,
|
|
61
62
|
Timeseries,
|
|
62
63
|
)
|
|
63
|
-
from cognite.neat.core._data_model.models.entities import (
|
|
64
|
+
from cognite.neat.v0.core._data_model.models.entities import (
|
|
64
65
|
ConceptEntity,
|
|
65
66
|
ContainerEntity,
|
|
66
67
|
EdgeEntity,
|
|
@@ -71,30 +72,30 @@ from cognite.neat.core._data_model.models.entities import (
|
|
|
71
72
|
UnknownEntity,
|
|
72
73
|
ViewEntity,
|
|
73
74
|
)
|
|
74
|
-
from cognite.neat.core._data_model.models.
|
|
75
|
+
from cognite.neat.v0.core._data_model.models.entities._single_value import ContainerConstraintEntity
|
|
76
|
+
from cognite.neat.v0.core._data_model.models.physical import (
|
|
75
77
|
PhysicalMetadata,
|
|
76
78
|
PhysicalProperty,
|
|
77
79
|
PhysicalValidation,
|
|
78
80
|
PhysicalView,
|
|
79
81
|
)
|
|
80
|
-
from cognite.neat.core._data_model.models.physical._verified import (
|
|
82
|
+
from cognite.neat.v0.core._data_model.models.physical._verified import (
|
|
81
83
|
PhysicalContainer,
|
|
82
84
|
PhysicalEnum,
|
|
83
85
|
PhysicalNodeType,
|
|
84
86
|
)
|
|
85
|
-
from cognite.neat.core._issues import IssueList
|
|
86
|
-
from cognite.neat.core._issues._factory import from_pydantic_errors
|
|
87
|
-
from cognite.neat.core._issues.errors import CDFMissingClientError, NeatValueError
|
|
88
|
-
from cognite.neat.core._issues.warnings import (
|
|
87
|
+
from cognite.neat.v0.core._issues import IssueList
|
|
88
|
+
from cognite.neat.v0.core._issues._factory import from_pydantic_errors
|
|
89
|
+
from cognite.neat.v0.core._issues.errors import CDFMissingClientError, NeatValueError
|
|
90
|
+
from cognite.neat.v0.core._issues.warnings import (
|
|
89
91
|
NeatValueWarning,
|
|
90
92
|
PropertyOverwritingWarning,
|
|
91
93
|
)
|
|
92
|
-
from cognite.neat.core._issues.warnings._models import (
|
|
94
|
+
from cognite.neat.v0.core._issues.warnings._models import (
|
|
93
95
|
SolutionModelBuildOnTopOfCDMWarning,
|
|
94
96
|
)
|
|
95
|
-
from cognite.neat.core._utils.rdf_ import get_inheritance_path
|
|
96
|
-
from cognite.neat.core._utils.
|
|
97
|
-
from cognite.neat.core._utils.text import (
|
|
97
|
+
from cognite.neat.v0.core._utils.rdf_ import get_inheritance_path
|
|
98
|
+
from cognite.neat.v0.core._utils.text import (
|
|
98
99
|
NamingStandardization,
|
|
99
100
|
humanize_collection,
|
|
100
101
|
title,
|
|
@@ -1437,7 +1438,7 @@ class _ConceptualDataModelConverter:
|
|
|
1437
1438
|
ignore_undefined_value_types: bool = False,
|
|
1438
1439
|
reserved_properties: Literal["error", "warning"] = "error",
|
|
1439
1440
|
) -> "PhysicalDataModel":
|
|
1440
|
-
from cognite.neat.core._data_model.models.physical._verified import (
|
|
1441
|
+
from cognite.neat.v0.core._data_model.models.physical._verified import (
|
|
1441
1442
|
PhysicalContainer,
|
|
1442
1443
|
PhysicalDataModel,
|
|
1443
1444
|
PhysicalProperty,
|
|
@@ -1638,19 +1639,25 @@ class _ConceptualDataModelConverter:
|
|
|
1638
1639
|
default_space: str,
|
|
1639
1640
|
concept_by_concept_entity: dict[ConceptEntity, Concept],
|
|
1640
1641
|
referenced_containers: Collection[ContainerEntity],
|
|
1641
|
-
) -> list[
|
|
1642
|
-
constrains: list[
|
|
1642
|
+
) -> list[ContainerConstraintEntity]:
|
|
1643
|
+
constrains: list[ContainerConstraintEntity] = []
|
|
1643
1644
|
for entity in concept_entities:
|
|
1644
1645
|
concept = concept_by_concept_entity[entity]
|
|
1645
1646
|
for parent in concept.implements or []:
|
|
1646
1647
|
parent_entity = parent.as_container_entity(default_space)
|
|
1647
1648
|
if parent_entity in referenced_containers:
|
|
1648
|
-
constrains.append(
|
|
1649
|
+
constrains.append(
|
|
1650
|
+
ContainerConstraintEntity(
|
|
1651
|
+
prefix="requires",
|
|
1652
|
+
suffix=f"{parent_entity.space}_{parent_entity.external_id}"[:CONSTRAINT_ID_MAX_LENGTH],
|
|
1653
|
+
require=parent_entity,
|
|
1654
|
+
)
|
|
1655
|
+
)
|
|
1649
1656
|
return constrains
|
|
1650
1657
|
|
|
1651
1658
|
@classmethod
|
|
1652
1659
|
def _convert_conceptual_to_physical_metadata(cls, metadata: ConceptualMetadata) -> "PhysicalMetadata":
|
|
1653
|
-
from cognite.neat.core._data_model.models.physical._verified import (
|
|
1660
|
+
from cognite.neat.v0.core._data_model.models.physical._verified import (
|
|
1654
1661
|
PhysicalMetadata,
|
|
1655
1662
|
)
|
|
1656
1663
|
|
|
@@ -1676,7 +1683,7 @@ class _ConceptualDataModelConverter:
|
|
|
1676
1683
|
edge_value_types_by_concept_property_pair: dict[tuple[ConceptEntity, str], ConceptEntity],
|
|
1677
1684
|
end_node_by_edge: dict[ConceptEntity, ConceptEntity],
|
|
1678
1685
|
) -> "PhysicalProperty":
|
|
1679
|
-
from cognite.neat.core._data_model.models.physical._verified import PhysicalProperty
|
|
1686
|
+
from cognite.neat.v0.core._data_model.models.physical._verified import PhysicalProperty
|
|
1680
1687
|
|
|
1681
1688
|
# returns property type, which can be ObjectProperty or DatatypeProperty
|
|
1682
1689
|
value_type = self._get_value_type(
|
|
@@ -2012,7 +2019,7 @@ class _PhysicalDataModelConverter:
|
|
|
2012
2019
|
def as_conceptual_data_model(
|
|
2013
2020
|
self,
|
|
2014
2021
|
) -> "ConceptualDataModel":
|
|
2015
|
-
from cognite.neat.core._data_model.models.conceptual._verified import (
|
|
2022
|
+
from cognite.neat.v0.core._data_model.models.conceptual._verified import (
|
|
2016
2023
|
Concept,
|
|
2017
2024
|
ConceptualDataModel,
|
|
2018
2025
|
ConceptualProperty,
|
|
@@ -2090,7 +2097,7 @@ class _PhysicalDataModelConverter:
|
|
|
2090
2097
|
|
|
2091
2098
|
@classmethod
|
|
2092
2099
|
def _convert_physical_to_conceptual_metadata(cls, metadata: PhysicalMetadata) -> "ConceptualMetadata":
|
|
2093
|
-
from cognite.neat.core._data_model.models.conceptual._verified import (
|
|
2100
|
+
from cognite.neat.v0.core._data_model.models.conceptual._verified import (
|
|
2094
2101
|
ConceptualMetadata,
|
|
2095
2102
|
)
|
|
2096
2103
|
|
|
@@ -2412,13 +2419,13 @@ class AddCogniteProperties(
|
|
|
2412
2419
|
concepts=new_classes,
|
|
2413
2420
|
prefixes=input_.prefixes,
|
|
2414
2421
|
),
|
|
2415
|
-
context=
|
|
2422
|
+
context=None,
|
|
2416
2423
|
)
|
|
2417
2424
|
|
|
2418
2425
|
@staticmethod
|
|
2419
2426
|
def _get_properties_by_concepts(
|
|
2420
2427
|
properties: list[UnverifiedConceptualProperty],
|
|
2421
|
-
read_context:
|
|
2428
|
+
read_context: ImportContext | None,
|
|
2422
2429
|
default_space: str,
|
|
2423
2430
|
) -> dict[ConceptEntity, dict[str, UnverifiedConceptualProperty]]:
|
|
2424
2431
|
issues = IssueList()
|
|
@@ -2438,7 +2445,7 @@ class AddCogniteProperties(
|
|
|
2438
2445
|
@staticmethod
|
|
2439
2446
|
def _get_dependencies_by_concepts(
|
|
2440
2447
|
concepts: list[UnverifiedConcept],
|
|
2441
|
-
read_context:
|
|
2448
|
+
read_context: ImportContext | None,
|
|
2442
2449
|
default_space: str,
|
|
2443
2450
|
) -> dict[ConceptEntity, set[ConceptEntity]]:
|
|
2444
2451
|
dependencies_by_concepts: dict[ConceptEntity, set[ConceptEntity]] = {}
|
|
@@ -5,25 +5,25 @@ from typing import Any, ClassVar, Literal
|
|
|
5
5
|
|
|
6
6
|
from cognite.client import data_modeling as dm
|
|
7
7
|
|
|
8
|
-
from cognite.neat.core._client import NeatClient
|
|
9
|
-
from cognite.neat.core._data_model.models import PhysicalDataModel, SheetList
|
|
10
|
-
from cognite.neat.core._data_model.models.data_types import Enum
|
|
11
|
-
from cognite.neat.core._data_model.models.entities import (
|
|
8
|
+
from cognite.neat.v0.core._client import NeatClient
|
|
9
|
+
from cognite.neat.v0.core._data_model.models import PhysicalDataModel, SheetList
|
|
10
|
+
from cognite.neat.v0.core._data_model.models.data_types import Enum
|
|
11
|
+
from cognite.neat.v0.core._data_model.models.entities import (
|
|
12
12
|
ConceptEntity,
|
|
13
13
|
ContainerEntity,
|
|
14
14
|
ViewEntity,
|
|
15
15
|
)
|
|
16
|
-
from cognite.neat.core._data_model.models.physical import (
|
|
16
|
+
from cognite.neat.v0.core._data_model.models.physical import (
|
|
17
17
|
PhysicalContainer,
|
|
18
18
|
PhysicalEnum,
|
|
19
19
|
PhysicalProperty,
|
|
20
20
|
)
|
|
21
|
-
from cognite.neat.core._issues.errors import (
|
|
21
|
+
from cognite.neat.v0.core._issues.errors import (
|
|
22
22
|
CDFMissingClientError,
|
|
23
23
|
NeatValueError,
|
|
24
24
|
ResourceNotFoundError,
|
|
25
25
|
)
|
|
26
|
-
from cognite.neat.core._issues.warnings import PropertyOverwritingWarning
|
|
26
|
+
from cognite.neat.v0.core._issues.warnings import PropertyOverwritingWarning
|
|
27
27
|
|
|
28
28
|
from ._base import VerifiedDataModelTransformer
|
|
29
29
|
|