cognite-neat 0.123.24__py3-none-any.whl → 1.0.22__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 +4 -3
- cognite/neat/_client/__init__.py +5 -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 +138 -0
- cognite/neat/_client/data_classes.py +44 -0
- cognite/neat/_client/data_model_api.py +115 -0
- cognite/neat/_client/init/credentials.py +70 -0
- cognite/neat/_client/init/env_vars.py +131 -0
- cognite/neat/_client/init/main.py +51 -0
- cognite/neat/_client/spaces_api.py +115 -0
- cognite/neat/_client/statistics_api.py +24 -0
- cognite/neat/_client/views_api.py +144 -0
- cognite/neat/_config.py +266 -0
- cognite/neat/_data_model/_analysis.py +571 -0
- cognite/neat/_data_model/_constants.py +74 -0
- cognite/neat/_data_model/_identifiers.py +61 -0
- cognite/neat/_data_model/_shared.py +41 -0
- cognite/neat/_data_model/_snapshot.py +134 -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 +644 -0
- cognite/neat/_data_model/deployer/deployer.py +431 -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 +480 -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 +344 -0
- cognite/neat/_data_model/importers/_table_importer/importer.py +192 -0
- cognite/neat/_data_model/importers/_table_importer/reader.py +1102 -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 +141 -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 +310 -0
- cognite/neat/_data_model/models/dms/_view_property.py +235 -0
- cognite/neat/_data_model/models/dms/_views.py +216 -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 +381 -0
- cognite/neat/_data_model/validation/dms/_base.py +25 -0
- cognite/neat/_data_model/validation/dms/_connections.py +681 -0
- cognite/neat/_data_model/validation/dms/_consistency.py +58 -0
- cognite/neat/_data_model/validation/dms/_containers.py +199 -0
- cognite/neat/_data_model/validation/dms/_limits.py +368 -0
- cognite/neat/_data_model/validation/dms/_orchestrator.py +70 -0
- cognite/neat/_data_model/validation/dms/_views.py +164 -0
- cognite/neat/_exceptions.py +68 -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 +476 -0
- cognite/neat/_session/_html/static/deployment.js +181 -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 +80 -0
- cognite/neat/_session/_html/templates/issues.html +45 -0
- cognite/neat/_session/_issues.py +81 -0
- cognite/neat/_session/_physical.py +294 -0
- cognite/neat/_session/_result/__init__.py +3 -0
- cognite/neat/_session/_result/_deployment/__init__.py +0 -0
- cognite/neat/_session/_result/_deployment/_physical/__init__.py +0 -0
- cognite/neat/_session/_result/_deployment/_physical/_changes.py +196 -0
- cognite/neat/_session/_result/_deployment/_physical/_statistics.py +180 -0
- cognite/neat/_session/_result/_deployment/_physical/serializer.py +35 -0
- cognite/neat/_session/_result/_result.py +31 -0
- cognite/neat/_session/_session.py +81 -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 +101 -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 +88 -0
- cognite/neat/_store/_store.py +220 -0
- cognite/neat/_utils/__init__.py +0 -0
- cognite/neat/_utils/_reader.py +194 -0
- cognite/neat/_utils/auxiliary.py +49 -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/repo.py +19 -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/_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 +8 -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 +5 -3
- cognite/neat/_v0/core/_data_model/__init__.py +0 -0
- cognite/neat/{core → _v0/core}/_data_model/_constants.py +7 -0
- cognite/neat/{core → _v0/core}/_data_model/_shared.py +4 -4
- cognite/neat/{core → _v0/core}/_data_model/analysis/_base.py +8 -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 +12 -12
- 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 -116
- cognite/neat/{core → _v0/core}/_data_model/exporters/_data_model2yaml.py +1 -1
- 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 +5 -5
- cognite/neat/{core → _v0/core}/_data_model/importers/_dms2data_model.py +18 -15
- cognite/neat/{core → _v0/core}/_data_model/importers/_graph2data_model.py +12 -12
- cognite/neat/{core → _v0/core}/_data_model/importers/_rdf/_base.py +12 -12
- 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/{core → _v0/core}/_data_model/importers/_rdf/_shared.py +17 -13
- cognite/neat/{core → _v0/core}/_data_model/importers/_spreadsheet2data_model.py +92 -12
- 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/{core → _v0/core}/_data_model/models/_import_contexts.py +1 -1
- cognite/neat/{core → _v0/core}/_data_model/models/_types.py +5 -5
- cognite/neat/{core → _v0/core}/_data_model/models/conceptual/_unverified.py +16 -10
- cognite/neat/{core → _v0/core}/_data_model/models/conceptual/_validation.py +12 -12
- cognite/neat/{core → _v0/core}/_data_model/models/conceptual/_verified.py +9 -9
- 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 +26 -19
- cognite/neat/{core → _v0/core}/_data_model/models/physical/_unverified.py +133 -37
- cognite/neat/{core → _v0/core}/_data_model/models/physical/_validation.py +24 -20
- cognite/neat/{core → _v0/core}/_data_model/models/physical/_verified.py +95 -24
- cognite/neat/{core → _v0/core}/_data_model/transformers/_base.py +4 -4
- cognite/neat/{core → _v0/core}/_data_model/transformers/_converters.py +35 -28
- cognite/neat/{core → _v0/core}/_data_model/transformers/_mapping.py +7 -7
- cognite/neat/{core → _v0/core}/_data_model/transformers/_union_conceptual.py +5 -5
- 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 +3 -2
- 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 +5 -5
- cognite/neat/{core → _v0/core}/_issues/_contextmanagers.py +1 -1
- cognite/neat/{core → _v0/core}/_issues/_factory.py +3 -3
- cognite/neat/{core → _v0/core}/_issues/errors/__init__.py +1 -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 +1 -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 +1 -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 +2 -2
- cognite/neat/{core → _v0/core}/_issues/warnings/_properties.py +2 -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 +12 -12
- cognite/neat/{core → _v0/core}/_store/_instance.py +43 -10
- 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 +22 -12
- cognite/neat/{core → _v0/core}/_utils/auxiliary.py +1 -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 +1 -1
- cognite/neat/{core → _v0/core}/_utils/reader/_base.py +1 -1
- cognite/neat/{core → _v0/core}/_utils/spreadsheet.py +18 -4
- cognite/neat/{core → _v0/core}/_utils/text.py +1 -1
- cognite/neat/{core → _v0/core}/_utils/upload.py +3 -3
- cognite/neat/{session → _v0}/engine/_load.py +1 -1
- 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 -15
- 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 +34 -21
- 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 +10 -10
- 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}/exceptions.py +5 -5
- cognite/neat/_version.py +1 -1
- cognite/neat/legacy.py +6 -0
- cognite_neat-1.0.22.dist-info/METADATA +123 -0
- cognite_neat-1.0.22.dist-info/RECORD +329 -0
- cognite_neat-1.0.22.dist-info/WHEEL +4 -0
- cognite/neat/core/_data_model/importers/_rdf/_owl2data_model.py +0 -91
- 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/session/_session/_data_model/__init__.py +0 -3
- cognite/neat/session/_session/_data_model/_read.py +0 -193
- cognite/neat/session/_session/_data_model/_routes.py +0 -45
- cognite/neat/session/_session/_data_model/_show.py +0 -147
- cognite/neat/session/_session/_data_model/_write.py +0 -335
- cognite_neat-0.123.24.dist-info/METADATA +0 -144
- cognite_neat-0.123.24.dist-info/RECORD +0 -201
- cognite_neat-0.123.24.dist-info/WHEEL +0 -4
- cognite_neat-0.123.24.dist-info/licenses/LICENSE +0 -201
- /cognite/neat/{core → _client/init}/__init__.py +0 -0
- /cognite/neat/{core/_client/_api → _data_model}/__init__.py +0 -0
- /cognite/neat/{core/_client/data_classes → _data_model/deployer}/__init__.py +0 -0
- /cognite/neat/{core/_data_model → _data_model/exporters/_table_exporter}/__init__.py +0 -0
- /cognite/neat/{core/_instances → _data_model/importers/_table_importer}/__init__.py +0 -0
- /cognite/neat/{core/_instances/extractors/_classic_cdf → _data_model/models}/__init__.py +0 -0
- /cognite/neat/{core/_utils → _data_model/models/conceptual}/__init__.py +0 -0
- /cognite/neat/{plugins/data_model → _data_model/validation}/__init__.py +0 -0
- /cognite/neat/{session/_session → _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/importers/__init__.py +0 -0
- /cognite/neat/{core → _v0/core}/_data_model/importers/_rdf/__init__.py +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}/_data_model/transformers/__init__.py +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/tarjan.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}/engine/__init__.py +0 -0
- /cognite/neat/{session → _v0}/engine/_import.py +0 -0
- /cognite/neat/{session → _v0}/engine/_interface.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
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
from cognite.neat._data_model.models.dms import (
|
|
2
|
+
ContainerPropertyDefinition,
|
|
3
|
+
ContainerReference,
|
|
4
|
+
ContainerRequest,
|
|
5
|
+
ViewPropertyDefinition,
|
|
6
|
+
ViewRequest,
|
|
7
|
+
)
|
|
8
|
+
from cognite.neat._data_model.models.dms._view_property import (
|
|
9
|
+
EdgeProperty,
|
|
10
|
+
ReverseDirectRelationProperty,
|
|
11
|
+
ViewCoreProperty,
|
|
12
|
+
ViewCorePropertyRequest,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
from ._differ import ItemDiffer, ObjectDiffer, field_differences
|
|
16
|
+
from ._differ_container import ContainerPropertyDiffer
|
|
17
|
+
from .data_classes import (
|
|
18
|
+
AddedField,
|
|
19
|
+
ChangedField,
|
|
20
|
+
FieldChange,
|
|
21
|
+
RemovedField,
|
|
22
|
+
SeverityType,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ViewDiffer(ItemDiffer[ViewRequest]):
|
|
27
|
+
def __init__(
|
|
28
|
+
self,
|
|
29
|
+
current_container_map: dict[ContainerReference, ContainerRequest],
|
|
30
|
+
new_container_map: dict[ContainerReference, ContainerRequest],
|
|
31
|
+
parent_path: str | None = None,
|
|
32
|
+
):
|
|
33
|
+
super().__init__(parent_path)
|
|
34
|
+
self._current_container_map = current_container_map
|
|
35
|
+
self._new_containe_map = new_container_map
|
|
36
|
+
|
|
37
|
+
def diff(self, current: ViewRequest, new: ViewRequest) -> list[FieldChange]:
|
|
38
|
+
changes: list[FieldChange] = []
|
|
39
|
+
if current.implements != new.implements:
|
|
40
|
+
# Added implements
|
|
41
|
+
current_implements = set(current.implements or [])
|
|
42
|
+
for new_implements in new.implements or []:
|
|
43
|
+
if new_implements not in current_implements:
|
|
44
|
+
changes.append(
|
|
45
|
+
AddedField(
|
|
46
|
+
item_severity=SeverityType.BREAKING,
|
|
47
|
+
field_path="implements",
|
|
48
|
+
new_value=new_implements,
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# Removed implements
|
|
53
|
+
new_implements = set(new.implements or [])
|
|
54
|
+
for current_implements in current.implements or []:
|
|
55
|
+
if current_implements not in new_implements:
|
|
56
|
+
changes.append(
|
|
57
|
+
RemovedField(
|
|
58
|
+
item_severity=SeverityType.BREAKING,
|
|
59
|
+
field_path="implements",
|
|
60
|
+
current_value=current_implements,
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
if not changes:
|
|
65
|
+
# If there are no added or removed implements, it means the order has changed
|
|
66
|
+
changes.append(
|
|
67
|
+
ChangedField(
|
|
68
|
+
item_severity=SeverityType.SAFE,
|
|
69
|
+
field_path="implements",
|
|
70
|
+
current_value=str(current.implements),
|
|
71
|
+
new_value=str(new.implements),
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
changes.extend(self._diff_name_description(current, new))
|
|
76
|
+
|
|
77
|
+
if current.filter != new.filter:
|
|
78
|
+
changes.append(
|
|
79
|
+
ChangedField(
|
|
80
|
+
field_path=self._get_path("filter"),
|
|
81
|
+
item_severity=SeverityType.WARNING,
|
|
82
|
+
new_value=str(new.filter),
|
|
83
|
+
current_value=str(current.filter),
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
changes.extend(
|
|
88
|
+
# MyPy fails to recognize that ViewPropertyDefinition and
|
|
89
|
+
# the union ViewRequestProperty are the same here.
|
|
90
|
+
field_differences( # type: ignore[misc]
|
|
91
|
+
"properties",
|
|
92
|
+
current.properties,
|
|
93
|
+
new.properties,
|
|
94
|
+
add_severity=SeverityType.SAFE,
|
|
95
|
+
remove_severity=SeverityType.BREAKING,
|
|
96
|
+
differ=ViewPropertyDiffer(
|
|
97
|
+
self._current_container_map, self._new_containe_map, self._get_path("properties")
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
return changes
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class ViewPropertyDiffer(ObjectDiffer[ViewPropertyDefinition]):
|
|
106
|
+
def __init__(
|
|
107
|
+
self,
|
|
108
|
+
current_container_map: dict[ContainerReference, ContainerRequest],
|
|
109
|
+
new_container_map: dict[ContainerReference, ContainerRequest],
|
|
110
|
+
parent_path: str | None = None,
|
|
111
|
+
):
|
|
112
|
+
super().__init__(parent_path)
|
|
113
|
+
self._current_container_map = current_container_map
|
|
114
|
+
self._new_container_map = new_container_map
|
|
115
|
+
|
|
116
|
+
def diff(
|
|
117
|
+
self,
|
|
118
|
+
current: ViewPropertyDefinition,
|
|
119
|
+
new: ViewPropertyDefinition,
|
|
120
|
+
identifier: str,
|
|
121
|
+
) -> list[FieldChange]:
|
|
122
|
+
changes: list[FieldChange] = self._diff_name_description(current, new, identifier)
|
|
123
|
+
if current.connection_type != new.connection_type:
|
|
124
|
+
changes.append(
|
|
125
|
+
ChangedField(
|
|
126
|
+
field_path=self._get_path(f"{identifier}.connectionType"),
|
|
127
|
+
item_severity=SeverityType.BREAKING,
|
|
128
|
+
new_value=new.connection_type,
|
|
129
|
+
current_value=current.connection_type,
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
elif isinstance(current, ViewCoreProperty) and isinstance(new, ViewCoreProperty):
|
|
133
|
+
changes.extend(self._diff_core_property(current, new, identifier))
|
|
134
|
+
|
|
135
|
+
elif isinstance(current, EdgeProperty) and isinstance(new, EdgeProperty):
|
|
136
|
+
changes.extend(self._diff_edge_property(current, new, identifier))
|
|
137
|
+
|
|
138
|
+
elif isinstance(current, ReverseDirectRelationProperty) and isinstance(new, ReverseDirectRelationProperty):
|
|
139
|
+
changes.extend(self._diff_reverse_direct_relation_property(current, new, identifier))
|
|
140
|
+
|
|
141
|
+
return changes
|
|
142
|
+
|
|
143
|
+
def _diff_core_property(
|
|
144
|
+
self,
|
|
145
|
+
current: ViewCoreProperty,
|
|
146
|
+
new: ViewCoreProperty,
|
|
147
|
+
identifier: str,
|
|
148
|
+
) -> list[FieldChange]:
|
|
149
|
+
changes: list[FieldChange] = []
|
|
150
|
+
|
|
151
|
+
if (current.container, current.container_property_identifier) != (
|
|
152
|
+
new.container,
|
|
153
|
+
new.container_property_identifier,
|
|
154
|
+
):
|
|
155
|
+
item_severity = self._get_container_change_severity(
|
|
156
|
+
current.container,
|
|
157
|
+
current.container_property_identifier,
|
|
158
|
+
new.container,
|
|
159
|
+
new.container_property_identifier,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
if current.container != new.container:
|
|
163
|
+
changes.append(
|
|
164
|
+
ChangedField(
|
|
165
|
+
field_path=self._get_path(f"{identifier}.container"),
|
|
166
|
+
item_severity=item_severity,
|
|
167
|
+
new_value=new.container,
|
|
168
|
+
current_value=current.container,
|
|
169
|
+
)
|
|
170
|
+
)
|
|
171
|
+
if current.container_property_identifier != new.container_property_identifier:
|
|
172
|
+
changes.append(
|
|
173
|
+
ChangedField(
|
|
174
|
+
field_path=self._get_path(f"{identifier}.containerPropertyIdentifier"),
|
|
175
|
+
item_severity=item_severity,
|
|
176
|
+
new_value=new.container_property_identifier,
|
|
177
|
+
current_value=current.container_property_identifier,
|
|
178
|
+
)
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
if isinstance(current, ViewCorePropertyRequest) and isinstance(new, ViewCorePropertyRequest):
|
|
182
|
+
if current.source != new.source:
|
|
183
|
+
changes.append(
|
|
184
|
+
ChangedField(
|
|
185
|
+
field_path=self._get_path(f"{identifier}.source"),
|
|
186
|
+
item_severity=SeverityType.BREAKING,
|
|
187
|
+
new_value=new.source,
|
|
188
|
+
current_value=current.source,
|
|
189
|
+
)
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
return changes
|
|
193
|
+
|
|
194
|
+
def _diff_edge_property(
|
|
195
|
+
self,
|
|
196
|
+
current: EdgeProperty,
|
|
197
|
+
new: EdgeProperty,
|
|
198
|
+
identifier: str,
|
|
199
|
+
) -> list[FieldChange]:
|
|
200
|
+
changes: list[FieldChange] = []
|
|
201
|
+
if current.source != new.source:
|
|
202
|
+
changes.append(
|
|
203
|
+
ChangedField(
|
|
204
|
+
field_path=self._get_path(f"{identifier}.source"),
|
|
205
|
+
item_severity=SeverityType.BREAKING,
|
|
206
|
+
new_value=new.source,
|
|
207
|
+
current_value=current.source,
|
|
208
|
+
)
|
|
209
|
+
)
|
|
210
|
+
if current.type != new.type:
|
|
211
|
+
changes.append(
|
|
212
|
+
ChangedField(
|
|
213
|
+
field_path=self._get_path(f"{identifier}.type"),
|
|
214
|
+
item_severity=SeverityType.WARNING,
|
|
215
|
+
new_value=new.type,
|
|
216
|
+
current_value=current.type,
|
|
217
|
+
)
|
|
218
|
+
)
|
|
219
|
+
if current.edge_source != new.edge_source:
|
|
220
|
+
changes.append(
|
|
221
|
+
ChangedField(
|
|
222
|
+
field_path=self._get_path(f"{identifier}.edgeSource"),
|
|
223
|
+
item_severity=SeverityType.BREAKING,
|
|
224
|
+
new_value=new.edge_source,
|
|
225
|
+
current_value=current.edge_source,
|
|
226
|
+
)
|
|
227
|
+
)
|
|
228
|
+
if current.direction != new.direction:
|
|
229
|
+
changes.append(
|
|
230
|
+
ChangedField(
|
|
231
|
+
field_path=self._get_path(f"{identifier}.direction"),
|
|
232
|
+
item_severity=SeverityType.BREAKING,
|
|
233
|
+
new_value=new.direction,
|
|
234
|
+
current_value=current.direction,
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
return changes
|
|
238
|
+
|
|
239
|
+
def _diff_reverse_direct_relation_property(
|
|
240
|
+
self,
|
|
241
|
+
current: ReverseDirectRelationProperty,
|
|
242
|
+
new: ReverseDirectRelationProperty,
|
|
243
|
+
identifier: str,
|
|
244
|
+
) -> list[FieldChange]:
|
|
245
|
+
changes: list[FieldChange] = []
|
|
246
|
+
if current.source != new.source:
|
|
247
|
+
changes.append(
|
|
248
|
+
ChangedField(
|
|
249
|
+
field_path=self._get_path(f"{identifier}.source"),
|
|
250
|
+
item_severity=SeverityType.BREAKING,
|
|
251
|
+
new_value=new.source,
|
|
252
|
+
current_value=current.source,
|
|
253
|
+
)
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
if current.through != new.through:
|
|
257
|
+
changes.append(
|
|
258
|
+
ChangedField(
|
|
259
|
+
field_path=self._get_path(f"{identifier}.through"),
|
|
260
|
+
item_severity=SeverityType.WARNING,
|
|
261
|
+
new_value=new.through,
|
|
262
|
+
current_value=current.through,
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
return changes
|
|
267
|
+
|
|
268
|
+
def _get_container_change_severity(
|
|
269
|
+
self,
|
|
270
|
+
current_container: ContainerReference,
|
|
271
|
+
current_property_identifier: str,
|
|
272
|
+
new_container: ContainerReference,
|
|
273
|
+
new_property_identifier: str,
|
|
274
|
+
) -> SeverityType:
|
|
275
|
+
current_container_property = self._get_container_property(
|
|
276
|
+
current_container, current_property_identifier, self._current_container_map
|
|
277
|
+
)
|
|
278
|
+
new_container_property = self._get_container_property(
|
|
279
|
+
new_container, new_property_identifier, self._new_container_map
|
|
280
|
+
)
|
|
281
|
+
if not current_container_property or not new_container_property:
|
|
282
|
+
return SeverityType.BREAKING
|
|
283
|
+
differ = ContainerPropertyDiffer(parent_path=None)
|
|
284
|
+
changes = differ.diff(current_container_property, new_container_property, identifier="")
|
|
285
|
+
return SeverityType.max_severity([item.severity for item in changes], default=SeverityType.SAFE)
|
|
286
|
+
|
|
287
|
+
@staticmethod
|
|
288
|
+
def _get_container_property(
|
|
289
|
+
container_ref: ContainerReference,
|
|
290
|
+
property_identifier: str,
|
|
291
|
+
containers: dict[ContainerReference, ContainerRequest],
|
|
292
|
+
) -> ContainerPropertyDefinition | None:
|
|
293
|
+
container = containers.get(container_ref)
|
|
294
|
+
if not container:
|
|
295
|
+
return None
|
|
296
|
+
property_def = container.properties.get(property_identifier)
|
|
297
|
+
if not property_def:
|
|
298
|
+
return None
|
|
299
|
+
return property_def
|