cognite-neat 0.84.1__tar.gz → 0.85.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/PKG-INFO +3 -1
- cognite_neat-0.85.1/cognite/neat/__init__.py +4 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/_shared.py +17 -1
- cognite_neat-0.85.1/cognite/neat/_version.py +1 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/__init__.py +22 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_base.py +5 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_assets.py +7 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_events.py +7 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_files.py +10 -3
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_labels.py +7 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_relationships.py +7 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_sequences.py +7 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_timeseries.py +7 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_dexpi.py +1 -1
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_rdf_file.py +8 -0
- cognite_neat-0.85.1/cognite/neat/graph/loaders/__init__.py +23 -0
- cognite_neat-0.85.1/cognite/neat/graph/loaders/_base.py +86 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/loaders/_rdf2dms.py +21 -9
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/queries/_base.py +24 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/stores/_base.py +10 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/stores/_provenance.py +11 -3
- cognite_neat-0.85.1/cognite/neat/rules/exporters/__init__.py +37 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/exporters/_base.py +5 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/exporters/_rules2dms.py +1 -1
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/exporters/_rules2ontology.py +6 -0
- cognite_neat-0.85.1/cognite/neat/rules/importers/__init__.py +38 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_base.py +5 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_dms2rules.py +10 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +1 -1
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_inference2rules.py +8 -4
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_spreadsheet2rules.py +17 -0
- cognite_neat-0.85.1/cognite/neat/utils/auth.py +305 -0
- cognite_neat-0.85.1/cognite/neat/utils/auxiliary.py +35 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/upload.py +5 -42
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/pyproject.toml +6 -2
- cognite_neat-0.84.1/cognite/neat/__init__.py +0 -3
- cognite_neat-0.84.1/cognite/neat/_version.py +0 -1
- cognite_neat-0.84.1/cognite/neat/graph/loaders/__init__.py +0 -4
- cognite_neat-0.84.1/cognite/neat/graph/loaders/_base.py +0 -109
- cognite_neat-0.84.1/cognite/neat/rules/exporters/__init__.py +0 -15
- cognite_neat-0.84.1/cognite/neat/rules/importers/__init__.py +0 -18
- cognite_neat-0.84.1/cognite/neat/utils/auxiliary.py +0 -11
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/LICENSE +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/README.md +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/config.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/_shared.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/_tracking/base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/_tracking/log.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/issues/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/issues/loader.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/loaders/_rdf2asset.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/queries/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/queries/_construct.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/queries/_shared.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/stores/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/transformers/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/transformers/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/issues.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/stores/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/analysis/_information_rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/_constants.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/asset/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/asset/_converter.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/asset/_rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/asset/_rules_input.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/asset/_serializer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/asset/_validation.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/data_types.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/_converter.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/_rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/_schema.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/_serializer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/domain.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/entities.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/information/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/information/_converter.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/information/_rules.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/information/_serializer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/information/_validation.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/rules/models/wrapped_entities.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/cdf_classes.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/utils/utils.py +0 -0
- /cognite_neat-0.84.1/cognite/neat/utils/xml.py → /cognite_neat-0.85.1/cognite/neat/utils/xml_.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/workflows/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.85.1
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Home-page: https://cognite-neat.readthedocs-hosted.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -16,6 +16,7 @@ Provides-Extra: all
|
|
|
16
16
|
Provides-Extra: docs
|
|
17
17
|
Provides-Extra: google
|
|
18
18
|
Provides-Extra: graphql
|
|
19
|
+
Provides-Extra: jupyter
|
|
19
20
|
Provides-Extra: oxi
|
|
20
21
|
Provides-Extra: service
|
|
21
22
|
Requires-Dist: PyYAML
|
|
@@ -46,6 +47,7 @@ Requires-Dist: pymdown-extensions ; extra == "docs"
|
|
|
46
47
|
Requires-Dist: pyoxigraph (==0.3.19) ; extra == "oxi" or extra == "all"
|
|
47
48
|
Requires-Dist: rdflib
|
|
48
49
|
Requires-Dist: requests
|
|
50
|
+
Requires-Dist: rich[jupyter] (>=13.7.1,<14.0.0) ; extra == "jupyter"
|
|
49
51
|
Requires-Dist: schedule (>=1,<2) ; extra == "service" or extra == "all"
|
|
50
52
|
Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
|
|
51
53
|
Requires-Dist: typing_extensions (>=4.8,<5.0) ; python_version < "3.11"
|
|
@@ -17,8 +17,24 @@ class NeatObject:
|
|
|
17
17
|
"""Return a dictionary representation of the object."""
|
|
18
18
|
raise NotImplementedError()
|
|
19
19
|
|
|
20
|
+
def _repr_html_(self) -> str:
|
|
21
|
+
return pd.Series(self.dump(aggregate=True)).to_frame(name="value")._repr_html_()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass(frozen=True)
|
|
25
|
+
class FrozenNeatObject:
|
|
26
|
+
"""A frozen neat object can be dumped to a dictionary."""
|
|
27
|
+
|
|
28
|
+
@abstractmethod
|
|
29
|
+
def dump(self, aggregate: bool = True) -> dict[str, Any]:
|
|
30
|
+
"""Return a dictionary representation of the object."""
|
|
31
|
+
raise NotImplementedError()
|
|
32
|
+
|
|
33
|
+
def _repr_html_(self) -> str:
|
|
34
|
+
return pd.Series(self.dump(aggregate=True)).to_frame(name="value")._repr_html_()
|
|
35
|
+
|
|
20
36
|
|
|
21
|
-
T_NeatObject = TypeVar("T_NeatObject", bound=NeatObject)
|
|
37
|
+
T_NeatObject = TypeVar("T_NeatObject", bound=NeatObject | FrozenNeatObject)
|
|
22
38
|
|
|
23
39
|
|
|
24
40
|
class NeatList(list, Sequence[T_NeatObject]):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.85.1"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from ._base import BaseExtractor
|
|
1
2
|
from ._classic_cdf._assets import AssetsExtractor
|
|
2
3
|
from ._classic_cdf._events import EventsExtractor
|
|
3
4
|
from ._classic_cdf._files import FilesExtractor
|
|
@@ -10,6 +11,7 @@ from ._mock_graph_generator import MockGraphGenerator
|
|
|
10
11
|
from ._rdf_file import RdfFileExtractor
|
|
11
12
|
|
|
12
13
|
__all__ = [
|
|
14
|
+
"BaseExtractor",
|
|
13
15
|
"AssetsExtractor",
|
|
14
16
|
"MockGraphGenerator",
|
|
15
17
|
"RelationshipsExtractor",
|
|
@@ -35,3 +37,23 @@ TripleExtractors = (
|
|
|
35
37
|
| RdfFileExtractor
|
|
36
38
|
| DexpiExtractor
|
|
37
39
|
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _repr_html_() -> str:
|
|
43
|
+
import pandas as pd
|
|
44
|
+
|
|
45
|
+
table = pd.DataFrame( # type: ignore[operator]
|
|
46
|
+
[
|
|
47
|
+
{
|
|
48
|
+
"Extractor": name,
|
|
49
|
+
"Description": globals()[name].__doc__.strip().split("\n")[0] if globals()[name].__doc__ else "Missing",
|
|
50
|
+
}
|
|
51
|
+
for name in __all__
|
|
52
|
+
if name != "BaseExtractor"
|
|
53
|
+
]
|
|
54
|
+
)._repr_html_()
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
"<strong>Extractor</strong> An extractor is used to read data from "
|
|
58
|
+
f"a source into Neat's internal triple storage. <br />{table}"
|
|
59
|
+
)
|
|
@@ -2,6 +2,7 @@ from abc import abstractmethod
|
|
|
2
2
|
from collections.abc import Iterable
|
|
3
3
|
|
|
4
4
|
from cognite.neat.graph.models import Triple
|
|
5
|
+
from cognite.neat.utils.auxiliary import class_html_doc
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class BaseExtractor:
|
|
@@ -12,3 +13,7 @@ class BaseExtractor:
|
|
|
12
13
|
@abstractmethod
|
|
13
14
|
def extract(self) -> Iterable[Triple]:
|
|
14
15
|
raise NotImplementedError()
|
|
16
|
+
|
|
17
|
+
@classmethod
|
|
18
|
+
def _repr_html_(cls) -> str:
|
|
19
|
+
return class_html_doc(cls)
|
{cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_assets.py
RENAMED
|
@@ -14,6 +14,13 @@ from cognite.neat.utils.utils import create_sha256_hash, string_to_ideal_type
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class AssetsExtractor(BaseExtractor):
|
|
17
|
+
"""Extract data from Cognite Data Fusions Assets into Neat.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
assets (Iterable[Asset]): An iterable of assets.
|
|
21
|
+
namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
|
|
22
|
+
"""
|
|
23
|
+
|
|
17
24
|
def __init__(
|
|
18
25
|
self,
|
|
19
26
|
assets: Iterable[Asset],
|
{cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_events.py
RENAMED
|
@@ -15,6 +15,13 @@ from cognite.neat.utils.utils import string_to_ideal_type
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class EventsExtractor(BaseExtractor):
|
|
18
|
+
"""Extract data from Cognite Data Fusions Events into Neat.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
events (Iterable[Event]): An iterable of events.
|
|
22
|
+
namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
|
|
23
|
+
"""
|
|
24
|
+
|
|
18
25
|
def __init__(
|
|
19
26
|
self,
|
|
20
27
|
events: Iterable[Event],
|
{cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_files.py
RENAMED
|
@@ -16,13 +16,20 @@ from cognite.neat.utils.utils import string_to_ideal_type
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class FilesExtractor(BaseExtractor):
|
|
19
|
+
"""Extract data from Cognite Data Fusions files metadata into Neat.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
files_metadata (Iterable[FileMetadata]): An iterable of files metadata.
|
|
23
|
+
namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
|
|
24
|
+
"""
|
|
25
|
+
|
|
19
26
|
def __init__(
|
|
20
27
|
self,
|
|
21
|
-
|
|
28
|
+
files_metadata: Iterable[FileMetadata],
|
|
22
29
|
namespace: Namespace | None = None,
|
|
23
30
|
):
|
|
24
31
|
self.namespace = namespace or DEFAULT_NAMESPACE
|
|
25
|
-
self.
|
|
32
|
+
self.files_metadata = files_metadata
|
|
26
33
|
|
|
27
34
|
@classmethod
|
|
28
35
|
def from_dataset(
|
|
@@ -39,7 +46,7 @@ class FilesExtractor(BaseExtractor):
|
|
|
39
46
|
|
|
40
47
|
def extract(self) -> Iterable[Triple]:
|
|
41
48
|
"""Extract files metadata as triples."""
|
|
42
|
-
for event in self.
|
|
49
|
+
for event in self.files_metadata:
|
|
43
50
|
yield from self._file2triples(event, self.namespace)
|
|
44
51
|
|
|
45
52
|
@classmethod
|
{cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_labels.py
RENAMED
|
@@ -14,6 +14,13 @@ from cognite.neat.utils.utils import create_sha256_hash
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class LabelsExtractor(BaseExtractor):
|
|
17
|
+
"""Extract data from Cognite Data Fusions Labels into Neat.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
labels (Iterable[LabelDefinition]): An iterable of labels.
|
|
21
|
+
namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
|
|
22
|
+
"""
|
|
23
|
+
|
|
17
24
|
def __init__(
|
|
18
25
|
self,
|
|
19
26
|
labels: Iterable[LabelDefinition],
|
|
@@ -15,6 +15,13 @@ from cognite.neat.utils.utils import create_sha256_hash
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class RelationshipsExtractor(BaseExtractor):
|
|
18
|
+
"""Extract data from Cognite Data Fusions Relationships into Neat.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
relationships (Iterable[Asset]): An iterable of relationships.
|
|
22
|
+
namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
|
|
23
|
+
"""
|
|
24
|
+
|
|
18
25
|
def __init__(
|
|
19
26
|
self,
|
|
20
27
|
relationships: Iterable[Relationship],
|
{cognite_neat-0.84.1 → cognite_neat-0.85.1}/cognite/neat/graph/extractors/_classic_cdf/_sequences.py
RENAMED
|
@@ -15,6 +15,13 @@ from cognite.neat.utils.utils import string_to_ideal_type
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class SequencesExtractor(BaseExtractor):
|
|
18
|
+
"""Extract data from Cognite Data Fusions Sequences into Neat.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
sequence (Iterable[Sequence]): An iterable of sequences.
|
|
22
|
+
namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
|
|
23
|
+
"""
|
|
24
|
+
|
|
18
25
|
def __init__(
|
|
19
26
|
self,
|
|
20
27
|
sequence: Iterable[Sequence],
|
|
@@ -15,6 +15,13 @@ from cognite.neat.utils.utils import string_to_ideal_type
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class TimeSeriesExtractor(BaseExtractor):
|
|
18
|
+
"""Extract data from Cognite Data Fusions TimeSeries into Neat.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
timeseries (Iterable[TimeSeries]): An iterable of timeseries.
|
|
22
|
+
namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
|
|
23
|
+
"""
|
|
24
|
+
|
|
18
25
|
def __init__(
|
|
19
26
|
self,
|
|
20
27
|
timeseries: Iterable[TimeSeries],
|
|
@@ -10,7 +10,7 @@ from cognite.neat.constants import DEFAULT_NAMESPACE
|
|
|
10
10
|
from cognite.neat.graph.extractors._base import BaseExtractor
|
|
11
11
|
from cognite.neat.graph.models import Triple
|
|
12
12
|
from cognite.neat.utils.utils import as_neat_compliant_uri
|
|
13
|
-
from cognite.neat.utils.
|
|
13
|
+
from cognite.neat.utils.xml_ import get_children, iterate_tree
|
|
14
14
|
|
|
15
15
|
DEXPI = Namespace("http://sandbox.dexpi.org/rdl/")
|
|
16
16
|
QUDT = Namespace("https://qudt.org/vocab/unit/")
|
|
@@ -7,6 +7,14 @@ from cognite.neat.graph.extractors._base import BaseExtractor
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class RdfFileExtractor(BaseExtractor):
|
|
10
|
+
"""Extract data from RDF files into Neat.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
filepath (Path): The path to the RDF file.
|
|
14
|
+
mime_type (MIMETypes, optional): The MIME type of the RDF file. Defaults to "application/rdf+xml".
|
|
15
|
+
base_uri (URIRef, optional): The base URI to use. Defaults to None.
|
|
16
|
+
"""
|
|
17
|
+
|
|
10
18
|
def __init__(
|
|
11
19
|
self,
|
|
12
20
|
filepath: Path,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from ._base import BaseLoader, CDFLoader
|
|
2
|
+
from ._rdf2dms import DMSLoader
|
|
3
|
+
|
|
4
|
+
__all__ = ["BaseLoader", "CDFLoader", "DMSLoader"]
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _repr_html_() -> str:
|
|
8
|
+
import pandas as pd
|
|
9
|
+
|
|
10
|
+
table = pd.DataFrame( # type: ignore[operator]
|
|
11
|
+
[
|
|
12
|
+
{
|
|
13
|
+
"Loader": name,
|
|
14
|
+
"Description": globals()[name].__doc__.strip().split("\n")[0] if globals()[name].__doc__ else "Missing",
|
|
15
|
+
}
|
|
16
|
+
for name in __all__
|
|
17
|
+
if name not in ("BaseLoader", "CDFLoader")
|
|
18
|
+
]
|
|
19
|
+
)._repr_html_()
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
"<strong>Loader</strong> A loader writes data from Neat's triple storage into a target system" f"<br />{table}"
|
|
23
|
+
)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from collections.abc import Hashable, Iterable
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import ClassVar, Generic, TypeVar
|
|
5
|
+
|
|
6
|
+
from cognite.client import CogniteClient
|
|
7
|
+
from cognite.client.data_classes.capabilities import Capability
|
|
8
|
+
|
|
9
|
+
from cognite.neat.graph import NeatGraphStore
|
|
10
|
+
from cognite.neat.graph.issues.loader import FailedAuthorizationError
|
|
11
|
+
from cognite.neat.issues import NeatIssue, NeatIssueList
|
|
12
|
+
from cognite.neat.utils.auxiliary import class_html_doc
|
|
13
|
+
from cognite.neat.utils.upload import UploadResult, UploadResultList
|
|
14
|
+
|
|
15
|
+
T_Output = TypeVar("T_Output")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BaseLoader(ABC, Generic[T_Output]):
|
|
19
|
+
_new_line = "\n"
|
|
20
|
+
_encoding = "utf-8"
|
|
21
|
+
|
|
22
|
+
def __init__(self, graph_store: NeatGraphStore):
|
|
23
|
+
self.graph_store = graph_store
|
|
24
|
+
|
|
25
|
+
@abstractmethod
|
|
26
|
+
def write_to_file(self, filepath: Path) -> None:
|
|
27
|
+
raise NotImplementedError
|
|
28
|
+
|
|
29
|
+
def load(self, stop_on_exception: bool = False) -> Iterable[T_Output | NeatIssue]:
|
|
30
|
+
"""Load the graph with data."""
|
|
31
|
+
return self._load(stop_on_exception)
|
|
32
|
+
|
|
33
|
+
@abstractmethod
|
|
34
|
+
def _load(self, stop_on_exception: bool = False) -> Iterable[T_Output | NeatIssue]:
|
|
35
|
+
"""Load the graph with data."""
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def _repr_html_(cls) -> str:
|
|
40
|
+
return class_html_doc(cls)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class CDFLoader(BaseLoader[T_Output]):
|
|
44
|
+
_UPLOAD_BATCH_SIZE: ClassVar[int] = 1000
|
|
45
|
+
|
|
46
|
+
def load_into_cdf(self, client: CogniteClient, dry_run: bool = False) -> UploadResultList:
|
|
47
|
+
return UploadResultList(self.load_into_cdf_iterable(client, dry_run))
|
|
48
|
+
|
|
49
|
+
def load_into_cdf_iterable(self, client: CogniteClient, dry_run: bool = False) -> Iterable[UploadResult]:
|
|
50
|
+
missing_capabilities = client.iam.verify_capabilities(self._get_required_capabilities())
|
|
51
|
+
if missing_capabilities:
|
|
52
|
+
upload_result = UploadResult[Hashable](name=type(self).__name__)
|
|
53
|
+
upload_result.issues.append(
|
|
54
|
+
FailedAuthorizationError(action="Upload to CDF", reason=str(missing_capabilities))
|
|
55
|
+
)
|
|
56
|
+
yield upload_result
|
|
57
|
+
return
|
|
58
|
+
|
|
59
|
+
issues = NeatIssueList[NeatIssue]()
|
|
60
|
+
items: list[T_Output] = []
|
|
61
|
+
for result in self.load(stop_on_exception=False):
|
|
62
|
+
if isinstance(result, NeatIssue):
|
|
63
|
+
issues.append(result)
|
|
64
|
+
else:
|
|
65
|
+
items.append(result)
|
|
66
|
+
|
|
67
|
+
if len(items) >= self._UPLOAD_BATCH_SIZE:
|
|
68
|
+
yield self._upload_to_cdf(client, items, dry_run, issues)
|
|
69
|
+
issues = NeatIssueList[NeatIssue]()
|
|
70
|
+
items = []
|
|
71
|
+
if items:
|
|
72
|
+
yield self._upload_to_cdf(client, items, dry_run, issues)
|
|
73
|
+
|
|
74
|
+
@abstractmethod
|
|
75
|
+
def _get_required_capabilities(self) -> list[Capability]:
|
|
76
|
+
raise NotImplementedError
|
|
77
|
+
|
|
78
|
+
@abstractmethod
|
|
79
|
+
def _upload_to_cdf(
|
|
80
|
+
self,
|
|
81
|
+
client: CogniteClient,
|
|
82
|
+
items: list[T_Output],
|
|
83
|
+
dry_run: bool,
|
|
84
|
+
read_issues: NeatIssueList,
|
|
85
|
+
) -> UploadResult:
|
|
86
|
+
raise NotImplementedError
|
|
@@ -10,6 +10,7 @@ from cognite.client import CogniteClient
|
|
|
10
10
|
from cognite.client import data_modeling as dm
|
|
11
11
|
from cognite.client.data_classes.capabilities import Capability, DataModelInstancesAcl
|
|
12
12
|
from cognite.client.data_classes.data_modeling import ViewId
|
|
13
|
+
from cognite.client.data_classes.data_modeling.ids import InstanceId
|
|
13
14
|
from cognite.client.data_classes.data_modeling.views import SingleEdgeConnection
|
|
14
15
|
from cognite.client.exceptions import CogniteAPIError
|
|
15
16
|
from pydantic import ValidationInfo, create_model, field_validator
|
|
@@ -21,13 +22,24 @@ from cognite.neat.graph.stores import NeatGraphStore
|
|
|
21
22
|
from cognite.neat.issues import NeatIssue, NeatIssueList
|
|
22
23
|
from cognite.neat.rules.models import DMSRules
|
|
23
24
|
from cognite.neat.rules.models.data_types import _DATA_TYPE_BY_DMS_TYPE
|
|
24
|
-
from cognite.neat.utils.upload import
|
|
25
|
+
from cognite.neat.utils.upload import UploadResult
|
|
25
26
|
from cognite.neat.utils.utils import create_sha256_hash
|
|
26
27
|
|
|
27
28
|
from ._base import CDFLoader
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
32
|
+
"""Load data from Cognite Data Fusions Data Modeling Service (DMS) into Neat.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
graph_store (NeatGraphStore): The graph store to load the data into.
|
|
36
|
+
data_model (dm.DataModel[dm.View] | None): The data model to load.
|
|
37
|
+
instance_space (str): The instance space to load the data into.
|
|
38
|
+
class_by_view_id (dict[ViewId, str] | None): A mapping from view id to class name. Defaults to None.
|
|
39
|
+
creat_issues (Sequence[NeatIssue] | None): A list of issues that occurred during reading. Defaults to None.
|
|
40
|
+
tracker (type[Tracker] | None): The tracker to use. Defaults to None.
|
|
41
|
+
"""
|
|
42
|
+
|
|
31
43
|
def __init__(
|
|
32
44
|
self,
|
|
33
45
|
graph_store: NeatGraphStore,
|
|
@@ -243,11 +255,10 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
243
255
|
self,
|
|
244
256
|
client: CogniteClient,
|
|
245
257
|
items: list[dm.InstanceApply],
|
|
246
|
-
return_diffs: bool,
|
|
247
258
|
dry_run: bool,
|
|
248
259
|
read_issues: NeatIssueList,
|
|
249
|
-
) ->
|
|
250
|
-
result =
|
|
260
|
+
) -> UploadResult:
|
|
261
|
+
result = UploadResult[InstanceId](name=type(self).__name__, issues=read_issues)
|
|
251
262
|
try:
|
|
252
263
|
nodes = [item for item in items if isinstance(item, dm.NodeApply)]
|
|
253
264
|
edges = [item for item in items if isinstance(item, dm.EdgeApply)]
|
|
@@ -260,16 +271,17 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
260
271
|
)
|
|
261
272
|
except CogniteAPIError as e:
|
|
262
273
|
result.error_messages.append(str(e))
|
|
263
|
-
result.
|
|
274
|
+
result.failed_upserted.update(item.as_id() for item in e.failed + e.unknown)
|
|
275
|
+
result.created.update(item.as_id() for item in e.successful)
|
|
264
276
|
else:
|
|
265
277
|
for instance in itertools.chain(upserted.nodes, upserted.edges):
|
|
266
278
|
if instance.was_modified and instance.created_time == instance.last_updated_time:
|
|
267
|
-
result.created.
|
|
279
|
+
result.created.add(instance.as_id())
|
|
268
280
|
elif instance.was_modified:
|
|
269
|
-
result.changed.
|
|
281
|
+
result.changed.add(instance.as_id())
|
|
270
282
|
else:
|
|
271
|
-
result.unchanged.
|
|
272
|
-
return result
|
|
283
|
+
result.unchanged.add(instance.as_id())
|
|
284
|
+
return result
|
|
273
285
|
|
|
274
286
|
|
|
275
287
|
def _triples2dictionary(
|
|
@@ -97,3 +97,27 @@ class Queries:
|
|
|
97
97
|
else:
|
|
98
98
|
warnings.warn("No rules found for the graph store, returning empty list.", stacklevel=2)
|
|
99
99
|
return []
|
|
100
|
+
|
|
101
|
+
def list_triples(self, limit: int = 25) -> list[ResultRow]:
|
|
102
|
+
"""List triples in the graph store
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
limit: Max number of triples to return, by default 25
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
List of triples
|
|
109
|
+
"""
|
|
110
|
+
query = f"SELECT ?subject ?predicate ?object WHERE {{ ?subject ?predicate ?object }} LIMIT {limit}"
|
|
111
|
+
return cast(list[ResultRow], list(self.graph.query(query)))
|
|
112
|
+
|
|
113
|
+
def list_types(self, limit: int = 25) -> list[ResultRow]:
|
|
114
|
+
"""List types in the graph store
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
limit: Max number of types to return, by default 25
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
List of types
|
|
121
|
+
"""
|
|
122
|
+
query = f"SELECT DISTINCT ?type WHERE {{ ?subject a ?type }} LIMIT {limit}"
|
|
123
|
+
return cast(list[ResultRow], list(self.graph.query(query)))
|
|
@@ -282,3 +282,13 @@ class NeatGraphStore:
|
|
|
282
282
|
description=transformer.description,
|
|
283
283
|
)
|
|
284
284
|
)
|
|
285
|
+
|
|
286
|
+
def _repr_html_(self) -> str:
|
|
287
|
+
provenance = self.provenance._repr_html_()
|
|
288
|
+
|
|
289
|
+
return (
|
|
290
|
+
f"<strong>{type(self).__name__}</strong> A graph store is a container for storing triples. "
|
|
291
|
+
"It can be queried and transformed to extract information.<br />"
|
|
292
|
+
"<strong>Provenance</strong> Provenance is a record of changes that have occurred in the graph store.<br />"
|
|
293
|
+
f"{provenance}"
|
|
294
|
+
)
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
import uuid
|
|
11
|
-
from collections import UserList
|
|
12
11
|
from collections.abc import Sequence
|
|
13
12
|
from dataclasses import dataclass
|
|
14
13
|
from datetime import datetime
|
|
@@ -16,6 +15,7 @@ from typing import TypeVar
|
|
|
16
15
|
|
|
17
16
|
from rdflib import PROV, RDF, Literal, URIRef
|
|
18
17
|
|
|
18
|
+
from cognite.neat._shared import FrozenNeatObject, NeatList
|
|
19
19
|
from cognite.neat.constants import DEFAULT_NAMESPACE
|
|
20
20
|
|
|
21
21
|
|
|
@@ -64,7 +64,7 @@ class Entity:
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
@dataclass(frozen=True)
|
|
67
|
-
class Change:
|
|
67
|
+
class Change(FrozenNeatObject):
|
|
68
68
|
agent: Agent
|
|
69
69
|
activity: Activity
|
|
70
70
|
entity: Entity
|
|
@@ -81,11 +81,19 @@ class Change:
|
|
|
81
81
|
entity = Entity(was_generated_by=activity, was_attributed_to=agent)
|
|
82
82
|
return cls(agent, activity, entity, description)
|
|
83
83
|
|
|
84
|
+
def dump(self, aggregate: bool = True) -> dict[str, str]:
|
|
85
|
+
return {
|
|
86
|
+
"Agent": self.agent.id_,
|
|
87
|
+
"Activity": self.activity.id_,
|
|
88
|
+
"Entity": self.entity.id_,
|
|
89
|
+
"Description": self.description,
|
|
90
|
+
}
|
|
91
|
+
|
|
84
92
|
|
|
85
93
|
T_Change = TypeVar("T_Change", bound=Change)
|
|
86
94
|
|
|
87
95
|
|
|
88
|
-
class Provenance(
|
|
96
|
+
class Provenance(NeatList[Change]):
|
|
89
97
|
def __init__(self, changes: Sequence[T_Change] | None = None):
|
|
90
98
|
super().__init__(changes or [])
|
|
91
99
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from ._base import BaseExporter, CDFExporter
|
|
2
|
+
from ._rules2dms import DMSExporter
|
|
3
|
+
from ._rules2excel import ExcelExporter
|
|
4
|
+
from ._rules2ontology import GraphExporter, OWLExporter, SemanticDataModelExporter, SHACLExporter
|
|
5
|
+
from ._rules2yaml import YAMLExporter
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"BaseExporter",
|
|
9
|
+
"DMSExporter",
|
|
10
|
+
"CDFExporter",
|
|
11
|
+
"SemanticDataModelExporter",
|
|
12
|
+
"OWLExporter",
|
|
13
|
+
"GraphExporter",
|
|
14
|
+
"SHACLExporter",
|
|
15
|
+
"ExcelExporter",
|
|
16
|
+
"YAMLExporter",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _repr_html_() -> str:
|
|
21
|
+
import pandas as pd
|
|
22
|
+
|
|
23
|
+
table = pd.DataFrame( # type: ignore[operator]
|
|
24
|
+
[
|
|
25
|
+
{
|
|
26
|
+
"Exporter": name,
|
|
27
|
+
"Description": globals()[name].__doc__.strip().split("\n")[0] if globals()[name].__doc__ else "Missing",
|
|
28
|
+
}
|
|
29
|
+
for name in __all__
|
|
30
|
+
if name not in ("BaseExporter", "CDFExporter", "GraphExporter")
|
|
31
|
+
]
|
|
32
|
+
)._repr_html_()
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
"<strong>Exporter</strong> An exporter converts Neat's representation of a data model called <em>Rules</em>"
|
|
36
|
+
f" into a schema/data model for a target format.<br />{table}"
|
|
37
|
+
)
|
|
@@ -7,6 +7,7 @@ from cognite.client import CogniteClient
|
|
|
7
7
|
|
|
8
8
|
from cognite.neat.rules._shared import Rules
|
|
9
9
|
from cognite.neat.rules.models import DMSRules, InformationRules, RoleTypes
|
|
10
|
+
from cognite.neat.utils.auxiliary import class_html_doc
|
|
10
11
|
from cognite.neat.utils.upload import UploadResult, UploadResultList
|
|
11
12
|
|
|
12
13
|
T_Export = TypeVar("T_Export")
|
|
@@ -34,6 +35,10 @@ class BaseExporter(ABC, Generic[T_Export]):
|
|
|
34
35
|
else:
|
|
35
36
|
raise NotImplementedError(f"Role {output_role} is not supported for {type(rules).__name__} rules")
|
|
36
37
|
|
|
38
|
+
@classmethod
|
|
39
|
+
def _repr_html_(cls) -> str:
|
|
40
|
+
return class_html_doc(cls, include_factory_methods=False)
|
|
41
|
+
|
|
37
42
|
|
|
38
43
|
class CDFExporter(BaseExporter[T_Export]):
|
|
39
44
|
@abstractmethod
|
|
@@ -39,7 +39,7 @@ Component: TypeAlias = Literal["all", "spaces", "data_models", "views", "contain
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class DMSExporter(CDFExporter[DMSSchema]):
|
|
42
|
-
"""
|
|
42
|
+
"""Export rules to Cognite Data Fusion's Data Model Storage (DMS) service.
|
|
43
43
|
|
|
44
44
|
Args:
|
|
45
45
|
export_components (frozenset[Literal["all", "spaces", "data_models", "views", "containers"]], optional):
|
|
@@ -39,16 +39,22 @@ class GraphExporter(BaseExporter[Graph], ABC):
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class OWLExporter(GraphExporter):
|
|
42
|
+
"""Exports rules to an OWL ontology."""
|
|
43
|
+
|
|
42
44
|
def export(self, rules: Rules) -> Graph:
|
|
43
45
|
return Ontology.from_rules(rules).as_owl()
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
class SHACLExporter(GraphExporter):
|
|
49
|
+
"""Exports rules to a SHACL graph."""
|
|
50
|
+
|
|
47
51
|
def export(self, rules: Rules) -> Graph:
|
|
48
52
|
return Ontology.from_rules(rules).as_shacl()
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
class SemanticDataModelExporter(GraphExporter):
|
|
56
|
+
"""Exports rules to a semantic data model."""
|
|
57
|
+
|
|
52
58
|
def export(self, rules: Rules) -> Graph:
|
|
53
59
|
return Ontology.from_rules(rules).as_semantic_data_model()
|
|
54
60
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from ._base import BaseImporter
|
|
2
|
+
from ._dms2rules import DMSImporter
|
|
3
|
+
from ._dtdl2rules import DTDLImporter
|
|
4
|
+
from ._inference2rules import InferenceImporter
|
|
5
|
+
from ._owl2rules import OWLImporter
|
|
6
|
+
from ._spreadsheet2rules import ExcelImporter, GoogleSheetImporter
|
|
7
|
+
from ._yaml2rules import YAMLImporter
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"BaseImporter",
|
|
11
|
+
"OWLImporter",
|
|
12
|
+
"DMSImporter",
|
|
13
|
+
"ExcelImporter",
|
|
14
|
+
"GoogleSheetImporter",
|
|
15
|
+
"DTDLImporter",
|
|
16
|
+
"YAMLImporter",
|
|
17
|
+
"InferenceImporter",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _repr_html_() -> str:
|
|
22
|
+
import pandas as pd
|
|
23
|
+
|
|
24
|
+
table = pd.DataFrame( # type: ignore[operator]
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
"Importer": name,
|
|
28
|
+
"Description": globals()[name].__doc__.strip().split("\n")[0] if globals()[name].__doc__ else "Missing",
|
|
29
|
+
}
|
|
30
|
+
for name in __all__
|
|
31
|
+
if name != "BaseImporter"
|
|
32
|
+
]
|
|
33
|
+
)._repr_html_()
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
"<strong>Importer</strong> An importer reads data/schema/data model from a source"
|
|
37
|
+
f" and converts it into Neat's representation of a data model called <em>Rules</em>.<br />{table}"
|
|
38
|
+
)
|