cognite-neat 0.77.3__tar.gz → 0.77.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/PKG-INFO +1 -1
- cognite_neat-0.77.5/cognite/neat/_version.py +1 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/analysis/_information_rules.py +2 -12
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2excel.py +10 -10
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2yaml.py +3 -3
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dms2rules.py +15 -6
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +1 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_spreadsheet2rules.py +21 -8
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/spreadsheet.py +60 -5
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_base.py +29 -18
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_converter.py +2 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_exporter.py +131 -17
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_rules.py +43 -31
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_rules_input.py +4 -11
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_schema.py +5 -4
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_serializer.py +26 -36
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/_validation.py +39 -61
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/domain.py +2 -6
- cognite_neat-0.77.5/cognite/neat/rules/models/information/__init__.py +10 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/information/_converter.py +53 -14
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/information/_rules.py +63 -106
- cognite_neat-0.77.5/cognite/neat/rules/models/information/_rules_input.py +266 -0
- cognite_neat-0.77.5/cognite/neat/rules/models/information/_serializer.py +73 -0
- cognite_neat-0.77.5/cognite/neat/rules/models/information/_validation.py +164 -0
- cognite_neat-0.77.5/cognite/neat/utils/cdf.py +59 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +30 -7
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/rules_importer.py +21 -2
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/pyproject.toml +1 -1
- cognite_neat-0.77.3/cognite/neat/_version.py +0 -1
- cognite_neat-0.77.3/cognite/neat/rules/models/information/__init__.py +0 -3
- cognite_neat-0.77.3/cognite/neat/utils/cdf.py +0 -24
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/LICENSE +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/README.md +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/config.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_models.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/data_types.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/entities.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/models/wrapped_entities.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_classes.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/utils.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/utils/xml.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.77.5"
|
{cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/analysis/_information_rules.py
RENAMED
|
@@ -13,23 +13,13 @@ from cognite.neat.rules.models.entities import ClassEntity, EntityTypes, ParentC
|
|
|
13
13
|
from cognite.neat.rules.models.information import InformationClass, InformationProperty, InformationRules
|
|
14
14
|
from cognite.neat.utils.utils import get_inheritance_path
|
|
15
15
|
|
|
16
|
-
from ._base import BaseAnalysis
|
|
16
|
+
from ._base import BaseAnalysis
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class InformationArchitectRulesAnalysis(BaseAnalysis):
|
|
20
20
|
def __init__(self, rules: InformationRules):
|
|
21
21
|
self.rules = rules
|
|
22
22
|
|
|
23
|
-
@property
|
|
24
|
-
def data_modeling_scenario(self) -> DataModelingScenario:
|
|
25
|
-
if not self.rules.reference:
|
|
26
|
-
return DataModelingScenario.from_scratch
|
|
27
|
-
|
|
28
|
-
if self.rules.metadata.namespace == self.rules.reference.metadata.namespace:
|
|
29
|
-
return DataModelingScenario.extend_reference
|
|
30
|
-
else:
|
|
31
|
-
return DataModelingScenario.build_solution
|
|
32
|
-
|
|
33
23
|
@property
|
|
34
24
|
def referred_classes(self) -> set[ClassEntity]:
|
|
35
25
|
return self.directly_referred_classes.union(self.inherited_referred_classes)
|
|
@@ -362,7 +352,7 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
|
|
|
362
352
|
|
|
363
353
|
rules = cast(InformationRules, self.rules.reference if use_reference else self.rules)
|
|
364
354
|
|
|
365
|
-
if
|
|
355
|
+
if rules.metadata.schema_ is not SchemaCompleteness.complete:
|
|
366
356
|
raise ValueError("Rules are not complete cannot perform reduction!")
|
|
367
357
|
class_as_dict = self.as_class_dict()
|
|
368
358
|
class_parents_pairs = self.class_parent_pairs()
|
|
@@ -116,27 +116,27 @@ class ExcelExporter(BaseExporter[Workbook]):
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if self.dump_as == "last":
|
|
119
|
-
dumped_last_rules = rules.
|
|
119
|
+
dumped_last_rules = rules.dump(by_alias=True)
|
|
120
120
|
if rules.reference:
|
|
121
|
-
dumped_reference_rules = rules.reference.
|
|
121
|
+
dumped_reference_rules = rules.reference.dump(by_alias=True, as_reference=True)
|
|
122
122
|
elif self.dump_as == "reference":
|
|
123
|
-
dumped_reference_rules = rules.
|
|
123
|
+
dumped_reference_rules = rules.dump(by_alias=True, as_reference=True)
|
|
124
124
|
else:
|
|
125
|
-
dumped_user_rules = rules.
|
|
125
|
+
dumped_user_rules = rules.dump(by_alias=True)
|
|
126
126
|
if rules.last:
|
|
127
|
-
dumped_last_rules = rules.last.
|
|
127
|
+
dumped_last_rules = rules.last.dump(by_alias=True)
|
|
128
128
|
if rules.reference:
|
|
129
|
-
dumped_reference_rules = rules.reference.
|
|
129
|
+
dumped_reference_rules = rules.reference.dump(by_alias=True, as_reference=True)
|
|
130
130
|
|
|
131
131
|
self._write_metadata_sheet(workbook, dumped_user_rules["Metadata"])
|
|
132
132
|
self._write_sheets(workbook, dumped_user_rules, rules)
|
|
133
133
|
if dumped_last_rules:
|
|
134
134
|
self._write_sheets(workbook, dumped_last_rules, rules, sheet_prefix="Last")
|
|
135
|
+
self._write_metadata_sheet(workbook, dumped_last_rules["Metadata"], sheet_prefix="Last")
|
|
135
136
|
|
|
136
137
|
if dumped_reference_rules:
|
|
137
|
-
|
|
138
|
-
self.
|
|
139
|
-
self._write_metadata_sheet(workbook, dumped_reference_rules["Metadata"], sheet_prefix=prefix)
|
|
138
|
+
self._write_sheets(workbook, dumped_reference_rules, rules, sheet_prefix="Ref")
|
|
139
|
+
self._write_metadata_sheet(workbook, dumped_reference_rules["Metadata"], sheet_prefix="Ref")
|
|
140
140
|
|
|
141
141
|
if self._styling_level > 0:
|
|
142
142
|
self._adjust_column_widths(workbook)
|
|
@@ -291,7 +291,7 @@ class _MetadataCreator:
|
|
|
291
291
|
prefix = self.new_model_id[0]
|
|
292
292
|
return InformationMetadata(
|
|
293
293
|
data_model_type=DataModelType.solution,
|
|
294
|
-
schema_=SchemaCompleteness.
|
|
294
|
+
schema_=SchemaCompleteness.complete,
|
|
295
295
|
extension=ExtensionCategory.addition,
|
|
296
296
|
prefix=prefix,
|
|
297
297
|
namespace=f"http://purl.org/neat/{prefix}/", # type: ignore[arg-type]
|
|
@@ -69,10 +69,10 @@ class YAMLExporter(BaseExporter[str]):
|
|
|
69
69
|
rules = self._convert_to_output_role(rules, self.output_role)
|
|
70
70
|
# model_dump_json ensures that the output is in JSON format,
|
|
71
71
|
# if we don't do this, we will get Enums and other types that are not serializable to YAML
|
|
72
|
-
json_output = rules.
|
|
72
|
+
json_output = rules.dump(mode="json")
|
|
73
73
|
if self.output == "json":
|
|
74
|
-
return json_output
|
|
74
|
+
return json.dumps(json_output)
|
|
75
75
|
elif self.output == "yaml":
|
|
76
|
-
return yaml.safe_dump(
|
|
76
|
+
return yaml.safe_dump(json_output)
|
|
77
77
|
else:
|
|
78
78
|
raise ValueError(f"Invalid output: {self.output}. Valid options are {self.format_option}")
|
|
@@ -109,7 +109,7 @@ class DMSImporter(BaseImporter):
|
|
|
109
109
|
if result.result == "failure" or issue_list.has_errors:
|
|
110
110
|
return cls(DMSSchema(), issue_list)
|
|
111
111
|
|
|
112
|
-
metadata = cls._create_metadata_from_model(user_model)
|
|
112
|
+
metadata = cls._create_metadata_from_model(user_model, has_reference=ref_model is not None)
|
|
113
113
|
ref_metadata = cls._create_metadata_from_model(ref_model) if ref_model else None
|
|
114
114
|
|
|
115
115
|
return cls(schema, issue_list, metadata, ref_metadata)
|
|
@@ -131,6 +131,7 @@ class DMSImporter(BaseImporter):
|
|
|
131
131
|
def _create_metadata_from_model(
|
|
132
132
|
cls,
|
|
133
133
|
model: dm.DataModel[dm.View] | dm.DataModelApply,
|
|
134
|
+
has_reference: bool = False,
|
|
134
135
|
) -> DMSMetadata:
|
|
135
136
|
description, creator = DMSMetadata._get_description_and_creator(model.description)
|
|
136
137
|
|
|
@@ -143,6 +144,7 @@ class DMSImporter(BaseImporter):
|
|
|
143
144
|
updated = now
|
|
144
145
|
return DMSMetadata(
|
|
145
146
|
schema_=SchemaCompleteness.complete,
|
|
147
|
+
data_model_type=DataModelType.solution if has_reference else DataModelType.enterprise,
|
|
146
148
|
extension=ExtensionCategory.addition,
|
|
147
149
|
space=model.space,
|
|
148
150
|
external_id=model.external_id,
|
|
@@ -202,16 +204,21 @@ class DMSImporter(BaseImporter):
|
|
|
202
204
|
**self._create_rule_components(
|
|
203
205
|
ref_model,
|
|
204
206
|
ref_schema,
|
|
205
|
-
self.ref_metadata
|
|
207
|
+
self.ref_metadata
|
|
208
|
+
or self._create_default_metadata(list(ref_schema.views.values()), is_ref=True),
|
|
206
209
|
DataModelType.enterprise,
|
|
207
210
|
)
|
|
208
211
|
)
|
|
209
|
-
schema_completeness = SchemaCompleteness.extended
|
|
210
212
|
data_model_type = DataModelType.solution
|
|
211
213
|
|
|
212
214
|
user_rules = DMSRules(
|
|
213
215
|
**self._create_rule_components(
|
|
214
|
-
model,
|
|
216
|
+
model,
|
|
217
|
+
self.root_schema,
|
|
218
|
+
self.metadata,
|
|
219
|
+
data_model_type,
|
|
220
|
+
schema_completeness,
|
|
221
|
+
has_reference=reference is not None,
|
|
215
222
|
),
|
|
216
223
|
reference=reference,
|
|
217
224
|
)
|
|
@@ -228,6 +235,7 @@ class DMSImporter(BaseImporter):
|
|
|
228
235
|
metadata: DMSMetadata | None = None,
|
|
229
236
|
data_model_type: DataModelType | None = None,
|
|
230
237
|
schema_completeness: SchemaCompleteness | None = None,
|
|
238
|
+
has_reference: bool = False,
|
|
231
239
|
) -> dict[str, Any]:
|
|
232
240
|
properties = SheetList[DMSProperty]()
|
|
233
241
|
for view_id, view in schema.views.items():
|
|
@@ -242,7 +250,7 @@ class DMSImporter(BaseImporter):
|
|
|
242
250
|
view.as_id() if isinstance(view, dm.View | dm.ViewApply) else view for view in data_model.views or []
|
|
243
251
|
}
|
|
244
252
|
|
|
245
|
-
metadata = metadata or DMSMetadata.from_data_model(data_model)
|
|
253
|
+
metadata = metadata or DMSMetadata.from_data_model(data_model, has_reference)
|
|
246
254
|
if data_model_type is not None:
|
|
247
255
|
metadata.data_model_type = data_model_type
|
|
248
256
|
if schema_completeness is not None:
|
|
@@ -262,12 +270,13 @@ class DMSImporter(BaseImporter):
|
|
|
262
270
|
)
|
|
263
271
|
|
|
264
272
|
@classmethod
|
|
265
|
-
def _create_default_metadata(cls, views: Sequence[dm.View | dm.ViewApply]) -> DMSMetadata:
|
|
273
|
+
def _create_default_metadata(cls, views: Sequence[dm.View | dm.ViewApply], is_ref: bool = False) -> DMSMetadata:
|
|
266
274
|
now = datetime.now().replace(microsecond=0)
|
|
267
275
|
space = Counter(view.space for view in views).most_common(1)[0][0]
|
|
268
276
|
return DMSMetadata(
|
|
269
277
|
schema_=SchemaCompleteness.complete,
|
|
270
278
|
extension=ExtensionCategory.addition,
|
|
279
|
+
data_model_type=DataModelType.enterprise if is_ref else DataModelType.solution,
|
|
271
280
|
space=space,
|
|
272
281
|
external_id="Unknown",
|
|
273
282
|
version="0.1.0",
|
{cognite_neat-0.77.3 → cognite_neat-0.77.5}/cognite/neat/rules/importers/_spreadsheet2rules.py
RENAMED
|
@@ -22,6 +22,7 @@ from cognite.neat.rules.models import (
|
|
|
22
22
|
SchemaCompleteness,
|
|
23
23
|
)
|
|
24
24
|
from cognite.neat.rules.models.dms import DMSRulesInput
|
|
25
|
+
from cognite.neat.rules.models.information import InformationRulesInput
|
|
25
26
|
from cognite.neat.utils.auxiliary import local_import
|
|
26
27
|
from cognite.neat.utils.spreadsheet import SpreadsheetRead, read_individual_sheet
|
|
27
28
|
|
|
@@ -110,17 +111,27 @@ class SpreadsheetReader:
|
|
|
110
111
|
self.required = required
|
|
111
112
|
self.metadata = metadata
|
|
112
113
|
self._sheet_prefix = sheet_prefix
|
|
114
|
+
self._seen_files: set[Path] = set()
|
|
115
|
+
self._seen_sheets: set[str] = set()
|
|
113
116
|
|
|
114
117
|
@property
|
|
115
118
|
def metadata_sheet_name(self) -> str:
|
|
116
119
|
return f"{self._sheet_prefix}Metadata"
|
|
117
120
|
|
|
121
|
+
@property
|
|
122
|
+
def seen_sheets(self) -> set[str]:
|
|
123
|
+
if not self._seen_files:
|
|
124
|
+
raise ValueError("No files have been read yet.")
|
|
125
|
+
return self._seen_sheets
|
|
126
|
+
|
|
118
127
|
def sheet_names(self, role: RoleTypes) -> set[str]:
|
|
119
128
|
names = MANDATORY_SHEETS_BY_ROLE[role]
|
|
120
129
|
return {f"{self._sheet_prefix}{sheet_name}" for sheet_name in names if sheet_name != "Metadata"}
|
|
121
130
|
|
|
122
131
|
def read(self, filepath: Path) -> None | ReadResult:
|
|
123
132
|
with pd.ExcelFile(filepath) as excel_file:
|
|
133
|
+
self._seen_files.add(filepath)
|
|
134
|
+
self._seen_sheets.update(map(str, excel_file.sheet_names))
|
|
124
135
|
metadata: MetadataRaw | None
|
|
125
136
|
if self.metadata is not None:
|
|
126
137
|
metadata = self.metadata
|
|
@@ -212,20 +223,20 @@ class ExcelImporter(BaseImporter):
|
|
|
212
223
|
issue_list.append(issues.spreadsheet_file.SpreadsheetNotFoundError(self.filepath))
|
|
213
224
|
return self._return_or_raise(issue_list, errors)
|
|
214
225
|
|
|
215
|
-
|
|
226
|
+
user_reader = SpreadsheetReader(issue_list)
|
|
227
|
+
user_read = user_reader.read(self.filepath)
|
|
216
228
|
if user_read is None or issue_list.has_errors:
|
|
217
229
|
return self._return_or_raise(issue_list, errors)
|
|
218
230
|
|
|
219
231
|
last_read: ReadResult | None = None
|
|
232
|
+
if any(sheet_name.startswith("Last") for sheet_name in user_reader.seen_sheets):
|
|
233
|
+
last_read = SpreadsheetReader(issue_list, required=False, sheet_prefix="Last").read(self.filepath)
|
|
220
234
|
reference_read: ReadResult | None = None
|
|
221
|
-
if
|
|
222
|
-
# Last does not have its own metadata sheet. It is the same as the user's metadata sheet.
|
|
223
|
-
last_read = SpreadsheetReader(
|
|
224
|
-
issue_list, required=False, metadata=user_read.metadata, sheet_prefix="Last"
|
|
225
|
-
).read(self.filepath)
|
|
235
|
+
if any(sheet_name.startswith("Ref") for sheet_name in user_reader.seen_sheets):
|
|
226
236
|
reference_read = SpreadsheetReader(issue_list, sheet_prefix="Ref").read(self.filepath)
|
|
227
|
-
|
|
228
|
-
|
|
237
|
+
|
|
238
|
+
if issue_list.has_errors:
|
|
239
|
+
return self._return_or_raise(issue_list, errors)
|
|
229
240
|
|
|
230
241
|
if reference_read and user_read.role != reference_read.role:
|
|
231
242
|
issue_list.append(issues.spreadsheet_file.RoleMismatchError(self.filepath))
|
|
@@ -253,6 +264,8 @@ class ExcelImporter(BaseImporter):
|
|
|
253
264
|
rules: Rules
|
|
254
265
|
if rules_cls is DMSRules:
|
|
255
266
|
rules = DMSRulesInput.load(sheets).as_rules()
|
|
267
|
+
elif rules_cls is InformationRules:
|
|
268
|
+
rules = InformationRulesInput.load(sheets).as_rules()
|
|
256
269
|
else:
|
|
257
270
|
rules = rules_cls.model_validate(sheets) # type: ignore[attr-defined]
|
|
258
271
|
|
|
@@ -10,7 +10,7 @@ from pydantic_core import ErrorDetails
|
|
|
10
10
|
|
|
11
11
|
from cognite.neat.utils.spreadsheet import SpreadsheetRead
|
|
12
12
|
|
|
13
|
-
from .base import DefaultPydanticError, MultiValueError, NeatValidationError
|
|
13
|
+
from .base import DefaultPydanticError, MultiValueError, NeatValidationError
|
|
14
14
|
|
|
15
15
|
if sys.version_info >= (3, 11):
|
|
16
16
|
from typing import Self
|
|
@@ -27,7 +27,7 @@ __all__ = [
|
|
|
27
27
|
"InvalidRowUnknownSheetError",
|
|
28
28
|
"NonExistingContainerError",
|
|
29
29
|
"NonExistingViewError",
|
|
30
|
-
"
|
|
30
|
+
"ClassNoPropertiesNoParentError",
|
|
31
31
|
"InconsistentContainerDefinitionError",
|
|
32
32
|
"MultiValueTypeError",
|
|
33
33
|
"MultiValueIsListError",
|
|
@@ -239,7 +239,26 @@ class NonExistingViewError(InvalidPropertyError):
|
|
|
239
239
|
|
|
240
240
|
|
|
241
241
|
@dataclass(frozen=True)
|
|
242
|
-
class
|
|
242
|
+
class PropertiesDefinedForUndefinedClassesError(NeatValidationError):
|
|
243
|
+
description = "Properties are defined for undefined classes."
|
|
244
|
+
fix = "Make sure to define class in the Classes sheet."
|
|
245
|
+
|
|
246
|
+
classes: list[str]
|
|
247
|
+
|
|
248
|
+
def dump(self) -> dict[str, list[str]]:
|
|
249
|
+
output = super().dump()
|
|
250
|
+
output["classes"] = self.classes
|
|
251
|
+
return output
|
|
252
|
+
|
|
253
|
+
def message(self) -> str:
|
|
254
|
+
return (
|
|
255
|
+
f"Classes {', '.join(self.classes)} have properties assigned to them, but"
|
|
256
|
+
" they are not defined in the Classes sheet."
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
@dataclass(frozen=True)
|
|
261
|
+
class ClassNoPropertiesNoParentError(NeatValidationError):
|
|
243
262
|
description = "Class has no properties and no parents."
|
|
244
263
|
fix = "Check if the class should have properties or parents."
|
|
245
264
|
|
|
@@ -252,8 +271,44 @@ class ClassNoPropertiesNoParentsWarning(ValidationWarning):
|
|
|
252
271
|
|
|
253
272
|
def message(self) -> str:
|
|
254
273
|
if len(self.classes) > 1:
|
|
255
|
-
return f"Classes {', '.join(self.classes)} have no
|
|
256
|
-
return f"Class {self.classes[0]}
|
|
274
|
+
return f"Classes {', '.join(self.classes)} have no direct or inherited properties. This may be a mistake."
|
|
275
|
+
return f"Class {self.classes[0]} have no direct or inherited properties. This may be a mistake."
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
@dataclass(frozen=True)
|
|
279
|
+
class ParentClassesNotDefinedError(NeatValidationError):
|
|
280
|
+
description = "Parent classes are not defined."
|
|
281
|
+
fix = "Check if the parent classes are defined in Classes sheet."
|
|
282
|
+
|
|
283
|
+
classes: list[str]
|
|
284
|
+
|
|
285
|
+
def dump(self) -> dict[str, list[str]]:
|
|
286
|
+
output = super().dump()
|
|
287
|
+
output["classes"] = self.classes
|
|
288
|
+
return output
|
|
289
|
+
|
|
290
|
+
def message(self) -> str:
|
|
291
|
+
if len(self.classes) > 1:
|
|
292
|
+
return f"Parent classes {', '.join(self.classes)} are not defined. This may be a mistake."
|
|
293
|
+
return f"Parent classes {', '.join(self.classes[0])} are not defined. This may be a mistake."
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
@dataclass(frozen=True)
|
|
297
|
+
class ValueTypeNotDefinedError(NeatValidationError):
|
|
298
|
+
description = "Value types referred by properties are not defined in Rules."
|
|
299
|
+
fix = "Make sure that all value types are defined in Rules."
|
|
300
|
+
|
|
301
|
+
value_types: list[str]
|
|
302
|
+
|
|
303
|
+
def dump(self) -> dict[str, list[str]]:
|
|
304
|
+
output = super().dump()
|
|
305
|
+
output["classes"] = self.value_types
|
|
306
|
+
return output
|
|
307
|
+
|
|
308
|
+
def message(self) -> str:
|
|
309
|
+
if len(self.value_types) > 1:
|
|
310
|
+
return f"Value types {', '.join(self.value_types)} are not defined. This may be a mistake."
|
|
311
|
+
return f"Value types {', '.join(self.value_types[0])} are not defined. This may be a mistake."
|
|
257
312
|
|
|
258
313
|
|
|
259
314
|
@dataclass(frozen=True)
|
|
@@ -7,10 +7,9 @@ from __future__ import annotations
|
|
|
7
7
|
import math
|
|
8
8
|
import sys
|
|
9
9
|
import types
|
|
10
|
-
from abc import abstractmethod
|
|
11
10
|
from collections.abc import Callable, Iterator
|
|
12
11
|
from functools import wraps
|
|
13
|
-
from typing import Annotated, Any, ClassVar, Generic, TypeAlias, TypeVar
|
|
12
|
+
from typing import Annotated, Any, ClassVar, Generic, Literal, TypeAlias, TypeVar
|
|
14
13
|
|
|
15
14
|
import pandas as pd
|
|
16
15
|
from pydantic import (
|
|
@@ -26,18 +25,23 @@ from pydantic import (
|
|
|
26
25
|
model_validator,
|
|
27
26
|
)
|
|
28
27
|
from pydantic.fields import FieldInfo
|
|
28
|
+
from pydantic.main import IncEx
|
|
29
29
|
|
|
30
30
|
if sys.version_info >= (3, 11):
|
|
31
31
|
from enum import StrEnum
|
|
32
|
-
from typing import Self
|
|
33
32
|
else:
|
|
34
33
|
from backports.strenum import StrEnum
|
|
35
|
-
from typing_extensions import Self
|
|
36
34
|
|
|
37
35
|
|
|
38
36
|
METADATA_VALUE_MAX_LENGTH = 5120
|
|
39
37
|
|
|
40
38
|
|
|
39
|
+
def _add_alias(data: dict[str, Any], base_model: type[BaseModel]) -> None:
|
|
40
|
+
for field_name, field_ in base_model.model_fields.items():
|
|
41
|
+
if field_name not in data and field_.alias in data:
|
|
42
|
+
data[field_name] = data[field_.alias]
|
|
43
|
+
|
|
44
|
+
|
|
41
45
|
def replace_nan_floats_with_default(values: dict, model_fields: dict[str, FieldInfo]) -> dict:
|
|
42
46
|
output = {}
|
|
43
47
|
for field_name, value in values.items():
|
|
@@ -253,26 +257,33 @@ class BaseRules(RuleModel):
|
|
|
253
257
|
|
|
254
258
|
Args:
|
|
255
259
|
metadata: Data model metadata
|
|
256
|
-
classes: Classes defined in the data model
|
|
257
|
-
properties: Class properties defined in the data model with accompanying transformation rules
|
|
258
|
-
to transform data from source to target representation
|
|
259
|
-
prefixes: Prefixes used in the data model. Defaults to PREFIXES
|
|
260
|
-
instances: Instances defined in the data model. Defaults to None
|
|
261
260
|
validators_to_skip: List of validators to skip. Defaults to []
|
|
262
261
|
"""
|
|
263
262
|
|
|
264
263
|
metadata: BaseMetadata
|
|
265
264
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
"""
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
265
|
+
def dump(
|
|
266
|
+
self,
|
|
267
|
+
mode: Literal["python", "json"] = "python",
|
|
268
|
+
by_alias: bool = False,
|
|
269
|
+
exclude: IncEx = None,
|
|
270
|
+
exclude_none: bool = False,
|
|
271
|
+
exclude_unset: bool = False,
|
|
272
|
+
exclude_defaults: bool = False,
|
|
273
|
+
as_reference: bool = False,
|
|
274
|
+
) -> dict[str, Any]:
|
|
275
|
+
"""Dump the model to a dictionary.
|
|
276
|
+
|
|
277
|
+
This is used in the Exporters to dump rules in the required format.
|
|
274
278
|
"""
|
|
275
|
-
|
|
279
|
+
return self.model_dump(
|
|
280
|
+
mode=mode,
|
|
281
|
+
by_alias=by_alias,
|
|
282
|
+
exclude=exclude,
|
|
283
|
+
exclude_none=exclude_none,
|
|
284
|
+
exclude_unset=exclude_unset,
|
|
285
|
+
exclude_defaults=exclude_defaults,
|
|
286
|
+
)
|
|
276
287
|
|
|
277
288
|
|
|
278
289
|
# An sheet entity is either a class or a property.
|
|
@@ -105,6 +105,8 @@ class _DMSRulesConverter:
|
|
|
105
105
|
prefix = metadata.space
|
|
106
106
|
return InformationMetadata(
|
|
107
107
|
schema_=metadata.schema_,
|
|
108
|
+
data_model_type=metadata.data_model_type,
|
|
109
|
+
extension=metadata.extension,
|
|
108
110
|
prefix=prefix,
|
|
109
111
|
namespace=Namespace(f"https://purl.orgl/neat/{prefix}/"),
|
|
110
112
|
version=metadata.version,
|