cognite-neat 1.0.9__tar.gz → 1.0.11__tar.gz
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-1.0.9 → cognite_neat-1.0.11}/PKG-INFO +1 -1
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/__init__.py +2 -2
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_config.py +14 -2
- cognite_neat-1.0.11/cognite/neat/_data_model/_analysis.py +345 -0
- cognite_neat-1.0.11/cognite/neat/_data_model/_snapshot.py +133 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/data_classes.py +1 -15
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/deployer.py +2 -27
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_references.py +6 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_views.py +6 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/dms/_ai_readiness.py +44 -36
- cognite_neat-1.0.11/cognite/neat/_data_model/validation/dms/_base.py +24 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/dms/_connections.py +125 -91
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/dms/_consistency.py +12 -11
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/dms/_containers.py +57 -38
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/dms/_limits.py +43 -118
- cognite_neat-1.0.11/cognite/neat/_data_model/validation/dms/_orchestrator.py +66 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/dms/_views.py +29 -4
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/templates/deployment.html +1 -1
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/templates/issues.html +1 -1
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_physical.py +42 -18
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_session.py +1 -1
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_wrappers.py +22 -7
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_store/_store.py +21 -1
- cognite_neat-1.0.11/cognite/neat/_version.py +2 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/pyproject.toml +1 -1
- cognite_neat-1.0.9/cognite/neat/_data_model/_analysis.py +0 -196
- cognite_neat-1.0.9/cognite/neat/_data_model/validation/dms/_base.py +0 -349
- cognite_neat-1.0.9/cognite/neat/_data_model/validation/dms/_orchestrator.py +0 -222
- cognite_neat-1.0.9/cognite/neat/_version.py +0 -2
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/README.md +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/api.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/client.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/config.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/containers_api.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/data_classes.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/data_model_api.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/spaces_api.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/statistics_api.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_client/views_api.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/_constants.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/_identifiers.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/_shared.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/_differ.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/_differ_container.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/_differ_data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/_differ_space.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/_differ_view.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/exporters/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/exporters/_api_exporter.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/exporters/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/exporters/_table_exporter/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/exporters/_table_exporter/exporter.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/exporters/_table_exporter/workbook.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/exporters/_table_exporter/writer.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/_api_importer.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/_table_importer/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/_table_importer/data_classes.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/_table_importer/importer.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/_table_importer/reader.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/importers/_table_importer/source.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/conceptual/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/conceptual/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/conceptual/_concept.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/conceptual/_data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/conceptual/_properties.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/conceptual/_property.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_constants.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_constraints.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_container.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_data_types.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_http.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_indexes.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_limits.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_schema.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_space.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_types.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_view_filter.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_view_property.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/entities/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/entities/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/entities/_constants.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/entities/_data_types.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/entities/_identifiers.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/entities/_parser.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/validation/dms/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_exceptions.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_issues.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/_render.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/static/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/static/deployment.css +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/static/deployment.js +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/static/issues.css +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/static/issues.js +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/static/shared.css +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_html/templates/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_issues.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_result/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_result/_deployment/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_result/_deployment/_physical/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_result/_deployment/_physical/_changes.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_result/_deployment/_physical/_statistics.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_result/_deployment/_physical/serializer.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_result/_result.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_usage_analytics/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_usage_analytics/_collector.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_usage_analytics/_constants.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_session/_usage_analytics/_storage.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_state_machine/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_state_machine/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_state_machine/_states.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_store/_provenance.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/_reader.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/collection.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/http_client/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/http_client/_client.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/http_client/_config.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/http_client/_data_classes.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/http_client/_tracker.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/useful_types.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_utils/validation.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/_api/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/_api/data_modeling_loaders.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/_api/neat_instances.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/_api/schema.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/_api/statistics.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/_api_client.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/data_classes/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/data_classes/data_modeling.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/data_classes/neat_sequence.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/data_classes/schema.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/data_classes/statistics.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_client/testing.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_config.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_constants.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/_constants.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/_shared.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/analysis/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/analysis/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/catalog/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/catalog/classic_model.xlsx +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/catalog/conceptual-imf-data-model.xlsx +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/catalog/hello_world_pump.xlsx +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/exporters/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/exporters/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/exporters/_data_model2dms.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/exporters/_data_model2excel.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/exporters/_data_model2instance_template.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/exporters/_data_model2semantic_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/exporters/_data_model2yaml.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_base_file_reader.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_dict2data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_dms2data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_graph2data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_rdf/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_rdf/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_rdf/_inference2rdata_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_rdf/_owl2data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_rdf/_shared.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/importers/_spreadsheet2data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/_base_unverified.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/_base_verified.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/_import_contexts.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/_types.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/conceptual/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/conceptual/_unverified.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/conceptual/_validation.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/conceptual/_verified.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/data_types.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/_constants.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/_loaders.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/_multi_value.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/_restrictions.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/_single_value.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/_types.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/entities/_wrapped.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/mapping/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/mapping/_classic2core.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/mapping/_classic2core.yaml +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/physical/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/physical/_exporter.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/physical/_unverified.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/physical/_validation.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/models/physical/_verified.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/transformers/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/transformers/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/transformers/_converters.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/transformers/_mapping.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/transformers/_union_conceptual.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_data_model/transformers/_verification.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/_shared.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/_tracking/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/_tracking/base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/_tracking/log.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/examples/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_classic.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_dict.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_dms.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_dms_graph.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_raw.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/extractors/_rdf_file.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/loaders/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/loaders/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/loaders/_rdf2dms.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/loaders/_rdf_to_instance_space.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/queries/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/queries/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/queries/_queries.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/queries/_select.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/queries/_update.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/transformers/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/transformers/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/transformers/_classic_cdf.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/transformers/_prune_graph.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/transformers/_rdfpath.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_instances/transformers/_value_type.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/_contextmanagers.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/_factory.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/errors/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/errors/_external.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/errors/_general.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/errors/_properties.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/errors/_resources.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/errors/_wrapper.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/formatters.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/warnings/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/warnings/_external.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/warnings/_general.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/warnings/_models.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/warnings/_properties.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/warnings/_resources.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_shared.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_store/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_store/_data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_store/_instance.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_store/_provenance.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_store/exceptions.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/auth.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/auxiliary.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/collection_.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/graph_transformations_report.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/io_.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/rdf_.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/reader/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/reader/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/spreadsheet.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/tarjan.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/text.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/time_.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/upload.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/core/_utils/xml_.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/engine/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/engine/_import.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/engine/_interface.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/engine/_load.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/plugins/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/plugins/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/plugins/_data_model.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/plugins/_issues.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/plugins/_manager.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/__init__.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_base.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_collector.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_diff.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_drop.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_experimental.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_explore.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_fix.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_inspect.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_mapping.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_plugin.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_prepare.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_read.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_set.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_show.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_state/README.md +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_state.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_subset.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_template.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_to.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/_wizard.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_v0/session/exceptions.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/legacy.py +0 -0
- {cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.11
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Author: Nikola Vasiljevic, Anders Albert
|
|
6
6
|
Author-email: Nikola Vasiljevic <nikola.vasiljevic@cognite.com>, Anders Albert <anders.albert@cognite.com>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from cognite.neat._v0.core._utils.auth import get_cognite_client
|
|
2
2
|
|
|
3
|
-
from ._config import NeatConfig
|
|
3
|
+
from ._config import NeatConfig, get_neat_config_from_file
|
|
4
4
|
from ._session import NeatSession
|
|
5
5
|
from ._version import __version__
|
|
6
6
|
|
|
7
|
-
__all__ = ["NeatConfig", "NeatSession", "__version__", "get_cognite_client"]
|
|
7
|
+
__all__ = ["NeatConfig", "NeatSession", "__version__", "get_cognite_client", "get_neat_config_from_file"]
|
|
@@ -121,7 +121,7 @@ class AlphaFlagConfig(ConfigModel):
|
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
class NeatConfig(ConfigModel):
|
|
124
|
-
"""
|
|
124
|
+
"""NeatSession configuration."""
|
|
125
125
|
|
|
126
126
|
profile: str
|
|
127
127
|
validation: ValidationConfig
|
|
@@ -139,7 +139,19 @@ class NeatConfig(ConfigModel):
|
|
|
139
139
|
|
|
140
140
|
@classmethod
|
|
141
141
|
def create_predefined(cls, profile: PredefinedProfile = "legacy-additive") -> "NeatConfig":
|
|
142
|
-
"""Create NeatConfig from internal profiles.
|
|
142
|
+
"""Create NeatConfig from internal profiles.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
profile: Profile name to use. Defaults to "legacy-additive".
|
|
146
|
+
|
|
147
|
+
!!! note "Predefined Profiles"
|
|
148
|
+
The following predefined profiles are available:
|
|
149
|
+
|
|
150
|
+
- `legacy-additive`: Additive modeling with legacy validation rules.
|
|
151
|
+
- `legacy-rebuild`: Rebuild modeling with legacy validation rules.
|
|
152
|
+
- `deep-additive`: Additive modeling with deep validation rules.
|
|
153
|
+
- `deep-rebuild`: Rebuild modeling with deep validation rules.
|
|
154
|
+
"""
|
|
143
155
|
available_profiles = internal_profiles()
|
|
144
156
|
if profile not in available_profiles:
|
|
145
157
|
raise UserInputError(
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
from itertools import chain
|
|
2
|
+
from typing import Literal, TypeAlias
|
|
3
|
+
|
|
4
|
+
from pyparsing import cached_property
|
|
5
|
+
|
|
6
|
+
from cognite.neat._data_model._snapshot import SchemaSnapshot
|
|
7
|
+
from cognite.neat._data_model.models.dms._container import ContainerRequest
|
|
8
|
+
from cognite.neat._data_model.models.dms._data_types import DirectNodeRelation
|
|
9
|
+
from cognite.neat._data_model.models.dms._limits import SchemaLimits
|
|
10
|
+
from cognite.neat._data_model.models.dms._references import (
|
|
11
|
+
ContainerDirectReference,
|
|
12
|
+
ContainerReference,
|
|
13
|
+
ViewDirectReference,
|
|
14
|
+
ViewReference,
|
|
15
|
+
)
|
|
16
|
+
from cognite.neat._data_model.models.dms._view_property import (
|
|
17
|
+
EdgeProperty,
|
|
18
|
+
ReverseDirectRelationProperty,
|
|
19
|
+
ViewCorePropertyRequest,
|
|
20
|
+
ViewRequestProperty,
|
|
21
|
+
)
|
|
22
|
+
from cognite.neat._data_model.models.dms._views import ViewRequest
|
|
23
|
+
from cognite.neat._utils.useful_types import ModusOperandi
|
|
24
|
+
|
|
25
|
+
# Type aliases for better readability
|
|
26
|
+
ViewsByReference: TypeAlias = dict[ViewReference, ViewRequest]
|
|
27
|
+
ContainersByReference: TypeAlias = dict[ContainerReference, ContainerRequest]
|
|
28
|
+
AncestorsByReference: TypeAlias = dict[ViewReference, set[ViewReference]]
|
|
29
|
+
ReverseToDirectMapping: TypeAlias = dict[
|
|
30
|
+
tuple[ViewReference, str], tuple[ViewReference, ContainerDirectReference | ViewDirectReference]
|
|
31
|
+
]
|
|
32
|
+
ConnectionEndNodeTypes: TypeAlias = dict[tuple[ViewReference, str], ViewReference | None]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
ResourceSource = Literal["auto", "merged", "cdf", "both"]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class ValidationResources:
|
|
39
|
+
def __init__(
|
|
40
|
+
self, modus_operandi: ModusOperandi, local: SchemaSnapshot, cdf: SchemaSnapshot, limits: SchemaLimits
|
|
41
|
+
) -> None:
|
|
42
|
+
self._modus_operandi = modus_operandi
|
|
43
|
+
self.limits = limits
|
|
44
|
+
|
|
45
|
+
self.local = local
|
|
46
|
+
self.cdf = cdf
|
|
47
|
+
|
|
48
|
+
if self._modus_operandi == "additive":
|
|
49
|
+
self.merged = self.local.merge(self.cdf)
|
|
50
|
+
elif self._modus_operandi == "rebuild":
|
|
51
|
+
self.merged = local.model_copy(deep=True)
|
|
52
|
+
else:
|
|
53
|
+
raise RuntimeError(f"ValidationResources: Unknown modus_operandi: {self._modus_operandi}. This is a bug!")
|
|
54
|
+
|
|
55
|
+
# need this shortcut for easier access and also to avoid mypy to complains
|
|
56
|
+
self.merged_data_model = self.merged.data_model[next(iter(self.merged.data_model.keys()))]
|
|
57
|
+
|
|
58
|
+
def select_view(
|
|
59
|
+
self, view_ref: ViewReference, property_: str | None = None, source: ResourceSource = "auto"
|
|
60
|
+
) -> ViewRequest | None:
|
|
61
|
+
"""Select view definition based on source strategy and optionally filter by property.
|
|
62
|
+
|
|
63
|
+
Selection prioritize merged view over CDF if both are available, as merged view represents the effective
|
|
64
|
+
definition which will be a result when the local schema is deployed to CDF.
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
view_ref: The view to select
|
|
69
|
+
property_: Optional property name to filter views that contain this property
|
|
70
|
+
source: The source strategy to use, options are: "auto", "local", "cdf", "both", where "auto" means
|
|
71
|
+
that the selection is driven by the modus_operandi of the validation resources.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
The selected ViewRequest or None if not found.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
check_merged, check_cdf = self._resolve_resource_sources(view_ref, source)
|
|
78
|
+
|
|
79
|
+
merged_view = self.merged.views.get(view_ref) if check_merged else None
|
|
80
|
+
cdf_view = self.cdf.views.get(view_ref) if check_cdf else None
|
|
81
|
+
|
|
82
|
+
if property_ is None:
|
|
83
|
+
return merged_view or cdf_view
|
|
84
|
+
|
|
85
|
+
# Filtering based on the property presence
|
|
86
|
+
# Try views with the property first, then any available view where merged view is prioritized
|
|
87
|
+
candidates = chain(
|
|
88
|
+
(v for v in (merged_view, cdf_view) if v and v.properties and property_ in v.properties),
|
|
89
|
+
(v for v in (merged_view, cdf_view) if v),
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return next(candidates, None)
|
|
93
|
+
|
|
94
|
+
def select_container(
|
|
95
|
+
self, container_ref: ContainerReference, property_: str | None = None, source: ResourceSource = "auto"
|
|
96
|
+
) -> ContainerRequest | None:
|
|
97
|
+
"""Select container definition based on source strategy and optionally filter by property.
|
|
98
|
+
|
|
99
|
+
Selection prioritize merged container over CDF if both are available, as merged container represents
|
|
100
|
+
the effective definition which will be a result when the local schema is deployed to CDF.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
container_ref: The container to select
|
|
104
|
+
property_: Optional property name to filter containers that contain this property
|
|
105
|
+
source: The source strategy to use, options are: "auto", "local", "cdf", "both", where "auto" means
|
|
106
|
+
that the selection is driven by the modus_operandi of the validation resources.
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
The selected ContainerRequest or None if not found.
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
check_merged, check_cdf = self._resolve_resource_sources(container_ref, source)
|
|
113
|
+
|
|
114
|
+
merged_container = self.merged.containers.get(container_ref) if check_merged else None
|
|
115
|
+
cdf_container = self.cdf.containers.get(container_ref) if check_cdf else None
|
|
116
|
+
|
|
117
|
+
if property_ is None:
|
|
118
|
+
return merged_container or cdf_container
|
|
119
|
+
|
|
120
|
+
# Try containers with the property first, then any available container
|
|
121
|
+
candidates = chain(
|
|
122
|
+
(c for c in (merged_container, cdf_container) if c and c.properties and property_ in c.properties),
|
|
123
|
+
(c for c in (merged_container, cdf_container) if c),
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
return next(candidates, None)
|
|
127
|
+
|
|
128
|
+
def _resolve_resource_sources(
|
|
129
|
+
self, resource_ref: ViewReference | ContainerReference, source: ResourceSource
|
|
130
|
+
) -> tuple[bool, bool]:
|
|
131
|
+
"""
|
|
132
|
+
Determine which resource sources (merged and/or CDF) to check based on the source parameter.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
resource_ref: The resource reference to check (ViewReference or ContainerReference)
|
|
136
|
+
source: The source strategy to use
|
|
137
|
+
|
|
138
|
+
Returns:
|
|
139
|
+
Tuple of (check_merged, check_cdf) booleans indicating which sources to check
|
|
140
|
+
"""
|
|
141
|
+
if source == "auto":
|
|
142
|
+
# Auto mode: driven by modus_operandi
|
|
143
|
+
# In "additive" mode or for resources outside local space, check both merged and CDF
|
|
144
|
+
# In "rebuild" mode for resources in local space, check only merged == local
|
|
145
|
+
check_merged = True
|
|
146
|
+
check_cdf = resource_ref.space != self.merged_data_model.space or self._modus_operandi == "additive"
|
|
147
|
+
elif source == "merged":
|
|
148
|
+
check_merged = True
|
|
149
|
+
check_cdf = False
|
|
150
|
+
elif source == "cdf":
|
|
151
|
+
check_merged = False
|
|
152
|
+
check_cdf = True
|
|
153
|
+
elif source == "both":
|
|
154
|
+
check_merged = True
|
|
155
|
+
check_cdf = True
|
|
156
|
+
else:
|
|
157
|
+
raise RuntimeError(f"_resolve_resource_sources: Unknown source: {source}. This is a bug!")
|
|
158
|
+
|
|
159
|
+
return check_merged, check_cdf
|
|
160
|
+
|
|
161
|
+
@cached_property
|
|
162
|
+
def ancestors_by_view(self) -> dict[ViewReference, list[ViewReference]]:
|
|
163
|
+
"""
|
|
164
|
+
Create a mapping of each view to its list of ancestors.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
Dictionary mapping each ViewReference to its list of ancestor ViewReferences
|
|
168
|
+
"""
|
|
169
|
+
ancestors_mapping: dict[ViewReference, list[ViewReference]] = {}
|
|
170
|
+
|
|
171
|
+
if not self.merged_data_model.views:
|
|
172
|
+
return ancestors_mapping
|
|
173
|
+
|
|
174
|
+
for view in self.merged_data_model.views:
|
|
175
|
+
ancestors_mapping[view] = self.view_ancestors(view)
|
|
176
|
+
return ancestors_mapping
|
|
177
|
+
|
|
178
|
+
def view_ancestors(
|
|
179
|
+
self, offspring: ViewReference, ancestors: list[ViewReference] | None = None, source: ResourceSource = "auto"
|
|
180
|
+
) -> list[ViewReference]:
|
|
181
|
+
"""
|
|
182
|
+
Recursively find all ancestors of a given view by traversing the implements hierarchy.
|
|
183
|
+
Handles branching to explore all possible ancestor paths.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
offspring: The view to find ancestors for
|
|
187
|
+
ancestors: Accumulated list of ancestors (used internally for recursion)
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
List of all ancestor ViewReferences
|
|
191
|
+
"""
|
|
192
|
+
if ancestors is None:
|
|
193
|
+
ancestors = []
|
|
194
|
+
|
|
195
|
+
# Determine which view definition to use based on space and modus operandi
|
|
196
|
+
|
|
197
|
+
view_definition = self.select_view(view_ref=offspring, source=source)
|
|
198
|
+
|
|
199
|
+
# Base case: no view definition or no implements
|
|
200
|
+
if not view_definition or not view_definition.implements:
|
|
201
|
+
return ancestors
|
|
202
|
+
|
|
203
|
+
# Explore all parent branches
|
|
204
|
+
for parent in view_definition.implements:
|
|
205
|
+
if parent not in ancestors:
|
|
206
|
+
ancestors.append(parent)
|
|
207
|
+
# Recursively explore this branch
|
|
208
|
+
self.view_ancestors(parent, ancestors)
|
|
209
|
+
|
|
210
|
+
return ancestors
|
|
211
|
+
|
|
212
|
+
def is_ancestor(self, offspring: ViewReference, ancestor: ViewReference) -> bool:
|
|
213
|
+
return ancestor in self.ancestors_by_view.get(offspring, set())
|
|
214
|
+
|
|
215
|
+
@cached_property
|
|
216
|
+
def properties_by_view(self) -> dict[ViewReference, dict[str, ViewRequestProperty]]:
|
|
217
|
+
"""Get a mapping of view references to their corresponding properties, both directly defined and inherited
|
|
218
|
+
from ancestor views through implements."""
|
|
219
|
+
|
|
220
|
+
properties_mapping: dict[ViewReference, dict[str, ViewRequestProperty]] = {}
|
|
221
|
+
|
|
222
|
+
if self.merged_data_model.views:
|
|
223
|
+
for view_ref in self.merged_data_model.views:
|
|
224
|
+
view = self.select_view(view_ref)
|
|
225
|
+
# This should never happen, if it happens, it's a bug
|
|
226
|
+
if not view:
|
|
227
|
+
raise RuntimeError(f"properties_by_view: View {view_ref!s} not found. This is a bug!")
|
|
228
|
+
|
|
229
|
+
combined_properties: dict[str, ViewRequestProperty] = {}
|
|
230
|
+
ancestors = self.ancestors_by_view.get(view_ref, [])
|
|
231
|
+
# Start with properties from ancestor views
|
|
232
|
+
for ancestor_ref in reversed(ancestors):
|
|
233
|
+
ancestor_view = self.select_view(ancestor_ref)
|
|
234
|
+
if ancestor_view:
|
|
235
|
+
combined_properties.update(ancestor_view.properties)
|
|
236
|
+
|
|
237
|
+
# Finally, add properties from the current view, overriding any inherited ones
|
|
238
|
+
if view.properties:
|
|
239
|
+
combined_properties.update(view.properties)
|
|
240
|
+
|
|
241
|
+
properties_mapping[view_ref] = combined_properties
|
|
242
|
+
|
|
243
|
+
return properties_mapping
|
|
244
|
+
|
|
245
|
+
@cached_property
|
|
246
|
+
def referenced_containers(self) -> set[ContainerReference]:
|
|
247
|
+
"""Get a set of all container references used by the views in the local data model."""
|
|
248
|
+
|
|
249
|
+
referenced_containers: set[ContainerReference] = set()
|
|
250
|
+
|
|
251
|
+
if not self.merged_data_model.views:
|
|
252
|
+
return referenced_containers
|
|
253
|
+
|
|
254
|
+
for view_ref in self.merged_data_model.views:
|
|
255
|
+
view = self.select_view(view_ref)
|
|
256
|
+
# This should never happen, if it happens, it's a bug
|
|
257
|
+
if not view:
|
|
258
|
+
raise RuntimeError(f"referenced_containers: View {view_ref!s} not found. This is a bug!")
|
|
259
|
+
|
|
260
|
+
if not view.properties:
|
|
261
|
+
continue
|
|
262
|
+
for property_ in view.properties.values():
|
|
263
|
+
if isinstance(property_, ViewCorePropertyRequest):
|
|
264
|
+
referenced_containers.add(property_.container)
|
|
265
|
+
|
|
266
|
+
return referenced_containers
|
|
267
|
+
|
|
268
|
+
@cached_property
|
|
269
|
+
def reverse_to_direct_mapping(
|
|
270
|
+
self,
|
|
271
|
+
) -> dict[tuple[ViewReference, str], tuple[ViewReference, ContainerDirectReference | ViewDirectReference]]:
|
|
272
|
+
"""Get a mapping of reverse direct relations to their corresponding source view and 'through' property."""
|
|
273
|
+
|
|
274
|
+
bidirectional_connections: dict[
|
|
275
|
+
tuple[ViewReference, str], tuple[ViewReference, ContainerDirectReference | ViewDirectReference]
|
|
276
|
+
] = {}
|
|
277
|
+
|
|
278
|
+
if self.merged_data_model.views:
|
|
279
|
+
for view_ref in self.merged_data_model.views:
|
|
280
|
+
view = self.select_view(view_ref)
|
|
281
|
+
|
|
282
|
+
# This should never happen, if it happens, it's a bug
|
|
283
|
+
if not view:
|
|
284
|
+
raise RuntimeError(f"reverse_to_direct_mapping: View {view_ref!s} not found. This is a bug!")
|
|
285
|
+
|
|
286
|
+
if not view.properties:
|
|
287
|
+
continue
|
|
288
|
+
for prop_ref, property_ in view.properties.items():
|
|
289
|
+
# reverse direct relation
|
|
290
|
+
if isinstance(property_, ReverseDirectRelationProperty):
|
|
291
|
+
bidirectional_connections[(view_ref, prop_ref)] = (
|
|
292
|
+
property_.source,
|
|
293
|
+
property_.through,
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
return bidirectional_connections
|
|
297
|
+
|
|
298
|
+
@property
|
|
299
|
+
def connection_end_node_types(self) -> dict[tuple[ViewReference, str], ViewReference | None]:
|
|
300
|
+
"""Get a mapping of view references to their corresponding ViewRequest objects."""
|
|
301
|
+
|
|
302
|
+
connection_end_node_types: dict[tuple[ViewReference, str], ViewReference | None] = {}
|
|
303
|
+
|
|
304
|
+
if self.merged_data_model.views:
|
|
305
|
+
for view_ref in self.merged_data_model.views:
|
|
306
|
+
view = self.select_view(view_ref)
|
|
307
|
+
if not view:
|
|
308
|
+
raise RuntimeError(f"View {view_ref!s} not found. This is a bug!")
|
|
309
|
+
|
|
310
|
+
if not view.properties:
|
|
311
|
+
continue
|
|
312
|
+
|
|
313
|
+
for prop_ref, property_ in view.properties.items():
|
|
314
|
+
# direct relation
|
|
315
|
+
if isinstance(property_, ViewCorePropertyRequest):
|
|
316
|
+
# explicit set of end node type via 'source' which is View reference
|
|
317
|
+
if property_.source:
|
|
318
|
+
connection_end_node_types[(view_ref, prop_ref)] = property_.source
|
|
319
|
+
|
|
320
|
+
# implicit end node type via container property, without actual knowledge of end node type
|
|
321
|
+
elif (
|
|
322
|
+
(
|
|
323
|
+
container := self.select_container(
|
|
324
|
+
property_.container, property_.container_property_identifier
|
|
325
|
+
)
|
|
326
|
+
)
|
|
327
|
+
and (property_.container_property_identifier in container.properties)
|
|
328
|
+
and (
|
|
329
|
+
isinstance(
|
|
330
|
+
container.properties[property_.container_property_identifier].type,
|
|
331
|
+
DirectNodeRelation,
|
|
332
|
+
)
|
|
333
|
+
)
|
|
334
|
+
):
|
|
335
|
+
connection_end_node_types[(view_ref, prop_ref)] = None
|
|
336
|
+
|
|
337
|
+
# reverse direct relation
|
|
338
|
+
elif isinstance(property_, ReverseDirectRelationProperty) and property_.source:
|
|
339
|
+
connection_end_node_types[(view_ref, prop_ref)] = property_.source
|
|
340
|
+
|
|
341
|
+
# edge property
|
|
342
|
+
elif isinstance(property_, EdgeProperty) and property_.source:
|
|
343
|
+
connection_end_node_types[(view_ref, prop_ref)] = property_.source
|
|
344
|
+
|
|
345
|
+
return connection_end_node_types
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from datetime import datetime, timezone
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field, field_serializer
|
|
6
|
+
from pydantic_core.core_schema import FieldSerializationInfo
|
|
7
|
+
|
|
8
|
+
from cognite.neat._client import NeatClient
|
|
9
|
+
from cognite.neat._data_model.models.dms import (
|
|
10
|
+
ContainerReference,
|
|
11
|
+
ContainerRequest,
|
|
12
|
+
DataModelReference,
|
|
13
|
+
DataModelRequest,
|
|
14
|
+
NodeReference,
|
|
15
|
+
RequestSchema,
|
|
16
|
+
SpaceReference,
|
|
17
|
+
SpaceRequest,
|
|
18
|
+
ViewReference,
|
|
19
|
+
ViewRequest,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
if sys.version_info >= (3, 11):
|
|
23
|
+
from typing import Self
|
|
24
|
+
else:
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SchemaSnapshot(BaseModel, extra="ignore"):
|
|
29
|
+
timestamp: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
|
30
|
+
data_model: dict[DataModelReference, DataModelRequest] = Field(default_factory=dict)
|
|
31
|
+
views: dict[ViewReference, ViewRequest] = Field(default_factory=dict)
|
|
32
|
+
containers: dict[ContainerReference, ContainerRequest] = Field(default_factory=dict)
|
|
33
|
+
spaces: dict[SpaceReference, SpaceRequest] = Field(default_factory=dict)
|
|
34
|
+
node_types: dict[NodeReference, NodeReference] = Field(default_factory=dict)
|
|
35
|
+
|
|
36
|
+
@field_serializer("data_model", "views", "containers", "spaces", "node_types", mode="plain")
|
|
37
|
+
@classmethod
|
|
38
|
+
def make_hashable_keys(cls, value: dict, info: FieldSerializationInfo) -> dict[str, Any]:
|
|
39
|
+
output: dict[str, Any] = {}
|
|
40
|
+
for key, val in value.items():
|
|
41
|
+
dumped_value = val.model_dump(**vars(info))
|
|
42
|
+
output[str(key)] = dumped_value
|
|
43
|
+
return output
|
|
44
|
+
|
|
45
|
+
def merge(self, cdf: Self) -> Self:
|
|
46
|
+
"""Merge another SchemaSnapshot into this one, prioritizing this snapshot's data."""
|
|
47
|
+
merged = self.model_copy(deep=True)
|
|
48
|
+
|
|
49
|
+
for model_ref, local_model in merged.data_model.items():
|
|
50
|
+
if model_ref not in cdf.data_model:
|
|
51
|
+
continue
|
|
52
|
+
cdf_model = cdf.data_model[model_ref]
|
|
53
|
+
if new_views := (set(cdf_model.views or []) - set(local_model.views or [])):
|
|
54
|
+
for view_ref in new_views:
|
|
55
|
+
if cdf_view := cdf.views.get(view_ref):
|
|
56
|
+
merged.views[view_ref] = cdf_view
|
|
57
|
+
# We append the local views at the end of the CDF views.
|
|
58
|
+
local_model.views = list(dict.fromkeys((cdf_model.views or []) + (local_model.views or [])).keys())
|
|
59
|
+
|
|
60
|
+
# Update local views with additional properties and implements from CDF views
|
|
61
|
+
for view_ref, view in merged.views.items():
|
|
62
|
+
if cdf_view := cdf.views.get(view_ref):
|
|
63
|
+
if cdf_only_containers := cdf_view.used_containers - set(view.used_containers):
|
|
64
|
+
for cdf_only_container_ref in cdf_only_containers:
|
|
65
|
+
if (
|
|
66
|
+
cdf_container := cdf.containers.get(cdf_only_container_ref)
|
|
67
|
+
) and cdf_only_container_ref not in merged.containers:
|
|
68
|
+
merged.containers[cdf_only_container_ref] = cdf_container
|
|
69
|
+
|
|
70
|
+
view.properties = {**cdf_view.properties, **view.properties}
|
|
71
|
+
|
|
72
|
+
# update implements
|
|
73
|
+
if cdf_view.implements:
|
|
74
|
+
view.implements = list(dict.fromkeys(cdf_view.implements + (view.implements or [])).keys())
|
|
75
|
+
|
|
76
|
+
for container_ref, container in merged.containers.items():
|
|
77
|
+
if cdf_container := cdf.containers.get(container_ref):
|
|
78
|
+
container.properties = {**cdf_container.properties, **container.properties}
|
|
79
|
+
|
|
80
|
+
return merged
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def fetch_cdf_data_model(cls, client: NeatClient, data_model: RequestSchema) -> Self:
|
|
84
|
+
"""Fetch the latest data model, views, containers, and spaces from CDF based on the provided RequestSchema."""
|
|
85
|
+
now = datetime.now(timezone.utc)
|
|
86
|
+
space_ids = [space.as_reference() for space in data_model.spaces]
|
|
87
|
+
cdf_spaces = client.spaces.retrieve(space_ids)
|
|
88
|
+
|
|
89
|
+
container_refs = [c.as_reference() for c in data_model.containers]
|
|
90
|
+
cdf_containers = client.containers.retrieve(container_refs)
|
|
91
|
+
|
|
92
|
+
view_refs = [v.as_reference() for v in data_model.views]
|
|
93
|
+
cdf_views = client.views.retrieve(view_refs)
|
|
94
|
+
|
|
95
|
+
dm_ref = data_model.data_model.as_reference()
|
|
96
|
+
cdf_data_models = client.data_models.retrieve([dm_ref])
|
|
97
|
+
|
|
98
|
+
nodes = [node_type for view in cdf_views for node_type in view.node_types]
|
|
99
|
+
return cls(
|
|
100
|
+
timestamp=now,
|
|
101
|
+
data_model={dm.as_reference(): dm.as_request() for dm in cdf_data_models},
|
|
102
|
+
views={view.as_reference(): view.as_request() for view in cdf_views},
|
|
103
|
+
containers={container.as_reference(): container.as_request() for container in cdf_containers},
|
|
104
|
+
spaces={space.as_reference(): space.as_request() for space in cdf_spaces},
|
|
105
|
+
node_types={node: node for node in nodes},
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
@classmethod
|
|
109
|
+
def fetch_entire_cdf(cls, client: NeatClient) -> Self:
|
|
110
|
+
"""Fetch the entire data model, views, containers, and spaces from CDF."""
|
|
111
|
+
now = datetime.now(timezone.utc)
|
|
112
|
+
all_views = client.views.list(
|
|
113
|
+
all_versions=True, include_global=True, include_inherited_properties=False, limit=None
|
|
114
|
+
)
|
|
115
|
+
nodes = [node_type for view in all_views for node_type in view.node_types]
|
|
116
|
+
return cls(
|
|
117
|
+
# TODO: spaces and data_models should be update after updating list methods for unlimited no
|
|
118
|
+
spaces={
|
|
119
|
+
response.as_reference(): response.as_request()
|
|
120
|
+
for response in client.spaces.list(include_global=True, limit=1000)
|
|
121
|
+
},
|
|
122
|
+
data_model={
|
|
123
|
+
response.as_reference(): response.as_request()
|
|
124
|
+
for response in client.data_models.list(all_versions=True, include_global=True, limit=1000)
|
|
125
|
+
},
|
|
126
|
+
views={response.as_reference(): response.as_request() for response in all_views},
|
|
127
|
+
containers={
|
|
128
|
+
response.as_reference(): response.as_request()
|
|
129
|
+
for response in client.containers.list(include_global=True, limit=None)
|
|
130
|
+
},
|
|
131
|
+
node_types={node_type: node_type for node_type in nodes},
|
|
132
|
+
timestamp=now,
|
|
133
|
+
)
|
{cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/deployer/data_classes.py
RENAMED
|
@@ -3,13 +3,13 @@ import sys
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
4
|
from collections import UserList, defaultdict
|
|
5
5
|
from collections.abc import Hashable, Sequence
|
|
6
|
-
from datetime import datetime
|
|
7
6
|
from enum import Enum
|
|
8
7
|
from typing import Any, Generic, Literal, TypeAlias, cast
|
|
9
8
|
|
|
10
9
|
from pydantic import BaseModel, Field
|
|
11
10
|
from pydantic.alias_generators import to_camel
|
|
12
11
|
|
|
12
|
+
from cognite.neat._data_model._snapshot import SchemaSnapshot
|
|
13
13
|
from cognite.neat._data_model.models.dms import (
|
|
14
14
|
BaseModelObject,
|
|
15
15
|
Constraint,
|
|
@@ -18,16 +18,11 @@ from cognite.neat._data_model.models.dms import (
|
|
|
18
18
|
ContainerPropertyDefinition,
|
|
19
19
|
ContainerReference,
|
|
20
20
|
ContainerRequest,
|
|
21
|
-
DataModelReference,
|
|
22
21
|
DataModelRequest,
|
|
23
22
|
DataModelResource,
|
|
24
23
|
Index,
|
|
25
|
-
NodeReference,
|
|
26
|
-
SpaceReference,
|
|
27
|
-
SpaceRequest,
|
|
28
24
|
T_DataModelResource,
|
|
29
25
|
T_ResourceId,
|
|
30
|
-
ViewReference,
|
|
31
26
|
ViewRequest,
|
|
32
27
|
ViewRequestProperty,
|
|
33
28
|
)
|
|
@@ -239,15 +234,6 @@ class ContainerDeploymentPlan(ResourceDeploymentPlan[ContainerReference, Contain
|
|
|
239
234
|
return False
|
|
240
235
|
|
|
241
236
|
|
|
242
|
-
class SchemaSnapshot(BaseDeployObject):
|
|
243
|
-
timestamp: datetime
|
|
244
|
-
data_model: dict[DataModelReference, DataModelRequest]
|
|
245
|
-
views: dict[ViewReference, ViewRequest]
|
|
246
|
-
containers: dict[ContainerReference, ContainerRequest]
|
|
247
|
-
spaces: dict[SpaceReference, SpaceRequest]
|
|
248
|
-
node_types: dict[NodeReference, NodeReference]
|
|
249
|
-
|
|
250
|
-
|
|
251
237
|
class ResourceDeploymentPlanList(UserList[ResourceDeploymentPlan]):
|
|
252
238
|
def consolidate_changes(self) -> Self:
|
|
253
239
|
"""Consolidate the deployment plans by applying field removals to the new_value of resources."""
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from collections.abc import Callable, Mapping, Sequence
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
-
from datetime import datetime, timezone
|
|
4
3
|
from functools import partial
|
|
5
4
|
from typing import cast
|
|
6
5
|
|
|
7
6
|
from cognite.neat._client import NeatClient
|
|
8
7
|
from cognite.neat._data_model._shared import OnSuccessResultProducer
|
|
8
|
+
from cognite.neat._data_model._snapshot import SchemaSnapshot
|
|
9
9
|
from cognite.neat._data_model.models.dms import (
|
|
10
10
|
ContainerReference,
|
|
11
11
|
ContainerRequest,
|
|
@@ -46,7 +46,6 @@ from .data_classes import (
|
|
|
46
46
|
ResourceChange,
|
|
47
47
|
ResourceDeploymentPlan,
|
|
48
48
|
ResourceDeploymentPlanList,
|
|
49
|
-
SchemaSnapshot,
|
|
50
49
|
SeverityType,
|
|
51
50
|
)
|
|
52
51
|
|
|
@@ -88,7 +87,7 @@ class SchemaDeployer(OnSuccessResultProducer):
|
|
|
88
87
|
|
|
89
88
|
def deploy(self, data_model: RequestSchema) -> DeploymentResult:
|
|
90
89
|
# Step 1: Fetch current CDF state
|
|
91
|
-
snapshot = self.
|
|
90
|
+
snapshot = SchemaSnapshot.fetch_cdf_data_model(self.client, data_model)
|
|
92
91
|
|
|
93
92
|
# Step 2: Create deployment plan by comparing local vs cdf
|
|
94
93
|
plan = self.create_deployment_plan(snapshot, data_model)
|
|
@@ -128,30 +127,6 @@ class SchemaDeployer(OnSuccessResultProducer):
|
|
|
128
127
|
status="success" if changes.is_success else "partial", plan=list(plan), snapshot=snapshot, responses=changes
|
|
129
128
|
)
|
|
130
129
|
|
|
131
|
-
def fetch_cdf_state(self, data_model: RequestSchema) -> SchemaSnapshot:
|
|
132
|
-
now = datetime.now(tz=timezone.utc)
|
|
133
|
-
space_ids = [space.as_reference() for space in data_model.spaces]
|
|
134
|
-
cdf_spaces = self.client.spaces.retrieve(space_ids)
|
|
135
|
-
|
|
136
|
-
container_refs = [c.as_reference() for c in data_model.containers]
|
|
137
|
-
cdf_containers = self.client.containers.retrieve(container_refs)
|
|
138
|
-
|
|
139
|
-
view_refs = [v.as_reference() for v in data_model.views]
|
|
140
|
-
cdf_views = self.client.views.retrieve(view_refs)
|
|
141
|
-
|
|
142
|
-
dm_ref = data_model.data_model.as_reference()
|
|
143
|
-
cdf_data_models = self.client.data_models.retrieve([dm_ref])
|
|
144
|
-
|
|
145
|
-
nodes = [node_type for view in cdf_views for node_type in view.node_types]
|
|
146
|
-
return SchemaSnapshot(
|
|
147
|
-
timestamp=now,
|
|
148
|
-
data_model={dm.as_reference(): dm.as_request() for dm in cdf_data_models},
|
|
149
|
-
views={view.as_reference(): view.as_request() for view in cdf_views},
|
|
150
|
-
containers={container.as_reference(): container.as_request() for container in cdf_containers},
|
|
151
|
-
spaces={space.as_reference(): space.as_request() for space in cdf_spaces},
|
|
152
|
-
node_types={node: node for node in nodes},
|
|
153
|
-
)
|
|
154
|
-
|
|
155
130
|
def create_deployment_plan(self, snapshot: SchemaSnapshot, data_model: RequestSchema) -> ResourceDeploymentPlanList:
|
|
156
131
|
return ResourceDeploymentPlanList(
|
|
157
132
|
[
|
{cognite_neat-1.0.9 → cognite_neat-1.0.11}/cognite/neat/_data_model/models/dms/_references.py
RENAMED
|
@@ -114,6 +114,9 @@ class ContainerDirectReference(ReferenceObject):
|
|
|
114
114
|
pattern=CONTAINER_AND_VIEW_PROPERTIES_IDENTIFIER_PATTERN,
|
|
115
115
|
)
|
|
116
116
|
|
|
117
|
+
def __str__(self) -> str:
|
|
118
|
+
return f"{self.source!s}.{self.identifier}"
|
|
119
|
+
|
|
117
120
|
|
|
118
121
|
class ViewDirectReference(ReferenceObject):
|
|
119
122
|
source: ViewReference = Field(
|
|
@@ -126,6 +129,9 @@ class ViewDirectReference(ReferenceObject):
|
|
|
126
129
|
pattern=CONTAINER_AND_VIEW_PROPERTIES_IDENTIFIER_PATTERN,
|
|
127
130
|
)
|
|
128
131
|
|
|
132
|
+
def __str__(self) -> str:
|
|
133
|
+
return f"{self.source!s}.{self.identifier}"
|
|
134
|
+
|
|
129
135
|
|
|
130
136
|
class ContainerIndexReference(ContainerReference):
|
|
131
137
|
identifier: str
|
|
@@ -21,6 +21,7 @@ from ._references import ContainerReference, NodeReference, ViewReference
|
|
|
21
21
|
from ._view_filter import Filter
|
|
22
22
|
from ._view_property import (
|
|
23
23
|
EdgeProperty,
|
|
24
|
+
ViewCorePropertyRequest,
|
|
24
25
|
ViewCorePropertyResponse,
|
|
25
26
|
ViewRequestProperty,
|
|
26
27
|
ViewResponseProperty,
|
|
@@ -130,6 +131,11 @@ class ViewRequest(View):
|
|
|
130
131
|
"""Validate properties Identifier"""
|
|
131
132
|
return _validate_properties_keys(val)
|
|
132
133
|
|
|
134
|
+
@property
|
|
135
|
+
def used_containers(self) -> set[ContainerReference]:
|
|
136
|
+
"""Get all containers referenced by this view."""
|
|
137
|
+
return {prop.container for prop in self.properties.values() if isinstance(prop, ViewCorePropertyRequest)}
|
|
138
|
+
|
|
133
139
|
|
|
134
140
|
class ViewResponse(View, WriteableResource[ViewRequest]):
|
|
135
141
|
properties: dict[str, ViewResponseProperty] = Field(
|