cognite-neat 0.85.11__tar.gz → 0.86.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/PKG-INFO +1 -1
- cognite_neat-0.86.0/cognite/neat/_version.py +1 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/routers/core.py +4 -4
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_mock_graph_generator.py +1 -1
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/loaders/_rdf2dms.py +33 -18
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/queries/_base.py +58 -5
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/queries/_construct.py +15 -13
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/stores/_base.py +18 -10
- cognite_neat-0.86.0/cognite/neat/graph/transformers/_rdfpath.py +7 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/analysis/_information_rules.py +9 -2
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/_base.py +4 -4
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/_rules2dms.py +1 -1
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/_rules2ontology.py +1 -1
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_base.py +4 -4
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_inference2rules.py +4 -1
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +1 -1
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_spreadsheet2rules.py +5 -5
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/__init__.py +3 -3
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/_base.py +3 -3
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/asset/_rules.py +5 -5
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/data_types.py +4 -4
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/_converter.py +3 -3
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/_rules.py +3 -3
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/information/_converter.py +3 -3
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/information/_rules.py +3 -3
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/utils.py +54 -18
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/pyproject.toml +1 -1
- cognite_neat-0.85.11/cognite/neat/_version.py +0 -1
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/LICENSE +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/README.md +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/config.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/_shared.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/_tracking/base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/_tracking/log.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/issues/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/issues/loader.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/loaders/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/loaders/_rdf2asset.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/queries/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/queries/_shared.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/stores/_provenance.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/transformers/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/transformers/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/issues.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/_constants.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/asset/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/asset/_converter.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/asset/_rules_input.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/asset/_serializer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/asset/_validation.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/_schema.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/_serializer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/domain.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/entities.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/information/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/information/_serializer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/information/_validation.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/models/wrapped_entities.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/auth.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/cdf_classes.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/upload.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/utils/xml_.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.86.0"
|
|
@@ -31,21 +31,21 @@ async def convert_data_model_to_rules(file: UploadFile):
|
|
|
31
31
|
|
|
32
32
|
# read as Excel rules
|
|
33
33
|
if suffix == ".xlsx":
|
|
34
|
-
rules, issues = importers.ExcelImporter(filepath=temp_filepath).to_rules(role=RoleTypes.
|
|
34
|
+
rules, issues = importers.ExcelImporter(filepath=temp_filepath).to_rules(role=RoleTypes.dms)
|
|
35
35
|
|
|
36
36
|
# load as OWL
|
|
37
37
|
elif suffix in [".ttl", ".owl"]:
|
|
38
|
-
rules, issues = importers.OWLImporter(filepath=temp_filepath).to_rules(role=RoleTypes.
|
|
38
|
+
rules, issues = importers.OWLImporter(filepath=temp_filepath).to_rules(role=RoleTypes.dms)
|
|
39
39
|
|
|
40
40
|
# load as YAML
|
|
41
41
|
elif suffix in [".yml", ".yaml"]:
|
|
42
|
-
rules, issues = importers.YAMLImporter.from_file(temp_filepath).to_rules(role=RoleTypes.
|
|
42
|
+
rules, issues = importers.YAMLImporter.from_file(temp_filepath).to_rules(role=RoleTypes.dms)
|
|
43
43
|
|
|
44
44
|
# load as JSON
|
|
45
45
|
elif suffix == ".json":
|
|
46
46
|
with temp_filepath.open() as temp:
|
|
47
47
|
json_data = json.load(temp)
|
|
48
|
-
rules, issues = importers.YAMLImporter(raw_data=json.loads(json_data)).to_rules(role=RoleTypes.
|
|
48
|
+
rules, issues = importers.YAMLImporter(raw_data=json.loads(json_data)).to_rules(role=RoleTypes.dms)
|
|
49
49
|
|
|
50
50
|
# Remove the temporary file
|
|
51
51
|
temp_filepath.unlink()
|
{cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/graph/extractors/_mock_graph_generator.py
RENAMED
|
@@ -42,7 +42,7 @@ class MockGraphGenerator(BaseExtractor):
|
|
|
42
42
|
allow_isolated_classes: bool = True,
|
|
43
43
|
):
|
|
44
44
|
if isinstance(rules, DMSRules):
|
|
45
|
-
self.rules = rules.
|
|
45
|
+
self.rules = rules.as_information_rules()
|
|
46
46
|
elif isinstance(rules, InformationRules):
|
|
47
47
|
self.rules = rules
|
|
48
48
|
else:
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from collections import defaultdict
|
|
3
2
|
from collections.abc import Iterable, Sequence
|
|
4
3
|
from pathlib import Path
|
|
5
|
-
from typing import Any
|
|
4
|
+
from typing import Any, get_args
|
|
6
5
|
|
|
7
6
|
import yaml
|
|
8
7
|
from cognite.client import CogniteClient
|
|
@@ -20,7 +19,7 @@ from cognite.neat.graph.issues import loader as loader_issues
|
|
|
20
19
|
from cognite.neat.graph.stores import NeatGraphStore
|
|
21
20
|
from cognite.neat.issues import NeatIssue, NeatIssueList
|
|
22
21
|
from cognite.neat.rules.models import DMSRules
|
|
23
|
-
from cognite.neat.rules.models.data_types import _DATA_TYPE_BY_DMS_TYPE
|
|
22
|
+
from cognite.neat.rules.models.data_types import _DATA_TYPE_BY_DMS_TYPE, Json
|
|
24
23
|
from cognite.neat.utils.upload import UploadResult
|
|
25
24
|
from cognite.neat.utils.utils import create_sha256_hash
|
|
26
25
|
|
|
@@ -106,8 +105,8 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
106
105
|
yield from issues
|
|
107
106
|
tracker.issue(issues)
|
|
108
107
|
class_name = self.class_by_view_id.get(view.as_id(), view.external_id)
|
|
109
|
-
|
|
110
|
-
for identifier, properties in
|
|
108
|
+
|
|
109
|
+
for identifier, properties in self.graph_store.read(class_name):
|
|
111
110
|
try:
|
|
112
111
|
yield self._create_node(identifier, properties, pydantic_cls, view_id)
|
|
113
112
|
except ValueError as e:
|
|
@@ -145,7 +144,9 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
145
144
|
issues = NeatIssueList[NeatIssue]()
|
|
146
145
|
field_definitions: dict[str, tuple[type, Any]] = {}
|
|
147
146
|
edge_by_property: dict[str, dm.EdgeConnection] = {}
|
|
147
|
+
validators: dict[str, classmethod] = {}
|
|
148
148
|
direct_relation_by_property: dict[str, dm.DirectRelation] = {}
|
|
149
|
+
json_fields: list[str] = []
|
|
149
150
|
for prop_name, prop in view.properties.items():
|
|
150
151
|
if isinstance(prop, dm.EdgeConnection):
|
|
151
152
|
edge_by_property[prop_name] = prop
|
|
@@ -163,6 +164,9 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
163
164
|
)
|
|
164
165
|
)
|
|
165
166
|
continue
|
|
167
|
+
|
|
168
|
+
if data_type == Json:
|
|
169
|
+
json_fields.append(prop_name)
|
|
166
170
|
python_type = data_type.python
|
|
167
171
|
if prop.type.is_list:
|
|
168
172
|
python_type = list[python_type]
|
|
@@ -175,13 +179,29 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
175
179
|
field_definitions[prop_name] = (python_type, default_value)
|
|
176
180
|
|
|
177
181
|
def parse_list(cls, value: Any, info: ValidationInfo) -> list[str]:
|
|
178
|
-
if isinstance(value, list) and
|
|
182
|
+
if isinstance(value, list) and list.__name__ not in _get_field_value_types(cls, info):
|
|
179
183
|
if len(value) == 1:
|
|
180
184
|
return value[0]
|
|
181
185
|
raise ValueError(f"Got multiple values for {info.field_name}: {value}")
|
|
186
|
+
|
|
182
187
|
return value
|
|
183
188
|
|
|
184
|
-
|
|
189
|
+
def parse_json_string(cls, value: Any, info: ValidationInfo) -> dict:
|
|
190
|
+
if isinstance(value, dict):
|
|
191
|
+
return value
|
|
192
|
+
elif isinstance(value, str):
|
|
193
|
+
try:
|
|
194
|
+
return json.loads(value)
|
|
195
|
+
except json.JSONDecodeError as error:
|
|
196
|
+
raise ValueError(f"Not valid JSON string for {info.field_name}: {value}, error {error}") from error
|
|
197
|
+
else:
|
|
198
|
+
raise ValueError(f"Expect valid JSON string or dict for {info.field_name}: {value}")
|
|
199
|
+
|
|
200
|
+
if json_fields:
|
|
201
|
+
validators["parse_json_string"] = field_validator(*json_fields, mode="before")(parse_json_string) # type: ignore[assignment, arg-type]
|
|
202
|
+
|
|
203
|
+
validators["parse_list"] = field_validator("*", mode="before")(parse_list) # type: ignore[assignment, arg-type]
|
|
204
|
+
|
|
185
205
|
if direct_relation_by_property:
|
|
186
206
|
|
|
187
207
|
def parse_direct_relation(cls, value: list, info: ValidationInfo) -> dict | list[dict]:
|
|
@@ -280,7 +300,10 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
280
300
|
result.created.update(item.as_id() for item in e.successful)
|
|
281
301
|
yield result
|
|
282
302
|
else:
|
|
283
|
-
for instance_type, instances in {
|
|
303
|
+
for instance_type, instances in {
|
|
304
|
+
"Nodes": upserted.nodes,
|
|
305
|
+
"Edges": upserted.edges,
|
|
306
|
+
}.items():
|
|
284
307
|
result = UploadResult[InstanceId](name=instance_type, issues=read_issues)
|
|
285
308
|
for instance in instances: # type: ignore[attr-defined]
|
|
286
309
|
if instance.was_modified and instance.created_time == instance.last_updated_time:
|
|
@@ -292,13 +315,5 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
292
315
|
yield result
|
|
293
316
|
|
|
294
317
|
|
|
295
|
-
def
|
|
296
|
-
|
|
297
|
-
) -> dict[str, dict[str, list[str]]]:
|
|
298
|
-
"""Converts list of triples to dictionary"""
|
|
299
|
-
values_by_property_by_identifier: dict[str, dict[str, list[str]]] = defaultdict(lambda: defaultdict(list))
|
|
300
|
-
for id_, property_, value in triples:
|
|
301
|
-
# avoid issue with strings "None", "nan", "null" being treated as values
|
|
302
|
-
if value.lower() not in ["", "None", "nan", "null"]:
|
|
303
|
-
values_by_property_by_identifier[id_][property_].append(value)
|
|
304
|
-
return values_by_property_by_identifier
|
|
318
|
+
def _get_field_value_types(cls, info):
|
|
319
|
+
return [type_.__name__ for type_ in get_args(cls.model_fields[info.field_name].annotation)]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import warnings
|
|
2
|
+
from collections import defaultdict
|
|
2
3
|
from typing import Literal, cast, overload
|
|
3
4
|
|
|
4
5
|
from rdflib import RDF, Graph, URIRef
|
|
@@ -93,12 +94,63 @@ class Queries:
|
|
|
93
94
|
)
|
|
94
95
|
return []
|
|
95
96
|
|
|
96
|
-
def
|
|
97
|
+
def describe(
|
|
98
|
+
self,
|
|
99
|
+
instance_id: URIRef,
|
|
100
|
+
property_renaming_config: dict | None = None,
|
|
101
|
+
) -> tuple[str, dict[str, list[str]]]:
|
|
102
|
+
"""DESCRIBE instance for a given class from the graph store
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
instance_id: Instance id for which we want to generate query
|
|
106
|
+
property_rename_config: Dictionary to rename properties, default None
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
Dictionary of instance properties
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
property_values: dict[str, list[str]] = defaultdict(list)
|
|
113
|
+
|
|
114
|
+
for subject, predicate, object_ in cast(list[ResultRow], self.graph.query(f"DESCRIBE <{instance_id}>")):
|
|
115
|
+
# We cannot include the RDF.type in case there is a neat:type property
|
|
116
|
+
# or if the object is empty
|
|
117
|
+
if predicate != RDF.type and object_.lower() not in [
|
|
118
|
+
"",
|
|
119
|
+
"none",
|
|
120
|
+
"nan",
|
|
121
|
+
"null",
|
|
122
|
+
]:
|
|
123
|
+
# we are skipping deep validation with Pydantic to remove namespace here
|
|
124
|
+
# as it reduce time to process triples by 10-15x
|
|
125
|
+
identifier, property_, value = cast( # type: ignore[misc]
|
|
126
|
+
(str, str, str),
|
|
127
|
+
remove_namespace_from_uri(*(subject, predicate, object_), validation="prefix"),
|
|
128
|
+
) # type: ignore[misc, index]
|
|
129
|
+
|
|
130
|
+
if property_renaming_config:
|
|
131
|
+
predicate = property_renaming_config.get(property_, property_)
|
|
132
|
+
|
|
133
|
+
property_values[property_].append(value)
|
|
134
|
+
if property_values:
|
|
135
|
+
return (
|
|
136
|
+
identifier,
|
|
137
|
+
property_values,
|
|
138
|
+
)
|
|
139
|
+
else:
|
|
140
|
+
return () # type: ignore [return-value]
|
|
141
|
+
|
|
142
|
+
def construct_instances_of_class(
|
|
143
|
+
self,
|
|
144
|
+
class_: str,
|
|
145
|
+
properties_optional: bool = True,
|
|
146
|
+
instance_id: URIRef | None = None,
|
|
147
|
+
) -> list[tuple[str, str, str]]:
|
|
97
148
|
"""CONSTRUCT instances for a given class from the graph store
|
|
98
149
|
|
|
99
150
|
Args:
|
|
100
151
|
class_: Class entity for which we want to generate query
|
|
101
152
|
properties_optional: Whether to make all properties optional, default True
|
|
153
|
+
instance_ids: List of instance ids to filter on, default None (all)
|
|
102
154
|
|
|
103
155
|
Returns:
|
|
104
156
|
List of triples for instances of the given class
|
|
@@ -106,10 +158,11 @@ class Queries:
|
|
|
106
158
|
|
|
107
159
|
if self.rules and (
|
|
108
160
|
query := build_construct_query(
|
|
109
|
-
ClassEntity(prefix=self.rules.metadata.prefix, suffix=class_),
|
|
110
|
-
self.graph,
|
|
111
|
-
self.rules,
|
|
112
|
-
properties_optional,
|
|
161
|
+
class_=ClassEntity(prefix=self.rules.metadata.prefix, suffix=class_),
|
|
162
|
+
graph=self.graph,
|
|
163
|
+
rules=self.rules,
|
|
164
|
+
properties_optional=properties_optional,
|
|
165
|
+
instance_id=instance_id,
|
|
113
166
|
)
|
|
114
167
|
):
|
|
115
168
|
result = self.graph.query(query)
|
|
@@ -18,8 +18,8 @@ from cognite.neat.utils.utils import most_occurring_element
|
|
|
18
18
|
from ._shared import Triple, hop2property_path
|
|
19
19
|
|
|
20
20
|
_QUERY_TEMPLATE = """CONSTRUCT {{ {graph_template} }}
|
|
21
|
-
WHERE {{ {
|
|
22
|
-
{
|
|
21
|
+
WHERE {{ {bind_instance_id}
|
|
22
|
+
{graph_pattern}
|
|
23
23
|
}}"""
|
|
24
24
|
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ def build_construct_query(
|
|
|
28
28
|
graph: Graph,
|
|
29
29
|
rules: InformationRules,
|
|
30
30
|
properties_optional: bool = True,
|
|
31
|
-
|
|
31
|
+
instance_id: URIRef | None = None,
|
|
32
32
|
) -> str | None:
|
|
33
33
|
"""Builds a CONSTRUCT query for a given class and rules and optionally filters by class instances.
|
|
34
34
|
|
|
@@ -53,6 +53,7 @@ def build_construct_query(
|
|
|
53
53
|
This is the reason why there is an option to make all properties optional, so that
|
|
54
54
|
the query will return all instances that have at least one property defined.
|
|
55
55
|
"""
|
|
56
|
+
|
|
56
57
|
if (
|
|
57
58
|
transformations := InformationArchitectRulesAnalysis(rules)
|
|
58
59
|
.class_property_pairs(only_rdfpath=True, consider_inheritance=True)
|
|
@@ -63,22 +64,20 @@ def build_construct_query(
|
|
|
63
64
|
)
|
|
64
65
|
|
|
65
66
|
return _QUERY_TEMPLATE.format(
|
|
67
|
+
bind_instance_id=(f"BIND(<{instance_id}> AS ?instance)" if instance_id else ""),
|
|
66
68
|
graph_template="\n".join(triples2sparql_statement(templates)),
|
|
67
69
|
graph_pattern="\n".join(triples2sparql_statement(patterns)),
|
|
68
|
-
filter="" if not class_instances else add_filter(class_instances),
|
|
69
70
|
)
|
|
70
71
|
|
|
71
72
|
else:
|
|
72
73
|
return None
|
|
73
74
|
|
|
74
75
|
|
|
75
|
-
def add_filter(class_instances: list[URIRef]):
|
|
76
|
-
class_instances_formatted = [f"<{instance}>" for instance in class_instances]
|
|
77
|
-
return f"FILTER (?instance IN ({', '.join(class_instances_formatted)}))"
|
|
78
|
-
|
|
79
|
-
|
|
80
76
|
def to_construct_triples(
|
|
81
|
-
graph: Graph,
|
|
77
|
+
graph: Graph,
|
|
78
|
+
transformations: list[InformationProperty],
|
|
79
|
+
prefixes: dict,
|
|
80
|
+
properties_optional: bool = True,
|
|
82
81
|
) -> tuple[list[Triple], list[Triple]]:
|
|
83
82
|
"""Converts transformations of a class to CONSTRUCT triples which are used to generate CONSTRUCT query
|
|
84
83
|
|
|
@@ -124,7 +123,10 @@ def to_construct_triples(
|
|
|
124
123
|
# use case AllReferences: binding instance to certain rdf property
|
|
125
124
|
if isinstance(traversal, AllReferences):
|
|
126
125
|
graph_pattern_triple = Triple(
|
|
127
|
-
subject="BIND(?instance",
|
|
126
|
+
subject="BIND(?instance",
|
|
127
|
+
predicate="AS",
|
|
128
|
+
object=f"{graph_template_triple.object})",
|
|
129
|
+
optional=False,
|
|
128
130
|
)
|
|
129
131
|
|
|
130
132
|
# use case SingleProperty: simple property traversal
|
|
@@ -133,7 +135,7 @@ def to_construct_triples(
|
|
|
133
135
|
subject=graph_template_triple.subject,
|
|
134
136
|
predicate=traversal.property.id,
|
|
135
137
|
object=graph_template_triple.object,
|
|
136
|
-
optional=True if properties_optional else not transformation.is_mandatory,
|
|
138
|
+
optional=(True if properties_optional else not transformation.is_mandatory),
|
|
137
139
|
)
|
|
138
140
|
|
|
139
141
|
# use case Hop: property traversal with multiple hops turned into property path
|
|
@@ -143,7 +145,7 @@ def to_construct_triples(
|
|
|
143
145
|
subject="?instance",
|
|
144
146
|
predicate=hop2property_path(graph, traversal, prefixes),
|
|
145
147
|
object=graph_template_triple.object,
|
|
146
|
-
optional=True if properties_optional else not transformation.is_mandatory,
|
|
148
|
+
optional=(True if properties_optional else not transformation.is_mandatory),
|
|
147
149
|
)
|
|
148
150
|
|
|
149
151
|
# other type of rdfpaths are skipped
|
|
@@ -15,6 +15,7 @@ from cognite.neat.graph.extractors import RdfFileExtractor, TripleExtractors
|
|
|
15
15
|
from cognite.neat.graph.models import Triple
|
|
16
16
|
from cognite.neat.graph.queries import Queries
|
|
17
17
|
from cognite.neat.graph.transformers import Transformers
|
|
18
|
+
from cognite.neat.rules.analysis import InformationArchitectRulesAnalysis
|
|
18
19
|
from cognite.neat.rules.models import InformationRules
|
|
19
20
|
from cognite.neat.rules.models.entities import ClassEntity
|
|
20
21
|
from cognite.neat.utils.auxiliary import local_import
|
|
@@ -165,25 +166,32 @@ class NeatGraphStore:
|
|
|
165
166
|
)
|
|
166
167
|
)
|
|
167
168
|
|
|
168
|
-
def read(self, class_: str) ->
|
|
169
|
+
def read(self, class_: str) -> Iterable[tuple[str, dict[str, list[str]]]]:
|
|
169
170
|
"""Read instances for given view from the graph store."""
|
|
170
|
-
# PLACEHOLDER: Implement reading instances for a given view
|
|
171
|
-
# not yet developed
|
|
172
171
|
|
|
173
172
|
if not self.rules:
|
|
174
|
-
warnings.warn(
|
|
175
|
-
|
|
176
|
-
stacklevel=2,
|
|
177
|
-
)
|
|
178
|
-
return []
|
|
173
|
+
warnings.warn("Rules not found in graph store!", stacklevel=2)
|
|
174
|
+
return None
|
|
179
175
|
|
|
180
176
|
class_entity = ClassEntity(prefix=self.rules.metadata.prefix, suffix=class_)
|
|
181
177
|
|
|
182
178
|
if class_entity not in [definition.class_ for definition in self.rules.classes.data]:
|
|
183
179
|
warnings.warn("Desired type not found in graph!", stacklevel=2)
|
|
184
|
-
return
|
|
180
|
+
return None
|
|
181
|
+
|
|
182
|
+
if InformationArchitectRulesAnalysis(self.rules).has_hop_transformations():
|
|
183
|
+
warnings.warn(
|
|
184
|
+
"Rules contain Hop rdfpath, run ReduceHopTraversal transformer first!",
|
|
185
|
+
stacklevel=2,
|
|
186
|
+
)
|
|
187
|
+
return None
|
|
188
|
+
|
|
189
|
+
instance_ids = self.queries.list_instances_ids_of_class(self.rules.metadata.namespace[class_])
|
|
190
|
+
|
|
191
|
+
property_renaming_config = InformationArchitectRulesAnalysis(self.rules).define_property_renaming_config()
|
|
185
192
|
|
|
186
|
-
|
|
193
|
+
for instance_id in instance_ids:
|
|
194
|
+
yield self.queries.describe(instance_id, property_renaming_config)
|
|
187
195
|
|
|
188
196
|
def _parse_file(
|
|
189
197
|
self,
|
{cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/analysis/_information_rules.py
RENAMED
|
@@ -8,7 +8,7 @@ import pandas as pd
|
|
|
8
8
|
from pydantic import ValidationError
|
|
9
9
|
|
|
10
10
|
from cognite.neat.rules.models import SchemaCompleteness
|
|
11
|
-
from cognite.neat.rules.models._rdfpath import RDFPath
|
|
11
|
+
from cognite.neat.rules.models._rdfpath import Hop, RDFPath
|
|
12
12
|
from cognite.neat.rules.models.asset import AssetClass, AssetProperty, AssetRules
|
|
13
13
|
from cognite.neat.rules.models.entities import (
|
|
14
14
|
AssetEntity,
|
|
@@ -401,7 +401,14 @@ class _SharedAnalysis(Generic[T_Rules, T_Property, T_Class]):
|
|
|
401
401
|
class InformationArchitectRulesAnalysis(_SharedAnalysis[InformationRules, InformationProperty, InformationClass]):
|
|
402
402
|
"""Assumes analysis over only the complete schema"""
|
|
403
403
|
|
|
404
|
-
|
|
404
|
+
def has_hop_transformations(self):
|
|
405
|
+
return any(
|
|
406
|
+
prop_.transformation and isinstance(prop_.transformation.traversal, Hop) for prop_ in self.rules.properties
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
def define_property_renaming_config(self) -> dict[str, str]:
|
|
410
|
+
# placeholder comes in new PR
|
|
411
|
+
return {}
|
|
405
412
|
|
|
406
413
|
|
|
407
414
|
class AssetArchitectRulesAnalysis(_SharedAnalysis[AssetRules, AssetProperty, AssetClass]):
|
|
@@ -28,10 +28,10 @@ class BaseExporter(ABC, Generic[T_Export]):
|
|
|
28
28
|
def _convert_to_output_role(self, rules: Rules, output_role: RoleTypes | None = None) -> Rules:
|
|
29
29
|
if rules.metadata.role is output_role or output_role is None:
|
|
30
30
|
return rules
|
|
31
|
-
elif output_role is RoleTypes.
|
|
32
|
-
return rules.
|
|
33
|
-
elif output_role is RoleTypes.
|
|
34
|
-
return rules.
|
|
31
|
+
elif output_role is RoleTypes.dms and isinstance(rules, InformationRules):
|
|
32
|
+
return rules.as_dms_rules()
|
|
33
|
+
elif output_role is RoleTypes.information and isinstance(rules, DMSRules):
|
|
34
|
+
return rules.as_information_rules()
|
|
35
35
|
else:
|
|
36
36
|
raise NotImplementedError(f"Role {output_role} is not supported for {type(rules).__name__} rules")
|
|
37
37
|
|
|
@@ -118,7 +118,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
118
118
|
if isinstance(rules, DMSRules):
|
|
119
119
|
dms_rules = rules
|
|
120
120
|
elif isinstance(rules, InformationRules):
|
|
121
|
-
dms_rules = rules.
|
|
121
|
+
dms_rules = rules.as_dms_rules()
|
|
122
122
|
else:
|
|
123
123
|
raise ValueError(f"{type(rules).__name__} cannot be exported to DMS")
|
|
124
124
|
return dms_rules.as_schema(include_pipeline=self.export_pipeline, instance_space=self.instance_space)
|
{cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/exporters/_rules2ontology.py
RENAMED
|
@@ -95,7 +95,7 @@ class Ontology(OntologyModel):
|
|
|
95
95
|
if isinstance(input_rules, InformationRules):
|
|
96
96
|
rules = input_rules
|
|
97
97
|
elif isinstance(input_rules, DMSRules):
|
|
98
|
-
rules = input_rules.
|
|
98
|
+
rules = input_rules.as_information_rules()
|
|
99
99
|
else:
|
|
100
100
|
raise ValueError(f"{type(input_rules).__name__} cannot be exported to Ontology")
|
|
101
101
|
|
|
@@ -55,10 +55,10 @@ class BaseImporter(ABC):
|
|
|
55
55
|
|
|
56
56
|
if rules.metadata.role is role or role is None:
|
|
57
57
|
output = rules
|
|
58
|
-
elif isinstance(rules, DMSRules) or isinstance(rules, AssetRules) and role is RoleTypes.
|
|
59
|
-
output = rules.
|
|
60
|
-
elif isinstance(rules, InformationRules) or isinstance(rules, AssetRules) and role is RoleTypes.
|
|
61
|
-
output = rules.
|
|
58
|
+
elif isinstance(rules, DMSRules) or isinstance(rules, AssetRules) and role is RoleTypes.information:
|
|
59
|
+
output = rules.as_information_rules()
|
|
60
|
+
elif isinstance(rules, InformationRules) or isinstance(rules, AssetRules) and role is RoleTypes.dms:
|
|
61
|
+
output = rules.as_dms_rules()
|
|
62
62
|
else:
|
|
63
63
|
raise NotImplementedError(f"Role {role} is not supported for {type(rules).__name__} rules")
|
|
64
64
|
|
{cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_inference2rules.py
RENAMED
|
@@ -75,7 +75,9 @@ class InferenceImporter(BaseImporter):
|
|
|
75
75
|
self.graph = graph
|
|
76
76
|
self.max_number_of_instance = max_number_of_instance
|
|
77
77
|
self.prefix = prefix
|
|
78
|
-
self.check_for_json_string =
|
|
78
|
+
self.check_for_json_string = (
|
|
79
|
+
check_for_json_string if graph.store.__class__.__name__ != "OxigraphStore" else False
|
|
80
|
+
)
|
|
79
81
|
|
|
80
82
|
@classmethod
|
|
81
83
|
def from_graph_store(
|
|
@@ -235,6 +237,7 @@ class InferenceImporter(BaseImporter):
|
|
|
235
237
|
query.replace("instance_id", instance)
|
|
236
238
|
): # type: ignore[misc]
|
|
237
239
|
property_id = remove_namespace_from_uri(property_uri)
|
|
240
|
+
|
|
238
241
|
self._add_uri_namespace_to_prefixes(cast(URIRef, property_uri), prefixes)
|
|
239
242
|
value_type_uri = data_type_uri if data_type_uri else object_type_uri
|
|
240
243
|
|
|
@@ -51,7 +51,7 @@ def parse_owl_metadata(graph: Graph) -> dict:
|
|
|
51
51
|
|
|
52
52
|
raw_metadata = convert_rdflib_content(
|
|
53
53
|
{
|
|
54
|
-
"role": RoleTypes.
|
|
54
|
+
"role": RoleTypes.information,
|
|
55
55
|
"schema": SchemaCompleteness.partial,
|
|
56
56
|
"prefix": results[1].pop(),
|
|
57
57
|
"namespace": Namespace(results[0].pop()),
|
{cognite_neat-0.85.11 → cognite_neat-0.86.0}/cognite/neat/rules/importers/_spreadsheet2rules.py
RENAMED
|
@@ -36,9 +36,9 @@ SOURCE_SHEET__TARGET_FIELD__HEADERS = [
|
|
|
36
36
|
"Properties",
|
|
37
37
|
{
|
|
38
38
|
RoleTypes.domain_expert: "Property",
|
|
39
|
-
RoleTypes.
|
|
40
|
-
RoleTypes.
|
|
41
|
-
RoleTypes.
|
|
39
|
+
RoleTypes.information: "Property",
|
|
40
|
+
RoleTypes.asset: "Property",
|
|
41
|
+
RoleTypes.dms: "View Property",
|
|
42
42
|
},
|
|
43
43
|
),
|
|
44
44
|
("Classes", "Classes", "Class"),
|
|
@@ -334,9 +334,9 @@ class GoogleSheetImporter(BaseImporter):
|
|
|
334
334
|
|
|
335
335
|
if role == RoleTypes.domain_expert:
|
|
336
336
|
output = rules_model.model_validate(sheets)
|
|
337
|
-
elif role == RoleTypes.
|
|
337
|
+
elif role == RoleTypes.information:
|
|
338
338
|
output = rules_model.model_validate(sheets)
|
|
339
|
-
elif role == RoleTypes.
|
|
339
|
+
elif role == RoleTypes.dms:
|
|
340
340
|
output = rules_model.model_validate(sheets)
|
|
341
341
|
else:
|
|
342
342
|
raise ValueError(f"Role {role} is not valid.")
|
|
@@ -8,9 +8,9 @@ from .dms._schema import DMSSchema
|
|
|
8
8
|
|
|
9
9
|
RULES_PER_ROLE: dict[RoleTypes, type[DomainRules] | type[InformationRules] | type[AssetRules] | type[DMSRules]] = {
|
|
10
10
|
RoleTypes.domain_expert: DomainRules,
|
|
11
|
-
RoleTypes.
|
|
12
|
-
RoleTypes.
|
|
13
|
-
RoleTypes.
|
|
11
|
+
RoleTypes.information: InformationRules,
|
|
12
|
+
RoleTypes.asset: AssetRules,
|
|
13
|
+
RoleTypes.dms: DMSRules,
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
@@ -150,9 +150,9 @@ class DataModelType(StrEnum):
|
|
|
150
150
|
|
|
151
151
|
class RoleTypes(StrEnum):
|
|
152
152
|
domain_expert = "domain expert"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
information = "information architect"
|
|
154
|
+
asset = "asset architect"
|
|
155
|
+
dms = "DMS Architect"
|
|
156
156
|
|
|
157
157
|
|
|
158
158
|
class MatchType(StrEnum):
|
|
@@ -35,7 +35,7 @@ else:
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
class AssetMetadata(InformationMetadata):
|
|
38
|
-
role: ClassVar[RoleTypes] = RoleTypes.
|
|
38
|
+
role: ClassVar[RoleTypes] = RoleTypes.asset
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class AssetClass(InformationClass): ...
|
|
@@ -148,12 +148,12 @@ class AssetRules(BaseRules):
|
|
|
148
148
|
def as_domain_rules(self) -> DomainRules:
|
|
149
149
|
from ._converter import _AssetRulesConverter
|
|
150
150
|
|
|
151
|
-
return _AssetRulesConverter(self.
|
|
151
|
+
return _AssetRulesConverter(self.as_information_rules()).as_domain_rules()
|
|
152
152
|
|
|
153
|
-
def
|
|
153
|
+
def as_dms_rules(self) -> "DMSRules":
|
|
154
154
|
from ._converter import _AssetRulesConverter
|
|
155
155
|
|
|
156
|
-
return _AssetRulesConverter(self.
|
|
156
|
+
return _AssetRulesConverter(self.as_information_rules()).as_dms_rules()
|
|
157
157
|
|
|
158
|
-
def
|
|
158
|
+
def as_information_rules(self) -> InformationRules:
|
|
159
159
|
return InformationRules.model_validate(self.model_dump())
|
|
@@ -237,7 +237,7 @@ class Literal(DataType):
|
|
|
237
237
|
|
|
238
238
|
class Timeseries(DataType):
|
|
239
239
|
name = "timeseries"
|
|
240
|
-
python =
|
|
240
|
+
python = str
|
|
241
241
|
dms = dms.TimeSeriesReference
|
|
242
242
|
graphql = "TimeSeries"
|
|
243
243
|
xsd = "string"
|
|
@@ -246,7 +246,7 @@ class Timeseries(DataType):
|
|
|
246
246
|
|
|
247
247
|
class File(DataType):
|
|
248
248
|
name = "file"
|
|
249
|
-
python =
|
|
249
|
+
python = str
|
|
250
250
|
dms = dms.FileReference
|
|
251
251
|
graphql = "File"
|
|
252
252
|
xsd = "string"
|
|
@@ -255,7 +255,7 @@ class File(DataType):
|
|
|
255
255
|
|
|
256
256
|
class Sequence(DataType):
|
|
257
257
|
name = "sequence"
|
|
258
|
-
python =
|
|
258
|
+
python = str
|
|
259
259
|
dms = dms.SequenceReference
|
|
260
260
|
graphql = "Sequence"
|
|
261
261
|
xsd = "string"
|
|
@@ -264,7 +264,7 @@ class Sequence(DataType):
|
|
|
264
264
|
|
|
265
265
|
class Json(DataType):
|
|
266
266
|
name = "json"
|
|
267
|
-
python =
|
|
267
|
+
python = dict
|
|
268
268
|
dms = dms.Json
|
|
269
269
|
graphql = "Json"
|
|
270
270
|
xsd = "json"
|
|
@@ -32,7 +32,7 @@ class _DMSRulesConverter:
|
|
|
32
32
|
def as_domain_rules(self) -> "DomainRules":
|
|
33
33
|
raise NotImplementedError("DomainRules not implemented yet")
|
|
34
34
|
|
|
35
|
-
def
|
|
35
|
+
def as_information_rules(
|
|
36
36
|
self,
|
|
37
37
|
) -> "InformationRules":
|
|
38
38
|
from cognite.neat.rules.models.information._rules import (
|
|
@@ -94,8 +94,8 @@ class _DMSRulesConverter:
|
|
|
94
94
|
metadata=metadata,
|
|
95
95
|
properties=SheetList[InformationProperty](data=properties),
|
|
96
96
|
classes=SheetList[InformationClass](data=classes),
|
|
97
|
-
last=self.dms.last.
|
|
98
|
-
reference=self.dms.reference.
|
|
97
|
+
last=self.dms.last.as_information_rules() if self.dms.last else None,
|
|
98
|
+
reference=self.dms.reference.as_information_rules() if self.dms.reference else None,
|
|
99
99
|
)
|
|
100
100
|
|
|
101
101
|
@classmethod
|