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
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
import warnings
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from typing import Any, Literal, cast, overload
|
|
4
|
-
|
|
5
|
-
from cognite.client.data_classes.data_modeling import DataModelIdentifier
|
|
6
|
-
|
|
7
|
-
from cognite.neat.core._client._api_client import NeatClient
|
|
8
|
-
from cognite.neat.core._constants import COGNITE_MODELS
|
|
9
|
-
from cognite.neat.core._data_model import exporters
|
|
10
|
-
from cognite.neat.core._data_model._shared import VerifiedDataModel
|
|
11
|
-
from cognite.neat.core._data_model.importers._dms2data_model import DMSImporter
|
|
12
|
-
from cognite.neat.core._data_model.models.conceptual._verified import ConceptualDataModel
|
|
13
|
-
from cognite.neat.core._data_model.models.physical._verified import PhysicalDataModel, PhysicalMetadata
|
|
14
|
-
from cognite.neat.core._issues._base import IssueList
|
|
15
|
-
from cognite.neat.core._issues._contextmanagers import catch_issues
|
|
16
|
-
from cognite.neat.core._utils.auxiliary import filter_kwargs_by_method
|
|
17
|
-
from cognite.neat.core._utils.reader._base import NeatReader
|
|
18
|
-
from cognite.neat.core._utils.upload import UploadResultList
|
|
19
|
-
from cognite.neat.session._state import SessionState
|
|
20
|
-
from cognite.neat.session.exceptions import NeatSessionError, session_class_wrapper
|
|
21
|
-
|
|
22
|
-
InternalWriterName = Literal["excel", "ontology", "shacl", "cdf", "yaml"]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@session_class_wrapper
|
|
26
|
-
class WriteAPI:
|
|
27
|
-
def __init__(self, state: SessionState) -> None:
|
|
28
|
-
self._state = state
|
|
29
|
-
|
|
30
|
-
def __call__(
|
|
31
|
-
self, name: str, io: str | Path | None = None, **kwargs: Any
|
|
32
|
-
) -> str | UploadResultList | IssueList | None:
|
|
33
|
-
"""Provides access to the writers for exporting data models to different formats.
|
|
34
|
-
|
|
35
|
-
Args:
|
|
36
|
-
name (str): The name of format (e.g. Excel) writer is handling.
|
|
37
|
-
io (str | Path | None): The input/output interface for the writer.
|
|
38
|
-
**kwargs (Any): Additional keyword arguments for the writer.
|
|
39
|
-
|
|
40
|
-
!!! note "kwargs"
|
|
41
|
-
Users must consult the documentation of the writer
|
|
42
|
-
to understand what keyword arguments are supported.
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
|
-
# Clean the input name once before matching.
|
|
46
|
-
clean_name: InternalWriterName | str = name.strip().lower()
|
|
47
|
-
|
|
48
|
-
match clean_name:
|
|
49
|
-
case "excel":
|
|
50
|
-
if io is None:
|
|
51
|
-
raise NeatSessionError("'io' parameter is required for Excel format.")
|
|
52
|
-
return self.excel(cast(str | Path, io), **filter_kwargs_by_method(kwargs, self.excel))
|
|
53
|
-
case "cdf":
|
|
54
|
-
return self.cdf(**filter_kwargs_by_method(kwargs, self.cdf))
|
|
55
|
-
case "yaml":
|
|
56
|
-
return self.yaml(io, **filter_kwargs_by_method(kwargs, self.yaml))
|
|
57
|
-
case "ontology":
|
|
58
|
-
if io is None:
|
|
59
|
-
raise NeatSessionError("'io' parameter is required for ontology format.")
|
|
60
|
-
self.ontology(cast(str | Path, io))
|
|
61
|
-
return None
|
|
62
|
-
case "shacl":
|
|
63
|
-
if io is None:
|
|
64
|
-
raise NeatSessionError("'io' parameter is required for SHACL format.")
|
|
65
|
-
self.shacl(cast(str | Path, io))
|
|
66
|
-
return None
|
|
67
|
-
case _:
|
|
68
|
-
raise NeatSessionError(
|
|
69
|
-
f"Unsupported data model writer: {name}. "
|
|
70
|
-
"Please use one of the following: 'excel', 'cdf', 'yaml', 'ontology', 'shacl'."
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
def excel(
|
|
74
|
-
self,
|
|
75
|
-
io: str | Path,
|
|
76
|
-
*,
|
|
77
|
-
include_reference: bool | DataModelIdentifier = True,
|
|
78
|
-
include_properties: Literal["same-space", "all"] = "all",
|
|
79
|
-
add_empty_rows: bool = False,
|
|
80
|
-
) -> IssueList | None:
|
|
81
|
-
"""Export the verified data model to Excel.
|
|
82
|
-
|
|
83
|
-
Args:
|
|
84
|
-
io: The file path or file-like object to write the Excel file to.
|
|
85
|
-
include_reference: If True, the reference data model will be included. Defaults to True.
|
|
86
|
-
Note that this only applies if you have created the data model using the
|
|
87
|
-
create.enterprise_model(...), create.solution_model(), or create.data_product_model() methods.
|
|
88
|
-
You can also provide a DataModelIdentifier directly, which will be read from CDF
|
|
89
|
-
include_properties: The properties to include in the Excel file. Defaults to "all".
|
|
90
|
-
- "same-space": Only properties that are in the same space as the data model will be included.
|
|
91
|
-
add_empty_rows: If True, empty rows will be added between each component. Defaults to False.
|
|
92
|
-
|
|
93
|
-
Example:
|
|
94
|
-
Export conceptual data model to an Excel file
|
|
95
|
-
```python
|
|
96
|
-
conceptual_dm_file_name = "conceptual_data_model.xlsx"
|
|
97
|
-
neat.data_model.write.excel(conceptual_dm_file_name)
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Example:
|
|
101
|
-
Read CogniteCore model, convert it to an enterprise model, and export it to an excel file
|
|
102
|
-
```python
|
|
103
|
-
client = CogniteClient()
|
|
104
|
-
neat = NeatSession(client)
|
|
105
|
-
|
|
106
|
-
neat.data_model.read.cdf(("cdf_cdm", "CogniteCore", "v1"))
|
|
107
|
-
neat.data_model.create.enterprise_model(
|
|
108
|
-
data_model_id=("sp_doctrino_space", "ExtensionCore", "v1"),
|
|
109
|
-
org_name="MyOrg",
|
|
110
|
-
)
|
|
111
|
-
physical_dm_file_name = "physical_dm.xlsx"
|
|
112
|
-
neat.data_model.write.excel(physical_dm_file_name, include_reference=True)
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Example:
|
|
116
|
-
Read the data model ("my_space", "ISA95Model", "v5") and export it to an excel file with the
|
|
117
|
-
CogniteCore model in the reference sheets.
|
|
118
|
-
```python
|
|
119
|
-
client = CogniteClient()
|
|
120
|
-
neat = NeatSession(client)
|
|
121
|
-
|
|
122
|
-
neat.data_model.read.cdf(("my_space", "ISA95Model", "v5"))
|
|
123
|
-
physical_dm_file_name = "physical_dm.xlsx"
|
|
124
|
-
neat.data_model.write.excel(physical_dm_file_name, include_reference=("cdf_cdm", "CogniteCore", "v1"))
|
|
125
|
-
"""
|
|
126
|
-
reference_data_model_with_prefix: tuple[VerifiedDataModel, str] | None = None
|
|
127
|
-
include_properties = include_properties.strip().lower()
|
|
128
|
-
if include_properties not in ["same-space", "all"]:
|
|
129
|
-
raise NeatSessionError(
|
|
130
|
-
f"Invalid include_properties value: '{include_properties}'. Must be 'same-space' or 'all'."
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
if include_reference is not False:
|
|
134
|
-
if include_reference is True and self._state.last_reference is not None:
|
|
135
|
-
ref_data_model: ConceptualDataModel | PhysicalDataModel | None = self._state.last_reference
|
|
136
|
-
elif include_reference is True:
|
|
137
|
-
ref_data_model = None
|
|
138
|
-
else:
|
|
139
|
-
if not self._state.client:
|
|
140
|
-
raise NeatSessionError("No client provided!")
|
|
141
|
-
ref_data_model = None
|
|
142
|
-
with catch_issues() as issues:
|
|
143
|
-
ref_read = DMSImporter.from_data_model_id(self._state.client, include_reference).to_data_model()
|
|
144
|
-
if ref_read.unverified_data_model is not None:
|
|
145
|
-
ref_data_model = ref_read.unverified_data_model.as_verified_data_model()
|
|
146
|
-
if ref_data_model is None or issues.has_errors:
|
|
147
|
-
issues.action = f"Read {include_reference}"
|
|
148
|
-
return issues
|
|
149
|
-
if ref_data_model is not None:
|
|
150
|
-
prefix = "Ref"
|
|
151
|
-
if (
|
|
152
|
-
isinstance(ref_data_model.metadata, PhysicalMetadata)
|
|
153
|
-
and ref_data_model.metadata.as_data_model_id() in COGNITE_MODELS
|
|
154
|
-
):
|
|
155
|
-
prefix = "CDM"
|
|
156
|
-
reference_data_model_with_prefix = ref_data_model, prefix
|
|
157
|
-
|
|
158
|
-
exporter = exporters.ExcelExporter(
|
|
159
|
-
styling="maximal",
|
|
160
|
-
reference_data_model_with_prefix=reference_data_model_with_prefix,
|
|
161
|
-
add_empty_rows=add_empty_rows,
|
|
162
|
-
include_properties=cast(Literal["same-space", "all"], include_properties),
|
|
163
|
-
)
|
|
164
|
-
self._state.data_model_store.export_to_file(exporter, NeatReader.create(io).materialize_path())
|
|
165
|
-
return None
|
|
166
|
-
|
|
167
|
-
def cdf(
|
|
168
|
-
self,
|
|
169
|
-
*,
|
|
170
|
-
existing: Literal["fail", "skip", "update", "force", "recreate"] = "update",
|
|
171
|
-
dry_run: bool = False,
|
|
172
|
-
drop_data: bool = False,
|
|
173
|
-
) -> UploadResultList:
|
|
174
|
-
"""Export the verified DMS data model to CDF.
|
|
175
|
-
|
|
176
|
-
Args:
|
|
177
|
-
existing: What to do if the component already exists. Defaults to "update".
|
|
178
|
-
See the note below for more information about the options.
|
|
179
|
-
dry_run: If True, no changes will be made to CDF. Defaults to False.
|
|
180
|
-
drop_data: If existing is 'force' or 'recreate' and the operation will lead to data loss,
|
|
181
|
-
the component will be skipped unless drop_data is True. Defaults to False.
|
|
182
|
-
Note this only applies to spaces and containers if they contain data.
|
|
183
|
-
|
|
184
|
-
!!! note "Data Model creation modes"
|
|
185
|
-
- "fail": If any component already exists, the export will fail.
|
|
186
|
-
- "skip": If any component already exists, it will be skipped.
|
|
187
|
-
- "update": If any component already exists, it will be updated. For data models, views, and containers
|
|
188
|
-
this means combining the existing and new component. Fo example, for data models the new
|
|
189
|
-
views will be added to the existing views.
|
|
190
|
-
- "force": If any component already exists, and the update fails, it will be deleted and recreated.
|
|
191
|
-
- "recreate": All components will be deleted and recreated. The exception is spaces, which will be updated.
|
|
192
|
-
|
|
193
|
-
"""
|
|
194
|
-
|
|
195
|
-
self._state._raise_exception_if_condition_not_met(
|
|
196
|
-
"Export DMS data model to CDF",
|
|
197
|
-
client_required=True,
|
|
198
|
-
)
|
|
199
|
-
|
|
200
|
-
exporter = exporters.DMSExporter(existing=existing, drop_data=drop_data)
|
|
201
|
-
|
|
202
|
-
result = self._state.data_model_store.export_to_cdf(exporter, cast(NeatClient, self._state.client), dry_run)
|
|
203
|
-
print("You can inspect the details with the .inspect.outcome.data_model(...) method.")
|
|
204
|
-
return result
|
|
205
|
-
|
|
206
|
-
@overload
|
|
207
|
-
def yaml(
|
|
208
|
-
self,
|
|
209
|
-
io: None,
|
|
210
|
-
*,
|
|
211
|
-
format: Literal["neat", "toolkit"] = "neat",
|
|
212
|
-
skip_system_spaces: bool = True,
|
|
213
|
-
) -> str: ...
|
|
214
|
-
|
|
215
|
-
@overload
|
|
216
|
-
def yaml(
|
|
217
|
-
self,
|
|
218
|
-
io: str | Path,
|
|
219
|
-
*,
|
|
220
|
-
format: Literal["neat", "toolkit"] = "neat",
|
|
221
|
-
skip_system_spaces: bool = True,
|
|
222
|
-
) -> None: ...
|
|
223
|
-
|
|
224
|
-
def yaml(
|
|
225
|
-
self,
|
|
226
|
-
io: str | Path | None = None,
|
|
227
|
-
*,
|
|
228
|
-
format: Literal["neat", "toolkit"] = "neat",
|
|
229
|
-
skip_system_spaces: bool = True,
|
|
230
|
-
) -> str | None:
|
|
231
|
-
"""Export the verified data model to YAML.
|
|
232
|
-
|
|
233
|
-
Args:
|
|
234
|
-
io: The file path or file-like object to write the YAML file to. Defaults to None.
|
|
235
|
-
format: The format of the YAML file. Defaults to "neat".
|
|
236
|
-
skip_system_spaces: If True, system spaces will be skipped. Defaults to True.
|
|
237
|
-
|
|
238
|
-
!!! note "YAML formats"
|
|
239
|
-
- "neat": This is the format Neat uses to store the data model.
|
|
240
|
-
- "toolkit": This is the format used by Cognite Toolkit, that matches the CDF API.
|
|
241
|
-
|
|
242
|
-
Returns:
|
|
243
|
-
str | None: If io is None, the YAML string will be returned. Otherwise, None will be returned.
|
|
244
|
-
|
|
245
|
-
Example:
|
|
246
|
-
Export to yaml file in the case of "neat" format
|
|
247
|
-
```python
|
|
248
|
-
your_yaml_file_name = "neat_dm.yaml"
|
|
249
|
-
neat.data_model.write.yaml(your_yaml_file_name, format="neat")
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
Example:
|
|
253
|
-
Export yaml files as a zip folder in the case of "toolkit" format
|
|
254
|
-
```python
|
|
255
|
-
your_zip_folder_name = "toolkit_data_model_files.zip"
|
|
256
|
-
neat.data_model.write.yaml(your_zip_folder_name, format="toolkit")
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
Example:
|
|
260
|
-
Export yaml files to a folder in the case of "toolkit" format
|
|
261
|
-
```python
|
|
262
|
-
your_folder_name = "my_project/data_model_files"
|
|
263
|
-
neat.data_model.write.yaml(your_folder_name, format="toolkit")
|
|
264
|
-
```
|
|
265
|
-
"""
|
|
266
|
-
|
|
267
|
-
if format == "neat":
|
|
268
|
-
exporter = exporters.YAMLExporter()
|
|
269
|
-
if io is None:
|
|
270
|
-
return self._state.data_model_store.export(exporter)
|
|
271
|
-
|
|
272
|
-
self._state.data_model_store.export_to_file(exporter, NeatReader.create(io).materialize_path())
|
|
273
|
-
elif format == "toolkit":
|
|
274
|
-
if io is None:
|
|
275
|
-
raise NeatSessionError(
|
|
276
|
-
"Please provide a zip file or directory path to write the YAML files to."
|
|
277
|
-
"This is required for the 'toolkit' format."
|
|
278
|
-
)
|
|
279
|
-
user_path = NeatReader.create(io).materialize_path()
|
|
280
|
-
if user_path.suffix == "" and not user_path.exists():
|
|
281
|
-
user_path.mkdir(parents=True)
|
|
282
|
-
self._state.data_model_store.export_to_file(
|
|
283
|
-
exporters.DMSExporter(remove_cdf_spaces=skip_system_spaces), user_path
|
|
284
|
-
)
|
|
285
|
-
else:
|
|
286
|
-
raise NeatSessionError("Please provide a valid format. 'neat' or 'toolkit'")
|
|
287
|
-
|
|
288
|
-
return None
|
|
289
|
-
|
|
290
|
-
def ontology(self, io: str | Path) -> None:
|
|
291
|
-
"""Write out data model as OWL ontology.
|
|
292
|
-
|
|
293
|
-
Args:
|
|
294
|
-
io: The file path to file-like object to write the session to.
|
|
295
|
-
|
|
296
|
-
Example:
|
|
297
|
-
Export the session to a file
|
|
298
|
-
```python
|
|
299
|
-
ontology_file_name = "neat_session.ttl"
|
|
300
|
-
neat.data_model.write.ontology(ontology_file_name)
|
|
301
|
-
```
|
|
302
|
-
"""
|
|
303
|
-
|
|
304
|
-
filepath = self._prepare_ttl_filepath(io)
|
|
305
|
-
exporter = exporters.OWLExporter()
|
|
306
|
-
self._state.data_model_store.export_to_file(exporter, filepath)
|
|
307
|
-
return None
|
|
308
|
-
|
|
309
|
-
def shacl(self, io: str | Path) -> None:
|
|
310
|
-
"""Write out data model as SHACL shapes.
|
|
311
|
-
|
|
312
|
-
Args:
|
|
313
|
-
io: The file path to file-like object to write the session to.
|
|
314
|
-
|
|
315
|
-
Example:
|
|
316
|
-
Export the session to a file
|
|
317
|
-
```python
|
|
318
|
-
shacl_file_name = "neat_session.shacl.ttl"
|
|
319
|
-
neat.data_model.write.shacl(shacl_file_name)
|
|
320
|
-
```
|
|
321
|
-
"""
|
|
322
|
-
|
|
323
|
-
filepath = self._prepare_ttl_filepath(io)
|
|
324
|
-
exporter = exporters.SHACLExporter()
|
|
325
|
-
self._state.data_model_store.export_to_file(exporter, filepath)
|
|
326
|
-
return None
|
|
327
|
-
|
|
328
|
-
def _prepare_ttl_filepath(self, io: str | Path) -> Path:
|
|
329
|
-
"""Ensures the filepath has a .ttl extension, adding it if missing."""
|
|
330
|
-
filepath = NeatReader.create(io).materialize_path()
|
|
331
|
-
if filepath.suffix != ".ttl":
|
|
332
|
-
warnings.filterwarnings("default")
|
|
333
|
-
warnings.warn("File extension is not .ttl, adding it to the file name", stacklevel=2)
|
|
334
|
-
filepath = filepath.with_suffix(".ttl")
|
|
335
|
-
return filepath
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: cognite-neat
|
|
3
|
-
Version: 0.123.26
|
|
4
|
-
Summary: Knowledge graph transformation
|
|
5
|
-
Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
|
|
6
|
-
Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
|
|
7
|
-
Project-URL: GitHub, https://github.com/cognitedata/neat
|
|
8
|
-
Project-URL: Changelog, https://github.com/cognitedata/neat/releases
|
|
9
|
-
Author-email: Nikola Vasiljevic <nikola.vasiljevic@cognite.com>, Anders Albert <anders.albert@cognite.com>, Rogerio Júnior <rogerio.junior@cognite.com>
|
|
10
|
-
License-Expression: Apache-2.0
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Requires-Python: >=3.10
|
|
13
|
-
Requires-Dist: backports-strenum<2.0.0,>=1.2; python_version < '3.11'
|
|
14
|
-
Requires-Dist: cognite-sdk<8.0.0,>=7.73.4
|
|
15
|
-
Requires-Dist: elementpath<5.0.0,>=4.0.0
|
|
16
|
-
Requires-Dist: exceptiongroup<2.0.0,>=1.1.3; python_version < '3.11'
|
|
17
|
-
Requires-Dist: jsonpath-python<2.0.0,>=1.0.6
|
|
18
|
-
Requires-Dist: mixpanel<5.0.0,>=4.10.1
|
|
19
|
-
Requires-Dist: networkx<4.0.0,>=3.4.2
|
|
20
|
-
Requires-Dist: openpyxl<4.0.0,>=3.0.10
|
|
21
|
-
Requires-Dist: packaging<25.0,>=22.0
|
|
22
|
-
Requires-Dist: pandas<3.0.0,>=1.5.3
|
|
23
|
-
Requires-Dist: pydantic<3.0.0,>=2.0.0
|
|
24
|
-
Requires-Dist: pyvis<1.0.0,>=0.3.2
|
|
25
|
-
Requires-Dist: pyyaml<7.0.0,>=6.0.1
|
|
26
|
-
Requires-Dist: rdflib<8.0.0,>=7.0.0
|
|
27
|
-
Requires-Dist: requests<3.0.0,>=2.28.1
|
|
28
|
-
Requires-Dist: rich[jupyter]<14.0.0,>=13.7.1
|
|
29
|
-
Requires-Dist: tomli<3.0.0,>=2.0.1; python_version < '3.11'
|
|
30
|
-
Requires-Dist: typing-extensions<5.0.0,>=4.8.0; python_version < '3.11'
|
|
31
|
-
Requires-Dist: urllib3<3.0.0,>=1.26.15
|
|
32
|
-
Provides-Extra: docs
|
|
33
|
-
Requires-Dist: mistune==3.0.2; extra == 'docs'
|
|
34
|
-
Requires-Dist: mkdocs-autorefs<1.0.0,>=0.5.0; extra == 'docs'
|
|
35
|
-
Requires-Dist: mkdocs-git-authors-plugin<1.0.0,>=0.9.4; extra == 'docs'
|
|
36
|
-
Requires-Dist: mkdocs-git-revision-date-localized-plugin; extra == 'docs'
|
|
37
|
-
Requires-Dist: mkdocs-gitbook<1.0.0,>=0.0.1; extra == 'docs'
|
|
38
|
-
Requires-Dist: mkdocs-glightbox<1.0.0,>=0.4.0; extra == 'docs'
|
|
39
|
-
Requires-Dist: mkdocs-jupyter<1.0.0,>=0.25.1; extra == 'docs'
|
|
40
|
-
Requires-Dist: mkdocs-material-extensions<2.0.0,>=1.3.1; extra == 'docs'
|
|
41
|
-
Requires-Dist: mkdocs<2.0.0,>=1.4.0; extra == 'docs'
|
|
42
|
-
Requires-Dist: mkdocstrings[python]<1.0.0,>=0.25.2; extra == 'docs'
|
|
43
|
-
Requires-Dist: pymdown-extensions<11.0.0,>=10.14.3; extra == 'docs'
|
|
44
|
-
Provides-Extra: google
|
|
45
|
-
Requires-Dist: google-api-python-client<3.0.0,>=2.70.0; extra == 'google'
|
|
46
|
-
Requires-Dist: google-auth-oauthlib<2.0.0,>=1.0.0; extra == 'google'
|
|
47
|
-
Requires-Dist: gspread<6.0.0,>=5.0.0; extra == 'google'
|
|
48
|
-
Provides-Extra: lxml
|
|
49
|
-
Requires-Dist: lxml<6.0.0,>=5.3.0; extra == 'lxml'
|
|
50
|
-
Provides-Extra: oxi
|
|
51
|
-
Requires-Dist: oxrdflib<0.5.0,>=0.4.0; extra == 'oxi'
|
|
52
|
-
Requires-Dist: pyoxigraph<0.5.0,>=0.4.3; extra == 'oxi'
|
|
53
|
-
Description-Content-Type: text/markdown
|
|
54
|
-
|
|
55
|
-
# kNowlEdge grAph Transformer (NEAT)
|
|
56
|
-
|
|
57
|
-
[](https://github.com/cognitedata/neat/actions/workflows/release.yaml)
|
|
58
|
-
[](https://cognite-neat.readthedocs-hosted.com/en/latest/?badge=latest)
|
|
59
|
-
[](https://github.com/cognitedata/neat)
|
|
60
|
-
[](https://pypi.org/project/cognite-neat/)
|
|
61
|
-
[](https://pypistats.org/packages/cognite-neat)
|
|
62
|
-
[](https://hub.docker.com/r/cognite/neat)
|
|
63
|
-
[](https://github.com/cognitedata/neat/blob/master/LICENSE)
|
|
64
|
-
[](https://github.com/ambv/black)
|
|
65
|
-
[](https://github.com/astral-sh/ruff)
|
|
66
|
-
[](http://mypy-lang.org)
|
|
67
|
-
|
|
68
|
-
NEAT is a domain expert centric and developer friendly solution for rapid:
|
|
69
|
-
|
|
70
|
-
- data modeling
|
|
71
|
-
- extraction, transformation and loading of instances
|
|
72
|
-
- and ingestion of the models and instances (i.e. knowledge graphs) into [Cognite Data Fusion](https://www.cognite.com/en/product/cognite_data_fusion_industrial_dataops_platform)
|
|
73
|
-
|
|
74
|
-
NEAT is using open and globally recognized standards maintained by the [World Wide Web Consortium (W3C)](https://www.w3.org/RDF/).
|
|
75
|
-
NEAT represents an essential tool for creation of standardized, machine-actionable, linked and semantic (meta)data.
|
|
76
|
-
|
|
77
|
-
> NEAT is a funny acronym derived from k**N**owl**Ed**ge gr**A**ph **T**ransformer produced using [ACRONIMIFY](https://acronymify.com/NEAT/?q=knowledge+graph+transformer).
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
## History
|
|
81
|
-
|
|
82
|
-
NEAT emerged from years of experience in semantic tooling and knowledge graph development. The foundation was laid in 2020 with [sheet2rdf](https://github.com/nikokaoja/sheet2rdf), an Excel-based tool that trained data stewards to build domain-specific knowledge graphs and supported CI/CD processes in the Dutch Covid program and european wind energy community.
|
|
83
|
-
|
|
84
|
-
By mid of 2022, sheet2rdf was used in several POCs in Cognite. As Cognite's Data Modeling Service (DMS) development progressed, the need for simplified data modeling experience led to demonstration of proto-NEAT, known as [sheet2fdm](https://github.com/cognitedata/sheet2fdm), an extension of sheet2rdf, enabling semantic data model definitions in OWL, SHACL, Python and GraphQL (see e.g., [wind energy data model](https://cognitedata.github.io/wind-energy-data-model/)) using a simplified version of sheet2rdf Excel template.
|
|
85
|
-
|
|
86
|
-
Presented in various forums in 2022, this approach paved the way for NEAT’s formal development in November 2022 to enable cost-saving and empowerment of Cognite customers to self-sufficiently maintain and onboard knowledge graphs to Cognite Data Fusion.
|
|
87
|
-
|
|
88
|
-
## Authorship
|
|
89
|
-
|
|
90
|
-
### Authors
|
|
91
|
-
The plot below shows the NEAT authorship from the start until present day.
|
|
92
|
-
|
|
93
|
-

|
|
94
|
-
|
|
95
|
-
#### Current authors
|
|
96
|
-
- [Nikola Vasiljević](www.linkedin.com/in/thisisnikola)
|
|
97
|
-
- [Anders Albert](https://www.linkedin.com/in/anders-albert-00790483/)
|
|
98
|
-
- [Rogerio Júnior](https://www.linkedin.com/in/rogerio-saboia-j%C3%BAnior-087118a7/)
|
|
99
|
-
|
|
100
|
-
#### Former authors
|
|
101
|
-
- [Aleksandrs Livincovs](https://www.linkedin.com/in/aleksandrslivincovs/)
|
|
102
|
-
- [Julia Graham](https://www.linkedin.com/in/julia-graham-959a78a7/)
|
|
103
|
-
|
|
104
|
-
### Contributors
|
|
105
|
-
We are very grateful for the contributions made by:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- [Marie Solvik Lepoutre](https://www.linkedin.com/in/mslepoutre/), who improved RDF triples projections to Cognite Data Fusion
|
|
109
|
-
- [Bård Henning Tvedt](https://www.linkedin.com/in/bhtvedt/), who implemented IMF importer
|
|
110
|
-
- [Hassan Gomaa](https://www.linkedin.com/in/dr-hassan-gomaa-232638121/), who extended the DEXPI extractor
|
|
111
|
-
- [Kristina Tomičić](https://www.linkedin.com/in/kristina-tomicic-6bb443108/), who implemented Data Model and Instances visualization
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
## Sponsors
|
|
115
|
-
NEAT is developed and maintained by Cognite. We are grateful for the past support of our sponsors, who funded us to develop NEAT and to make it open source.
|
|
116
|
-
|
|
117
|
-
- [Statnett](https://www.statnett.no/) - the MIMIR team ([Ola Hagen Øyan](https://www.linkedin.com/in/ola-%C3%B8yan-b0205b19/), [Olav Westeng Alstad](https://www.linkedin.com/in/olav-w-alstad-52329191/),[Andreas Kimsås](https://www.linkedin.com/in/andreas-kims%C3%A5s-964a0b2/) and [Anders Willersrud](https://www.linkedin.com/in/anders-willersrud-13a20220/)) – who supported the development of NEAT from end of 2022 to mid of 2023 and its integration with Statnett's infrastructure, where NEAT was battle-tested as a tool for non-sematic experts to define data models and transform large knowledge graphs representing the entire Norwegian power grid system. Without Statnett's support NEAT would not exist in the first place, and would not be open-source.
|
|
118
|
-
- [Aker Solutions](https://www.akersolutions.com/) – the IMod Team (currently lead by [Maria Kenderkova](https://www.linkedin.com/in/maria-kenderkova/)), who funded development of NEAT from mid of 2023 till end of 2024 (multi-level and role-based data modeling, support for ontologies, IMF, DEXPI, AML,...) , as well who were early adopters and embraced NEAT and who were patient with us when things did not work so well. Aker Solutions was instrumental to elevating NEAT to a product level, and who selflessly advocate for NEAT globally.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
## Installation
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
pip install cognite-neat
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Usage
|
|
128
|
-
|
|
129
|
-
The user interface for `NEAT` is a notebook-based environment. Once you have set up your notebook
|
|
130
|
-
environment, you start by creating a `CogniteClient` and instantiate a `NeatSession` object.
|
|
131
|
-
|
|
132
|
-
```python
|
|
133
|
-
from cognite.neat import NeatSession, get_cognite_client
|
|
134
|
-
|
|
135
|
-
client = get_cognite_client(".env")
|
|
136
|
-
|
|
137
|
-
neat = NeatSession(client)
|
|
138
|
-
|
|
139
|
-
neat.read.cdf.data_model(("my_space", "MyDataModel", "v1"))
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## Documentation
|
|
143
|
-
|
|
144
|
-
For more information, see the [documentation](https://cognite-neat.readthedocs-hosted.com/en/latest/)
|