cognite-neat 0.123.26__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/{core → _v0/core}/_data_model/importers/_rdf/_owl2data_model.py +41 -21
- cognite/neat/{core → _v0/core}/_data_model/importers/_rdf/_shared.py +9 -9
- 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/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.26.dist-info/METADATA +0 -144
- cognite_neat-0.123.26.dist-info/RECORD +0 -201
- cognite_neat-0.123.26.dist-info/WHEEL +0 -4
- cognite_neat-0.123.26.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,381 @@
|
|
|
1
|
+
"""Validators for checking if data model is AI-ready."""
|
|
2
|
+
|
|
3
|
+
from cognite.neat._data_model.models.dms._data_types import EnumProperty
|
|
4
|
+
from cognite.neat._data_model.validation.dms._base import DataModelValidator
|
|
5
|
+
from cognite.neat._issues import Recommendation
|
|
6
|
+
|
|
7
|
+
BASE_CODE = "NEAT-DMS-AI-READINESS"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DataModelMissingName(DataModelValidator):
|
|
11
|
+
"""Validates that data model has a human-readable name.
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
Validates that the data model has a human-readable name.
|
|
15
|
+
|
|
16
|
+
## Why is this bad?
|
|
17
|
+
Often the data model ids are technical identifiers, abbreviations, etc.
|
|
18
|
+
A missing name makes it harder for users (humans or machines) to understand what the data model represents.
|
|
19
|
+
Providing a clear name improves usability, maintainability, searchability, and AI-readiness.
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
A data model has an id IEC61400-25-2 but no name. Users may find it difficult to understand what this data model
|
|
23
|
+
represents. However adding a name "Wind Energy Information Model" would increase clarity and usability.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
code = f"{BASE_CODE}-001"
|
|
27
|
+
issue_type = Recommendation
|
|
28
|
+
|
|
29
|
+
def run(self) -> list[Recommendation]:
|
|
30
|
+
recommendations: list[Recommendation] = []
|
|
31
|
+
|
|
32
|
+
if not self.validation_resources.merged_data_model.name:
|
|
33
|
+
recommendations.append(
|
|
34
|
+
Recommendation(
|
|
35
|
+
message="Data model is missing a human-readable name.",
|
|
36
|
+
fix="Add a clear and concise name to the data model.",
|
|
37
|
+
code=self.code,
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
return recommendations
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class DataModelMissingDescription(DataModelValidator):
|
|
45
|
+
"""Validates that data model has a human-readable description.
|
|
46
|
+
|
|
47
|
+
## What it does
|
|
48
|
+
Validates that the data model has a human-readable description.
|
|
49
|
+
|
|
50
|
+
## Why is this bad?
|
|
51
|
+
A missing description makes it harder for users (humans or machines) to understand the purpose and scope
|
|
52
|
+
of the data model. The description provides important context about what domain the data model covers,
|
|
53
|
+
what use cases it supports, and how it should be used.
|
|
54
|
+
|
|
55
|
+
## Example
|
|
56
|
+
A data model has an id CIM, with name Common Information Model, but no description. Users may find it difficult to
|
|
57
|
+
understand what this data model represents, unless extra context is provided. In this particualar case, name
|
|
58
|
+
does not provide sufficient information, as it is too generic, that this data model is focused on the
|
|
59
|
+
electrical power systems domain. However, providing a description such as:
|
|
60
|
+
"The Common Information Model (CIM) is a standard developed by IEC for representing power system
|
|
61
|
+
components and their relationships. It is widely used in the electrical utility industry for data
|
|
62
|
+
exchange and system modeling." would greatly improve clarity and usability.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
code = f"{BASE_CODE}-002"
|
|
66
|
+
issue_type = Recommendation
|
|
67
|
+
|
|
68
|
+
def run(self) -> list[Recommendation]:
|
|
69
|
+
recommendations: list[Recommendation] = []
|
|
70
|
+
|
|
71
|
+
if not self.validation_resources.merged_data_model.description:
|
|
72
|
+
recommendations.append(
|
|
73
|
+
Recommendation(
|
|
74
|
+
message="Data model is missing a description.",
|
|
75
|
+
fix="Add a clear and concise description to the data model.",
|
|
76
|
+
code=self.code,
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return recommendations
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class ViewMissingName(DataModelValidator):
|
|
84
|
+
"""Validates that a View has a human-readable name.
|
|
85
|
+
|
|
86
|
+
## What it does
|
|
87
|
+
Validates that each view in the data model has a human-readable name.
|
|
88
|
+
|
|
89
|
+
## Why is this bad?
|
|
90
|
+
A missing name makes it harder for users (humans or machines) to understand the purpose of the view.
|
|
91
|
+
This is important as views' external ids are often based on technical identifiers, abbreviations, etc.
|
|
92
|
+
Providing a clear name improves usability, maintainability, searchability, and AI-readiness.
|
|
93
|
+
|
|
94
|
+
## Example
|
|
95
|
+
A view has an id CFIHOS-30000038 but no name. Users may find it difficult to understand what this view represents,
|
|
96
|
+
unless they look up the id in documentation or other resources. Adding name "Pump" would increase clarity and
|
|
97
|
+
usability.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
code = f"{BASE_CODE}-003"
|
|
101
|
+
issue_type = Recommendation
|
|
102
|
+
|
|
103
|
+
def run(self) -> list[Recommendation]:
|
|
104
|
+
recommendations: list[Recommendation] = []
|
|
105
|
+
|
|
106
|
+
for view_ref in self.validation_resources.merged_data_model.views or []:
|
|
107
|
+
view = self.validation_resources.select_view(view_ref)
|
|
108
|
+
|
|
109
|
+
if view is None:
|
|
110
|
+
raise RuntimeError(f"{type(self).__name__}: View {view_ref!s} not found. This is a bug.")
|
|
111
|
+
|
|
112
|
+
if not view.name:
|
|
113
|
+
recommendations.append(
|
|
114
|
+
Recommendation(
|
|
115
|
+
message=f"View {view_ref!s} is missing a human-readable name.",
|
|
116
|
+
fix="Add a clear and concise name to the view.",
|
|
117
|
+
code=self.code,
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
return recommendations
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class ViewMissingDescription(DataModelValidator):
|
|
125
|
+
"""Validates that a View has a human-readable description.
|
|
126
|
+
|
|
127
|
+
## What it does
|
|
128
|
+
Validates that each view in the data model has a human-readable description.
|
|
129
|
+
|
|
130
|
+
## Why is this bad?
|
|
131
|
+
A missing description makes it harder for users (humans or machines) to understand in what context the view
|
|
132
|
+
should be used. The description can provide important information about the view's purpose, scope, and usage.
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## Example
|
|
136
|
+
A view Site has no description. Users may find it difficult to understand what this view represents, unless
|
|
137
|
+
extra context is provided. Even if we know that Site is used in the context of wind energy developments, a
|
|
138
|
+
description is necessary as it can be used in various context within the same domain such as:
|
|
139
|
+
|
|
140
|
+
Option 1 — Project area
|
|
141
|
+
This view represents a geographical area where wind energy projects are developed and managed.
|
|
142
|
+
|
|
143
|
+
Option 2 — Lease area
|
|
144
|
+
The legally defined lease area allocated for offshore wind development.
|
|
145
|
+
|
|
146
|
+
Option 3 — Measurement site
|
|
147
|
+
A specific location where wind measurements (e.g., LiDAR, met mast) are collected.
|
|
148
|
+
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
code = f"{BASE_CODE}-004"
|
|
152
|
+
issue_type = Recommendation
|
|
153
|
+
|
|
154
|
+
def run(self) -> list[Recommendation]:
|
|
155
|
+
recommendations: list[Recommendation] = []
|
|
156
|
+
|
|
157
|
+
for view_ref in self.validation_resources.merged_data_model.views or []:
|
|
158
|
+
view = self.validation_resources.select_view(view_ref)
|
|
159
|
+
|
|
160
|
+
if view is None:
|
|
161
|
+
raise RuntimeError(f"{type(self).__name__}: View {view_ref!s} not found. This is a bug.")
|
|
162
|
+
|
|
163
|
+
if not view.description:
|
|
164
|
+
recommendations.append(
|
|
165
|
+
Recommendation(
|
|
166
|
+
message=f"View {view_ref!s} is missing a description.",
|
|
167
|
+
fix="Add a clear and concise description to the view.",
|
|
168
|
+
code=self.code,
|
|
169
|
+
)
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
return recommendations
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class ViewPropertyMissingName(DataModelValidator):
|
|
176
|
+
"""Validates that a view property has a human-readable name.
|
|
177
|
+
|
|
178
|
+
## What it does
|
|
179
|
+
Validates that each view property in the data model has a human-readable name.
|
|
180
|
+
|
|
181
|
+
## Why is this bad?
|
|
182
|
+
A missing name makes it harder for users (humans or machines) to understand the purpose of the view property.
|
|
183
|
+
This is important as view property's ids are often based on technical identifiers, abbreviations, etc.
|
|
184
|
+
Providing a clear name improves usability, maintainability, searchability, and AI-readiness.
|
|
185
|
+
|
|
186
|
+
## Example
|
|
187
|
+
A view WindTurbine has a property pc which has no name. Users may find it difficult to understand what this view
|
|
188
|
+
property represents, unless they look up the id in documentation or other resources. Adding name "power curve"
|
|
189
|
+
would increase clarity and usability.
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
code = f"{BASE_CODE}-005"
|
|
193
|
+
issue_type = Recommendation
|
|
194
|
+
|
|
195
|
+
def run(self) -> list[Recommendation]:
|
|
196
|
+
recommendations: list[Recommendation] = []
|
|
197
|
+
|
|
198
|
+
for view_ref in self.validation_resources.merged_data_model.views or []:
|
|
199
|
+
view = self.validation_resources.select_view(view_ref)
|
|
200
|
+
|
|
201
|
+
if view is None:
|
|
202
|
+
raise RuntimeError(f"{type(self).__name__}: View {view_ref!s} not found. This is a bug.")
|
|
203
|
+
|
|
204
|
+
if not view.properties:
|
|
205
|
+
continue
|
|
206
|
+
|
|
207
|
+
for prop_ref, definition in view.properties.items():
|
|
208
|
+
if not definition.name:
|
|
209
|
+
recommendations.append(
|
|
210
|
+
Recommendation(
|
|
211
|
+
message=f"View {view_ref!s} property {prop_ref!s} is missing a human-readable name.",
|
|
212
|
+
fix="Add a clear and concise name to the view property.",
|
|
213
|
+
code=self.code,
|
|
214
|
+
)
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
return recommendations
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
class ViewPropertyMissingDescription(DataModelValidator):
|
|
221
|
+
"""Validates that a View property has a human-readable description.
|
|
222
|
+
|
|
223
|
+
## What it does
|
|
224
|
+
Validates that each view property in the data model has a human-readable description.
|
|
225
|
+
|
|
226
|
+
## Why is this bad?
|
|
227
|
+
A missing description makes it harder for users (humans or machines) to understand in what context the view property
|
|
228
|
+
should be used. The description can provide important information about the view property's purpose,
|
|
229
|
+
scope, and usage.
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
## Example
|
|
233
|
+
A view WindTurbine has a property status with no description. Users may find it difficult to understand what this
|
|
234
|
+
property represents, unless extra context is provided. Even if we know that status is related to wind turbine
|
|
235
|
+
operations, a description is necessary as it can have different meanings in various contexts:
|
|
236
|
+
|
|
237
|
+
Option 1 — Operational status
|
|
238
|
+
Current operational state of the wind turbine (e.g., running, stopped, maintenance, fault).
|
|
239
|
+
|
|
240
|
+
Option 2 — Connection status
|
|
241
|
+
Grid connection status indicating whether the turbine is connected to the electrical grid.
|
|
242
|
+
|
|
243
|
+
Option 3 — Availability status
|
|
244
|
+
Availability state for production indicating whether the turbine is available for power generation.
|
|
245
|
+
|
|
246
|
+
"""
|
|
247
|
+
|
|
248
|
+
code = f"{BASE_CODE}-006"
|
|
249
|
+
issue_type = Recommendation
|
|
250
|
+
|
|
251
|
+
def run(self) -> list[Recommendation]:
|
|
252
|
+
recommendations: list[Recommendation] = []
|
|
253
|
+
|
|
254
|
+
for view_ref in self.validation_resources.merged_data_model.views or []:
|
|
255
|
+
view = self.validation_resources.select_view(view_ref)
|
|
256
|
+
|
|
257
|
+
if view is None:
|
|
258
|
+
raise RuntimeError(f"{type(self).__name__}: View {view_ref!s} not found. This is a bug.")
|
|
259
|
+
|
|
260
|
+
if not view.properties:
|
|
261
|
+
continue
|
|
262
|
+
|
|
263
|
+
for prop_ref, definition in view.properties.items():
|
|
264
|
+
if not definition.description:
|
|
265
|
+
recommendations.append(
|
|
266
|
+
Recommendation(
|
|
267
|
+
message=f"View {view_ref!s} property {prop_ref!s} is missing a description.",
|
|
268
|
+
fix="Add a clear and concise description to the view property.",
|
|
269
|
+
code=self.code,
|
|
270
|
+
)
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
return recommendations
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class EnumerationMissingName(DataModelValidator):
|
|
277
|
+
"""Validates that an enumeration has a human-readable name.
|
|
278
|
+
|
|
279
|
+
## What it does
|
|
280
|
+
Validates that each enumeration value in the data model has a human-readable name.
|
|
281
|
+
|
|
282
|
+
## Why is this bad?
|
|
283
|
+
A missing name makes it harder for users (humans or machines) to understand the purpose of the enumeration value.
|
|
284
|
+
This is important as enumeration values are often technical codes or abbreviations, and a clear name improves
|
|
285
|
+
usability, maintainability, searchability, and AI-readiness.
|
|
286
|
+
|
|
287
|
+
## Example
|
|
288
|
+
An enumeration value with id "NOM" in a wind turbine operational mode property has no name. Users may find it
|
|
289
|
+
difficult to understand what this value represents. Adding name "Normal Operation" would increase clarity
|
|
290
|
+
and usability.
|
|
291
|
+
"""
|
|
292
|
+
|
|
293
|
+
code = f"{BASE_CODE}-007"
|
|
294
|
+
issue_type = Recommendation
|
|
295
|
+
|
|
296
|
+
def run(self) -> list[Recommendation]:
|
|
297
|
+
recommendations: list[Recommendation] = []
|
|
298
|
+
|
|
299
|
+
for container_ref in self.validation_resources.merged.containers:
|
|
300
|
+
container = self.validation_resources.select_container(container_ref)
|
|
301
|
+
|
|
302
|
+
if not container:
|
|
303
|
+
raise RuntimeError(f"{type(self).__name__}: Container {container_ref!s} not found. This is a bug.")
|
|
304
|
+
|
|
305
|
+
for prop_ref, definition in container.properties.items():
|
|
306
|
+
if not isinstance(definition.type, EnumProperty):
|
|
307
|
+
continue
|
|
308
|
+
|
|
309
|
+
for value, enum_def in definition.type.values.items():
|
|
310
|
+
if not enum_def.name:
|
|
311
|
+
recommendations.append(
|
|
312
|
+
Recommendation(
|
|
313
|
+
message=(
|
|
314
|
+
f"Enumeration value {value!r} in property {prop_ref!s} of container "
|
|
315
|
+
f"{container_ref!s} is missing a human-readable name."
|
|
316
|
+
),
|
|
317
|
+
fix="Add a clear and concise name to the enumeration value.",
|
|
318
|
+
code=self.code,
|
|
319
|
+
)
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
return recommendations
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
class EnumerationMissingDescription(DataModelValidator):
|
|
326
|
+
"""Validates that an enumeration value has a human-readable description.
|
|
327
|
+
|
|
328
|
+
## What it does
|
|
329
|
+
Validates that each enumeration value in the data model has a human-readable description.
|
|
330
|
+
|
|
331
|
+
## Why is this bad?
|
|
332
|
+
A missing description makes it harder for users (humans or machines) to understand the meaning and context
|
|
333
|
+
of the enumeration value. The description can provide important information about when and how the value
|
|
334
|
+
should be used, especially when enumeration values are technical codes or abbreviations.
|
|
335
|
+
|
|
336
|
+
## Example
|
|
337
|
+
An enumeration value "NOM" in a wind turbine operational mode property has no description. Users may find it
|
|
338
|
+
difficult to understand what this value represents without additional context. Even with a name like
|
|
339
|
+
"Normal Operation", the description is valuable as it can clarify specifics:
|
|
340
|
+
|
|
341
|
+
Option 1 — Basic definition
|
|
342
|
+
The turbine is operating normally and generating power according to its power curve.
|
|
343
|
+
|
|
344
|
+
Option 2 — Detailed operational context
|
|
345
|
+
The turbine is in normal operation mode, actively generating power with all systems functioning within
|
|
346
|
+
specified parameters and connected to the grid.
|
|
347
|
+
|
|
348
|
+
Option 3 — Contrasting with other modes
|
|
349
|
+
Standard operating mode where the turbine follows the power curve and responds to grid commands,
|
|
350
|
+
as opposed to maintenance mode or fault conditions.
|
|
351
|
+
"""
|
|
352
|
+
|
|
353
|
+
code = f"{BASE_CODE}-008"
|
|
354
|
+
issue_type = Recommendation
|
|
355
|
+
|
|
356
|
+
def run(self) -> list[Recommendation]:
|
|
357
|
+
recommendations: list[Recommendation] = []
|
|
358
|
+
|
|
359
|
+
for container_ref in self.validation_resources.merged.containers:
|
|
360
|
+
container = self.validation_resources.select_container(container_ref)
|
|
361
|
+
if not container:
|
|
362
|
+
raise RuntimeError(f"{self.__class__.__name__}: Container {container_ref!s} not found. This is a bug.")
|
|
363
|
+
|
|
364
|
+
for prop_ref, definition in container.properties.items():
|
|
365
|
+
if not isinstance(definition.type, EnumProperty):
|
|
366
|
+
continue
|
|
367
|
+
|
|
368
|
+
for value, enum_def in definition.type.values.items():
|
|
369
|
+
if not enum_def.description:
|
|
370
|
+
recommendations.append(
|
|
371
|
+
Recommendation(
|
|
372
|
+
message=(
|
|
373
|
+
f"Enumeration value {value!r} in property {prop_ref!s} of container "
|
|
374
|
+
f"{container_ref!s} is missing a human-readable description."
|
|
375
|
+
),
|
|
376
|
+
fix="Add a clear and concise description to the enumeration value.",
|
|
377
|
+
code=self.code,
|
|
378
|
+
)
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
return recommendations
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import ClassVar
|
|
3
|
+
|
|
4
|
+
from cognite.neat._data_model._analysis import ValidationResources
|
|
5
|
+
from cognite.neat._issues import ConsistencyError, Recommendation
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DataModelValidator(ABC):
|
|
9
|
+
"""Assessors for fundamental data model principles."""
|
|
10
|
+
|
|
11
|
+
code: ClassVar[str]
|
|
12
|
+
issue_type: ClassVar[type[ConsistencyError] | type[Recommendation]]
|
|
13
|
+
alpha: ClassVar[bool] = False
|
|
14
|
+
|
|
15
|
+
def __init__(
|
|
16
|
+
self,
|
|
17
|
+
validation_resources: ValidationResources,
|
|
18
|
+
) -> None:
|
|
19
|
+
self.validation_resources = validation_resources
|
|
20
|
+
|
|
21
|
+
@abstractmethod
|
|
22
|
+
def run(self) -> list[ConsistencyError] | list[Recommendation] | list[ConsistencyError | Recommendation]:
|
|
23
|
+
"""Execute the success handler on the data model."""
|
|
24
|
+
# do something with data model
|
|
25
|
+
...
|