cognite-neat 0.78.5__tar.gz → 0.80.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/PKG-INFO +1 -1
- cognite_neat-0.80.0/cognite/neat/_version.py +1 -0
- cognite_neat-0.80.0/cognite/neat/graph/__init__.py +3 -0
- cognite_neat-0.80.0/cognite/neat/graph/_shared.py +5 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/__init__.py +15 -0
- cognite_neat-0.80.0/cognite/neat/graph/extractors/_rdf_file.py +18 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/loaders/_base.py +2 -2
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/loaders/_rdf2dms.py +4 -4
- cognite_neat-0.80.0/cognite/neat/graph/stores/__init__.py +3 -0
- cognite_neat-0.80.0/cognite/neat/graph/stores/_base.py +257 -0
- cognite_neat-0.80.0/cognite/neat/graph/stores/_provenance.py +99 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_inference2rules.py +2 -2
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/pyproject.toml +1 -1
- cognite_neat-0.78.5/cognite/neat/_version.py +0 -1
- cognite_neat-0.78.5/cognite/neat/graph/stores/_base.py +0 -378
- cognite_neat-0.78.5/cognite/neat/legacy/graph/__init__.py +0 -3
- cognite_neat-0.78.5/cognite/neat/legacy/graph/stores/__init__.py +0 -13
- cognite_neat-0.78.5/cognite/neat/legacy/graph/stores/_graphdb_store.py +0 -51
- cognite_neat-0.78.5/cognite/neat/legacy/graph/stores/_memory_store.py +0 -43
- cognite_neat-0.78.5/cognite/neat/legacy/graph/stores/_oxigraph_store.py +0 -147
- cognite_neat-0.78.5/cognite/neat/legacy/graph/stores/_rdf_to_graph.py +0 -40
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/LICENSE +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/README.md +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/configuration.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/explorer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/routers/configuration.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/routers/core.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/routers/crud.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/routers/data_exploration.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/routers/metrics.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/routers/rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/routers/workflows.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/utils/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/utils/logging.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/main.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/monitoring/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/monitoring/metrics.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/index.html +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/static/css/main.38a62222.css.map +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.LICENSE.txt +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/static/js/main.ec7f72e2.js.map +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/config.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/constants.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/_tracking/base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/_tracking/log.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/examples/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/issues/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/issues/loader.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/models.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/issues.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/__init__.py +0 -0
- {cognite_neat-0.78.5/cognite/neat → cognite_neat-0.80.0/cognite/neat/legacy}/graph/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/examples/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/extractors/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/extractors/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/_asset_loader.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/_exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/core/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/core/labels.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/core/models.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/rdf_to_dms.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/loaders/validator.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/models.py +0 -0
- {cognite_neat-0.78.5/cognite/neat → cognite_neat-0.80.0/cognite/neat/legacy}/graph/stores/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/stores/_base.py +0 -0
- {cognite_neat-0.78.5/cognite/neat → cognite_neat-0.80.0/cognite/neat/legacy}/graph/stores/_graphdb_store.py +0 -0
- {cognite_neat-0.78.5/cognite/neat → cognite_neat-0.80.0/cognite/neat/legacy}/graph/stores/_memory_store.py +0 -0
- {cognite_neat-0.78.5/cognite/neat → cognite_neat-0.80.0/cognite/neat/legacy}/graph/stores/_oxigraph_store.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/stores/_oxrdflib.py +0 -0
- {cognite_neat-0.78.5/cognite/neat → cognite_neat-0.80.0/cognite/neat/legacy}/graph/stores/_rdf_to_graph.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/transformations/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/transformations/entity_matcher.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/transformations/query_generator/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/transformations/query_generator/sparql.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/graph/transformations/transformer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/analysis.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-TNT.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/power-grid-containers.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/power-grid-example.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/power-grid-model.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/rules-template.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/sheet2cdf-transformation-rules.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/skos-rules.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/source-to-solution-mapping-rules.xlsx +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_core/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_core/rules2labels.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_rules2graphql.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_rules2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_rules2triples.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_dict2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_graph2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_json2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_xsd2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/models/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/models/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/models/raw_rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/models/rdfpath.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/models/rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/models/tables.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/rules/models/value_types.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/py.typed +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/_shared.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/analysis/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/analysis/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/analysis/_information_rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/examples/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/examples/wind-energy.owl +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exporters/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exporters/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/exporters/_validation.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/dms.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/fileread.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/formatters.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/importing.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/spreadsheet.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/issues/spreadsheet_file.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/_types/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/_types/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/_types/_field.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/data_types.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/_converter.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/_rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/_schema.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/_serializer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/domain.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/entities.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/information/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/information/_converter.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/information/_rules.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/information/_serializer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/information/_validation.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/models/wrapped_entities.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/auxiliary.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/cdf.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/cdf_classes.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/cdf_loaders/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/cdf_loaders/_base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/cdf_loaders/_data_modeling.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/cdf_loaders/_ingestion.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/cdf_loaders/data_classes.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/spreadsheet.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/text.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/upload.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/utils.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/utils/xml.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/_exceptions.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/base.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/cdf_store.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Export_Rules_to_Ontology/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Extract_DEXPI_Graph_and_Export_Rules/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Extract_RDF_Graph_and_Generate_Assets/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Ontology_to_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Visualize_Data_Model_Using_Mock_Graph/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/examples/Visualize_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/manager.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/migration/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/migration/steps.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/migration/wf_manifests.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/model.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/__init__.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/graph_contextualization.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/graph_extractor.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/graph_loader.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/graph_store.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/graph_transformer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/rules_exporter.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/lib/legacy/rules_importer.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps/step_model.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/steps_registry.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/tasks.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/triggers.py +0 -0
- {cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/workflows/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.80.0"
|
|
@@ -6,6 +6,7 @@ from ._classic_cdf._relationships import RelationshipsExtractor
|
|
|
6
6
|
from ._classic_cdf._sequences import SequencesExtractor
|
|
7
7
|
from ._classic_cdf._timeseries import TimeSeriesExtractor
|
|
8
8
|
from ._mock_graph_generator import MockGraphGenerator
|
|
9
|
+
from ._rdf_file import RdfFileExtractor
|
|
9
10
|
|
|
10
11
|
__all__ = [
|
|
11
12
|
"AssetsExtractor",
|
|
@@ -16,4 +17,18 @@ __all__ = [
|
|
|
16
17
|
"EventsExtractor",
|
|
17
18
|
"FilesExtractor",
|
|
18
19
|
"LabelsExtractor",
|
|
20
|
+
"RdfFileExtractor",
|
|
19
21
|
]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
TripleExtractors = (
|
|
25
|
+
AssetsExtractor
|
|
26
|
+
| MockGraphGenerator
|
|
27
|
+
| RelationshipsExtractor
|
|
28
|
+
| TimeSeriesExtractor
|
|
29
|
+
| SequencesExtractor
|
|
30
|
+
| EventsExtractor
|
|
31
|
+
| FilesExtractor
|
|
32
|
+
| LabelsExtractor
|
|
33
|
+
| RdfFileExtractor
|
|
34
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from rdflib import URIRef
|
|
4
|
+
|
|
5
|
+
from cognite.neat.graph._shared import MIMETypes
|
|
6
|
+
from cognite.neat.graph.extractors._base import BaseExtractor
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RdfFileExtractor(BaseExtractor):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
filepath: Path,
|
|
13
|
+
mime_type: MIMETypes = "application/rdf+xml",
|
|
14
|
+
base_uri: URIRef | None = None,
|
|
15
|
+
):
|
|
16
|
+
self.filepath = filepath
|
|
17
|
+
self.mime_type = mime_type
|
|
18
|
+
self.base_uri = base_uri
|
|
@@ -6,7 +6,7 @@ from typing import ClassVar, Generic, Literal, TypeVar, overload
|
|
|
6
6
|
from cognite.client import CogniteClient
|
|
7
7
|
from cognite.client.data_classes.capabilities import Capability
|
|
8
8
|
|
|
9
|
-
from cognite.neat.graph import
|
|
9
|
+
from cognite.neat.graph import NeatGraphStore
|
|
10
10
|
from cognite.neat.graph.issues.loader import FailedAuthorizationError
|
|
11
11
|
from cognite.neat.issues import NeatIssue, NeatIssueList
|
|
12
12
|
from cognite.neat.utils.upload import UploadDiffsID, UploadResultIDs
|
|
@@ -18,7 +18,7 @@ class BaseLoader(ABC, Generic[T_Output]):
|
|
|
18
18
|
_new_line = "\n"
|
|
19
19
|
_encoding = "utf-8"
|
|
20
20
|
|
|
21
|
-
def __init__(self, graph_store:
|
|
21
|
+
def __init__(self, graph_store: NeatGraphStore):
|
|
22
22
|
self.graph_store = graph_store
|
|
23
23
|
|
|
24
24
|
@abstractmethod
|
|
@@ -17,7 +17,7 @@ from pydantic.main import Model
|
|
|
17
17
|
|
|
18
18
|
from cognite.neat.graph._tracking import LogTracker, Tracker
|
|
19
19
|
from cognite.neat.graph.issues import loader as loader_issues
|
|
20
|
-
from cognite.neat.graph.stores import
|
|
20
|
+
from cognite.neat.graph.stores import NeatGraphStore
|
|
21
21
|
from cognite.neat.issues import NeatIssue, NeatIssueList
|
|
22
22
|
from cognite.neat.rules.models import DMSRules
|
|
23
23
|
from cognite.neat.rules.models.data_types import _DATA_TYPE_BY_DMS_TYPE
|
|
@@ -29,7 +29,7 @@ from ._base import CDFLoader
|
|
|
29
29
|
class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
30
30
|
def __init__(
|
|
31
31
|
self,
|
|
32
|
-
graph_store:
|
|
32
|
+
graph_store: NeatGraphStore,
|
|
33
33
|
data_model: dm.DataModel[dm.View] | None,
|
|
34
34
|
instance_space: str,
|
|
35
35
|
class_by_view_id: dict[ViewId, str] | None = None,
|
|
@@ -48,7 +48,7 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
48
48
|
cls,
|
|
49
49
|
client: CogniteClient,
|
|
50
50
|
data_model_id: dm.DataModelId,
|
|
51
|
-
graph_store:
|
|
51
|
+
graph_store: NeatGraphStore,
|
|
52
52
|
instance_space: str,
|
|
53
53
|
) -> "DMSLoader":
|
|
54
54
|
issues: list[NeatIssue] = []
|
|
@@ -61,7 +61,7 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
61
61
|
return cls(graph_store, data_model, instance_space, {}, issues)
|
|
62
62
|
|
|
63
63
|
@classmethod
|
|
64
|
-
def from_rules(cls, rules: DMSRules, graph_store:
|
|
64
|
+
def from_rules(cls, rules: DMSRules, graph_store: NeatGraphStore, instance_space: str) -> "DMSLoader":
|
|
65
65
|
issues: list[NeatIssue] = []
|
|
66
66
|
data_model: dm.DataModel[dm.View] | None = None
|
|
67
67
|
try:
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import warnings
|
|
3
|
+
from collections.abc import Iterable
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import cast
|
|
7
|
+
|
|
8
|
+
import pytz
|
|
9
|
+
from rdflib import RDF, Graph, Namespace, URIRef
|
|
10
|
+
from rdflib.plugins.stores.sparqlstore import SPARQLUpdateStore
|
|
11
|
+
from rdflib.query import ResultRow
|
|
12
|
+
|
|
13
|
+
from cognite.neat.graph._shared import MIMETypes
|
|
14
|
+
from cognite.neat.graph.extractors import RdfFileExtractor, TripleExtractors
|
|
15
|
+
from cognite.neat.graph.models import Triple
|
|
16
|
+
from cognite.neat.rules.models.information import InformationRules
|
|
17
|
+
from cognite.neat.utils import remove_namespace
|
|
18
|
+
from cognite.neat.utils.auxiliary import local_import
|
|
19
|
+
|
|
20
|
+
from ._provenance import Change, Provenance
|
|
21
|
+
|
|
22
|
+
if sys.version_info < (3, 11):
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
else:
|
|
25
|
+
from typing import Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class NeatGraphStore:
|
|
29
|
+
"""NeatGraphStore is a class that stores the graph and provides methods to read/write data it contains
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
graph : Instance of rdflib.Graph class for graph storage
|
|
34
|
+
rules:
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
rdf_store_type: str
|
|
38
|
+
|
|
39
|
+
def __init__(
|
|
40
|
+
self,
|
|
41
|
+
graph: Graph,
|
|
42
|
+
rules: InformationRules | None = None,
|
|
43
|
+
):
|
|
44
|
+
_start = datetime.now(pytz.utc)
|
|
45
|
+
self.graph = graph
|
|
46
|
+
self.provenance = Provenance(
|
|
47
|
+
[
|
|
48
|
+
Change.record(
|
|
49
|
+
activity=f"{type(self).__name__}.__init__",
|
|
50
|
+
start=_start,
|
|
51
|
+
end=datetime.now(pytz.utc),
|
|
52
|
+
description=f"Initialize graph store as {type(self.graph.store).__name__}",
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
)
|
|
56
|
+
self.rules = rules
|
|
57
|
+
|
|
58
|
+
if self.rules and self.rules.prefixes:
|
|
59
|
+
self._upsert_prefixes(self.rules.prefixes)
|
|
60
|
+
|
|
61
|
+
self.queries = _Queries(self)
|
|
62
|
+
|
|
63
|
+
def _upsert_prefixes(self, prefixes: dict[str, Namespace]) -> None:
|
|
64
|
+
"""Adds prefixes to the graph store."""
|
|
65
|
+
_start = datetime.now(pytz.utc)
|
|
66
|
+
for prefix, namespace in prefixes.items():
|
|
67
|
+
self.graph.bind(prefix, namespace)
|
|
68
|
+
|
|
69
|
+
self.provenance.append(
|
|
70
|
+
Change.record(
|
|
71
|
+
activity=f"{type(self).__name__}._upsert_prefixes",
|
|
72
|
+
start=_start,
|
|
73
|
+
end=datetime.now(pytz.utc),
|
|
74
|
+
description="Upsert prefixes to graph store",
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_memory_store(cls, rules: InformationRules | None = None) -> "Self":
|
|
80
|
+
return cls(Graph(), rules)
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_sparql_store(
|
|
84
|
+
cls,
|
|
85
|
+
query_endpoint: str | None = None,
|
|
86
|
+
update_endpoint: str | None = None,
|
|
87
|
+
returnFormat: str = "csv",
|
|
88
|
+
rules: InformationRules | None = None,
|
|
89
|
+
) -> "Self":
|
|
90
|
+
store = SPARQLUpdateStore(
|
|
91
|
+
query_endpoint=query_endpoint,
|
|
92
|
+
update_endpoint=update_endpoint,
|
|
93
|
+
returnFormat=returnFormat,
|
|
94
|
+
context_aware=False,
|
|
95
|
+
postAsEncoded=False,
|
|
96
|
+
autocommit=False,
|
|
97
|
+
)
|
|
98
|
+
graph = Graph(store=store)
|
|
99
|
+
return cls(graph, rules)
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_oxi_store(cls, storage_dir: Path | None = None, rules: InformationRules | None = None) -> "Self":
|
|
103
|
+
"""Creates a NeatGraphStore from an Oxigraph store."""
|
|
104
|
+
local_import("pyoxigraph", "oxi")
|
|
105
|
+
import pyoxigraph
|
|
106
|
+
|
|
107
|
+
from cognite.neat.graph.stores._oxrdflib import OxigraphStore
|
|
108
|
+
|
|
109
|
+
# Adding support for both oxigraph in-memory and file-based storage
|
|
110
|
+
for i in range(4):
|
|
111
|
+
try:
|
|
112
|
+
oxi_store = pyoxigraph.Store(path=str(storage_dir) if storage_dir else None)
|
|
113
|
+
break
|
|
114
|
+
except OSError as e:
|
|
115
|
+
if "lock" in str(e) and i < 3:
|
|
116
|
+
continue
|
|
117
|
+
raise e
|
|
118
|
+
else:
|
|
119
|
+
raise Exception("Error initializing Oxigraph store")
|
|
120
|
+
|
|
121
|
+
graph = Graph(store=OxigraphStore(store=oxi_store))
|
|
122
|
+
graph.default_union = True
|
|
123
|
+
|
|
124
|
+
return cls(graph, rules)
|
|
125
|
+
|
|
126
|
+
def write(self, extractor: TripleExtractors) -> None:
|
|
127
|
+
if isinstance(extractor, RdfFileExtractor):
|
|
128
|
+
self._parse_file(extractor.filepath, extractor.mime_type, extractor.base_uri)
|
|
129
|
+
else:
|
|
130
|
+
self._add_triples(extractor.extract())
|
|
131
|
+
|
|
132
|
+
def _parse_file(
|
|
133
|
+
self,
|
|
134
|
+
filepath: Path,
|
|
135
|
+
mime_type: MIMETypes = "application/rdf+xml",
|
|
136
|
+
base_uri: URIRef | None = None,
|
|
137
|
+
) -> None:
|
|
138
|
+
"""Imports graph data from file.
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
filepath : File path to file containing graph data, by default None
|
|
142
|
+
mime_type : MIME type of graph data, by default "application/rdf+xml"
|
|
143
|
+
add_base_iri : Add base IRI to graph, by default True
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
# Oxigraph store, do not want to type hint this as it is an optional dependency
|
|
147
|
+
if type(self.graph.store).__name__ == "OxigraphStore":
|
|
148
|
+
|
|
149
|
+
def parse_to_oxi_store():
|
|
150
|
+
local_import("pyoxigraph", "oxi")
|
|
151
|
+
from cognite.neat.graph.stores._oxrdflib import OxigraphStore
|
|
152
|
+
|
|
153
|
+
cast(OxigraphStore, self.graph.store)._inner.bulk_load(str(filepath), mime_type, base_iri=base_uri) # type: ignore[attr-defined]
|
|
154
|
+
cast(OxigraphStore, self.graph.store)._inner.optimize() # type: ignore[attr-defined]
|
|
155
|
+
|
|
156
|
+
parse_to_oxi_store()
|
|
157
|
+
|
|
158
|
+
# All other stores
|
|
159
|
+
else:
|
|
160
|
+
if filepath.is_file():
|
|
161
|
+
self.graph.parse(filepath, publicID=base_uri)
|
|
162
|
+
else:
|
|
163
|
+
for filename in filepath.iterdir():
|
|
164
|
+
if filename.is_file():
|
|
165
|
+
self.graph.parse(filename, publicID=base_uri)
|
|
166
|
+
|
|
167
|
+
def _add_triples(self, triples: Iterable[Triple], batch_size: int = 10_000):
|
|
168
|
+
"""Adds triples to the graph store in batches.
|
|
169
|
+
|
|
170
|
+
Args:
|
|
171
|
+
triples: list of triples to be added to the graph store
|
|
172
|
+
batch_size: Batch size of triples per commit, by default 10_000
|
|
173
|
+
verbose: Verbose mode, by default False
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
commit_counter = 0
|
|
177
|
+
number_of_written_triples = 0
|
|
178
|
+
|
|
179
|
+
def check_commit(force_commit: bool = False):
|
|
180
|
+
"""Commit nodes to the graph if batch counter is reached or if force_commit is True"""
|
|
181
|
+
nonlocal commit_counter
|
|
182
|
+
nonlocal number_of_written_triples
|
|
183
|
+
if force_commit:
|
|
184
|
+
number_of_written_triples += commit_counter
|
|
185
|
+
self.graph.commit()
|
|
186
|
+
return
|
|
187
|
+
commit_counter += 1
|
|
188
|
+
if commit_counter >= batch_size:
|
|
189
|
+
number_of_written_triples += commit_counter
|
|
190
|
+
self.graph.commit()
|
|
191
|
+
commit_counter = 0
|
|
192
|
+
|
|
193
|
+
for triple in triples:
|
|
194
|
+
self.graph.add(triple)
|
|
195
|
+
check_commit()
|
|
196
|
+
|
|
197
|
+
check_commit(force_commit=True)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class _Queries:
|
|
201
|
+
"""Helper class for storing standard queries for the graph store."""
|
|
202
|
+
|
|
203
|
+
def __init__(self, store: NeatGraphStore):
|
|
204
|
+
self.store = store
|
|
205
|
+
|
|
206
|
+
def list_instances_ids_of_class(self, class_uri: URIRef, limit: int = -1) -> list[URIRef]:
|
|
207
|
+
"""Get instances ids for a given class
|
|
208
|
+
|
|
209
|
+
Args:
|
|
210
|
+
class_uri: Class for which instances are to be found
|
|
211
|
+
limit: Max number of instances to return, by default -1 meaning all instances
|
|
212
|
+
|
|
213
|
+
Returns:
|
|
214
|
+
List of class instance URIs
|
|
215
|
+
"""
|
|
216
|
+
query_statement = "SELECT DISTINCT ?subject WHERE { ?subject a <class> .} LIMIT X".replace(
|
|
217
|
+
"class", class_uri
|
|
218
|
+
).replace("LIMIT X", "" if limit == -1 else f"LIMIT {limit}")
|
|
219
|
+
return [cast(tuple, res)[0] for res in list(self.store.graph.query(query_statement))]
|
|
220
|
+
|
|
221
|
+
def list_instances_of_type(self, class_uri: URIRef) -> list[ResultRow]:
|
|
222
|
+
"""Get all triples for instances of a given class
|
|
223
|
+
|
|
224
|
+
Args:
|
|
225
|
+
class_uri: Class for which instances are to be found
|
|
226
|
+
|
|
227
|
+
Returns:
|
|
228
|
+
List of triples for instances of the given class
|
|
229
|
+
"""
|
|
230
|
+
query = (
|
|
231
|
+
f"SELECT ?instance ?prop ?value "
|
|
232
|
+
f"WHERE {{ ?instance rdf:type <{class_uri}> . ?instance ?prop ?value . }} order by ?instance "
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
# Select queries gives an iterable of result rows
|
|
236
|
+
return cast(list[ResultRow], list(self.store.graph.query(query)))
|
|
237
|
+
|
|
238
|
+
def triples_of_type_instances(self, rdf_type: str) -> list[tuple[str, str, str]]:
|
|
239
|
+
"""Get all triples of a given type.
|
|
240
|
+
|
|
241
|
+
This method assumes the graph has been transformed into the default namespace.
|
|
242
|
+
"""
|
|
243
|
+
|
|
244
|
+
if self.store.rules:
|
|
245
|
+
query = (
|
|
246
|
+
f"SELECT ?instance ?prop ?value "
|
|
247
|
+
f"WHERE {{ ?instance a <{self.store.rules.metadata.namespace[rdf_type]}> . ?instance ?prop ?value . }} "
|
|
248
|
+
"order by ?instance"
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
result = self.store.graph.query(query)
|
|
252
|
+
|
|
253
|
+
# We cannot include the RDF.type in case there is a neat:type property
|
|
254
|
+
return [remove_namespace(*triple) for triple in result if triple[1] != RDF.type] # type: ignore[misc, index]
|
|
255
|
+
else:
|
|
256
|
+
warnings.warn("No rules found for the graph store, returning empty list.", stacklevel=2)
|
|
257
|
+
return []
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# we will use prov-o to represent the provenance of the neat graph store
|
|
2
|
+
# basically tracking changes that occur in the graph store
|
|
3
|
+
# prov-o use concepts of Agent, Activity and Entity to represent provenance
|
|
4
|
+
# where in case of neat we have:
|
|
5
|
+
# Agent: triples extractors, graph enhancers, contextualizers, etc.
|
|
6
|
+
# Activity: write triple, add connection, etc.
|
|
7
|
+
# Entity: neat graph store
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
import uuid
|
|
11
|
+
from collections import UserList
|
|
12
|
+
from collections.abc import Sequence
|
|
13
|
+
from dataclasses import dataclass
|
|
14
|
+
from datetime import datetime
|
|
15
|
+
from typing import TypeVar
|
|
16
|
+
|
|
17
|
+
from rdflib import PROV, RDF, Literal, URIRef
|
|
18
|
+
|
|
19
|
+
from cognite.neat.constants import DEFAULT_NAMESPACE
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass(frozen=True)
|
|
23
|
+
class Agent:
|
|
24
|
+
id_: URIRef = DEFAULT_NAMESPACE.agent
|
|
25
|
+
acted_on_behalf_of: str = "NEAT"
|
|
26
|
+
|
|
27
|
+
def as_triples(self):
|
|
28
|
+
return [
|
|
29
|
+
(self.id_, RDF.type, PROV[type(self).__name__]),
|
|
30
|
+
(self.id_, PROV.actedOnBehalfOf, self.acted_on_behalf_of),
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass(frozen=True)
|
|
35
|
+
class Activity:
|
|
36
|
+
was_associated_with: Agent
|
|
37
|
+
ended_at_time: datetime
|
|
38
|
+
started_at_time: datetime
|
|
39
|
+
used: str # this would be set to for example Extractor, Enhancer, Contextualizer, etc.
|
|
40
|
+
id_: URIRef = DEFAULT_NAMESPACE[f"activity-{uuid.uuid4()}"]
|
|
41
|
+
|
|
42
|
+
def as_triples(self):
|
|
43
|
+
return [
|
|
44
|
+
(self.id_, RDF.type, PROV[type(self).__name__]),
|
|
45
|
+
(self.id_, PROV.wasAssociatedWith, self.was_associated_with.id_),
|
|
46
|
+
(self.id_, PROV.startedAtTime, Literal(self.started_at_time)),
|
|
47
|
+
(self.id_, PROV.endedAtTime, Literal(self.ended_at_time)),
|
|
48
|
+
(self.id_, PROV.used, self.used),
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass(frozen=True)
|
|
53
|
+
class Entity:
|
|
54
|
+
was_generated_by: Activity
|
|
55
|
+
was_attributed_to: Agent
|
|
56
|
+
id_: URIRef = DEFAULT_NAMESPACE["graph-store"]
|
|
57
|
+
|
|
58
|
+
def as_triples(self):
|
|
59
|
+
return [
|
|
60
|
+
(self.id_, RDF.type, PROV[type(self).__name__]),
|
|
61
|
+
(self.id_, PROV.wasGeneratedBy, self.was_generated_by.id_),
|
|
62
|
+
(self.id_, PROV.wasAttributedTo, self.was_attributed_to.id_),
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass(frozen=True)
|
|
67
|
+
class Change:
|
|
68
|
+
agent: Agent
|
|
69
|
+
activity: Activity
|
|
70
|
+
entity: Entity
|
|
71
|
+
description: str
|
|
72
|
+
|
|
73
|
+
def as_triples(self):
|
|
74
|
+
return self.agent.as_triples() + self.activity.as_triples() + self.entity.as_triples()
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def record(cls, activity: str, start: datetime, end: datetime, description: str):
|
|
78
|
+
"""User friendly method to record a change that occurred in the graph store."""
|
|
79
|
+
agent = Agent()
|
|
80
|
+
activity = Activity(used=activity, was_associated_with=agent, started_at_time=start, ended_at_time=end)
|
|
81
|
+
entity = Entity(was_generated_by=activity, was_attributed_to=agent)
|
|
82
|
+
return cls(agent, activity, entity, description)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
T_Change = TypeVar("T_Change", bound=Change)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class Provenance(UserList[T_Change]):
|
|
89
|
+
def __init__(self, changes: Sequence[T_Change] | None = None):
|
|
90
|
+
super().__init__(changes or [])
|
|
91
|
+
|
|
92
|
+
def did_this_happen(self, this: str) -> bool:
|
|
93
|
+
return any(change.description == this for change in self)
|
|
94
|
+
|
|
95
|
+
def __delitem__(self, *args, **kwargs):
|
|
96
|
+
raise TypeError("Cannot delete change from provenance")
|
|
97
|
+
|
|
98
|
+
def __setitem__(self, *args, **kwargs):
|
|
99
|
+
raise TypeError("Cannot modify change from provenance")
|
{cognite_neat-0.78.5 → cognite_neat-0.80.0}/cognite/neat/rules/importers/_inference2rules.py
RENAMED
|
@@ -8,7 +8,7 @@ from rdflib import Literal as RdfLiteral
|
|
|
8
8
|
|
|
9
9
|
import cognite.neat.rules.issues as issues
|
|
10
10
|
from cognite.neat.constants import PREFIXES
|
|
11
|
-
from cognite.neat.graph.stores import
|
|
11
|
+
from cognite.neat.graph.stores import NeatGraphStore
|
|
12
12
|
from cognite.neat.rules.importers._base import BaseImporter, Rules, _handle_issues
|
|
13
13
|
from cognite.neat.rules.issues import IssueList
|
|
14
14
|
from cognite.neat.rules.models import InformationRules, RoleTypes
|
|
@@ -47,7 +47,7 @@ class InferenceImporter(BaseImporter):
|
|
|
47
47
|
self.max_number_of_instance = max_number_of_instance
|
|
48
48
|
|
|
49
49
|
@classmethod
|
|
50
|
-
def from_graph_store(cls, store:
|
|
50
|
+
def from_graph_store(cls, store: NeatGraphStore, max_number_of_instance: int = -1):
|
|
51
51
|
issue_list = IssueList(title="Inferred from graph store")
|
|
52
52
|
|
|
53
53
|
return cls(issue_list, store.graph, max_number_of_instance=max_number_of_instance)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.78.5"
|