cognite-neat 0.76.3__tar.gz → 0.77.1__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.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/PKG-INFO +1 -1
- cognite_neat-0.77.1/cognite/neat/_version.py +1 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/_rules2dms.py +13 -8
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_dms2rules.py +72 -39
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/_exporter.py +25 -27
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/_rules.py +4 -6
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/_schema.py +186 -72
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/_validation.py +9 -9
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/wrapped_entities.py +34 -2
- cognite_neat-0.77.1/cognite/neat/utils/cdf_classes.py +181 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/current/rules_validator.py +3 -3
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/pyproject.toml +1 -1
- cognite_neat-0.76.3/cognite/neat/_version.py +0 -1
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/LICENSE +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/README.md +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/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.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/config.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/stores/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/analysis/_information_rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/_models.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/data_types.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/_converter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/dms/_serializer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/domain.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/entities.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/information/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/information/_converter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/rules/models/information/_rules.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/utils.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/utils/xml.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.76.3 → cognite_neat-0.77.1}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.77.1"
|
|
@@ -5,7 +5,14 @@ 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
|
|
8
|
+
from cognite.client.data_classes.data_modeling import (
|
|
9
|
+
ContainerApplyList,
|
|
10
|
+
DataModelApply,
|
|
11
|
+
DataModelApplyList,
|
|
12
|
+
DataModelId,
|
|
13
|
+
SpaceApplyList,
|
|
14
|
+
ViewApplyList,
|
|
15
|
+
)
|
|
9
16
|
from cognite.client.exceptions import CogniteAPIError
|
|
10
17
|
|
|
11
18
|
from cognite.neat.rules import issues
|
|
@@ -114,9 +121,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
114
121
|
dms_rules = rules.as_dms_architect_rules()
|
|
115
122
|
else:
|
|
116
123
|
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
|
-
)
|
|
124
|
+
return dms_rules.as_schema(include_pipeline=self.export_pipeline, instance_space=self.instance_space)
|
|
120
125
|
|
|
121
126
|
def delete_from_cdf(self, rules: Rules, client: CogniteClient, dry_run: bool = False) -> Iterable[UploadResult]:
|
|
122
127
|
schema, to_export = self._prepare_schema_and_exporters(rules, client)
|
|
@@ -266,13 +271,13 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
266
271
|
schema = self.export(rules)
|
|
267
272
|
to_export: list[tuple[CogniteResourceList, ResourceLoader]] = []
|
|
268
273
|
if self.export_components.intersection({"all", "spaces"}):
|
|
269
|
-
to_export.append((schema.spaces, SpaceLoader(client)))
|
|
274
|
+
to_export.append((SpaceApplyList(schema.spaces.values()), SpaceLoader(client)))
|
|
270
275
|
if self.export_components.intersection({"all", "containers"}):
|
|
271
|
-
to_export.append((schema.containers, ContainerLoader(client)))
|
|
276
|
+
to_export.append((ContainerApplyList(schema.containers.values()), ContainerLoader(client)))
|
|
272
277
|
if self.export_components.intersection({"all", "views"}):
|
|
273
|
-
to_export.append((schema.views, ViewLoader(client, self.existing_handling)))
|
|
278
|
+
to_export.append((ViewApplyList(schema.views.values()), ViewLoader(client, self.existing_handling)))
|
|
274
279
|
if self.export_components.intersection({"all", "data_models"}):
|
|
275
|
-
to_export.append((schema.
|
|
280
|
+
to_export.append((DataModelApplyList([schema.data_model]), DataModelLoader(client)))
|
|
276
281
|
if isinstance(schema, PipelineSchema):
|
|
277
282
|
to_export.append((schema.databases, RawDatabaseLoader(client)))
|
|
278
283
|
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,56 +51,92 @@ 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
|
-
self._all_containers_by_id =
|
|
63
|
+
self._all_containers_by_id = schema.containers.copy()
|
|
63
64
|
if self.root_schema.reference:
|
|
64
|
-
self._all_containers_by_id.update(
|
|
65
|
-
{container.as_id(): container for container in self.root_schema.reference.containers}
|
|
66
|
-
)
|
|
65
|
+
self._all_containers_by_id.update(self.root_schema.reference.containers)
|
|
67
66
|
|
|
68
67
|
@classmethod
|
|
69
|
-
def from_data_model_id(
|
|
68
|
+
def from_data_model_id(
|
|
69
|
+
cls,
|
|
70
|
+
client: CogniteClient,
|
|
71
|
+
data_model_id: DataModelIdentifier,
|
|
72
|
+
reference_model_id: DataModelIdentifier | None = None,
|
|
73
|
+
) -> "DMSImporter":
|
|
70
74
|
"""Create a DMSImporter ready to convert the given data model to rules.
|
|
71
75
|
|
|
72
76
|
Args:
|
|
73
77
|
client: Instantiated CogniteClient to retrieve data model.
|
|
78
|
+
reference_model_id: The reference data model to retrieve. This is the data model that
|
|
79
|
+
the given data model is built on top of, typically, an enterprise data model.
|
|
74
80
|
data_model_id: Data Model to retrieve.
|
|
75
81
|
|
|
76
82
|
Returns:
|
|
77
83
|
DMSImporter: DMSImporter instance
|
|
78
84
|
"""
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
data_model_ids = [data_model_id, reference_model_id] if reference_model_id else [data_model_id]
|
|
86
|
+
data_models = client.data_modeling.data_models.retrieve(data_model_ids, inline_views=True)
|
|
87
|
+
|
|
88
|
+
user_models = cls._find_model_in_list(data_models, data_model_id)
|
|
89
|
+
if len(user_models) == 0:
|
|
81
90
|
return cls(DMSSchema(), [issues.importing.NoDataModelError(f"Data model {data_model_id} not found")])
|
|
82
|
-
|
|
91
|
+
user_model = user_models.latest_version()
|
|
92
|
+
|
|
93
|
+
if reference_model_id:
|
|
94
|
+
ref_models = cls._find_model_in_list(data_models, reference_model_id)
|
|
95
|
+
if len(ref_models) == 0:
|
|
96
|
+
return cls(
|
|
97
|
+
DMSSchema(), [issues.importing.NoDataModelError(f"Data model {reference_model_id} not found")]
|
|
98
|
+
)
|
|
99
|
+
ref_model: dm.DataModel[dm.View] | None = ref_models.latest_version()
|
|
100
|
+
else:
|
|
101
|
+
ref_model = None
|
|
83
102
|
|
|
84
103
|
try:
|
|
85
|
-
schema = DMSSchema.from_data_model(client,
|
|
104
|
+
schema = DMSSchema.from_data_model(client, user_model, ref_model)
|
|
86
105
|
except Exception as e:
|
|
87
106
|
return cls(DMSSchema(), [issues.importing.APIError(str(e))])
|
|
88
107
|
|
|
89
|
-
|
|
90
|
-
|
|
108
|
+
metadata = cls._create_metadata_from_model(user_model)
|
|
109
|
+
ref_metadata = cls._create_metadata_from_model(ref_model) if ref_model else None
|
|
91
110
|
|
|
92
|
-
|
|
111
|
+
return cls(schema, [], metadata, ref_metadata)
|
|
93
112
|
|
|
94
|
-
|
|
113
|
+
@classmethod
|
|
114
|
+
def _find_model_in_list(
|
|
115
|
+
cls, data_models: dm.DataModelList[dm.View], model_id: DataModelIdentifier
|
|
116
|
+
) -> dm.DataModelList[dm.View]:
|
|
117
|
+
identifier = DataModelId.load(model_id)
|
|
118
|
+
return dm.DataModelList[dm.View](
|
|
119
|
+
[
|
|
120
|
+
model
|
|
121
|
+
for model in data_models
|
|
122
|
+
if (model.space, model.external_id) == (identifier.space, identifier.external_id)
|
|
123
|
+
]
|
|
124
|
+
)
|
|
95
125
|
|
|
96
126
|
@classmethod
|
|
97
127
|
def _create_metadata_from_model(
|
|
98
128
|
cls,
|
|
99
129
|
model: dm.DataModel[dm.View] | dm.DataModelApply,
|
|
100
|
-
created: datetime | None = None,
|
|
101
|
-
updated: datetime | None = None,
|
|
102
130
|
) -> DMSMetadata:
|
|
103
131
|
description, creator = DMSMetadata._get_description_and_creator(model.description)
|
|
104
|
-
|
|
132
|
+
|
|
133
|
+
if isinstance(model, dm.DataModel):
|
|
134
|
+
created = ms_to_datetime(model.created_time)
|
|
135
|
+
updated = ms_to_datetime(model.last_updated_time)
|
|
136
|
+
else:
|
|
137
|
+
now = datetime.now().replace(microsecond=0)
|
|
138
|
+
created = now
|
|
139
|
+
updated = now
|
|
105
140
|
return DMSMetadata(
|
|
106
141
|
schema_=SchemaCompleteness.complete,
|
|
107
142
|
extension=ExtensionCategory.addition,
|
|
@@ -109,8 +144,8 @@ class DMSImporter(BaseImporter):
|
|
|
109
144
|
external_id=model.external_id,
|
|
110
145
|
name=model.name or model.external_id,
|
|
111
146
|
version=model.version or "0.1.0",
|
|
112
|
-
updated=updated
|
|
113
|
-
created=created
|
|
147
|
+
updated=updated,
|
|
148
|
+
created=created,
|
|
114
149
|
creator=creator,
|
|
115
150
|
description=description,
|
|
116
151
|
)
|
|
@@ -147,28 +182,33 @@ class DMSImporter(BaseImporter):
|
|
|
147
182
|
# In case there were errors during the import, the to_rules method will return None
|
|
148
183
|
return self._return_or_raise(self.issue_list, errors)
|
|
149
184
|
|
|
150
|
-
if
|
|
185
|
+
if not self.root_schema.data_model:
|
|
151
186
|
self.issue_list.append(issues.importing.NoDataModelError("No data model found."))
|
|
152
187
|
return self._return_or_raise(self.issue_list, errors)
|
|
153
|
-
|
|
188
|
+
model = self.root_schema.data_model
|
|
154
189
|
with _handle_issues(
|
|
155
190
|
self.issue_list,
|
|
156
191
|
) as future:
|
|
157
192
|
schema_completeness = SchemaCompleteness.complete
|
|
158
193
|
data_model_type = DataModelType.enterprise
|
|
159
194
|
reference: DMSRules | None = None
|
|
160
|
-
if ref_schema := self.root_schema.reference:
|
|
195
|
+
if (ref_schema := self.root_schema.reference) and (ref_model := ref_schema.data_model):
|
|
161
196
|
# Reference should always be an enterprise model.
|
|
162
197
|
reference = DMSRules(
|
|
163
198
|
**self._create_rule_components(
|
|
164
|
-
|
|
199
|
+
ref_model,
|
|
200
|
+
ref_schema,
|
|
201
|
+
self.ref_metadata or self._create_default_metadata(list(ref_schema.views.values())),
|
|
202
|
+
DataModelType.enterprise,
|
|
165
203
|
)
|
|
166
204
|
)
|
|
167
205
|
schema_completeness = SchemaCompleteness.extended
|
|
168
206
|
data_model_type = DataModelType.solution
|
|
169
207
|
|
|
170
208
|
user_rules = DMSRules(
|
|
171
|
-
**self._create_rule_components(
|
|
209
|
+
**self._create_rule_components(
|
|
210
|
+
model, self.root_schema, self.metadata, data_model_type, schema_completeness
|
|
211
|
+
),
|
|
172
212
|
reference=reference,
|
|
173
213
|
)
|
|
174
214
|
|
|
@@ -179,24 +219,14 @@ class DMSImporter(BaseImporter):
|
|
|
179
219
|
|
|
180
220
|
def _create_rule_components(
|
|
181
221
|
self,
|
|
222
|
+
data_model: dm.DataModelApply,
|
|
182
223
|
schema: DMSSchema,
|
|
183
224
|
metadata: DMSMetadata | None = None,
|
|
184
225
|
data_model_type: DataModelType | None = None,
|
|
185
226
|
schema_completeness: SchemaCompleteness | None = None,
|
|
186
227
|
) -> 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
228
|
properties = SheetList[DMSProperty]()
|
|
198
|
-
for view in schema.views:
|
|
199
|
-
view_id = view.as_id()
|
|
229
|
+
for view_id, view in schema.views.items():
|
|
200
230
|
view_entity = ViewEntity.from_id(view_id)
|
|
201
231
|
class_entity = view_entity.as_class()
|
|
202
232
|
for prop_id, prop in (view.properties or {}).items():
|
|
@@ -217,10 +247,13 @@ class DMSImporter(BaseImporter):
|
|
|
217
247
|
metadata=metadata,
|
|
218
248
|
properties=properties,
|
|
219
249
|
containers=SheetList[DMSContainer](
|
|
220
|
-
data=[DMSContainer.from_container(container) for container in schema.containers]
|
|
250
|
+
data=[DMSContainer.from_container(container) for container in schema.containers.values()]
|
|
221
251
|
),
|
|
222
252
|
views=SheetList[DMSView](
|
|
223
|
-
data=[
|
|
253
|
+
data=[
|
|
254
|
+
DMSView.from_view(view, in_model=view_id in data_model_view_ids)
|
|
255
|
+
for view_id, view in schema.views.items()
|
|
256
|
+
]
|
|
224
257
|
),
|
|
225
258
|
)
|
|
226
259
|
|
|
@@ -22,6 +22,7 @@ from cognite.neat.rules.models.entities import (
|
|
|
22
22
|
ViewPropertyEntity,
|
|
23
23
|
)
|
|
24
24
|
from cognite.neat.rules.models.wrapped_entities import DMSFilter, HasDataFilter, NodeTypeFilter
|
|
25
|
+
from cognite.neat.utils.cdf_classes import ContainerApplyDict, NodeApplyDict, SpaceApplyDict, ViewApplyDict
|
|
25
26
|
|
|
26
27
|
from ._rules import DMSMetadata, DMSProperty, DMSRules, DMSView
|
|
27
28
|
from ._schema import DMSSchema, PipelineSchema
|
|
@@ -42,18 +43,18 @@ class _DMSExporter:
|
|
|
42
43
|
def __init__(
|
|
43
44
|
self,
|
|
44
45
|
rules: DMSRules,
|
|
45
|
-
include_ref: bool = True,
|
|
46
46
|
include_pipeline: bool = False,
|
|
47
47
|
instance_space: str | None = None,
|
|
48
48
|
):
|
|
49
|
-
self.include_ref = include_ref
|
|
50
49
|
self.include_pipeline = include_pipeline
|
|
51
50
|
self.instance_space = instance_space
|
|
52
51
|
self.rules = rules
|
|
53
52
|
self._ref_schema = rules.reference.as_schema() if rules.reference else None
|
|
54
53
|
if self._ref_schema:
|
|
55
54
|
# We skip version as that will always be missing in the reference
|
|
56
|
-
self._ref_views_by_id = {
|
|
55
|
+
self._ref_views_by_id = {
|
|
56
|
+
dm.ViewId(view.space, view.external_id): view for view in self._ref_schema.views.values()
|
|
57
|
+
}
|
|
57
58
|
else:
|
|
58
59
|
self._ref_views_by_id = {}
|
|
59
60
|
|
|
@@ -67,7 +68,7 @@ class _DMSExporter:
|
|
|
67
68
|
views_not_in_model = {view.view.as_id() for view in rules.views if not view.in_model}
|
|
68
69
|
data_model = rules.metadata.as_data_model()
|
|
69
70
|
data_model.views = sorted(
|
|
70
|
-
[view_id for view_id in views.
|
|
71
|
+
[view_id for view_id in views.keys() if view_id not in views_not_in_model],
|
|
71
72
|
key=lambda v: v.as_tuple(), # type: ignore[union-attr]
|
|
72
73
|
)
|
|
73
74
|
|
|
@@ -75,7 +76,7 @@ class _DMSExporter:
|
|
|
75
76
|
|
|
76
77
|
output = DMSSchema(
|
|
77
78
|
spaces=spaces,
|
|
78
|
-
|
|
79
|
+
data_model=data_model,
|
|
79
80
|
views=views,
|
|
80
81
|
containers=containers,
|
|
81
82
|
node_types=node_types,
|
|
@@ -91,31 +92,30 @@ class _DMSExporter:
|
|
|
91
92
|
def _create_spaces(
|
|
92
93
|
self,
|
|
93
94
|
metadata: DMSMetadata,
|
|
94
|
-
containers:
|
|
95
|
-
views:
|
|
95
|
+
containers: ContainerApplyDict,
|
|
96
|
+
views: ViewApplyDict,
|
|
96
97
|
data_model: dm.DataModelApply,
|
|
97
|
-
) ->
|
|
98
|
-
used_spaces = {container.space for container in containers} | {view.space for view in views}
|
|
98
|
+
) -> SpaceApplyDict:
|
|
99
|
+
used_spaces = {container.space for container in containers.values()} | {view.space for view in views.values()}
|
|
99
100
|
if len(used_spaces) == 1:
|
|
100
101
|
# We skip the default space and only use this space for the data model
|
|
101
102
|
data_model.space = used_spaces.pop()
|
|
102
|
-
spaces =
|
|
103
|
+
spaces = SpaceApplyDict([dm.SpaceApply(space=data_model.space)])
|
|
103
104
|
else:
|
|
104
105
|
used_spaces.add(metadata.space)
|
|
105
|
-
spaces =
|
|
106
|
-
if self.instance_space and self.instance_space not in
|
|
107
|
-
spaces.
|
|
106
|
+
spaces = SpaceApplyDict([dm.SpaceApply(space=space) for space in used_spaces])
|
|
107
|
+
if self.instance_space and self.instance_space not in spaces:
|
|
108
|
+
spaces[self.instance_space] = dm.SpaceApply(space=self.instance_space, name=self.instance_space)
|
|
108
109
|
return spaces
|
|
109
110
|
|
|
110
111
|
def _create_views_with_node_types(
|
|
111
112
|
self,
|
|
112
113
|
view_properties_by_id: dict[dm.ViewId, list[DMSProperty]],
|
|
113
|
-
) -> tuple[
|
|
114
|
-
views =
|
|
114
|
+
) -> tuple[ViewApplyDict, NodeApplyDict]:
|
|
115
|
+
views = ViewApplyDict([dms_view.as_view() for dms_view in self.rules.views])
|
|
115
116
|
dms_view_by_id = {dms_view.view.as_id(): dms_view for dms_view in self.rules.views}
|
|
116
117
|
|
|
117
|
-
for view in views:
|
|
118
|
-
view_id = view.as_id()
|
|
118
|
+
for view_id, view in views.items():
|
|
119
119
|
view.properties = {}
|
|
120
120
|
if not (view_properties := view_properties_by_id.get(view_id)):
|
|
121
121
|
continue
|
|
@@ -126,14 +126,13 @@ class _DMSExporter:
|
|
|
126
126
|
|
|
127
127
|
data_model_type = self.rules.metadata.data_model_type
|
|
128
128
|
unique_node_types: set[dm.NodeId] = set()
|
|
129
|
-
parent_views = {parent for view in views for parent in view.implements or []}
|
|
130
|
-
for view in views:
|
|
131
|
-
dms_view = dms_view_by_id.get(
|
|
132
|
-
dms_properties = view_properties_by_id.get(
|
|
129
|
+
parent_views = {parent for view in views.values() for parent in view.implements or []}
|
|
130
|
+
for view_id, view in views.items():
|
|
131
|
+
dms_view = dms_view_by_id.get(view_id)
|
|
132
|
+
dms_properties = view_properties_by_id.get(view_id, [])
|
|
133
133
|
view_filter = self._create_view_filter(view, dms_view, data_model_type, dms_properties)
|
|
134
134
|
|
|
135
135
|
view.filter = view_filter.as_dms_filter()
|
|
136
|
-
|
|
137
136
|
if isinstance(view_filter, NodeTypeFilter):
|
|
138
137
|
unique_node_types.update(view_filter.nodes)
|
|
139
138
|
if view.as_id() in parent_views:
|
|
@@ -153,7 +152,7 @@ class _DMSExporter:
|
|
|
153
152
|
issues.dms.HasDataFilterOnViewWithReferencesWarning(view.as_id(), list(references)), stacklevel=2
|
|
154
153
|
)
|
|
155
154
|
|
|
156
|
-
return views,
|
|
155
|
+
return views, NodeApplyDict(
|
|
157
156
|
[dm.NodeApply(space=node.space, external_id=node.external_id) for node in unique_node_types]
|
|
158
157
|
)
|
|
159
158
|
|
|
@@ -176,7 +175,7 @@ class _DMSExporter:
|
|
|
176
175
|
def _create_containers(
|
|
177
176
|
self,
|
|
178
177
|
container_properties_by_id: dict[dm.ContainerId, list[DMSProperty]],
|
|
179
|
-
) ->
|
|
178
|
+
) -> ContainerApplyDict:
|
|
180
179
|
containers = dm.ContainerApplyList(
|
|
181
180
|
[dms_container.as_container() for dms_container in self.rules.containers or []]
|
|
182
181
|
)
|
|
@@ -231,9 +230,7 @@ class _DMSExporter:
|
|
|
231
230
|
for name, const in container.constraints.items()
|
|
232
231
|
if not (isinstance(const, dm.RequiresConstraint) and const.require in container_to_drop)
|
|
233
232
|
}
|
|
234
|
-
return
|
|
235
|
-
[container for container in containers if container.as_id() not in container_to_drop]
|
|
236
|
-
)
|
|
233
|
+
return ContainerApplyDict([container for container in containers if container.as_id() not in container_to_drop])
|
|
237
234
|
|
|
238
235
|
def _gather_properties(self) -> tuple[dict[dm.ContainerId, list[DMSProperty]], dict[dm.ViewId, list[DMSProperty]]]:
|
|
239
236
|
container_properties_by_id: dict[dm.ContainerId, list[DMSProperty]] = defaultdict(list)
|
|
@@ -256,6 +253,7 @@ class _DMSExporter:
|
|
|
256
253
|
dms_properties: list[DMSProperty],
|
|
257
254
|
) -> DMSFilter:
|
|
258
255
|
selected_filter_name = (dms_view and dms_view.filter_ and dms_view.filter_.name) or ""
|
|
256
|
+
|
|
259
257
|
if dms_view and dms_view.filter_ and not dms_view.filter_.is_empty:
|
|
260
258
|
# Has Explicit Filter, use it
|
|
261
259
|
return dms_view.filter_
|
|
@@ -41,7 +41,7 @@ from cognite.neat.rules.models.entities import (
|
|
|
41
41
|
ViewEntityList,
|
|
42
42
|
ViewPropertyEntity,
|
|
43
43
|
)
|
|
44
|
-
from cognite.neat.rules.models.wrapped_entities import HasDataFilter, NodeTypeFilter
|
|
44
|
+
from cognite.neat.rules.models.wrapped_entities import HasDataFilter, NodeTypeFilter, RawFilter
|
|
45
45
|
|
|
46
46
|
from ._schema import DMSSchema
|
|
47
47
|
|
|
@@ -257,7 +257,7 @@ class DMSView(SheetEntity):
|
|
|
257
257
|
description: str | None = Field(alias="Description", default=None)
|
|
258
258
|
implements: ViewEntityList | None = Field(None, alias="Implements")
|
|
259
259
|
reference: URLEntity | ReferenceEntity | None = Field(alias="Reference", default=None, union_mode="left_to_right")
|
|
260
|
-
filter_: HasDataFilter | NodeTypeFilter | None = Field(None, alias="Filter")
|
|
260
|
+
filter_: HasDataFilter | NodeTypeFilter | RawFilter | None = Field(None, alias="Filter")
|
|
261
261
|
in_model: bool = Field(True, alias="In Model")
|
|
262
262
|
class_: ClassEntity = Field(alias="Class (linage)")
|
|
263
263
|
|
|
@@ -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
|