cognite-neat 0.82.0__tar.gz → 0.82.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.82.0 → cognite_neat-0.82.1}/PKG-INFO +1 -1
- cognite_neat-0.82.1/cognite/neat/_version.py +1 -0
- cognite_neat-0.82.1/cognite/neat/rules/_shared.py +5 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_spreadsheet2rules.py +6 -1
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/__init__.py +4 -1
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/_base.py +1 -0
- cognite_neat-0.82.1/cognite/neat/rules/models/asset/__init__.py +10 -0
- cognite_neat-0.82.1/cognite/neat/rules/models/asset/_converter.py +4 -0
- cognite_neat-0.82.1/cognite/neat/rules/models/asset/_rules.py +156 -0
- cognite_neat-0.82.1/cognite/neat/rules/models/asset/_rules_input.py +171 -0
- cognite_neat-0.82.1/cognite/neat/rules/models/asset/_serializer.py +73 -0
- cognite_neat-0.82.1/cognite/neat/rules/models/asset/_validation.py +4 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/entities.py +56 -1
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/data_contracts.py +5 -2
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/pyproject.toml +2 -4
- cognite_neat-0.82.0/cognite/neat/_version.py +0 -1
- cognite_neat-0.82.0/cognite/neat/rules/_shared.py +0 -5
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/LICENSE +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/README.md +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/config.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/_shared.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/_tracking/base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/_tracking/log.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/issues/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/issues/loader.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/loaders/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/loaders/_rdf2dms.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/queries/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/queries/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/queries/_construct.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/queries/_shared.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/stores/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/stores/_provenance.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/transformers/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/transformers/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/issues.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/analysis/_information_rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exporters/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_inference2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/_constants.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/data_types.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/_converter.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/_rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/_schema.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/_serializer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/domain.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/information/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/information/_converter.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/information/_rules.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/information/_serializer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/information/_validation.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/models/wrapped_entities.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/cdf_classes.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/upload.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/utils.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/utils/xml.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.82.1"
|
{cognite_neat-0.82.0 → cognite_neat-0.82.1}/cognite/neat/rules/importers/_spreadsheet2rules.py
RENAMED
|
@@ -15,12 +15,14 @@ from cognite.neat.rules import issues
|
|
|
15
15
|
from cognite.neat.rules.issues import IssueList
|
|
16
16
|
from cognite.neat.rules.models import (
|
|
17
17
|
RULES_PER_ROLE,
|
|
18
|
+
AssetRules,
|
|
18
19
|
DMSRules,
|
|
19
20
|
DomainRules,
|
|
20
21
|
InformationRules,
|
|
21
22
|
RoleTypes,
|
|
22
23
|
SchemaCompleteness,
|
|
23
24
|
)
|
|
25
|
+
from cognite.neat.rules.models.asset import AssetRulesInput
|
|
24
26
|
from cognite.neat.rules.models.dms import DMSRulesInput
|
|
25
27
|
from cognite.neat.rules.models.information import InformationRulesInput
|
|
26
28
|
from cognite.neat.utils.auxiliary import local_import
|
|
@@ -35,6 +37,7 @@ SOURCE_SHEET__TARGET_FIELD__HEADERS = [
|
|
|
35
37
|
{
|
|
36
38
|
RoleTypes.domain_expert: "Property",
|
|
37
39
|
RoleTypes.information_architect: "Property",
|
|
40
|
+
RoleTypes.asset_architect: "Property",
|
|
38
41
|
RoleTypes.dms_architect: "View Property",
|
|
39
42
|
},
|
|
40
43
|
),
|
|
@@ -266,6 +269,8 @@ class ExcelImporter(BaseImporter):
|
|
|
266
269
|
rules = DMSRulesInput.load(sheets).as_rules()
|
|
267
270
|
elif rules_cls is InformationRules:
|
|
268
271
|
rules = InformationRulesInput.load(sheets).as_rules()
|
|
272
|
+
elif rules_cls is AssetRules:
|
|
273
|
+
rules = AssetRulesInput.load(sheets).as_rules()
|
|
269
274
|
else:
|
|
270
275
|
rules = rules_cls.model_validate(sheets) # type: ignore[attr-defined]
|
|
271
276
|
|
|
@@ -300,7 +305,7 @@ class GoogleSheetImporter(BaseImporter):
|
|
|
300
305
|
import gspread # type: ignore[import]
|
|
301
306
|
|
|
302
307
|
role = role or RoleTypes.domain_expert
|
|
303
|
-
rules_model = cast(DomainRules | InformationRules | DMSRules, RULES_PER_ROLE[role])
|
|
308
|
+
rules_model = cast(DomainRules | InformationRules | AssetRules | DMSRules, RULES_PER_ROLE[role])
|
|
304
309
|
|
|
305
310
|
client_google = gspread.service_account()
|
|
306
311
|
google_sheet = client_google.open_by_key(self.sheet_id)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from cognite.neat.rules.models.asset import AssetRules
|
|
1
2
|
from cognite.neat.rules.models.domain import DomainRules
|
|
2
3
|
from cognite.neat.rules.models.information._rules import InformationRules
|
|
3
4
|
|
|
@@ -5,9 +6,10 @@ from ._base import DataModelType, ExtensionCategory, RoleTypes, SchemaCompletene
|
|
|
5
6
|
from .dms._rules import DMSRules
|
|
6
7
|
from .dms._schema import DMSSchema
|
|
7
8
|
|
|
8
|
-
RULES_PER_ROLE: dict[RoleTypes, type[DomainRules] | type[InformationRules] | type[DMSRules]] = {
|
|
9
|
+
RULES_PER_ROLE: dict[RoleTypes, type[DomainRules] | type[InformationRules] | type[AssetRules] | type[DMSRules]] = {
|
|
9
10
|
RoleTypes.domain_expert: DomainRules,
|
|
10
11
|
RoleTypes.information_architect: InformationRules,
|
|
12
|
+
RoleTypes.asset_architect: AssetRules,
|
|
11
13
|
RoleTypes.dms_architect: DMSRules,
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -15,6 +17,7 @@ RULES_PER_ROLE: dict[RoleTypes, type[DomainRules] | type[InformationRules] | typ
|
|
|
15
17
|
__all__ = [
|
|
16
18
|
"DomainRules",
|
|
17
19
|
"InformationRules",
|
|
20
|
+
"AssetRules",
|
|
18
21
|
"DMSRules",
|
|
19
22
|
"RULES_PER_ROLE",
|
|
20
23
|
"DMSSchema",
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Literal, cast
|
|
3
|
+
|
|
4
|
+
from pydantic import Field, field_validator, model_validator
|
|
5
|
+
from pydantic.main import IncEx
|
|
6
|
+
from rdflib import Namespace
|
|
7
|
+
|
|
8
|
+
from cognite.neat.constants import PREFIXES
|
|
9
|
+
from cognite.neat.issues import MultiValueError
|
|
10
|
+
from cognite.neat.rules import issues
|
|
11
|
+
from cognite.neat.rules.models._base import BaseRules, RoleTypes, SheetList
|
|
12
|
+
from cognite.neat.rules.models.domain import DomainRules
|
|
13
|
+
from cognite.neat.rules.models.entities import (
|
|
14
|
+
CdfResourceEntityList,
|
|
15
|
+
ClassEntity,
|
|
16
|
+
MultiValueTypeInfo,
|
|
17
|
+
ParentClassEntity,
|
|
18
|
+
Undefined,
|
|
19
|
+
)
|
|
20
|
+
from cognite.neat.rules.models.information import (
|
|
21
|
+
InformationClass,
|
|
22
|
+
InformationMetadata,
|
|
23
|
+
InformationProperty,
|
|
24
|
+
InformationRules,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
from cognite.neat.rules.models.dms._rules import DMSRules
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if sys.version_info >= (3, 11):
|
|
32
|
+
from typing import Self
|
|
33
|
+
else:
|
|
34
|
+
from typing_extensions import Self
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class AssetMetadata(InformationMetadata):
|
|
38
|
+
role: ClassVar[RoleTypes] = RoleTypes.asset_architect
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class AssetClass(InformationClass): ...
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AssetProperty(InformationProperty):
|
|
45
|
+
"""
|
|
46
|
+
A property is a characteristic of a class. It is a named attribute of a class that describes a range of values
|
|
47
|
+
or a relationship to another class.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
class_: Class ID to which property belongs
|
|
51
|
+
property_: Property ID of the property
|
|
52
|
+
name: Property name.
|
|
53
|
+
value_type: Type of value property will hold (data or link to another class)
|
|
54
|
+
min_count: Minimum count of the property values. Defaults to 0
|
|
55
|
+
max_count: Maximum count of the property values. Defaults to None
|
|
56
|
+
default: Default value of the property
|
|
57
|
+
reference: Reference to the source of the information, HTTP URI
|
|
58
|
+
match_type: The match type of the resource being described and the source entity.
|
|
59
|
+
transformation: Actual rule for the transformation from source to target representation of
|
|
60
|
+
knowledge graph. Defaults to None (no transformation)
|
|
61
|
+
implementation: Details on how given class-property is implemented in the classic CDF
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
implementation: CdfResourceEntityList | None = Field(alias="Implementation", default=None)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class AssetRules(BaseRules):
|
|
68
|
+
metadata: AssetMetadata = Field(alias="Metadata")
|
|
69
|
+
properties: SheetList[AssetProperty] = Field(alias="Properties")
|
|
70
|
+
classes: SheetList[AssetClass] = Field(alias="Classes")
|
|
71
|
+
prefixes: dict[str, Namespace] = Field(default_factory=lambda: PREFIXES.copy())
|
|
72
|
+
last: "AssetRules | None" = Field(None, alias="Last")
|
|
73
|
+
reference: "AssetRules | None" = Field(None, alias="Reference")
|
|
74
|
+
|
|
75
|
+
@field_validator("prefixes", mode="before")
|
|
76
|
+
def parse_str(cls, values: Any) -> Any:
|
|
77
|
+
if isinstance(values, dict):
|
|
78
|
+
return {key: Namespace(value) if isinstance(value, str) else value for key, value in values.items()}
|
|
79
|
+
return values
|
|
80
|
+
|
|
81
|
+
@model_validator(mode="after")
|
|
82
|
+
def update_entities_prefix(self) -> Self:
|
|
83
|
+
# update expected_value_types
|
|
84
|
+
for property_ in self.properties:
|
|
85
|
+
if isinstance(property_.value_type, ClassEntity) and property_.value_type.prefix is Undefined:
|
|
86
|
+
property_.value_type.prefix = self.metadata.prefix
|
|
87
|
+
|
|
88
|
+
if isinstance(property_.value_type, MultiValueTypeInfo):
|
|
89
|
+
property_.value_type.set_default_prefix(self.metadata.prefix)
|
|
90
|
+
|
|
91
|
+
if property_.class_.prefix is Undefined:
|
|
92
|
+
property_.class_.prefix = self.metadata.prefix
|
|
93
|
+
|
|
94
|
+
# update parent classes
|
|
95
|
+
for class_ in self.classes:
|
|
96
|
+
if class_.parent:
|
|
97
|
+
for parent in cast(list[ParentClassEntity], class_.parent):
|
|
98
|
+
if not isinstance(parent.prefix, str):
|
|
99
|
+
parent.prefix = self.metadata.prefix
|
|
100
|
+
if class_.class_.prefix is Undefined:
|
|
101
|
+
class_.class_.prefix = self.metadata.prefix
|
|
102
|
+
|
|
103
|
+
return self
|
|
104
|
+
|
|
105
|
+
@model_validator(mode="after")
|
|
106
|
+
def post_validation(self) -> "AssetRules":
|
|
107
|
+
from ._validation import AssetPostValidation
|
|
108
|
+
|
|
109
|
+
issue_list = AssetPostValidation(cast(InformationRules, self)).validate()
|
|
110
|
+
if issue_list.warnings:
|
|
111
|
+
issue_list.trigger_warnings()
|
|
112
|
+
if issue_list.has_errors:
|
|
113
|
+
raise MultiValueError([error for error in issue_list if isinstance(error, issues.NeatValidationError)])
|
|
114
|
+
return self
|
|
115
|
+
|
|
116
|
+
def dump(
|
|
117
|
+
self,
|
|
118
|
+
mode: Literal["python", "json"] = "python",
|
|
119
|
+
by_alias: bool = False,
|
|
120
|
+
exclude: IncEx = None,
|
|
121
|
+
exclude_none: bool = False,
|
|
122
|
+
exclude_unset: bool = False,
|
|
123
|
+
exclude_defaults: bool = False,
|
|
124
|
+
as_reference: bool = False,
|
|
125
|
+
) -> dict[str, Any]:
|
|
126
|
+
from ._serializer import _AssetRulesSerializer
|
|
127
|
+
|
|
128
|
+
dumped = self.model_dump(
|
|
129
|
+
mode=mode,
|
|
130
|
+
by_alias=by_alias,
|
|
131
|
+
exclude=exclude,
|
|
132
|
+
exclude_none=exclude_none,
|
|
133
|
+
exclude_unset=exclude_unset,
|
|
134
|
+
exclude_defaults=exclude_defaults,
|
|
135
|
+
)
|
|
136
|
+
prefix = self.metadata.prefix
|
|
137
|
+
serializer = _AssetRulesSerializer(by_alias, prefix)
|
|
138
|
+
cleaned = serializer.clean(dumped, as_reference)
|
|
139
|
+
last = "Last" if by_alias else "last"
|
|
140
|
+
if last_dump := cleaned.get(last):
|
|
141
|
+
cleaned[last] = serializer.clean(last_dump, False)
|
|
142
|
+
reference = "Reference" if by_alias else "reference"
|
|
143
|
+
if self.reference and (ref_dump := cleaned.get(reference)):
|
|
144
|
+
prefix = self.reference.metadata.prefix
|
|
145
|
+
cleaned[reference] = _AssetRulesSerializer(by_alias, prefix).clean(ref_dump, True)
|
|
146
|
+
return cleaned
|
|
147
|
+
|
|
148
|
+
def as_domain_rules(self) -> DomainRules:
|
|
149
|
+
from ._converter import _AssetRulesConverter
|
|
150
|
+
|
|
151
|
+
return _AssetRulesConverter(cast(InformationRules, self)).as_domain_rules()
|
|
152
|
+
|
|
153
|
+
def as_dms_architect_rules(self) -> "DMSRules":
|
|
154
|
+
from ._converter import _AssetRulesConverter
|
|
155
|
+
|
|
156
|
+
return _AssetRulesConverter(cast(InformationRules, self)).as_dms_architect_rules()
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Any, cast, overload
|
|
4
|
+
|
|
5
|
+
from cognite.neat.rules.models._base import _add_alias
|
|
6
|
+
from cognite.neat.rules.models.data_types import DataType
|
|
7
|
+
from cognite.neat.rules.models.entities import (
|
|
8
|
+
ClassEntity,
|
|
9
|
+
MultiValueTypeInfo,
|
|
10
|
+
Unknown,
|
|
11
|
+
UnknownEntity,
|
|
12
|
+
)
|
|
13
|
+
from cognite.neat.rules.models.information._rules_input import InformationClassInput, InformationMetadataInput
|
|
14
|
+
|
|
15
|
+
from ._rules import AssetProperty, AssetRules
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class AssetMetadataInput(InformationMetadataInput): ...
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass
|
|
23
|
+
class AssetPropertyInput:
|
|
24
|
+
class_: str
|
|
25
|
+
property_: str
|
|
26
|
+
value_type: str
|
|
27
|
+
name: str | None = None
|
|
28
|
+
description: str | None = None
|
|
29
|
+
comment: str | None = None
|
|
30
|
+
min_count: int | None = None
|
|
31
|
+
max_count: int | float | None = None
|
|
32
|
+
default: Any | None = None
|
|
33
|
+
reference: str | None = None
|
|
34
|
+
match_type: str | None = None
|
|
35
|
+
transformation: str | None = None
|
|
36
|
+
implementation: str | None = None
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
@overload
|
|
40
|
+
def load(cls, data: None) -> None: ...
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
@overload
|
|
44
|
+
def load(cls, data: dict[str, Any]) -> "AssetPropertyInput": ...
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
@overload
|
|
48
|
+
def load(cls, data: list[dict[str, Any]]) -> list["AssetPropertyInput"]: ...
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def load(
|
|
52
|
+
cls, data: dict[str, Any] | list[dict[str, Any]] | None
|
|
53
|
+
) -> "AssetPropertyInput | list[AssetPropertyInput] | None":
|
|
54
|
+
if data is None:
|
|
55
|
+
return None
|
|
56
|
+
if isinstance(data, list) or (isinstance(data, dict) and isinstance(data.get("data"), list)):
|
|
57
|
+
items = cast(list[dict[str, Any]], data.get("data") if isinstance(data, dict) else data)
|
|
58
|
+
return [loaded for item in items if (loaded := cls.load(item)) is not None]
|
|
59
|
+
|
|
60
|
+
_add_alias(data, AssetProperty)
|
|
61
|
+
return cls(
|
|
62
|
+
class_=data.get("class_"), # type: ignore[arg-type]
|
|
63
|
+
property_=data.get("property_"), # type: ignore[arg-type]
|
|
64
|
+
name=data.get("name", None),
|
|
65
|
+
description=data.get("description", None),
|
|
66
|
+
comment=data.get("comment", None),
|
|
67
|
+
value_type=data.get("value_type"), # type: ignore[arg-type]
|
|
68
|
+
min_count=data.get("min_count", None),
|
|
69
|
+
max_count=data.get("max_count", None),
|
|
70
|
+
default=data.get("default", None),
|
|
71
|
+
reference=data.get("reference", None),
|
|
72
|
+
match_type=data.get("match_type", None),
|
|
73
|
+
transformation=data.get("transformation", None),
|
|
74
|
+
implementation=data.get("implementation", None),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
def dump(self, default_prefix: str) -> dict[str, Any]:
|
|
78
|
+
value_type: MultiValueTypeInfo | DataType | ClassEntity | UnknownEntity
|
|
79
|
+
|
|
80
|
+
# property holding xsd data type
|
|
81
|
+
# check if it is multi value type
|
|
82
|
+
if "|" in self.value_type:
|
|
83
|
+
value_type = MultiValueTypeInfo.load(self.value_type)
|
|
84
|
+
value_type.set_default_prefix(default_prefix)
|
|
85
|
+
|
|
86
|
+
elif DataType.is_data_type(self.value_type):
|
|
87
|
+
value_type = DataType.load(self.value_type)
|
|
88
|
+
|
|
89
|
+
# unknown value type
|
|
90
|
+
elif self.value_type == str(Unknown):
|
|
91
|
+
value_type = UnknownEntity()
|
|
92
|
+
|
|
93
|
+
# property holding link to class
|
|
94
|
+
else:
|
|
95
|
+
value_type = ClassEntity.load(self.value_type, prefix=default_prefix)
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
"Class": ClassEntity.load(self.class_, prefix=default_prefix),
|
|
99
|
+
"Property": self.property_,
|
|
100
|
+
"Name": self.name,
|
|
101
|
+
"Description": self.description,
|
|
102
|
+
"Comment": self.comment,
|
|
103
|
+
"Value Type": value_type,
|
|
104
|
+
"Min Count": self.min_count,
|
|
105
|
+
"Max Count": self.max_count,
|
|
106
|
+
"Default": self.default,
|
|
107
|
+
"Reference": self.reference,
|
|
108
|
+
"Match Type": self.match_type,
|
|
109
|
+
"Transformation": self.transformation,
|
|
110
|
+
"Implementation": self.implementation,
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class AssetClassInput(InformationClassInput): ...
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@dataclass
|
|
118
|
+
class AssetRulesInput:
|
|
119
|
+
metadata: AssetMetadataInput
|
|
120
|
+
properties: Sequence[AssetPropertyInput]
|
|
121
|
+
classes: Sequence[AssetClassInput]
|
|
122
|
+
last: "AssetRulesInput | AssetRules | None" = None
|
|
123
|
+
reference: "AssetRulesInput | AssetRules | None" = None
|
|
124
|
+
|
|
125
|
+
@classmethod
|
|
126
|
+
@overload
|
|
127
|
+
def load(cls, data: dict[str, Any]) -> "AssetRulesInput": ...
|
|
128
|
+
|
|
129
|
+
@classmethod
|
|
130
|
+
@overload
|
|
131
|
+
def load(cls, data: None) -> None: ...
|
|
132
|
+
|
|
133
|
+
@classmethod
|
|
134
|
+
def load(cls, data: dict | None) -> "AssetRulesInput | None":
|
|
135
|
+
if data is None:
|
|
136
|
+
return None
|
|
137
|
+
_add_alias(data, AssetRules)
|
|
138
|
+
|
|
139
|
+
return cls(
|
|
140
|
+
metadata=AssetMetadataInput.load(data.get("metadata")), # type: ignore[arg-type]
|
|
141
|
+
properties=AssetPropertyInput.load(data.get("properties")), # type: ignore[arg-type]
|
|
142
|
+
classes=InformationClassInput.load(data.get("classes")), # type: ignore[arg-type]
|
|
143
|
+
last=AssetRulesInput.load(data.get("last")),
|
|
144
|
+
reference=AssetRulesInput.load(data.get("reference")),
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
def as_rules(self) -> AssetRules:
|
|
148
|
+
return AssetRules.model_validate(self.dump())
|
|
149
|
+
|
|
150
|
+
def dump(self) -> dict[str, Any]:
|
|
151
|
+
default_prefix = self.metadata.prefix
|
|
152
|
+
reference: dict[str, Any] | None = None
|
|
153
|
+
if isinstance(self.reference, AssetRulesInput):
|
|
154
|
+
reference = self.reference.dump()
|
|
155
|
+
elif isinstance(self.reference, AssetRules):
|
|
156
|
+
# We need to load through the AssetRulesInput to set the correct default space and version
|
|
157
|
+
reference = AssetRulesInput.load(self.reference.model_dump()).dump()
|
|
158
|
+
last: dict[str, Any] | None = None
|
|
159
|
+
if isinstance(self.last, AssetRulesInput):
|
|
160
|
+
last = self.last.dump()
|
|
161
|
+
elif isinstance(self.last, AssetRules):
|
|
162
|
+
# We need to load through the AssetRulesInput to set the correct default space and version
|
|
163
|
+
last = AssetRulesInput.load(self.last.model_dump()).dump()
|
|
164
|
+
|
|
165
|
+
return dict(
|
|
166
|
+
Metadata=self.metadata.dump(),
|
|
167
|
+
Properties=[prop.dump(default_prefix) for prop in self.properties],
|
|
168
|
+
Classes=[class_.dump(default_prefix) for class_ in self.classes],
|
|
169
|
+
Last=last,
|
|
170
|
+
Reference=reference,
|
|
171
|
+
)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
from typing import Any, ClassVar
|
|
2
|
+
|
|
3
|
+
from cognite.neat.rules.models.entities import ClassEntity, ReferenceEntity
|
|
4
|
+
|
|
5
|
+
from ._rules import AssetClass, AssetProperty, AssetRules
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class _AssetRulesSerializer:
|
|
9
|
+
# These are the fields that need to be cleaned from the default space and version
|
|
10
|
+
PROPERTIES_FIELDS: ClassVar[list[str]] = ["class_", "value_type"]
|
|
11
|
+
CLASSES_FIELDS: ClassVar[list[str]] = ["class_"]
|
|
12
|
+
|
|
13
|
+
def __init__(self, by_alias: bool, default_prefix: str) -> None:
|
|
14
|
+
self.default_prefix = f"{default_prefix}:"
|
|
15
|
+
|
|
16
|
+
self.properties_fields = self.PROPERTIES_FIELDS
|
|
17
|
+
self.classes_fields = self.CLASSES_FIELDS
|
|
18
|
+
|
|
19
|
+
self.prop_name = "properties"
|
|
20
|
+
self.class_name = "classes"
|
|
21
|
+
self.metadata_name = "metadata"
|
|
22
|
+
self.class_parent = "parent"
|
|
23
|
+
|
|
24
|
+
self.prop_property = "property_"
|
|
25
|
+
self.prop_class = "class_"
|
|
26
|
+
|
|
27
|
+
self.reference = "Reference" if by_alias else "reference"
|
|
28
|
+
if by_alias:
|
|
29
|
+
self.properties_fields = [
|
|
30
|
+
AssetProperty.model_fields[field].alias or field for field in self.properties_fields
|
|
31
|
+
]
|
|
32
|
+
self.classes_fields = [AssetClass.model_fields[field].alias or field for field in self.classes_fields]
|
|
33
|
+
self.prop_name = AssetRules.model_fields[self.prop_name].alias or self.prop_name
|
|
34
|
+
self.class_name = AssetRules.model_fields[self.class_name].alias or self.class_name
|
|
35
|
+
self.class_parent = AssetClass.model_fields[self.class_parent].alias or self.class_parent
|
|
36
|
+
self.metadata_name = AssetRules.model_fields[self.metadata_name].alias or self.metadata_name
|
|
37
|
+
|
|
38
|
+
self.prop_property = AssetProperty.model_fields[self.prop_property].alias or self.prop_property
|
|
39
|
+
self.prop_class = AssetProperty.model_fields[self.prop_class].alias or self.prop_class
|
|
40
|
+
|
|
41
|
+
def clean(self, dumped: dict[str, Any], as_reference: bool) -> dict[str, Any]:
|
|
42
|
+
# Sorting to get a deterministic order
|
|
43
|
+
dumped[self.prop_name] = sorted(
|
|
44
|
+
dumped[self.prop_name]["data"], key=lambda p: (p[self.prop_class], p[self.prop_property])
|
|
45
|
+
)
|
|
46
|
+
dumped[self.class_name] = sorted(dumped[self.class_name]["data"], key=lambda v: v[self.prop_class])
|
|
47
|
+
|
|
48
|
+
for prop in dumped[self.prop_name]:
|
|
49
|
+
if as_reference:
|
|
50
|
+
class_entity = ClassEntity.load(prop[self.prop_class])
|
|
51
|
+
prop[self.reference] = str(
|
|
52
|
+
ReferenceEntity(
|
|
53
|
+
prefix=str(class_entity.prefix), suffix=class_entity.suffix, property=prop[self.prop_property]
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
for field_name in self.properties_fields:
|
|
58
|
+
if value := prop.get(field_name):
|
|
59
|
+
prop[field_name] = value.removeprefix(self.default_prefix)
|
|
60
|
+
|
|
61
|
+
for class_ in dumped[self.class_name]:
|
|
62
|
+
if as_reference:
|
|
63
|
+
class_[self.reference] = class_[self.prop_class]
|
|
64
|
+
for field_name in self.classes_fields:
|
|
65
|
+
if value := class_.get(field_name):
|
|
66
|
+
class_[field_name] = value.removeprefix(self.default_prefix)
|
|
67
|
+
|
|
68
|
+
if value := class_.get(self.class_parent):
|
|
69
|
+
class_[self.class_parent] = ",".join(
|
|
70
|
+
parent.strip().removeprefix(self.default_prefix) for parent in value.split(",")
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
return dumped
|
|
@@ -48,6 +48,8 @@ class EntityTypes(StrEnum):
|
|
|
48
48
|
datamodel = "datamodel"
|
|
49
49
|
undefined = "undefined"
|
|
50
50
|
multi_value_type = "multi_value_type"
|
|
51
|
+
asset = "asset"
|
|
52
|
+
relationship = "relationship"
|
|
51
53
|
|
|
52
54
|
|
|
53
55
|
# ALLOWED
|
|
@@ -204,7 +206,7 @@ class Entity(BaseModel, extra="ignore"):
|
|
|
204
206
|
if (v := getattr(self, field_name)) is not None and field_name not in {"prefix", "suffix"}
|
|
205
207
|
)
|
|
206
208
|
args = ",".join([f"{k}={v}" for k, v in model_dump])
|
|
207
|
-
if self.prefix
|
|
209
|
+
if self.prefix == Undefined:
|
|
208
210
|
base_id = str(self.suffix)
|
|
209
211
|
else:
|
|
210
212
|
base_id = f"{self.prefix}:{self.suffix!s}"
|
|
@@ -267,6 +269,28 @@ class UnknownEntity(ClassEntity):
|
|
|
267
269
|
return str(Unknown)
|
|
268
270
|
|
|
269
271
|
|
|
272
|
+
class AssetFields(StrEnum):
|
|
273
|
+
external_id = "external_id"
|
|
274
|
+
name = "name"
|
|
275
|
+
parent_external_id = "parent_external_id"
|
|
276
|
+
description = "description"
|
|
277
|
+
metadata = "metadata"
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
class AssetEntity(Entity):
|
|
281
|
+
type_: ClassVar[EntityTypes] = EntityTypes.asset
|
|
282
|
+
suffix: str = "Asset"
|
|
283
|
+
prefix: _UndefinedType = Undefined
|
|
284
|
+
property_: AssetFields = Field(alias="property")
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class RelationshipEntity(Entity):
|
|
288
|
+
type_: ClassVar[EntityTypes] = EntityTypes.relationship
|
|
289
|
+
suffix: str = "Relationship"
|
|
290
|
+
prefix: _UndefinedType = Undefined
|
|
291
|
+
label: str | None = None
|
|
292
|
+
|
|
293
|
+
|
|
270
294
|
T_ID = TypeVar("T_ID", bound=ContainerId | ViewId | DataModelId | PropertyId | NodeId | None)
|
|
271
295
|
|
|
272
296
|
|
|
@@ -505,6 +529,25 @@ def _join_str(v: list[ClassEntity]) -> str | None:
|
|
|
505
529
|
return ",".join([entry.id for entry in v]) if v else None
|
|
506
530
|
|
|
507
531
|
|
|
532
|
+
def _generate_cdf_resource_list(v: Any) -> list[AssetEntity | RelationshipEntity]:
|
|
533
|
+
results = []
|
|
534
|
+
for item in _split_str(v):
|
|
535
|
+
if isinstance(item, str):
|
|
536
|
+
if "relationship" in item.lower():
|
|
537
|
+
results.append(RelationshipEntity.load(item))
|
|
538
|
+
elif "asset" in item.lower():
|
|
539
|
+
results.append(AssetEntity.load(item)) # type: ignore
|
|
540
|
+
else:
|
|
541
|
+
raise ValueError(f"Unsupported implementation definition: {item}")
|
|
542
|
+
|
|
543
|
+
elif isinstance(item, AssetEntity | RelationshipEntity):
|
|
544
|
+
results.append(item)
|
|
545
|
+
else:
|
|
546
|
+
raise ValueError(f"Unsupported implementation definition: {item}")
|
|
547
|
+
|
|
548
|
+
return results # type: ignore
|
|
549
|
+
|
|
550
|
+
|
|
508
551
|
ParentEntityList = Annotated[
|
|
509
552
|
list[ParentClassEntity],
|
|
510
553
|
BeforeValidator(_split_str),
|
|
@@ -515,6 +558,18 @@ ParentEntityList = Annotated[
|
|
|
515
558
|
),
|
|
516
559
|
]
|
|
517
560
|
|
|
561
|
+
|
|
562
|
+
CdfResourceEntityList = Annotated[
|
|
563
|
+
list[AssetEntity | RelationshipEntity],
|
|
564
|
+
BeforeValidator(_generate_cdf_resource_list),
|
|
565
|
+
PlainSerializer(
|
|
566
|
+
_join_str,
|
|
567
|
+
return_type=str,
|
|
568
|
+
when_used="unless-none",
|
|
569
|
+
),
|
|
570
|
+
]
|
|
571
|
+
|
|
572
|
+
|
|
518
573
|
ContainerEntityList = Annotated[
|
|
519
574
|
list[ContainerEntity],
|
|
520
575
|
BeforeValidator(_split_str),
|
|
@@ -7,7 +7,7 @@ from cognite.client.data_classes.data_modeling import EdgeApply, NodeApply
|
|
|
7
7
|
from cognite.neat.legacy.graph.stores import NeatGraphStoreBase
|
|
8
8
|
from cognite.neat.legacy.rules.exporters._rules2dms import DMSSchemaComponents
|
|
9
9
|
from cognite.neat.legacy.rules.models.rules import Rules
|
|
10
|
-
from cognite.neat.rules.models import DMSRules, DomainRules, InformationRules
|
|
10
|
+
from cognite.neat.rules.models import AssetRules, DMSRules, DomainRules, InformationRules
|
|
11
11
|
from cognite.neat.workflows.steps.step_model import DataContract
|
|
12
12
|
|
|
13
13
|
|
|
@@ -25,14 +25,17 @@ class RulesData(DataContract):
|
|
|
25
25
|
class MultiRuleData(DataContract):
|
|
26
26
|
domain: DomainRules | None = None
|
|
27
27
|
information: InformationRules | None = None
|
|
28
|
+
asset: AssetRules | None = None
|
|
28
29
|
dms: DMSRules | None = None
|
|
29
30
|
|
|
30
31
|
@classmethod
|
|
31
|
-
def from_rules(cls, rules: DomainRules | InformationRules | DMSRules):
|
|
32
|
+
def from_rules(cls, rules: DomainRules | InformationRules | AssetRules | DMSRules):
|
|
32
33
|
if isinstance(rules, DomainRules):
|
|
33
34
|
return cls(domain=rules)
|
|
34
35
|
elif isinstance(rules, InformationRules):
|
|
35
36
|
return cls(information=rules)
|
|
37
|
+
elif isinstance(rules, AssetRules):
|
|
38
|
+
return cls(asset=rules)
|
|
36
39
|
elif isinstance(rules, DMSRules):
|
|
37
40
|
return cls(dms=rules)
|
|
38
41
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "cognite-neat"
|
|
3
|
-
version = "0.82.
|
|
3
|
+
version = "0.82.1"
|
|
4
4
|
readme = "README.md"
|
|
5
5
|
description = "Knowledge graph transformation"
|
|
6
6
|
authors = [
|
|
@@ -147,9 +147,7 @@ types-PyYAML = "^6"
|
|
|
147
147
|
types-openpyxl = "^3"
|
|
148
148
|
types-requests = "^2"
|
|
149
149
|
types-setuptools = "^68"
|
|
150
|
-
|
|
151
|
-
# current strict upper bound on cognite-sdk.
|
|
152
|
-
#cognite-toolkit = {git = "https://github.com/cognitedata/cdf-project-templates.git", branch = "main"}
|
|
150
|
+
cognite-toolkit = "^0.2.4"
|
|
153
151
|
|
|
154
152
|
|
|
155
153
|
[build-system]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.82.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|