cognite-neat 0.72.2__tar.gz → 0.72.3__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.72.2 → cognite_neat-0.72.3}/PKG-INFO +1 -1
- cognite_neat-0.72.3/cognite/neat/_version.py +1 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/constants.py +3 -2
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/_rules2dms.py +3 -7
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/_rules2ontology.py +2 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +15 -15
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +2 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +1 -1
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_spreadsheet2rules.py +52 -31
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/_types/_base.py +6 -16
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/dms_architect_rules.py +58 -56
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/rules_exporter.py +0 -1
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/pyproject.toml +1 -1
- cognite_neat-0.72.2/cognite/neat/_version.py +0 -1
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/LICENSE +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/README.md +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/data_classes/configuration.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/static/js/main.2efd96b2.js +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/static/js/main.2efd96b2.js.LICENSE.txt +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/static/js/main.2efd96b2.js.map +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/config.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractor/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractor/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractor/_dexpi.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractor/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractor/_mock_graph_generator.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/_asset_loader.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/_exceptions.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/core/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/core/labels.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/core/models.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/rdf_to_dms.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/loader/validator.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/stores/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/transformation/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/transformation/entity_matcher.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/transformation/query_generator/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/transformation/query_generator/sparql.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/graph/transformation/transformer.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/_analysis/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/_analysis/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/_analysis/_information_rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/analysis.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_core/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_core/rules2labels.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_rules2dms.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_rules2excel.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_rules2graphql.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_rules2ontology.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_rules2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_rules2triples.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporter/_validation.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/_models.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_dict2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_dms2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_graph2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_json2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_xsd2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importer/_yaml2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/_types/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/_types/_field.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/_types/_value.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/dms_schema.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/domain_rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/information_rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/rules.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/tables.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/value_types.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/utils.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/utils/xml.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Export DMS/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Export Rules to Ontology/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Extract DEXPI Graph and Export Rules/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Extract RDF Graph and Generate Assets/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Import DMS/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Ontology to Data Model/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Validate Rules/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Validate Solution Model/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Visualize Data Model Using Mock Graph/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/examples/Visualize Semantic Data Model/workflow.yaml +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/graph_extractor.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/graph_loader.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/graph_store.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/io_steps.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/rules_importer.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/rules_validator.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/__init__.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/graph_contextualization.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/graph_extractor.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/graph_loader.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/graph_store.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/graph_transformer.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/rules_exporter.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/lib/v1/rules_importer.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.72.3"
|
|
@@ -11,6 +11,7 @@ EXAMPLE_RULES = PACKAGE_DIRECTORY / "rules" / "examples"
|
|
|
11
11
|
EXAMPLE_GRAPHS = PACKAGE_DIRECTORY / "graph" / "examples"
|
|
12
12
|
EXAMPLE_WORKFLOWS = PACKAGE_DIRECTORY / "workflows" / "examples"
|
|
13
13
|
|
|
14
|
+
DEFAULT_NAMESPACE = Namespace("http://purl.org/cognite/neat#")
|
|
14
15
|
|
|
15
16
|
PREFIXES = {
|
|
16
17
|
"rdf": RDF._NS,
|
|
@@ -27,10 +28,10 @@ PREFIXES = {
|
|
|
27
28
|
"md": Namespace("http://iec.ch/TC57/61970-552/ModelDescription/1#"),
|
|
28
29
|
"pti": Namespace("http://www.pti-us.com/PTI_CIM-schema-cim16#"),
|
|
29
30
|
"tnt": Namespace("http://purl.org/cognite/tnt#"),
|
|
30
|
-
"neat":
|
|
31
|
+
"neat": DEFAULT_NAMESPACE,
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
|
|
34
35
|
DEFAULT_URI = ""
|
|
35
36
|
|
|
36
37
|
DEFAULT_DOCS_URL = "https://cognite-neat.readthedocs-hosted.com/en/latest/"
|
|
@@ -40,8 +40,6 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
40
40
|
If set, only export components in the given spaces. Defaults to None which means all spaces.
|
|
41
41
|
existing_handling (Literal["fail", "skip", "update", "force"], optional): How to handle existing components.
|
|
42
42
|
Defaults to "update". See below for details.
|
|
43
|
-
standardize_casing(bool, optional): Whether to standardize the casing. This means PascalCase for external ID
|
|
44
|
-
of views, containers, and data models, and camelCase for properties.
|
|
45
43
|
export_pipeline (bool, optional): Whether to export the pipeline. Defaults to False. This means setting
|
|
46
44
|
up transformations, RAW databases and tables to populate the data model.
|
|
47
45
|
instance_space (str, optional): The space to use for the instance. Defaults to None.
|
|
@@ -59,14 +57,12 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
59
57
|
export_components: Component | Collection[Component] = "all",
|
|
60
58
|
include_space: set[str] | None = None,
|
|
61
59
|
existing_handling: Literal["fail", "skip", "update", "force"] = "update",
|
|
62
|
-
standardize_casing: bool = True,
|
|
63
60
|
export_pipeline: bool = False,
|
|
64
61
|
instance_space: str | None = None,
|
|
65
62
|
):
|
|
66
63
|
self.export_components = {export_components} if isinstance(export_components, str) else set(export_components)
|
|
67
64
|
self.include_space = include_space
|
|
68
65
|
self.existing_handling = existing_handling
|
|
69
|
-
self.standardize_casing = standardize_casing
|
|
70
66
|
self.export_pipeline = export_pipeline
|
|
71
67
|
self.instance_space = instance_space
|
|
72
68
|
self._schema: DMSSchema | None = None
|
|
@@ -119,11 +115,11 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
119
115
|
)
|
|
120
116
|
is_new_model = dms_rules.reference is None
|
|
121
117
|
if is_new_model or is_solution_model:
|
|
122
|
-
return dms_rules.as_schema(self.
|
|
118
|
+
return dms_rules.as_schema(self.export_pipeline, self.instance_space)
|
|
123
119
|
|
|
124
120
|
# This is an extension of an existing model.
|
|
125
121
|
reference_rules = cast(DMSRules, dms_rules.reference).copy(deep=True)
|
|
126
|
-
reference_schema = reference_rules.as_schema(self.
|
|
122
|
+
reference_schema = reference_rules.as_schema(self.export_pipeline)
|
|
127
123
|
|
|
128
124
|
# Todo Move this to an appropriate location
|
|
129
125
|
# Merging Reference with User Rules
|
|
@@ -146,7 +142,7 @@ class DMSExporter(CDFExporter[DMSSchema]):
|
|
|
146
142
|
property_.reference = None
|
|
147
143
|
combined_rules.properties.append(property_)
|
|
148
144
|
|
|
149
|
-
schema = combined_rules.as_schema(self.
|
|
145
|
+
schema = combined_rules.as_schema(self.export_pipeline, self.instance_space)
|
|
150
146
|
|
|
151
147
|
if dms_rules.metadata.extension in (ExtensionCategory.addition, ExtensionCategory.reshape):
|
|
152
148
|
# We do not freeze views as they might be changed, even for addition,
|
|
@@ -8,6 +8,7 @@ from pydantic import BaseModel, ConfigDict, ValidationInfo, field_validator
|
|
|
8
8
|
from rdflib import DCTERMS, OWL, RDF, RDFS, XSD, BNode, Graph, Literal, Namespace, URIRef
|
|
9
9
|
from rdflib.collection import Collection as GraphCollection
|
|
10
10
|
|
|
11
|
+
from cognite.neat.constants import DEFAULT_NAMESPACE as NEAT_NAMESPACE
|
|
11
12
|
from cognite.neat.rules import exceptions
|
|
12
13
|
from cognite.neat.rules._analysis._information_rules import InformationArchitectRulesAnalysis
|
|
13
14
|
from cognite.neat.rules.models._rules import DMSRules
|
|
@@ -217,6 +218,7 @@ class OWLMetadata(InformationMetadata):
|
|
|
217
218
|
(URIRef(self.namespace), DCTERMS.hasVersion, Literal(self.version)),
|
|
218
219
|
(URIRef(self.namespace), OWL.versionInfo, Literal(self.version)),
|
|
219
220
|
(URIRef(self.namespace), RDFS.label, Literal(self.name)),
|
|
221
|
+
(URIRef(self.namespace), NEAT_NAMESPACE.prefix, Literal(self.prefix)),
|
|
220
222
|
(URIRef(self.namespace), DCTERMS.title, Literal(self.name)),
|
|
221
223
|
(URIRef(self.namespace), DCTERMS.created, Literal(self.created, datatype=XSD.dateTime)),
|
|
222
224
|
(URIRef(self.namespace), DCTERMS.description, Literal(self.description)),
|
{cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py
RENAMED
|
@@ -3,6 +3,7 @@ import re
|
|
|
3
3
|
|
|
4
4
|
from rdflib import Graph, Namespace
|
|
5
5
|
|
|
6
|
+
from cognite.neat.constants import DEFAULT_NAMESPACE
|
|
6
7
|
from cognite.neat.rules.models._rules.base import RoleTypes, SchemaCompleteness
|
|
7
8
|
from cognite.neat.rules.models.rules import (
|
|
8
9
|
prefix_compliance_regex,
|
|
@@ -29,23 +30,23 @@ def parse_owl_metadata(graph: Graph, make_compliant: bool = False) -> dict:
|
|
|
29
30
|
"""
|
|
30
31
|
# TODO: Move dataframe to dict representation
|
|
31
32
|
|
|
32
|
-
query = """SELECT ?namespace ?prefix ?version ?created ?updated ?title ?description ?creator ?rights ?license
|
|
33
|
-
WHERE {
|
|
33
|
+
query = f"""SELECT ?namespace ?prefix ?version ?created ?updated ?title ?description ?creator ?rights ?license
|
|
34
|
+
WHERE {{
|
|
34
35
|
?namespace a owl:Ontology .
|
|
35
|
-
OPTIONAL {?namespace owl:versionInfo ?version }.
|
|
36
|
-
OPTIONAL {?namespace dcterms:creator ?creator }.
|
|
37
|
-
OPTIONAL {?namespace
|
|
38
|
-
OPTIONAL {?namespace dcterms:
|
|
39
|
-
OPTIONAL {?namespace dcterms:
|
|
40
|
-
OPTIONAL {?namespace dcterms:
|
|
41
|
-
|
|
42
|
-
OPTIONAL {?namespace dcterms:rights|dc:rights ?rights }.
|
|
43
|
-
|
|
44
|
-
OPTIONAL {?namespace dcterms:license|dc:license ?license }.
|
|
36
|
+
OPTIONAL {{?namespace owl:versionInfo ?version }}.
|
|
37
|
+
OPTIONAL {{?namespace dcterms:creator ?creator }}.
|
|
38
|
+
OPTIONAL {{?namespace <{DEFAULT_NAMESPACE.prefix}> ?prefix }}.
|
|
39
|
+
OPTIONAL {{?namespace dcterms:title|rdfs:label|skos:prefLabel ?title }}.
|
|
40
|
+
OPTIONAL {{?namespace dcterms:modified ?updated }}.
|
|
41
|
+
OPTIONAL {{?namespace dcterms:created ?created }}.
|
|
42
|
+
OPTIONAL {{?namespace dcterms:description ?description }}.
|
|
43
|
+
OPTIONAL {{?namespace dcterms:rights|dc:rights ?rights }}.
|
|
44
|
+
|
|
45
|
+
OPTIONAL {{?namespace dcterms:license|dc:license ?license }}.
|
|
45
46
|
FILTER (!isBlank(?namespace))
|
|
46
47
|
FILTER (!bound(?description) || LANG(?description) = "" || LANGMATCHES(LANG(?description), "en"))
|
|
47
48
|
FILTER (!bound(?title) || LANG(?title) = "" || LANGMATCHES(LANG(?title), "en"))
|
|
48
|
-
}
|
|
49
|
+
}}
|
|
49
50
|
"""
|
|
50
51
|
|
|
51
52
|
results = [{item for item in sublist} for sublist in list(zip(*graph.query(query), strict=True))]
|
|
@@ -72,7 +73,6 @@ def parse_owl_metadata(graph: Graph, make_compliant: bool = False) -> dict:
|
|
|
72
73
|
)
|
|
73
74
|
|
|
74
75
|
if make_compliant:
|
|
75
|
-
raw_metadata.pop("created")
|
|
76
76
|
return make_metadata_compliant(raw_metadata)
|
|
77
77
|
|
|
78
78
|
return raw_metadata
|
|
@@ -176,7 +176,7 @@ def fix_date(
|
|
|
176
176
|
if date := metadata.get(date_type, None):
|
|
177
177
|
try:
|
|
178
178
|
if isinstance(date, datetime.datetime):
|
|
179
|
-
|
|
179
|
+
return metadata
|
|
180
180
|
elif isinstance(date, datetime.date):
|
|
181
181
|
metadata[date_type] = datetime.datetime.combine(metadata[date_type], datetime.datetime.min.time())
|
|
182
182
|
elif isinstance(date, str):
|
|
@@ -40,6 +40,8 @@ def parse_owl_properties(graph: Graph, make_compliant: bool = False, language: s
|
|
|
40
40
|
FILTER (!bound(?class) || !isBlank(?class))
|
|
41
41
|
FILTER (!bound(?name) || LANG(?name) = "" || LANGMATCHES(LANG(?name), "en"))
|
|
42
42
|
FILTER (!bound(?description) || LANG(?description) = "" || LANGMATCHES(LANG(?description), "en"))
|
|
43
|
+
BIND(IF(bound(?minCount), ?minCount, 0) AS ?minCount)
|
|
44
|
+
BIND(IF(bound(?maxCount), ?maxCount, 1) AS ?maxCount)
|
|
43
45
|
}
|
|
44
46
|
"""
|
|
45
47
|
|
{cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py
RENAMED
|
@@ -38,7 +38,7 @@ class OWLImporter(BaseImporter):
|
|
|
38
38
|
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
|
-
def __init__(self, owl_filepath: Path, make_compliant: bool =
|
|
41
|
+
def __init__(self, owl_filepath: Path, make_compliant: bool = False):
|
|
42
42
|
self.owl_filepath = owl_filepath
|
|
43
43
|
self.make_compliant = make_compliant
|
|
44
44
|
|
{cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/importers/_spreadsheet2rules.py
RENAMED
|
@@ -4,6 +4,7 @@ generating a list of rules based on which nodes that form the graph are made.
|
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
from collections import UserDict, defaultdict
|
|
7
|
+
from dataclasses import dataclass
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
from typing import Literal, cast, overload
|
|
9
10
|
|
|
@@ -49,6 +50,12 @@ class MetadataRaw(UserDict):
|
|
|
49
50
|
def has_schema_field(self) -> bool:
|
|
50
51
|
return self.get("schema") in [schema.value for schema in SchemaCompleteness.__members__.values()]
|
|
51
52
|
|
|
53
|
+
@property
|
|
54
|
+
def schema(self) -> SchemaCompleteness | None:
|
|
55
|
+
if not self.has_schema_field:
|
|
56
|
+
return None
|
|
57
|
+
return SchemaCompleteness(self["schema"])
|
|
58
|
+
|
|
52
59
|
def is_valid(self, issue_list: IssueList, filepath: Path) -> bool:
|
|
53
60
|
if not self.has_role_field:
|
|
54
61
|
issue_list.append(issues.spreadsheet_file.RoleMissingOrUnsupportedError(filepath))
|
|
@@ -61,6 +68,14 @@ class MetadataRaw(UserDict):
|
|
|
61
68
|
return True
|
|
62
69
|
|
|
63
70
|
|
|
71
|
+
@dataclass
|
|
72
|
+
class ReadResult:
|
|
73
|
+
sheets: dict[str, dict | list]
|
|
74
|
+
read_info_by_sheet: dict[str, SpreadsheetRead]
|
|
75
|
+
role: RoleTypes
|
|
76
|
+
schema: SchemaCompleteness | None
|
|
77
|
+
|
|
78
|
+
|
|
64
79
|
class SpreadsheetReader:
|
|
65
80
|
def __init__(self, issue_list: IssueList, is_reference: bool = False):
|
|
66
81
|
self.issue_list = issue_list
|
|
@@ -79,7 +94,7 @@ class SpreadsheetReader:
|
|
|
79
94
|
def to_reference_sheet(cls, sheet_name: str) -> str:
|
|
80
95
|
return f"Ref{sheet_name}"
|
|
81
96
|
|
|
82
|
-
def read(self, filepath: Path) ->
|
|
97
|
+
def read(self, filepath: Path) -> None | ReadResult:
|
|
83
98
|
with pd.ExcelFile(filepath) as excel_file:
|
|
84
99
|
if self.metadata_sheet_name not in excel_file.sheet_names:
|
|
85
100
|
self.issue_list.append(
|
|
@@ -95,21 +110,10 @@ class SpreadsheetReader:
|
|
|
95
110
|
return None
|
|
96
111
|
|
|
97
112
|
sheets, read_info_by_sheet = self._read_sheets(metadata, excel_file)
|
|
98
|
-
if self.issue_list.has_errors:
|
|
99
|
-
return None
|
|
100
|
-
|
|
101
|
-
rules_cls = RULES_PER_ROLE[metadata.role]
|
|
102
|
-
with _handle_issues(
|
|
103
|
-
self.issue_list,
|
|
104
|
-
error_cls=issues.spreadsheet.InvalidSheetError,
|
|
105
|
-
error_args={"read_info_by_sheet": read_info_by_sheet},
|
|
106
|
-
) as future:
|
|
107
|
-
rules = rules_cls.model_validate(sheets) # type: ignore[attr-defined]
|
|
108
|
-
|
|
109
|
-
if future.result == "failure" or self.issue_list.has_errors:
|
|
113
|
+
if sheets is None or self.issue_list.has_errors:
|
|
110
114
|
return None
|
|
111
115
|
|
|
112
|
-
|
|
116
|
+
return ReadResult(sheets, read_info_by_sheet, metadata.role, metadata.schema)
|
|
113
117
|
|
|
114
118
|
def _read_sheets(
|
|
115
119
|
self, metadata: MetadataRaw, excel_file: ExcelFile
|
|
@@ -167,43 +171,60 @@ class ExcelImporter(BaseImporter):
|
|
|
167
171
|
is_reference: bool = False,
|
|
168
172
|
) -> tuple[Rules | None, IssueList] | Rules:
|
|
169
173
|
issue_list = IssueList(title=f"'{self.filepath.name}'")
|
|
170
|
-
|
|
171
174
|
if not self.filepath.exists():
|
|
172
175
|
issue_list.append(issues.spreadsheet_file.SpreadsheetNotFoundError(self.filepath))
|
|
173
176
|
return self._return_or_raise(issue_list, errors)
|
|
174
177
|
|
|
175
|
-
|
|
178
|
+
user_result: ReadResult | None = None
|
|
176
179
|
if not is_reference:
|
|
177
|
-
|
|
178
|
-
if issue_list.has_errors:
|
|
180
|
+
user_result = SpreadsheetReader(issue_list, is_reference=False).read(self.filepath)
|
|
181
|
+
if user_result is None or issue_list.has_errors:
|
|
179
182
|
return self._return_or_raise(issue_list, errors)
|
|
180
183
|
|
|
181
|
-
|
|
184
|
+
reference_result: ReadResult | None = None
|
|
182
185
|
if is_reference or (
|
|
183
|
-
|
|
184
|
-
and
|
|
185
|
-
and
|
|
186
|
+
user_result
|
|
187
|
+
and user_result.role != RoleTypes.domain_expert
|
|
188
|
+
and user_result.schema == SchemaCompleteness.extended
|
|
186
189
|
):
|
|
187
|
-
|
|
190
|
+
reference_result = SpreadsheetReader(issue_list, is_reference=True).read(self.filepath)
|
|
188
191
|
if issue_list.has_errors:
|
|
189
192
|
return self._return_or_raise(issue_list, errors)
|
|
190
193
|
|
|
191
|
-
if
|
|
194
|
+
if user_result and reference_result and user_result.role != reference_result.role:
|
|
192
195
|
issue_list.append(issues.spreadsheet_file.RoleMismatchError(self.filepath))
|
|
193
196
|
return self._return_or_raise(issue_list, errors)
|
|
194
197
|
|
|
195
|
-
if
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
if user_result and reference_result:
|
|
199
|
+
user_result.sheets["reference"] = reference_result.sheets
|
|
200
|
+
sheets = user_result.sheets
|
|
201
|
+
original_role = user_result.role
|
|
202
|
+
read_info_by_sheet = user_result.read_info_by_sheet
|
|
203
|
+
read_info_by_sheet.update(reference_result.read_info_by_sheet)
|
|
204
|
+
elif user_result:
|
|
205
|
+
sheets = user_result.sheets
|
|
206
|
+
original_role = user_result.role
|
|
207
|
+
read_info_by_sheet = user_result.read_info_by_sheet
|
|
208
|
+
elif reference_result:
|
|
209
|
+
sheets = reference_result.sheets
|
|
210
|
+
original_role = reference_result.role
|
|
211
|
+
read_info_by_sheet = reference_result.read_info_by_sheet
|
|
202
212
|
else:
|
|
203
213
|
raise ValueError(
|
|
204
214
|
"No rules were generated. This should have been caught earlier. " f"Bug in {type(self).__name__}."
|
|
205
215
|
)
|
|
206
216
|
|
|
217
|
+
rules_cls = RULES_PER_ROLE[original_role]
|
|
218
|
+
with _handle_issues(
|
|
219
|
+
issue_list,
|
|
220
|
+
error_cls=issues.spreadsheet.InvalidSheetError,
|
|
221
|
+
error_args={"read_info_by_sheet": read_info_by_sheet},
|
|
222
|
+
) as future:
|
|
223
|
+
rules = rules_cls.model_validate(sheets) # type: ignore[attr-defined]
|
|
224
|
+
|
|
225
|
+
if future.result == "failure" or issue_list.has_errors:
|
|
226
|
+
return self._return_or_raise(issue_list, errors)
|
|
227
|
+
|
|
207
228
|
return self._to_output(
|
|
208
229
|
rules,
|
|
209
230
|
issue_list,
|
{cognite_neat-0.72.2 → cognite_neat-0.72.3}/cognite/neat/rules/models/_rules/_types/_base.py
RENAMED
|
@@ -14,7 +14,6 @@ from cognite.neat.rules.models.rdfpath import (
|
|
|
14
14
|
TransformationRuleType,
|
|
15
15
|
parse_rule,
|
|
16
16
|
)
|
|
17
|
-
from cognite.neat.utils.text import to_pascal
|
|
18
17
|
|
|
19
18
|
if sys.version_info >= (3, 11):
|
|
20
19
|
from enum import StrEnum
|
|
@@ -197,15 +196,14 @@ class ContainerEntity(Entity):
|
|
|
197
196
|
def from_id(cls, container_id: ContainerId) -> "ContainerEntity":
|
|
198
197
|
return ContainerEntity(prefix=container_id.space, suffix=container_id.external_id)
|
|
199
198
|
|
|
200
|
-
def as_id(self, default_space: str | None
|
|
199
|
+
def as_id(self, default_space: str | None) -> ContainerId:
|
|
201
200
|
if self.space is Undefined and default_space is None:
|
|
202
201
|
raise ValueError("Space is Undefined! Set default_space!")
|
|
203
202
|
|
|
204
|
-
external_id = to_pascal(self.external_id) if standardize_casing else self.external_id
|
|
205
203
|
if self.space is Undefined:
|
|
206
|
-
return ContainerId(space=cast(str, default_space), external_id=external_id)
|
|
204
|
+
return ContainerId(space=cast(str, default_space), external_id=self.external_id)
|
|
207
205
|
else:
|
|
208
|
-
return ContainerId(space=self.space, external_id=external_id)
|
|
206
|
+
return ContainerId(space=self.space, external_id=self.external_id)
|
|
209
207
|
|
|
210
208
|
|
|
211
209
|
class ViewEntity(Entity):
|
|
@@ -233,7 +231,6 @@ class ViewEntity(Entity):
|
|
|
233
231
|
allow_none: Literal[False] = False,
|
|
234
232
|
default_space: str | None = None,
|
|
235
233
|
default_version: str | None = None,
|
|
236
|
-
standardize_casing: bool = True,
|
|
237
234
|
) -> ViewId:
|
|
238
235
|
...
|
|
239
236
|
|
|
@@ -243,7 +240,6 @@ class ViewEntity(Entity):
|
|
|
243
240
|
allow_none: Literal[True],
|
|
244
241
|
default_space: str | None = None,
|
|
245
242
|
default_version: str | None = None,
|
|
246
|
-
standardize_casing: bool = True,
|
|
247
243
|
) -> ViewId | None:
|
|
248
244
|
...
|
|
249
245
|
|
|
@@ -252,7 +248,6 @@ class ViewEntity(Entity):
|
|
|
252
248
|
allow_none: bool = False,
|
|
253
249
|
default_space: str | None = None,
|
|
254
250
|
default_version: str | None = None,
|
|
255
|
-
standardize_casing: bool = True,
|
|
256
251
|
) -> ViewId | None:
|
|
257
252
|
if self.suffix is Unknown and allow_none:
|
|
258
253
|
return None
|
|
@@ -265,8 +260,7 @@ class ViewEntity(Entity):
|
|
|
265
260
|
raise ValueError("space is required")
|
|
266
261
|
if version is None:
|
|
267
262
|
raise ValueError("version is required")
|
|
268
|
-
|
|
269
|
-
return ViewId(space=space, external_id=external_id, version=version)
|
|
263
|
+
return ViewId(space=space, external_id=self.external_id, version=version)
|
|
270
264
|
|
|
271
265
|
|
|
272
266
|
class ViewPropEntity(ViewEntity):
|
|
@@ -303,14 +297,10 @@ class ViewPropEntity(ViewEntity):
|
|
|
303
297
|
property_=prop_id.property,
|
|
304
298
|
)
|
|
305
299
|
|
|
306
|
-
def as_prop_id(
|
|
307
|
-
self, default_space: str | None = None, default_version: str | None = None, standardize_casing: bool = True
|
|
308
|
-
) -> PropertyId:
|
|
300
|
+
def as_prop_id(self, default_space: str | None = None, default_version: str | None = None) -> PropertyId:
|
|
309
301
|
if self.property_ is None:
|
|
310
302
|
raise ValueError("property is required to create PropertyId")
|
|
311
|
-
return PropertyId(
|
|
312
|
-
source=self.as_id(False, default_space, default_version, standardize_casing), property=self.property_
|
|
313
|
-
)
|
|
303
|
+
return PropertyId(source=self.as_id(False, default_space, default_version), property=self.property_)
|
|
314
304
|
|
|
315
305
|
@property
|
|
316
306
|
def versioned_id(self) -> str:
|