cognite-neat 0.76.3__tar.gz → 0.77.0__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-0.76.3 → cognite_neat-0.77.0}/PKG-INFO +1 -1
- cognite_neat-0.77.0/cognite/neat/_version.py +1 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/_rules2dms.py +3 -5
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_dms2rules.py +64 -31
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/_exporter.py +1 -3
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/_rules.py +2 -4
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/_schema.py +134 -39
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/_validation.py +1 -1
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/pyproject.toml +1 -1
- cognite_neat-0.76.3/cognite/neat/_version.py +0 -1
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/LICENSE +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/README.md +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/config.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/stores/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/analysis/_information_rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/_models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/data_types.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/_converter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/dms/_serializer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/domain.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/entities.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/information/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/information/_converter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/information/_rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/rules/models/wrapped_entities.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/utils.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/utils/xml.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.77.0"
|
|
@@ -5,7 +5,7 @@ from typing import Literal, TypeAlias, cast
|
|
|
5
5
|
|
|
6
6
|
from cognite.client import CogniteClient
|
|
7
7
|
from cognite.client.data_classes._base import CogniteResource, CogniteResourceList
|
|
8
|
-
from cognite.client.data_classes.data_modeling import DataModelApply, DataModelId
|
|
8
|
+
from cognite.client.data_classes.data_modeling import DataModelApply, DataModelApplyList, DataModelId
|
|
9
9
|
from cognite.client.exceptions import CogniteAPIError
|
|
10
10
|
|
|
11
11
|
from cognite.neat.rules import issues
|
|
@@ -114,9 +114,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
114
114
|
dms_rules = rules.as_dms_architect_rules()
|
|
115
115
|
else:
|
|
116
116
|
raise ValueError(f"{type(rules).__name__} cannot be exported to DMS")
|
|
117
|
-
return dms_rules.as_schema(
|
|
118
|
-
include_ref=True, include_pipeline=self.export_pipeline, instance_space=self.instance_space
|
|
119
|
-
)
|
|
117
|
+
return dms_rules.as_schema(include_pipeline=self.export_pipeline, instance_space=self.instance_space)
|
|
120
118
|
|
|
121
119
|
def delete_from_cdf(self, rules: Rules, client: CogniteClient, dry_run: bool = False) -> Iterable[UploadResult]:
|
|
122
120
|
schema, to_export = self._prepare_schema_and_exporters(rules, client)
|
|
@@ -272,7 +270,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
272
270
|
if self.export_components.intersection({"all", "views"}):
|
|
273
271
|
to_export.append((schema.views, ViewLoader(client, self.existing_handling)))
|
|
274
272
|
if self.export_components.intersection({"all", "data_models"}):
|
|
275
|
-
to_export.append((schema.
|
|
273
|
+
to_export.append((DataModelApplyList([schema.data_model]), DataModelLoader(client)))
|
|
276
274
|
if isinstance(schema, PipelineSchema):
|
|
277
275
|
to_export.append((schema.databases, RawDatabaseLoader(client)))
|
|
278
276
|
to_export.append((schema.raw_tables, RawTableLoader(client)))
|
|
@@ -6,7 +6,7 @@ from typing import Any, Literal, cast, overload
|
|
|
6
6
|
|
|
7
7
|
from cognite.client import CogniteClient
|
|
8
8
|
from cognite.client import data_modeling as dm
|
|
9
|
-
from cognite.client.data_classes.data_modeling import DataModelIdentifier
|
|
9
|
+
from cognite.client.data_classes.data_modeling import DataModelId, DataModelIdentifier
|
|
10
10
|
from cognite.client.data_classes.data_modeling.containers import BTreeIndex, InvertedIndex
|
|
11
11
|
from cognite.client.data_classes.data_modeling.views import (
|
|
12
12
|
MultiEdgeConnectionApply,
|
|
@@ -39,7 +39,6 @@ from cognite.neat.rules.models.dms import (
|
|
|
39
39
|
from cognite.neat.rules.models.entities import (
|
|
40
40
|
ClassEntity,
|
|
41
41
|
ContainerEntity,
|
|
42
|
-
DataModelEntity,
|
|
43
42
|
DMSUnknownEntity,
|
|
44
43
|
ViewEntity,
|
|
45
44
|
ViewPropertyEntity,
|
|
@@ -52,12 +51,14 @@ class DMSImporter(BaseImporter):
|
|
|
52
51
|
schema: DMSSchema,
|
|
53
52
|
read_issues: Sequence[ValidationIssue] | None = None,
|
|
54
53
|
metadata: DMSMetadata | None = None,
|
|
54
|
+
ref_metadata: DMSMetadata | None = None,
|
|
55
55
|
):
|
|
56
56
|
# Calling this root schema to distinguish it from
|
|
57
57
|
# * User Schema
|
|
58
58
|
# * Reference Schema
|
|
59
59
|
self.root_schema = schema
|
|
60
60
|
self.metadata = metadata
|
|
61
|
+
self.ref_metadata = ref_metadata
|
|
61
62
|
self.issue_list = IssueList(read_issues)
|
|
62
63
|
self._all_containers_by_id = {container.as_id(): container for container in schema.containers}
|
|
63
64
|
if self.root_schema.reference:
|
|
@@ -66,42 +67,78 @@ class DMSImporter(BaseImporter):
|
|
|
66
67
|
)
|
|
67
68
|
|
|
68
69
|
@classmethod
|
|
69
|
-
def from_data_model_id(
|
|
70
|
+
def from_data_model_id(
|
|
71
|
+
cls,
|
|
72
|
+
client: CogniteClient,
|
|
73
|
+
data_model_id: DataModelIdentifier,
|
|
74
|
+
reference_model_id: DataModelIdentifier | None = None,
|
|
75
|
+
) -> "DMSImporter":
|
|
70
76
|
"""Create a DMSImporter ready to convert the given data model to rules.
|
|
71
77
|
|
|
72
78
|
Args:
|
|
73
79
|
client: Instantiated CogniteClient to retrieve data model.
|
|
80
|
+
reference_model_id: The reference data model to retrieve. This is the data model that
|
|
81
|
+
the given data model is built on top of, typically, an enterprise data model.
|
|
74
82
|
data_model_id: Data Model to retrieve.
|
|
75
83
|
|
|
76
84
|
Returns:
|
|
77
85
|
DMSImporter: DMSImporter instance
|
|
78
86
|
"""
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
data_model_ids = [data_model_id, reference_model_id] if reference_model_id else [data_model_id]
|
|
88
|
+
data_models = client.data_modeling.data_models.retrieve(data_model_ids, inline_views=True)
|
|
89
|
+
|
|
90
|
+
user_models = cls._find_model_in_list(data_models, data_model_id)
|
|
91
|
+
if len(user_models) == 0:
|
|
81
92
|
return cls(DMSSchema(), [issues.importing.NoDataModelError(f"Data model {data_model_id} not found")])
|
|
82
|
-
|
|
93
|
+
user_model = user_models.latest_version()
|
|
94
|
+
|
|
95
|
+
if reference_model_id:
|
|
96
|
+
ref_models = cls._find_model_in_list(data_models, reference_model_id)
|
|
97
|
+
if len(ref_models) == 0:
|
|
98
|
+
return cls(
|
|
99
|
+
DMSSchema(), [issues.importing.NoDataModelError(f"Data model {reference_model_id} not found")]
|
|
100
|
+
)
|
|
101
|
+
ref_model: dm.DataModel[dm.View] | None = ref_models.latest_version()
|
|
102
|
+
else:
|
|
103
|
+
ref_model = None
|
|
83
104
|
|
|
84
105
|
try:
|
|
85
|
-
schema = DMSSchema.from_data_model(client,
|
|
106
|
+
schema = DMSSchema.from_data_model(client, user_model, ref_model)
|
|
86
107
|
except Exception as e:
|
|
87
108
|
return cls(DMSSchema(), [issues.importing.APIError(str(e))])
|
|
88
109
|
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
metadata = cls._create_metadata_from_model(user_model)
|
|
111
|
+
ref_metadata = cls._create_metadata_from_model(ref_model) if ref_model else None
|
|
91
112
|
|
|
92
|
-
|
|
113
|
+
return cls(schema, [], metadata, ref_metadata)
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
@classmethod
|
|
116
|
+
def _find_model_in_list(
|
|
117
|
+
cls, data_models: dm.DataModelList[dm.View], model_id: DataModelIdentifier
|
|
118
|
+
) -> dm.DataModelList[dm.View]:
|
|
119
|
+
identifier = DataModelId.load(model_id)
|
|
120
|
+
return dm.DataModelList[dm.View](
|
|
121
|
+
[
|
|
122
|
+
model
|
|
123
|
+
for model in data_models
|
|
124
|
+
if (model.space, model.external_id) == (identifier.space, identifier.external_id)
|
|
125
|
+
]
|
|
126
|
+
)
|
|
95
127
|
|
|
96
128
|
@classmethod
|
|
97
129
|
def _create_metadata_from_model(
|
|
98
130
|
cls,
|
|
99
131
|
model: dm.DataModel[dm.View] | dm.DataModelApply,
|
|
100
|
-
created: datetime | None = None,
|
|
101
|
-
updated: datetime | None = None,
|
|
102
132
|
) -> DMSMetadata:
|
|
103
133
|
description, creator = DMSMetadata._get_description_and_creator(model.description)
|
|
104
|
-
|
|
134
|
+
|
|
135
|
+
if isinstance(model, dm.DataModel):
|
|
136
|
+
created = ms_to_datetime(model.created_time)
|
|
137
|
+
updated = ms_to_datetime(model.last_updated_time)
|
|
138
|
+
else:
|
|
139
|
+
now = datetime.now().replace(microsecond=0)
|
|
140
|
+
created = now
|
|
141
|
+
updated = now
|
|
105
142
|
return DMSMetadata(
|
|
106
143
|
schema_=SchemaCompleteness.complete,
|
|
107
144
|
extension=ExtensionCategory.addition,
|
|
@@ -109,8 +146,8 @@ class DMSImporter(BaseImporter):
|
|
|
109
146
|
external_id=model.external_id,
|
|
110
147
|
name=model.name or model.external_id,
|
|
111
148
|
version=model.version or "0.1.0",
|
|
112
|
-
updated=updated
|
|
113
|
-
created=created
|
|
149
|
+
updated=updated,
|
|
150
|
+
created=created,
|
|
114
151
|
creator=creator,
|
|
115
152
|
description=description,
|
|
116
153
|
)
|
|
@@ -147,28 +184,33 @@ class DMSImporter(BaseImporter):
|
|
|
147
184
|
# In case there were errors during the import, the to_rules method will return None
|
|
148
185
|
return self._return_or_raise(self.issue_list, errors)
|
|
149
186
|
|
|
150
|
-
if
|
|
187
|
+
if not self.root_schema.data_model:
|
|
151
188
|
self.issue_list.append(issues.importing.NoDataModelError("No data model found."))
|
|
152
189
|
return self._return_or_raise(self.issue_list, errors)
|
|
153
|
-
|
|
190
|
+
model = self.root_schema.data_model
|
|
154
191
|
with _handle_issues(
|
|
155
192
|
self.issue_list,
|
|
156
193
|
) as future:
|
|
157
194
|
schema_completeness = SchemaCompleteness.complete
|
|
158
195
|
data_model_type = DataModelType.enterprise
|
|
159
196
|
reference: DMSRules | None = None
|
|
160
|
-
if ref_schema := self.root_schema.reference:
|
|
197
|
+
if (ref_schema := self.root_schema.reference) and (ref_model := ref_schema.data_model):
|
|
161
198
|
# Reference should always be an enterprise model.
|
|
162
199
|
reference = DMSRules(
|
|
163
200
|
**self._create_rule_components(
|
|
164
|
-
|
|
201
|
+
ref_model,
|
|
202
|
+
ref_schema,
|
|
203
|
+
self.ref_metadata or self._create_default_metadata(ref_schema.views),
|
|
204
|
+
DataModelType.enterprise,
|
|
165
205
|
)
|
|
166
206
|
)
|
|
167
207
|
schema_completeness = SchemaCompleteness.extended
|
|
168
208
|
data_model_type = DataModelType.solution
|
|
169
209
|
|
|
170
210
|
user_rules = DMSRules(
|
|
171
|
-
**self._create_rule_components(
|
|
211
|
+
**self._create_rule_components(
|
|
212
|
+
model, self.root_schema, self.metadata, data_model_type, schema_completeness
|
|
213
|
+
),
|
|
172
214
|
reference=reference,
|
|
173
215
|
)
|
|
174
216
|
|
|
@@ -179,21 +221,12 @@ class DMSImporter(BaseImporter):
|
|
|
179
221
|
|
|
180
222
|
def _create_rule_components(
|
|
181
223
|
self,
|
|
224
|
+
data_model: dm.DataModelApply,
|
|
182
225
|
schema: DMSSchema,
|
|
183
226
|
metadata: DMSMetadata | None = None,
|
|
184
227
|
data_model_type: DataModelType | None = None,
|
|
185
228
|
schema_completeness: SchemaCompleteness | None = None,
|
|
186
229
|
) -> dict[str, Any]:
|
|
187
|
-
if len(schema.data_models) > 2:
|
|
188
|
-
# Creating a DataModelEntity to convert the data model id to a string.
|
|
189
|
-
self.issue_list.append(
|
|
190
|
-
issues.importing.MultipleDataModelsWarning(
|
|
191
|
-
[str(DataModelEntity.from_id(model.as_id())) for model in schema.data_models]
|
|
192
|
-
)
|
|
193
|
-
)
|
|
194
|
-
|
|
195
|
-
data_model = schema.data_models[0]
|
|
196
|
-
|
|
197
230
|
properties = SheetList[DMSProperty]()
|
|
198
231
|
for view in schema.views:
|
|
199
232
|
view_id = view.as_id()
|
|
@@ -42,11 +42,9 @@ class _DMSExporter:
|
|
|
42
42
|
def __init__(
|
|
43
43
|
self,
|
|
44
44
|
rules: DMSRules,
|
|
45
|
-
include_ref: bool = True,
|
|
46
45
|
include_pipeline: bool = False,
|
|
47
46
|
instance_space: str | None = None,
|
|
48
47
|
):
|
|
49
|
-
self.include_ref = include_ref
|
|
50
48
|
self.include_pipeline = include_pipeline
|
|
51
49
|
self.instance_space = instance_space
|
|
52
50
|
self.rules = rules
|
|
@@ -75,7 +73,7 @@ class _DMSExporter:
|
|
|
75
73
|
|
|
76
74
|
output = DMSSchema(
|
|
77
75
|
spaces=spaces,
|
|
78
|
-
|
|
76
|
+
data_model=data_model,
|
|
79
77
|
views=views,
|
|
80
78
|
containers=containers,
|
|
81
79
|
node_types=node_types,
|
|
@@ -345,12 +345,10 @@ class DMSRules(BaseRules):
|
|
|
345
345
|
space, version = self.metadata.space, self.metadata.version
|
|
346
346
|
return _DMSRulesSerializer(info, space, version).clean(dumped)
|
|
347
347
|
|
|
348
|
-
def as_schema(
|
|
349
|
-
self, include_ref: bool = False, include_pipeline: bool = False, instance_space: str | None = None
|
|
350
|
-
) -> DMSSchema:
|
|
348
|
+
def as_schema(self, include_pipeline: bool = False, instance_space: str | None = None) -> DMSSchema:
|
|
351
349
|
from ._exporter import _DMSExporter
|
|
352
350
|
|
|
353
|
-
return _DMSExporter(self,
|
|
351
|
+
return _DMSExporter(self, include_pipeline, instance_space).to_schema()
|
|
354
352
|
|
|
355
353
|
def as_information_architect_rules(self) -> "InformationRules":
|
|
356
354
|
from ._converter import _DMSRulesConverter
|
|
@@ -3,6 +3,7 @@ import sys
|
|
|
3
3
|
import warnings
|
|
4
4
|
import zipfile
|
|
5
5
|
from collections import Counter, defaultdict
|
|
6
|
+
from collections.abc import Sequence
|
|
6
7
|
from dataclasses import Field, dataclass, field, fields
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
from typing import Any, ClassVar, cast
|
|
@@ -43,12 +44,12 @@ else:
|
|
|
43
44
|
|
|
44
45
|
@dataclass
|
|
45
46
|
class DMSSchema:
|
|
46
|
-
|
|
47
|
+
data_model: dm.DataModelApply | None = None
|
|
47
48
|
spaces: dm.SpaceApplyList = field(default_factory=lambda: dm.SpaceApplyList([]))
|
|
48
49
|
views: dm.ViewApplyList = field(default_factory=lambda: dm.ViewApplyList([]))
|
|
49
50
|
containers: dm.ContainerApplyList = field(default_factory=lambda: dm.ContainerApplyList([]))
|
|
50
51
|
node_types: dm.NodeApplyList = field(default_factory=lambda: dm.NodeApplyList([]))
|
|
51
|
-
# The last schema is the previous version of the data model. In the case, extension=
|
|
52
|
+
# The last schema is the previous version of the data model. In the case, extension=addition, this
|
|
52
53
|
# should not be modified.
|
|
53
54
|
last: "DMSSchema | None" = None
|
|
54
55
|
# Reference is typically the Enterprise model, while this is the solution model.
|
|
@@ -57,7 +58,7 @@ class DMSSchema:
|
|
|
57
58
|
_FIELD_NAME_BY_RESOURCE_TYPE: ClassVar[dict[str, str]] = {
|
|
58
59
|
"container": "containers",
|
|
59
60
|
"view": "views",
|
|
60
|
-
"datamodel": "
|
|
61
|
+
"datamodel": "data_model",
|
|
61
62
|
"space": "spaces",
|
|
62
63
|
"node": "node_types",
|
|
63
64
|
}
|
|
@@ -95,18 +96,49 @@ class DMSSchema:
|
|
|
95
96
|
return cls.from_data_model(client, data_model)
|
|
96
97
|
|
|
97
98
|
@classmethod
|
|
98
|
-
def from_data_model(
|
|
99
|
+
def from_data_model(
|
|
100
|
+
cls,
|
|
101
|
+
client: CogniteClient,
|
|
102
|
+
data_model: dm.DataModel[dm.View],
|
|
103
|
+
reference_model: dm.DataModel[dm.View] | None = None,
|
|
104
|
+
) -> "DMSSchema":
|
|
105
|
+
"""Create a schema from a data model.
|
|
106
|
+
|
|
107
|
+
If a reference model is provided, the schema will include a reference schema. To determine which views,
|
|
108
|
+
and containers to put in the reference schema, the following rule is applied:
|
|
109
|
+
|
|
110
|
+
If a view or container space is different from the data model space,
|
|
111
|
+
it will be included in the reference schema.*
|
|
112
|
+
|
|
113
|
+
*One exception to this rule is if a view is directly referenced by the data model. In this case, the view will
|
|
114
|
+
be included in the data model schema, even if the space is different.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
client: The Cognite client used for retrieving components referenced by the data model.
|
|
118
|
+
data_model: The data model to create the schema from.
|
|
119
|
+
reference_model: (Optional) The reference model to include in the schema.
|
|
120
|
+
This is typically the Enterprise model.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
DMSSchema: The schema created from the data model.
|
|
124
|
+
"""
|
|
99
125
|
views = dm.ViewList(data_model.views)
|
|
126
|
+
|
|
127
|
+
data_model_write = data_model.as_write()
|
|
128
|
+
data_model_write.views = list(views.as_ids())
|
|
129
|
+
|
|
130
|
+
if reference_model:
|
|
131
|
+
views.extend(reference_model.views)
|
|
132
|
+
|
|
100
133
|
container_ids = views.referenced_containers()
|
|
101
134
|
containers = client.data_modeling.containers.retrieve(list(container_ids))
|
|
102
135
|
cls._append_referenced_containers(client, containers)
|
|
103
136
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
data_model_write.views = list(views.as_write())
|
|
137
|
+
space_ids = [data_model.space, reference_model.space] if reference_model else [data_model.space]
|
|
138
|
+
space_read = client.data_modeling.spaces.retrieve(space_ids)
|
|
139
|
+
if len(space_read) != len(space_ids):
|
|
140
|
+
raise ValueError(f"Space(s) {space_read} not found")
|
|
141
|
+
space_write = space_read.as_write()
|
|
110
142
|
|
|
111
143
|
view_loader = ViewLoader(client)
|
|
112
144
|
# We need to include parent views in the schema to make sure that the schema is valid.
|
|
@@ -121,11 +153,41 @@ class DMSSchema:
|
|
|
121
153
|
# The ViewLoader as_write method looks up parents and remove properties from them.
|
|
122
154
|
view_write = dm.ViewApplyList([view_loader.as_write(view) for view in views])
|
|
123
155
|
|
|
156
|
+
container_write = containers.as_write()
|
|
157
|
+
user_space = data_model.space
|
|
158
|
+
if reference_model:
|
|
159
|
+
user_model_view_ids = set(data_model_write.views)
|
|
160
|
+
ref_model_write = reference_model.as_write()
|
|
161
|
+
ref_model_write.views = [view.as_id() for view in reference_model.views]
|
|
162
|
+
|
|
163
|
+
ref_views = dm.ViewApplyList(
|
|
164
|
+
[view for view in view_write if (view.space != user_space) or (view.as_id() not in user_model_view_ids)]
|
|
165
|
+
)
|
|
166
|
+
view_write = dm.ViewApplyList(
|
|
167
|
+
[view for view in view_write if view.space == user_space or view.as_id() in user_model_view_ids]
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
ref_containers = dm.ContainerApplyList(
|
|
171
|
+
[container for container in container_write if container.space != user_space]
|
|
172
|
+
)
|
|
173
|
+
container_write = dm.ContainerApplyList(
|
|
174
|
+
[container for container in container_write if container.space == user_space]
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
ref_schema: DMSSchema | None = cls(
|
|
178
|
+
spaces=dm.SpaceApplyList([s for s in space_write if s.space != user_space]),
|
|
179
|
+
data_model=ref_model_write,
|
|
180
|
+
views=ref_views,
|
|
181
|
+
containers=ref_containers,
|
|
182
|
+
)
|
|
183
|
+
else:
|
|
184
|
+
ref_schema = None
|
|
124
185
|
return cls(
|
|
125
|
-
spaces=dm.SpaceApplyList([space]),
|
|
126
|
-
|
|
186
|
+
spaces=dm.SpaceApplyList([s for s in space_write if s.space == user_space]),
|
|
187
|
+
data_model=data_model_write,
|
|
127
188
|
views=view_write,
|
|
128
|
-
containers=
|
|
189
|
+
containers=container_write,
|
|
190
|
+
reference=ref_schema,
|
|
129
191
|
)
|
|
130
192
|
|
|
131
193
|
@classmethod
|
|
@@ -187,11 +249,10 @@ class DMSSchema:
|
|
|
187
249
|
(data_models / f"{space.space}.space.yaml").write_text(
|
|
188
250
|
space.dump_yaml(), newline=new_line, encoding=encoding
|
|
189
251
|
)
|
|
190
|
-
if "data_models" not in exclude_set:
|
|
191
|
-
|
|
192
|
-
(
|
|
193
|
-
|
|
194
|
-
)
|
|
252
|
+
if "data_models" not in exclude_set and self.data_model:
|
|
253
|
+
(data_models / f"{self.data_model.external_id}.datamodel.yaml").write_text(
|
|
254
|
+
self.data_model.dump_yaml(), newline=new_line, encoding=encoding
|
|
255
|
+
)
|
|
195
256
|
if "views" not in exclude_set and self.views:
|
|
196
257
|
view_dir = data_models / "views"
|
|
197
258
|
view_dir.mkdir(parents=True, exist_ok=True)
|
|
@@ -265,9 +326,10 @@ class DMSSchema:
|
|
|
265
326
|
if "spaces" not in exclude_set:
|
|
266
327
|
for space in self.spaces:
|
|
267
328
|
zip_ref.writestr(f"data_models/{space.space}.space.yaml", space.dump_yaml())
|
|
268
|
-
if "data_models" not in exclude_set:
|
|
269
|
-
|
|
270
|
-
|
|
329
|
+
if "data_models" not in exclude_set and self.data_model:
|
|
330
|
+
zip_ref.writestr(
|
|
331
|
+
f"data_models/{self.data_model.external_id}.datamodel.yaml", self.data_model.dump_yaml()
|
|
332
|
+
)
|
|
271
333
|
if "views" not in exclude_set:
|
|
272
334
|
for view in self.views:
|
|
273
335
|
zip_ref.writestr(f"data_models/views/{view.external_id}.view.yaml", view.dump_yaml())
|
|
@@ -308,10 +370,30 @@ class DMSSchema:
|
|
|
308
370
|
loaded: dict[str, Any] = {}
|
|
309
371
|
for attr in fields(cls):
|
|
310
372
|
if items := data_dict.get(attr.name) or data_dict.get(to_camel(attr.name)):
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
373
|
+
if attr.name == "data_model":
|
|
374
|
+
if isinstance(items, list) and len(items) > 1:
|
|
375
|
+
warnings.warn(
|
|
376
|
+
issues.importing.MultipleDataModelsWarning(
|
|
377
|
+
[item.get("externalId", "Unknown") for item in items]
|
|
378
|
+
),
|
|
379
|
+
stacklevel=2,
|
|
380
|
+
)
|
|
381
|
+
item = items[0] if isinstance(items, list) else items
|
|
382
|
+
try:
|
|
383
|
+
loaded[attr.name] = dm.DataModelApply.load(item)
|
|
384
|
+
except Exception as e:
|
|
385
|
+
data_model_file = context.get(attr.name, [Path("UNKNOWN")])[0]
|
|
386
|
+
warnings.warn(
|
|
387
|
+
issues.fileread.FailedLoadWarning(data_model_file, dm.DataModelApply.__name__, str(e)),
|
|
388
|
+
stacklevel=2,
|
|
389
|
+
)
|
|
390
|
+
else:
|
|
391
|
+
try:
|
|
392
|
+
loaded[attr.name] = attr.type.load(items)
|
|
393
|
+
except Exception as e:
|
|
394
|
+
loaded[attr.name] = cls._load_individual_resources(
|
|
395
|
+
items, attr, str(e), context.get(attr.name, [])
|
|
396
|
+
)
|
|
315
397
|
return cls(**loaded)
|
|
316
398
|
|
|
317
399
|
@classmethod
|
|
@@ -353,9 +435,12 @@ class DMSSchema:
|
|
|
353
435
|
cls_fields = sorted(fields(self), key=lambda f: f.name) if sort else fields(self)
|
|
354
436
|
for attr in cls_fields:
|
|
355
437
|
if items := getattr(self, attr.name):
|
|
356
|
-
items = sorted(items, key=self._to_sortable_identifier) if sort else items
|
|
357
438
|
key = to_camel(attr.name) if camel_case else attr.name
|
|
358
|
-
|
|
439
|
+
if isinstance(items, Sequence):
|
|
440
|
+
items = sorted(items, key=self._to_sortable_identifier) if sort else items
|
|
441
|
+
output[key] = [item.dump(camel_case=camel_case) for item in items]
|
|
442
|
+
else:
|
|
443
|
+
output[key] = items.dump(camel_case=camel_case)
|
|
359
444
|
return output
|
|
360
445
|
|
|
361
446
|
@classmethod
|
|
@@ -458,7 +543,8 @@ class DMSSchema:
|
|
|
458
543
|
)
|
|
459
544
|
)
|
|
460
545
|
|
|
461
|
-
|
|
546
|
+
if self.data_model:
|
|
547
|
+
model = self.data_model
|
|
462
548
|
if model.space not in defined_spaces:
|
|
463
549
|
errors.add(MissingSpaceError(space=model.space, referred_by=model.as_id()))
|
|
464
550
|
|
|
@@ -506,16 +592,25 @@ class DMSSchema:
|
|
|
506
592
|
)
|
|
507
593
|
return None
|
|
508
594
|
|
|
509
|
-
def referenced_spaces(self) -> set[str]:
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
595
|
+
def referenced_spaces(self, include_indirect_references: bool = True) -> set[str]:
|
|
596
|
+
"""Get the spaces referenced by the schema.
|
|
597
|
+
|
|
598
|
+
Args:
|
|
599
|
+
include_indirect_references (bool): If True, the spaces referenced by as view.implements, and
|
|
600
|
+
view.referenced_containers will be included in the output.
|
|
601
|
+
Returns:
|
|
602
|
+
set[str]: The spaces referenced by the schema.
|
|
603
|
+
"""
|
|
604
|
+
referenced_spaces = {view.space for view in self.views}
|
|
605
|
+
referenced_spaces |= {container.space for container in self.containers}
|
|
606
|
+
if include_indirect_references:
|
|
607
|
+
referenced_spaces |= {container.space for view in self.views for container in view.referenced_containers()}
|
|
608
|
+
referenced_spaces |= {parent.space for view in self.views for parent in view.implements or []}
|
|
514
609
|
referenced_spaces |= {node.space for node in self.node_types}
|
|
515
|
-
|
|
516
|
-
|
|
610
|
+
if self.data_model:
|
|
611
|
+
referenced_spaces |= {self.data_model.space}
|
|
612
|
+
referenced_spaces |= {view.space for view in self.data_model.views or []}
|
|
517
613
|
referenced_spaces |= {s.space for s in self.spaces}
|
|
518
|
-
|
|
519
614
|
return referenced_spaces
|
|
520
615
|
|
|
521
616
|
|
|
@@ -625,9 +720,9 @@ class PipelineSchema(DMSSchema):
|
|
|
625
720
|
|
|
626
721
|
@classmethod
|
|
627
722
|
def from_dms(cls, schema: DMSSchema, instance_space: str | None = None) -> "PipelineSchema":
|
|
628
|
-
if not schema.
|
|
723
|
+
if not schema.data_model:
|
|
629
724
|
raise ValueError("PipelineSchema must contain at least one data model")
|
|
630
|
-
first_data_model = schema.
|
|
725
|
+
first_data_model = schema.data_model
|
|
631
726
|
# The database name is limited to 32 characters
|
|
632
727
|
database_name = first_data_model.external_id[:32]
|
|
633
728
|
instance_space = instance_space or first_data_model.space
|
|
@@ -666,7 +761,7 @@ class PipelineSchema(DMSSchema):
|
|
|
666
761
|
|
|
667
762
|
return cls(
|
|
668
763
|
spaces=schema.spaces,
|
|
669
|
-
|
|
764
|
+
data_model=schema.data_model,
|
|
670
765
|
views=schema.views,
|
|
671
766
|
containers=schema.containers,
|
|
672
767
|
transformations=transformations,
|
|
@@ -164,7 +164,7 @@ class DMSPostValidation:
|
|
|
164
164
|
# Everything is allowed
|
|
165
165
|
return None
|
|
166
166
|
# Is an extension of an existing model.
|
|
167
|
-
user_schema = self.rules.as_schema(
|
|
167
|
+
user_schema = self.rules.as_schema()
|
|
168
168
|
ref_schema = self.rules.reference.as_schema()
|
|
169
169
|
new_containers = {container.as_id(): container for container in user_schema.containers}
|
|
170
170
|
existing_containers = {container.as_id(): container for container in ref_schema.containers}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.76.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/context_manager/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/api/routers/data_exploration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_neat-0.76.3 → cognite_neat-0.77.0}/cognite/neat/app/ui/neat-app/build/asset-manifest.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|