cognite-neat 0.77.0__tar.gz → 0.77.2__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.77.0 → cognite_neat-0.77.2}/PKG-INFO +1 -1
- cognite_neat-0.77.2/cognite/neat/_version.py +1 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/_rules2dms.py +11 -4
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_dms2rules.py +9 -9
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/dms.py +20 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/_exporter.py +24 -24
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/_rules.py +2 -2
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/_rules_input.py +1 -1
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/_schema.py +72 -53
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/_validation.py +19 -8
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/wrapped_entities.py +34 -2
- cognite_neat-0.77.2/cognite/neat/utils/cdf_classes.py +181 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/current/rules_validator.py +3 -3
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/pyproject.toml +1 -1
- cognite_neat-0.77.0/cognite/neat/_version.py +0 -1
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/LICENSE +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/README.md +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/config.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/stores/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/analysis/_information_rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/_models.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/data_types.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/_converter.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/dms/_serializer.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/domain.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/entities.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/information/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/information/_converter.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/rules/models/information/_rules.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/utils.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/utils/xml.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.77.0 → cognite_neat-0.77.2}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.77.2"
|
|
@@ -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
|
|
@@ -264,11 +271,11 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
264
271
|
schema = self.export(rules)
|
|
265
272
|
to_export: list[tuple[CogniteResourceList, ResourceLoader]] = []
|
|
266
273
|
if self.export_components.intersection({"all", "spaces"}):
|
|
267
|
-
to_export.append((schema.spaces, SpaceLoader(client)))
|
|
274
|
+
to_export.append((SpaceApplyList(schema.spaces.values()), SpaceLoader(client)))
|
|
268
275
|
if self.export_components.intersection({"all", "containers"}):
|
|
269
|
-
to_export.append((schema.containers, ContainerLoader(client)))
|
|
276
|
+
to_export.append((ContainerApplyList(schema.containers.values()), ContainerLoader(client)))
|
|
270
277
|
if self.export_components.intersection({"all", "views"}):
|
|
271
|
-
to_export.append((schema.views, ViewLoader(client, self.existing_handling)))
|
|
278
|
+
to_export.append((ViewApplyList(schema.views.values()), ViewLoader(client, self.existing_handling)))
|
|
272
279
|
if self.export_components.intersection({"all", "data_models"}):
|
|
273
280
|
to_export.append((DataModelApplyList([schema.data_model]), DataModelLoader(client)))
|
|
274
281
|
if isinstance(schema, PipelineSchema):
|
|
@@ -60,11 +60,9 @@ class DMSImporter(BaseImporter):
|
|
|
60
60
|
self.metadata = metadata
|
|
61
61
|
self.ref_metadata = ref_metadata
|
|
62
62
|
self.issue_list = IssueList(read_issues)
|
|
63
|
-
self._all_containers_by_id =
|
|
63
|
+
self._all_containers_by_id = schema.containers.copy()
|
|
64
64
|
if self.root_schema.reference:
|
|
65
|
-
self._all_containers_by_id.update(
|
|
66
|
-
{container.as_id(): container for container in self.root_schema.reference.containers}
|
|
67
|
-
)
|
|
65
|
+
self._all_containers_by_id.update(self.root_schema.reference.containers)
|
|
68
66
|
|
|
69
67
|
@classmethod
|
|
70
68
|
def from_data_model_id(
|
|
@@ -200,7 +198,7 @@ class DMSImporter(BaseImporter):
|
|
|
200
198
|
**self._create_rule_components(
|
|
201
199
|
ref_model,
|
|
202
200
|
ref_schema,
|
|
203
|
-
self.ref_metadata or self._create_default_metadata(ref_schema.views),
|
|
201
|
+
self.ref_metadata or self._create_default_metadata(list(ref_schema.views.values())),
|
|
204
202
|
DataModelType.enterprise,
|
|
205
203
|
)
|
|
206
204
|
)
|
|
@@ -228,8 +226,7 @@ class DMSImporter(BaseImporter):
|
|
|
228
226
|
schema_completeness: SchemaCompleteness | None = None,
|
|
229
227
|
) -> dict[str, Any]:
|
|
230
228
|
properties = SheetList[DMSProperty]()
|
|
231
|
-
for view in schema.views:
|
|
232
|
-
view_id = view.as_id()
|
|
229
|
+
for view_id, view in schema.views.items():
|
|
233
230
|
view_entity = ViewEntity.from_id(view_id)
|
|
234
231
|
class_entity = view_entity.as_class()
|
|
235
232
|
for prop_id, prop in (view.properties or {}).items():
|
|
@@ -250,10 +247,13 @@ class DMSImporter(BaseImporter):
|
|
|
250
247
|
metadata=metadata,
|
|
251
248
|
properties=properties,
|
|
252
249
|
containers=SheetList[DMSContainer](
|
|
253
|
-
data=[DMSContainer.from_container(container) for container in schema.containers]
|
|
250
|
+
data=[DMSContainer.from_container(container) for container in schema.containers.values()]
|
|
254
251
|
),
|
|
255
252
|
views=SheetList[DMSView](
|
|
256
|
-
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
|
+
]
|
|
257
257
|
),
|
|
258
258
|
)
|
|
259
259
|
|
|
@@ -507,6 +507,26 @@ class HasDataFilterAppliedToTooManyContainersWarning(DMSSchemaWarning):
|
|
|
507
507
|
return output
|
|
508
508
|
|
|
509
509
|
|
|
510
|
+
@dataclass(frozen=True)
|
|
511
|
+
class RawFilterAppliedToViewWarning(DMSSchemaWarning):
|
|
512
|
+
description = "Raw filter is applied to a view, which is against the neat data modeling lifecycle."
|
|
513
|
+
fix = "Do not use raw filter, instead use HasData filter or nodeType filter or change the data model design."
|
|
514
|
+
error_name: ClassVar[str] = "RawFilterAppliedToView"
|
|
515
|
+
view_id: dm.ViewId
|
|
516
|
+
|
|
517
|
+
def message(self) -> str:
|
|
518
|
+
return (
|
|
519
|
+
f"RawFilter applied to the view {self.view_id}."
|
|
520
|
+
" The usage of RawFilter is against the neat team recommendations and the neat data modeling lifecycle."
|
|
521
|
+
" When opting for raw filter, the user is responsible for any errors that arise in neat."
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
def dump(self) -> dict[str, Any]:
|
|
525
|
+
output = super().dump()
|
|
526
|
+
output["view_id"] = self.view_id.dump()
|
|
527
|
+
return output
|
|
528
|
+
|
|
529
|
+
|
|
510
530
|
@dataclass(frozen=True)
|
|
511
531
|
class NodeTypeFilterOnParentViewWarning(DMSSchemaWarning):
|
|
512
532
|
description = (
|
|
@@ -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
|
|
@@ -51,7 +52,9 @@ class _DMSExporter:
|
|
|
51
52
|
self._ref_schema = rules.reference.as_schema() if rules.reference else None
|
|
52
53
|
if self._ref_schema:
|
|
53
54
|
# We skip version as that will always be missing in the reference
|
|
54
|
-
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
|
+
}
|
|
55
58
|
else:
|
|
56
59
|
self._ref_views_by_id = {}
|
|
57
60
|
|
|
@@ -65,7 +68,7 @@ class _DMSExporter:
|
|
|
65
68
|
views_not_in_model = {view.view.as_id() for view in rules.views if not view.in_model}
|
|
66
69
|
data_model = rules.metadata.as_data_model()
|
|
67
70
|
data_model.views = sorted(
|
|
68
|
-
[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],
|
|
69
72
|
key=lambda v: v.as_tuple(), # type: ignore[union-attr]
|
|
70
73
|
)
|
|
71
74
|
|
|
@@ -89,31 +92,30 @@ class _DMSExporter:
|
|
|
89
92
|
def _create_spaces(
|
|
90
93
|
self,
|
|
91
94
|
metadata: DMSMetadata,
|
|
92
|
-
containers:
|
|
93
|
-
views:
|
|
95
|
+
containers: ContainerApplyDict,
|
|
96
|
+
views: ViewApplyDict,
|
|
94
97
|
data_model: dm.DataModelApply,
|
|
95
|
-
) ->
|
|
96
|
-
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()}
|
|
97
100
|
if len(used_spaces) == 1:
|
|
98
101
|
# We skip the default space and only use this space for the data model
|
|
99
102
|
data_model.space = used_spaces.pop()
|
|
100
|
-
spaces =
|
|
103
|
+
spaces = SpaceApplyDict([dm.SpaceApply(space=data_model.space)])
|
|
101
104
|
else:
|
|
102
105
|
used_spaces.add(metadata.space)
|
|
103
|
-
spaces =
|
|
104
|
-
if self.instance_space and self.instance_space not in
|
|
105
|
-
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)
|
|
106
109
|
return spaces
|
|
107
110
|
|
|
108
111
|
def _create_views_with_node_types(
|
|
109
112
|
self,
|
|
110
113
|
view_properties_by_id: dict[dm.ViewId, list[DMSProperty]],
|
|
111
|
-
) -> tuple[
|
|
112
|
-
views =
|
|
114
|
+
) -> tuple[ViewApplyDict, NodeApplyDict]:
|
|
115
|
+
views = ViewApplyDict([dms_view.as_view() for dms_view in self.rules.views])
|
|
113
116
|
dms_view_by_id = {dms_view.view.as_id(): dms_view for dms_view in self.rules.views}
|
|
114
117
|
|
|
115
|
-
for view in views:
|
|
116
|
-
view_id = view.as_id()
|
|
118
|
+
for view_id, view in views.items():
|
|
117
119
|
view.properties = {}
|
|
118
120
|
if not (view_properties := view_properties_by_id.get(view_id)):
|
|
119
121
|
continue
|
|
@@ -124,14 +126,13 @@ class _DMSExporter:
|
|
|
124
126
|
|
|
125
127
|
data_model_type = self.rules.metadata.data_model_type
|
|
126
128
|
unique_node_types: set[dm.NodeId] = set()
|
|
127
|
-
parent_views = {parent for view in views for parent in view.implements or []}
|
|
128
|
-
for view in views:
|
|
129
|
-
dms_view = dms_view_by_id.get(
|
|
130
|
-
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, [])
|
|
131
133
|
view_filter = self._create_view_filter(view, dms_view, data_model_type, dms_properties)
|
|
132
134
|
|
|
133
135
|
view.filter = view_filter.as_dms_filter()
|
|
134
|
-
|
|
135
136
|
if isinstance(view_filter, NodeTypeFilter):
|
|
136
137
|
unique_node_types.update(view_filter.nodes)
|
|
137
138
|
if view.as_id() in parent_views:
|
|
@@ -151,7 +152,7 @@ class _DMSExporter:
|
|
|
151
152
|
issues.dms.HasDataFilterOnViewWithReferencesWarning(view.as_id(), list(references)), stacklevel=2
|
|
152
153
|
)
|
|
153
154
|
|
|
154
|
-
return views,
|
|
155
|
+
return views, NodeApplyDict(
|
|
155
156
|
[dm.NodeApply(space=node.space, external_id=node.external_id) for node in unique_node_types]
|
|
156
157
|
)
|
|
157
158
|
|
|
@@ -174,7 +175,7 @@ class _DMSExporter:
|
|
|
174
175
|
def _create_containers(
|
|
175
176
|
self,
|
|
176
177
|
container_properties_by_id: dict[dm.ContainerId, list[DMSProperty]],
|
|
177
|
-
) ->
|
|
178
|
+
) -> ContainerApplyDict:
|
|
178
179
|
containers = dm.ContainerApplyList(
|
|
179
180
|
[dms_container.as_container() for dms_container in self.rules.containers or []]
|
|
180
181
|
)
|
|
@@ -229,9 +230,7 @@ class _DMSExporter:
|
|
|
229
230
|
for name, const in container.constraints.items()
|
|
230
231
|
if not (isinstance(const, dm.RequiresConstraint) and const.require in container_to_drop)
|
|
231
232
|
}
|
|
232
|
-
return
|
|
233
|
-
[container for container in containers if container.as_id() not in container_to_drop]
|
|
234
|
-
)
|
|
233
|
+
return ContainerApplyDict([container for container in containers if container.as_id() not in container_to_drop])
|
|
235
234
|
|
|
236
235
|
def _gather_properties(self) -> tuple[dict[dm.ContainerId, list[DMSProperty]], dict[dm.ViewId, list[DMSProperty]]]:
|
|
237
236
|
container_properties_by_id: dict[dm.ContainerId, list[DMSProperty]] = defaultdict(list)
|
|
@@ -254,6 +253,7 @@ class _DMSExporter:
|
|
|
254
253
|
dms_properties: list[DMSProperty],
|
|
255
254
|
) -> DMSFilter:
|
|
256
255
|
selected_filter_name = (dms_view and dms_view.filter_ and dms_view.filter_.name) or ""
|
|
256
|
+
|
|
257
257
|
if dms_view and dms_view.filter_ and not dms_view.filter_.is_empty:
|
|
258
258
|
# Has Explicit Filter, use it
|
|
259
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
|
|
|
@@ -237,7 +237,7 @@ class DMSViewInput:
|
|
|
237
237
|
description: str | None = None
|
|
238
238
|
implements: str | None = None
|
|
239
239
|
reference: str | None = None
|
|
240
|
-
filter_: Literal["hasData", "nodeType"] | None = None
|
|
240
|
+
filter_: Literal["hasData", "nodeType", "rawFilter"] | None = None
|
|
241
241
|
in_model: bool = True
|
|
242
242
|
|
|
243
243
|
@classmethod
|
|
@@ -3,7 +3,6 @@ import sys
|
|
|
3
3
|
import warnings
|
|
4
4
|
import zipfile
|
|
5
5
|
from collections import Counter, defaultdict
|
|
6
|
-
from collections.abc import Sequence
|
|
7
6
|
from dataclasses import Field, dataclass, field, fields
|
|
8
7
|
from pathlib import Path
|
|
9
8
|
from typing import Any, ClassVar, cast
|
|
@@ -31,6 +30,13 @@ from cognite.neat.rules.issues.dms import (
|
|
|
31
30
|
MissingViewError,
|
|
32
31
|
)
|
|
33
32
|
from cognite.neat.rules.models.data_types import _DATA_TYPE_BY_DMS_TYPE
|
|
33
|
+
from cognite.neat.utils.cdf_classes import (
|
|
34
|
+
CogniteResourceDict,
|
|
35
|
+
ContainerApplyDict,
|
|
36
|
+
NodeApplyDict,
|
|
37
|
+
SpaceApplyDict,
|
|
38
|
+
ViewApplyDict,
|
|
39
|
+
)
|
|
34
40
|
from cognite.neat.utils.cdf_loaders import ViewLoader
|
|
35
41
|
from cognite.neat.utils.cdf_loaders.data_classes import RawTableWrite, RawTableWriteList
|
|
36
42
|
from cognite.neat.utils.text import to_camel
|
|
@@ -45,10 +51,10 @@ else:
|
|
|
45
51
|
@dataclass
|
|
46
52
|
class DMSSchema:
|
|
47
53
|
data_model: dm.DataModelApply | None = None
|
|
48
|
-
spaces:
|
|
49
|
-
views:
|
|
50
|
-
containers:
|
|
51
|
-
node_types:
|
|
54
|
+
spaces: SpaceApplyDict = field(default_factory=SpaceApplyDict)
|
|
55
|
+
views: ViewApplyDict = field(default_factory=ViewApplyDict)
|
|
56
|
+
containers: ContainerApplyDict = field(default_factory=ContainerApplyDict)
|
|
57
|
+
node_types: NodeApplyDict = field(default_factory=NodeApplyDict)
|
|
52
58
|
# The last schema is the previous version of the data model. In the case, extension=addition, this
|
|
53
59
|
# should not be modified.
|
|
54
60
|
last: "DMSSchema | None" = None
|
|
@@ -65,22 +71,21 @@ class DMSSchema:
|
|
|
65
71
|
|
|
66
72
|
def _get_mapped_container_from_view(self, view_id: dm.ViewId) -> set[dm.ContainerId]:
|
|
67
73
|
# index all views, including ones from reference
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
74
|
+
view_by_id = self.views.copy()
|
|
75
|
+
if self.reference:
|
|
76
|
+
view_by_id.update(self.reference.views)
|
|
72
77
|
|
|
73
|
-
if view_id not in
|
|
78
|
+
if view_id not in view_by_id:
|
|
74
79
|
raise ValueError(f"View {view_id} not found")
|
|
75
80
|
|
|
76
|
-
indexed_implemented_views = {id_: view.implements for id_, view in
|
|
81
|
+
indexed_implemented_views = {id_: view.implements for id_, view in view_by_id.items()}
|
|
77
82
|
view_inheritance = get_inheritance_path(view_id, indexed_implemented_views)
|
|
78
83
|
|
|
79
|
-
directly_referenced_containers =
|
|
84
|
+
directly_referenced_containers = view_by_id[view_id].referenced_containers()
|
|
80
85
|
inherited_referenced_containers = set()
|
|
81
86
|
|
|
82
87
|
for view_id in view_inheritance:
|
|
83
|
-
if implemented_view :=
|
|
88
|
+
if implemented_view := view_by_id.get(view_id):
|
|
84
89
|
inherited_referenced_containers |= implemented_view.referenced_containers()
|
|
85
90
|
else:
|
|
86
91
|
raise IncompleteSchemaError(missing_component=view_id).as_exception()
|
|
@@ -151,31 +156,39 @@ class DMSSchema:
|
|
|
151
156
|
# as the read format contains all properties from all parents, while the write formate should not contain
|
|
152
157
|
# properties from any parents.
|
|
153
158
|
# The ViewLoader as_write method looks up parents and remove properties from them.
|
|
154
|
-
view_write =
|
|
159
|
+
view_write = ViewApplyDict([view_loader.as_write(view) for view in views])
|
|
155
160
|
|
|
156
|
-
container_write = containers.as_write()
|
|
161
|
+
container_write = ContainerApplyDict(containers.as_write())
|
|
157
162
|
user_space = data_model.space
|
|
158
163
|
if reference_model:
|
|
159
164
|
user_model_view_ids = set(data_model_write.views)
|
|
160
165
|
ref_model_write = reference_model.as_write()
|
|
161
166
|
ref_model_write.views = [view.as_id() for view in reference_model.views]
|
|
162
167
|
|
|
163
|
-
ref_views =
|
|
164
|
-
[
|
|
168
|
+
ref_views = ViewApplyDict(
|
|
169
|
+
[
|
|
170
|
+
view
|
|
171
|
+
for view_id, view in view_write.items()
|
|
172
|
+
if (view.space != user_space) or (view_id not in user_model_view_ids)
|
|
173
|
+
]
|
|
165
174
|
)
|
|
166
|
-
view_write =
|
|
167
|
-
[
|
|
175
|
+
view_write = ViewApplyDict(
|
|
176
|
+
[
|
|
177
|
+
view
|
|
178
|
+
for view_id, view in view_write.items()
|
|
179
|
+
if view.space == user_space or view_id in user_model_view_ids
|
|
180
|
+
]
|
|
168
181
|
)
|
|
169
182
|
|
|
170
|
-
ref_containers =
|
|
171
|
-
[container for container in container_write if container.space != user_space]
|
|
183
|
+
ref_containers = ContainerApplyDict(
|
|
184
|
+
[container for container in container_write.values() if container.space != user_space]
|
|
172
185
|
)
|
|
173
|
-
container_write =
|
|
174
|
-
[container for container in container_write if container.space == user_space]
|
|
186
|
+
container_write = ContainerApplyDict(
|
|
187
|
+
[container for container in container_write.values() if container.space == user_space]
|
|
175
188
|
)
|
|
176
189
|
|
|
177
190
|
ref_schema: DMSSchema | None = cls(
|
|
178
|
-
spaces=
|
|
191
|
+
spaces=SpaceApplyDict([s for s in space_write if s.space != user_space]),
|
|
179
192
|
data_model=ref_model_write,
|
|
180
193
|
views=ref_views,
|
|
181
194
|
containers=ref_containers,
|
|
@@ -183,7 +196,7 @@ class DMSSchema:
|
|
|
183
196
|
else:
|
|
184
197
|
ref_schema = None
|
|
185
198
|
return cls(
|
|
186
|
-
spaces=
|
|
199
|
+
spaces=SpaceApplyDict([s for s in space_write if s.space == user_space]),
|
|
187
200
|
data_model=data_model_write,
|
|
188
201
|
views=view_write,
|
|
189
202
|
containers=container_write,
|
|
@@ -245,7 +258,7 @@ class DMSSchema:
|
|
|
245
258
|
data_models = path_dir / "data_models"
|
|
246
259
|
data_models.mkdir(parents=True, exist_ok=True)
|
|
247
260
|
if "spaces" not in exclude_set:
|
|
248
|
-
for space in self.spaces:
|
|
261
|
+
for space in self.spaces.values():
|
|
249
262
|
(data_models / f"{space.space}.space.yaml").write_text(
|
|
250
263
|
space.dump_yaml(), newline=new_line, encoding=encoding
|
|
251
264
|
)
|
|
@@ -256,21 +269,21 @@ class DMSSchema:
|
|
|
256
269
|
if "views" not in exclude_set and self.views:
|
|
257
270
|
view_dir = data_models / "views"
|
|
258
271
|
view_dir.mkdir(parents=True, exist_ok=True)
|
|
259
|
-
for view in self.views:
|
|
272
|
+
for view in self.views.values():
|
|
260
273
|
(view_dir / f"{view.external_id}.view.yaml").write_text(
|
|
261
274
|
view.dump_yaml(), newline=new_line, encoding=encoding
|
|
262
275
|
)
|
|
263
276
|
if "containers" not in exclude_set and self.containers:
|
|
264
277
|
container_dir = data_models / "containers"
|
|
265
278
|
container_dir.mkdir(parents=True, exist_ok=True)
|
|
266
|
-
for container in self.containers:
|
|
279
|
+
for container in self.containers.values():
|
|
267
280
|
(container_dir / f"{container.external_id}.container.yaml").write_text(
|
|
268
281
|
container.dump_yaml(), newline=new_line, encoding=encoding
|
|
269
282
|
)
|
|
270
283
|
if "node_types" not in exclude_set and self.node_types:
|
|
271
284
|
node_dir = data_models / "nodes"
|
|
272
285
|
node_dir.mkdir(parents=True, exist_ok=True)
|
|
273
|
-
for node in self.node_types:
|
|
286
|
+
for node in self.node_types.values():
|
|
274
287
|
(node_dir / f"{node.external_id}.node.yaml").write_text(
|
|
275
288
|
node.dump_yaml(), newline=new_line, encoding=encoding
|
|
276
289
|
)
|
|
@@ -324,22 +337,22 @@ class DMSSchema:
|
|
|
324
337
|
exclude_set = exclude or set()
|
|
325
338
|
with zipfile.ZipFile(zip_file, "w") as zip_ref:
|
|
326
339
|
if "spaces" not in exclude_set:
|
|
327
|
-
for space in self.spaces:
|
|
340
|
+
for space in self.spaces.values():
|
|
328
341
|
zip_ref.writestr(f"data_models/{space.space}.space.yaml", space.dump_yaml())
|
|
329
342
|
if "data_models" not in exclude_set and self.data_model:
|
|
330
343
|
zip_ref.writestr(
|
|
331
344
|
f"data_models/{self.data_model.external_id}.datamodel.yaml", self.data_model.dump_yaml()
|
|
332
345
|
)
|
|
333
346
|
if "views" not in exclude_set:
|
|
334
|
-
for view in self.views:
|
|
347
|
+
for view in self.views.values():
|
|
335
348
|
zip_ref.writestr(f"data_models/views/{view.external_id}.view.yaml", view.dump_yaml())
|
|
336
349
|
if "containers" not in exclude_set:
|
|
337
|
-
for container in self.containers:
|
|
350
|
+
for container in self.containers.values():
|
|
338
351
|
zip_ref.writestr(
|
|
339
352
|
f"data_models/containers{container.external_id}.container.yaml", container.dump_yaml()
|
|
340
353
|
)
|
|
341
354
|
if "node_types" not in exclude_set:
|
|
342
|
-
for node in self.node_types:
|
|
355
|
+
for node in self.node_types.values():
|
|
343
356
|
zip_ref.writestr(f"data_models/nodes/{node.external_id}.node.yaml", node.dump_yaml())
|
|
344
357
|
|
|
345
358
|
@classmethod
|
|
@@ -436,9 +449,13 @@ class DMSSchema:
|
|
|
436
449
|
for attr in cls_fields:
|
|
437
450
|
if items := getattr(self, attr.name):
|
|
438
451
|
key = to_camel(attr.name) if camel_case else attr.name
|
|
439
|
-
if isinstance(items,
|
|
440
|
-
|
|
441
|
-
|
|
452
|
+
if isinstance(items, CogniteResourceDict):
|
|
453
|
+
if sort:
|
|
454
|
+
output[key] = [
|
|
455
|
+
item.dump(camel_case) for item in sorted(items.values(), key=self._to_sortable_identifier)
|
|
456
|
+
]
|
|
457
|
+
else:
|
|
458
|
+
output[key] = items.dump(camel_case)
|
|
442
459
|
else:
|
|
443
460
|
output[key] = items.dump(camel_case=camel_case)
|
|
444
461
|
return output
|
|
@@ -461,19 +478,19 @@ class DMSSchema:
|
|
|
461
478
|
|
|
462
479
|
def validate(self) -> list[DMSSchemaError]:
|
|
463
480
|
errors: set[DMSSchemaError] = set()
|
|
464
|
-
defined_spaces =
|
|
465
|
-
defined_containers =
|
|
466
|
-
defined_views =
|
|
481
|
+
defined_spaces = self.spaces.copy()
|
|
482
|
+
defined_containers = self.containers.copy()
|
|
483
|
+
defined_views = self.views.copy()
|
|
467
484
|
if self.reference:
|
|
468
|
-
defined_spaces |=
|
|
469
|
-
defined_containers |=
|
|
470
|
-
defined_views |=
|
|
485
|
+
defined_spaces |= self.reference.spaces
|
|
486
|
+
defined_containers |= self.reference.containers
|
|
487
|
+
defined_views |= self.reference.views
|
|
471
488
|
|
|
472
|
-
for container in self.containers:
|
|
489
|
+
for container in self.containers.values():
|
|
473
490
|
if container.space not in defined_spaces:
|
|
474
491
|
errors.add(MissingSpaceError(space=container.space, referred_by=container.as_id()))
|
|
475
492
|
|
|
476
|
-
for view in self.views:
|
|
493
|
+
for view in self.views.values():
|
|
477
494
|
view_id = view.as_id()
|
|
478
495
|
if view.space not in defined_spaces:
|
|
479
496
|
errors.add(MissingSpaceError(space=view.space, referred_by=view_id))
|
|
@@ -601,16 +618,18 @@ class DMSSchema:
|
|
|
601
618
|
Returns:
|
|
602
619
|
set[str]: The spaces referenced by the schema.
|
|
603
620
|
"""
|
|
604
|
-
referenced_spaces = {view.space for view in self.views}
|
|
605
|
-
referenced_spaces |= {container.space for container in self.containers}
|
|
621
|
+
referenced_spaces = {view.space for view in self.views.values()}
|
|
622
|
+
referenced_spaces |= {container.space for container in self.containers.values()}
|
|
606
623
|
if include_indirect_references:
|
|
607
|
-
referenced_spaces |= {
|
|
608
|
-
|
|
609
|
-
|
|
624
|
+
referenced_spaces |= {
|
|
625
|
+
container.space for view in self.views.values() for container in view.referenced_containers()
|
|
626
|
+
}
|
|
627
|
+
referenced_spaces |= {parent.space for view in self.views.values() for parent in view.implements or []}
|
|
628
|
+
referenced_spaces |= {node.space for node in self.node_types.values()}
|
|
610
629
|
if self.data_model:
|
|
611
630
|
referenced_spaces |= {self.data_model.space}
|
|
612
631
|
referenced_spaces |= {view.space for view in self.data_model.views or []}
|
|
613
|
-
referenced_spaces |= {s.space for s in self.spaces}
|
|
632
|
+
referenced_spaces |= {s.space for s in self.spaces.values()}
|
|
614
633
|
return referenced_spaces
|
|
615
634
|
|
|
616
635
|
|
|
@@ -727,12 +746,12 @@ class PipelineSchema(DMSSchema):
|
|
|
727
746
|
database_name = first_data_model.external_id[:32]
|
|
728
747
|
instance_space = instance_space or first_data_model.space
|
|
729
748
|
database = DatabaseWrite(name=database_name)
|
|
730
|
-
parent_views = {parent for view in schema.views for parent in view.implements or []}
|
|
731
|
-
container_by_id =
|
|
749
|
+
parent_views = {parent for view in schema.views.values() for parent in view.implements or []}
|
|
750
|
+
container_by_id = schema.containers.copy()
|
|
732
751
|
|
|
733
752
|
transformations = TransformationWriteList([])
|
|
734
753
|
raw_tables = RawTableWriteList([])
|
|
735
|
-
for view in schema.views:
|
|
754
|
+
for view in schema.views.values():
|
|
736
755
|
if view.as_id() in parent_views:
|
|
737
756
|
# Skipping parents as they do not have their own data
|
|
738
757
|
continue
|
|
@@ -8,6 +8,7 @@ from cognite.neat.rules.issues import IssueList
|
|
|
8
8
|
from cognite.neat.rules.models._base import ExtensionCategory, SchemaCompleteness
|
|
9
9
|
from cognite.neat.rules.models.data_types import DataType
|
|
10
10
|
from cognite.neat.rules.models.entities import ContainerEntity
|
|
11
|
+
from cognite.neat.rules.models.wrapped_entities import RawFilter
|
|
11
12
|
|
|
12
13
|
from ._rules import DMSProperty, DMSRules
|
|
13
14
|
|
|
@@ -25,6 +26,7 @@ class DMSPostValidation:
|
|
|
25
26
|
self.issue_list = IssueList()
|
|
26
27
|
|
|
27
28
|
def validate(self) -> IssueList:
|
|
29
|
+
self._validate_best_practices()
|
|
28
30
|
self._consistent_container_properties()
|
|
29
31
|
self._referenced_views_and_containers_are_existing()
|
|
30
32
|
self._validate_extension()
|
|
@@ -166,8 +168,8 @@ class DMSPostValidation:
|
|
|
166
168
|
# Is an extension of an existing model.
|
|
167
169
|
user_schema = self.rules.as_schema()
|
|
168
170
|
ref_schema = self.rules.reference.as_schema()
|
|
169
|
-
new_containers =
|
|
170
|
-
existing_containers =
|
|
171
|
+
new_containers = user_schema.containers.copy()
|
|
172
|
+
existing_containers = ref_schema.containers.copy()
|
|
171
173
|
|
|
172
174
|
for container_id, container in new_containers.items():
|
|
173
175
|
existing_container = existing_containers.get(container_id)
|
|
@@ -193,8 +195,8 @@ class DMSPostValidation:
|
|
|
193
195
|
# Reshape allows changes to views
|
|
194
196
|
return None
|
|
195
197
|
|
|
196
|
-
new_views =
|
|
197
|
-
existing_views =
|
|
198
|
+
new_views = user_schema.views.copy()
|
|
199
|
+
existing_views = ref_schema.views.copy()
|
|
198
200
|
for view_id, view in new_views.items():
|
|
199
201
|
existing_view = existing_views.get(view_id)
|
|
200
202
|
if not existing_view or existing_view == view:
|
|
@@ -219,13 +221,13 @@ class DMSPostValidation:
|
|
|
219
221
|
|
|
220
222
|
dms_schema = self.rules.as_schema()
|
|
221
223
|
|
|
222
|
-
for view in dms_schema.views:
|
|
223
|
-
mapped_containers = dms_schema._get_mapped_container_from_view(
|
|
224
|
+
for view_id, view in dms_schema.views.items():
|
|
225
|
+
mapped_containers = dms_schema._get_mapped_container_from_view(view_id)
|
|
224
226
|
|
|
225
227
|
if mapped_containers and len(mapped_containers) > 10:
|
|
226
228
|
self.issue_list.append(
|
|
227
229
|
issues.dms.ViewMapsToTooManyContainersWarning(
|
|
228
|
-
view_id=
|
|
230
|
+
view_id=view_id,
|
|
229
231
|
container_ids=mapped_containers,
|
|
230
232
|
)
|
|
231
233
|
)
|
|
@@ -236,11 +238,20 @@ class DMSPostValidation:
|
|
|
236
238
|
):
|
|
237
239
|
self.issue_list.append(
|
|
238
240
|
issues.dms.HasDataFilterAppliedToTooManyContainersWarning(
|
|
239
|
-
view_id=
|
|
241
|
+
view_id=view_id,
|
|
240
242
|
container_ids=mapped_containers,
|
|
241
243
|
)
|
|
242
244
|
)
|
|
243
245
|
|
|
246
|
+
def _validate_best_practices(self) -> None:
|
|
247
|
+
for view in self.views:
|
|
248
|
+
if view.filter_ and isinstance(view.filter_, RawFilter):
|
|
249
|
+
self.issue_list.append(
|
|
250
|
+
issues.dms.RawFilterAppliedToViewWarning(
|
|
251
|
+
view_id=view.view.as_id(),
|
|
252
|
+
)
|
|
253
|
+
)
|
|
254
|
+
|
|
244
255
|
@staticmethod
|
|
245
256
|
def _changed_attributes_and_properties(
|
|
246
257
|
new_dumped: dict[str, Any], existing_dumped: dict[str, Any]
|