cognite-neat 0.108.0__tar.gz → 0.109.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.108.0 → cognite_neat-0.109.0}/PKG-INFO +1 -1
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_constants.py +1 -1
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +8 -4
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/queries/_base.py +4 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/__init__.py +3 -3
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_base.py +4 -4
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_classic_cdf.py +13 -13
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_prune_graph.py +3 -3
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_rdfpath.py +3 -4
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_value_type.py +23 -16
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/errors/__init__.py +2 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/errors/_external.py +8 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/warnings/_resources.py +1 -1
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/_rules2yaml.py +1 -1
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +179 -118
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/_base_rules.py +9 -8
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/dms/_exporter.py +5 -4
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/transformers/__init__.py +4 -3
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/transformers/_base.py +6 -1
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/transformers/_converters.py +436 -361
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/transformers/_mapping.py +4 -4
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_base.py +71 -69
- cognite_neat-0.109.0/cognite/neat/_session/_create.py +133 -0
- cognite_neat-0.109.0/cognite/neat/_session/_drop.py +103 -0
- cognite_neat-0.109.0/cognite/neat/_session/_fix.py +28 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_inspect.py +19 -5
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_mapping.py +8 -8
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_prepare.py +3 -247
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_read.py +78 -4
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_set.py +34 -12
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_show.py +14 -41
- cognite_neat-0.109.0/cognite/neat/_session/_state.py +100 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_to.py +7 -3
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/exceptions.py +7 -1
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_store/_graph_store.py +14 -13
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_store/_provenance.py +36 -20
- cognite_neat-0.109.0/cognite/neat/_store/_rules_store.py +386 -0
- cognite_neat-0.109.0/cognite/neat/_store/exceptions.py +59 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/auth.py +4 -2
- cognite_neat-0.109.0/cognite/neat/_version.py +2 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/pyproject.toml +1 -1
- cognite_neat-0.108.0/cognite/neat/_session/_drop.py +0 -49
- cognite_neat-0.108.0/cognite/neat/_session/_state.py +0 -103
- cognite_neat-0.108.0/cognite/neat/_store/_rules_store.py +0 -507
- cognite_neat-0.108.0/cognite/neat/_store/exceptions.py +0 -23
- cognite_neat-0.108.0/cognite/neat/_version.py +0 -2
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/LICENSE +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/README.md +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/_api/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/_api/data_modeling_loaders.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/_api/schema.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/_api_client.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/data_classes/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/data_classes/data_modeling.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/data_classes/neat_sequence.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/data_classes/schema.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_client/testing.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/_shared.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_dms.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_dms_graph.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_iodd.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/loaders/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/loaders/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/loaders/_rdf2dms.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/queries/_construct.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/queries/_shared.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_iodd.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/errors/_properties.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/errors/_resources.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/errors/_workflow.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/warnings/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/warnings/_general.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/warnings/_models.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/warnings/_properties.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/_shared.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/analysis/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/analysis/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/analysis/_dms.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/analysis/_information.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/catalog/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/catalog/classic_model.xlsx +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/catalog/hello_world_pump.xlsx +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_rdf/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_rdf/_imf2rules.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_rdf/_owl2rules.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/_types.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/data_types.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/dms/_rules.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/information/_rules.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/information/_validation.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/models/mapping/_classic2core.yaml +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_rules/transformers/_verification.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_collector.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/_wizard.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/engine/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/engine/_import.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/engine/_interface.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_session/engine/_load.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/graph_transformations_report.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/io_.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/rdf_.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/reader/__init__.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/reader/_base.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/upload.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/py.typed +0 -0
|
@@ -86,8 +86,8 @@ class NEAT(DefinedNamespace):
|
|
|
86
86
|
_fail = True
|
|
87
87
|
_NS = Namespace("http://thisisneat.io/internal/")
|
|
88
88
|
|
|
89
|
-
type: URIRef # type property used to express a type of a subject
|
|
90
89
|
UnknownType: URIRef # Unknown type used to express that the type of a subject is unknown
|
|
90
|
+
EmptyType: URIRef # Empty type used to express that the type of a subject is empty
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
def get_default_prefixes_and_namespaces() -> dict[str, Namespace]:
|
|
@@ -369,8 +369,12 @@ class ClassicGraphExtractor(KnowledgeGraphExtractor):
|
|
|
369
369
|
|
|
370
370
|
def _lookup_dataset(self, dataset_id: int) -> str:
|
|
371
371
|
if dataset_id not in self._dataset_external_ids_by_id:
|
|
372
|
-
|
|
373
|
-
self.
|
|
374
|
-
|
|
375
|
-
|
|
372
|
+
try:
|
|
373
|
+
if (dataset := self._client.data_sets.retrieve(id=dataset_id)) and dataset.external_id:
|
|
374
|
+
self._dataset_external_ids_by_id[dataset_id] = dataset.external_id
|
|
375
|
+
else:
|
|
376
|
+
raise KeyError(f"Could not find dataset with id {dataset_id}.")
|
|
377
|
+
except CogniteAPIError as e:
|
|
378
|
+
warnings.warn(CDFAuthWarning("lookup dataset", str(e)), stacklevel=2)
|
|
379
|
+
return f"{InstanceIdPrefix.data_set}{dataset_id}"
|
|
376
380
|
return self._dataset_external_ids_by_id[dataset_id]
|
|
@@ -185,6 +185,10 @@ class Queries:
|
|
|
185
185
|
query = f"ASK WHERE {{ ?s ?p ?o . FILTER(STRSTARTS(STR(?p), STR(<{namespace}>))) }}"
|
|
186
186
|
return bool(self.graph(named_graph).query(query))
|
|
187
187
|
|
|
188
|
+
def has_data(self) -> bool:
|
|
189
|
+
"""Check if the graph store has data"""
|
|
190
|
+
return cast(bool, next(iter(self.dataset.query("ASK WHERE { ?s ?p ?o }"))))
|
|
191
|
+
|
|
188
192
|
def has_type(self, type_: URIRef, named_graph: URIRef | None = None) -> bool:
|
|
189
193
|
"""Check if a type exists in the graph store
|
|
190
194
|
|
|
@@ -17,7 +17,7 @@ from ._prune_graph import (
|
|
|
17
17
|
PruneTypes,
|
|
18
18
|
)
|
|
19
19
|
from ._rdfpath import AddSelfReferenceProperty, MakeConnectionOnExactMatch
|
|
20
|
-
from ._value_type import ConnectionToLiteral, ConvertLiteral, LiteralToEntity,
|
|
20
|
+
from ._value_type import ConnectionToLiteral, ConvertLiteral, LiteralToEntity, SetType, SplitMultiValueProperty
|
|
21
21
|
|
|
22
22
|
__all__ = [
|
|
23
23
|
"AddAssetDepth",
|
|
@@ -38,7 +38,7 @@ __all__ = [
|
|
|
38
38
|
"PruneInstancesOfUnknownType",
|
|
39
39
|
"PruneTypes",
|
|
40
40
|
"RelationshipAsEdgeTransformer",
|
|
41
|
-
"
|
|
41
|
+
"SetType",
|
|
42
42
|
"SplitMultiValueProperty",
|
|
43
43
|
]
|
|
44
44
|
|
|
@@ -63,5 +63,5 @@ Transformers = (
|
|
|
63
63
|
| ConnectionToLiteral
|
|
64
64
|
| BaseTransformerStandardised
|
|
65
65
|
| LookupRelationshipSourceTarget
|
|
66
|
-
|
|
|
66
|
+
| SetType
|
|
67
67
|
)
|
|
@@ -12,14 +12,14 @@ from cognite.neat._shared import Triple
|
|
|
12
12
|
from cognite.neat._utils.collection_ import iterate_progress_bar_if_above_config_threshold
|
|
13
13
|
from cognite.neat._utils.graph_transformations_report import GraphTransformationResult
|
|
14
14
|
|
|
15
|
-
To_Add_Triples: TypeAlias =
|
|
16
|
-
To_Remove_Triples: TypeAlias =
|
|
15
|
+
To_Add_Triples: TypeAlias = set[Triple]
|
|
16
|
+
To_Remove_Triples: TypeAlias = set[Triple]
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
@dataclasses.dataclass
|
|
20
20
|
class RowTransformationOutput:
|
|
21
|
-
remove_triples: To_Remove_Triples = dataclasses.field(default_factory=
|
|
22
|
-
add_triples: To_Add_Triples = dataclasses.field(default_factory=
|
|
21
|
+
remove_triples: To_Remove_Triples = dataclasses.field(default_factory=set)
|
|
22
|
+
add_triples: To_Add_Triples = dataclasses.field(default_factory=set)
|
|
23
23
|
instances_removed_count: int = 0
|
|
24
24
|
instances_added_count: int = 0
|
|
25
25
|
instances_modified_count: int = 0
|
{cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_classic_cdf.py
RENAMED
|
@@ -63,11 +63,11 @@ class AddAssetDepth(BaseTransformerStandardised):
|
|
|
63
63
|
row_output = RowTransformationOutput()
|
|
64
64
|
subject, object = query_result_row
|
|
65
65
|
|
|
66
|
-
row_output.add_triples.
|
|
66
|
+
row_output.add_triples.add(cast(Triple, (subject, DEFAULT_NAMESPACE.depth, object)))
|
|
67
67
|
|
|
68
68
|
if self.depth_typing and (type_ := self.depth_typing.get(int(object), None)):
|
|
69
|
-
row_output.remove_triples.
|
|
70
|
-
row_output.add_triples.
|
|
69
|
+
row_output.remove_triples.add(cast(Triple, (subject, RDF.type, self.asset_type)))
|
|
70
|
+
row_output.add_triples.add(cast(Triple, (subject, RDF.type, DEFAULT_NAMESPACE[type_])))
|
|
71
71
|
|
|
72
72
|
row_output.instances_modified_count += 1
|
|
73
73
|
|
|
@@ -128,7 +128,7 @@ class BaseAssetConnector(BaseTransformerStandardised, ABC):
|
|
|
128
128
|
row_output = RowTransformationOutput()
|
|
129
129
|
subject, object = query_result_row
|
|
130
130
|
|
|
131
|
-
row_output.add_triples.
|
|
131
|
+
row_output.add_triples.add(cast(Triple, (subject, self.asset_to_resource_connection, object)))
|
|
132
132
|
|
|
133
133
|
row_output.instances_modified_count += 1
|
|
134
134
|
|
|
@@ -305,12 +305,12 @@ class AssetRelationshipConnector(BaseTransformerStandardised):
|
|
|
305
305
|
row_output = RowTransformationOutput()
|
|
306
306
|
source, relationship, target = query_result_row
|
|
307
307
|
|
|
308
|
-
row_output.add_triples.
|
|
309
|
-
row_output.add_triples.
|
|
310
|
-
row_output.add_triples.
|
|
308
|
+
row_output.add_triples.add(cast(Triple, (source, DEFAULT_NAMESPACE.relationship, target)))
|
|
309
|
+
row_output.add_triples.add(cast(Triple, (relationship, DEFAULT_NAMESPACE.source, source)))
|
|
310
|
+
row_output.add_triples.add(cast(Triple, (relationship, DEFAULT_NAMESPACE.target, target)))
|
|
311
311
|
|
|
312
|
-
row_output.remove_triples.
|
|
313
|
-
row_output.remove_triples.
|
|
312
|
+
row_output.remove_triples.add(cast(Triple, (relationship, self.relationship_source_xid_prop, None)))
|
|
313
|
+
row_output.remove_triples.add(cast(Triple, (relationship, self.relationship_target_xid_prop, None)))
|
|
314
314
|
|
|
315
315
|
row_output.instances_modified_count += 2
|
|
316
316
|
|
|
@@ -578,10 +578,10 @@ WHERE {{
|
|
|
578
578
|
warnings.warn(ResourceNotFoundWarning(target, "class", str(instance), "class"), stacklevel=2)
|
|
579
579
|
return output
|
|
580
580
|
|
|
581
|
-
output.remove_triples.
|
|
582
|
-
output.remove_triples.
|
|
583
|
-
output.add_triples.
|
|
584
|
-
output.add_triples.
|
|
581
|
+
output.remove_triples.add((instance, self._namespace.sourceExternalId, source))
|
|
582
|
+
output.remove_triples.add((instance, self._namespace.targetExternalId, target))
|
|
583
|
+
output.add_triples.add((instance, self._namespace.sourceExternalId, source_id))
|
|
584
|
+
output.add_triples.add((instance, self._namespace.targetExternalId, target_id))
|
|
585
585
|
output.instances_modified_count += 1
|
|
586
586
|
return output
|
|
587
587
|
|
{cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_prune_graph.py
RENAMED
|
@@ -237,7 +237,7 @@ class PruneTypes(BaseTransformerStandardised):
|
|
|
237
237
|
row_output = RowTransformationOutput()
|
|
238
238
|
|
|
239
239
|
(subject,) = query_result_row
|
|
240
|
-
row_output.remove_triples.
|
|
240
|
+
row_output.remove_triples.add((subject, None, None)) # type: ignore
|
|
241
241
|
row_output.instances_removed_count = 1
|
|
242
242
|
|
|
243
243
|
return row_output
|
|
@@ -272,7 +272,7 @@ class PruneDeadEndEdges(BaseTransformerStandardised):
|
|
|
272
272
|
|
|
273
273
|
def operation(self, row: ResultRow) -> RowTransformationOutput:
|
|
274
274
|
row_output = RowTransformationOutput()
|
|
275
|
-
row_output.remove_triples.
|
|
275
|
+
row_output.remove_triples.add(cast(Triple, row))
|
|
276
276
|
row_output.instances_modified_count = 1
|
|
277
277
|
|
|
278
278
|
return row_output
|
|
@@ -307,7 +307,7 @@ class PruneInstancesOfUnknownType(BaseTransformerStandardised):
|
|
|
307
307
|
def operation(self, query_result_row: ResultRow) -> RowTransformationOutput:
|
|
308
308
|
row_output = RowTransformationOutput()
|
|
309
309
|
(subject,) = query_result_row
|
|
310
|
-
row_output.remove_triples.
|
|
310
|
+
row_output.remove_triples.add(cast(Triple, (subject, None, None)))
|
|
311
311
|
row_output.instances_removed_count = 1
|
|
312
312
|
|
|
313
313
|
return row_output
|
|
@@ -7,7 +7,6 @@ from rdflib.query import ResultRow
|
|
|
7
7
|
from cognite.neat._rules.analysis import InformationAnalysis
|
|
8
8
|
from cognite.neat._rules.models._rdfpath import RDFPath, SingleProperty
|
|
9
9
|
from cognite.neat._rules.models.information import InformationRules
|
|
10
|
-
from cognite.neat._shared import Triple
|
|
11
10
|
from cognite.neat._utils.rdf_ import get_namespace, remove_namespace_from_uri
|
|
12
11
|
|
|
13
12
|
from ._base import BaseTransformer, BaseTransformerStandardised, RowTransformationOutput
|
|
@@ -76,7 +75,7 @@ class MakeConnectionOnExactMatch(BaseTransformerStandardised):
|
|
|
76
75
|
self.object_type = object_type
|
|
77
76
|
self.object_predicate = object_predicate
|
|
78
77
|
subject_namespace = Namespace(get_namespace(subject_type))
|
|
79
|
-
self.connection = (
|
|
78
|
+
self.connection: URIRef = (
|
|
80
79
|
subject_namespace[quote(connection.strip())]
|
|
81
80
|
if isinstance(connection, str)
|
|
82
81
|
else connection or subject_namespace[remove_namespace_from_uri(self.object_type).lower()]
|
|
@@ -125,8 +124,8 @@ class MakeConnectionOnExactMatch(BaseTransformerStandardised):
|
|
|
125
124
|
def operation(self, query_result_row: ResultRow) -> RowTransformationOutput:
|
|
126
125
|
row_output = RowTransformationOutput()
|
|
127
126
|
|
|
128
|
-
subject, object = query_result_row
|
|
127
|
+
subject, object = cast(tuple[URIRef, URIRef], query_result_row)
|
|
129
128
|
|
|
130
|
-
row_output.add_triples.
|
|
129
|
+
row_output.add_triples.add((subject, self.connection, object))
|
|
131
130
|
row_output.instances_modified_count += 1
|
|
132
131
|
return row_output
|
{cognite_neat-0.108.0 → cognite_neat-0.109.0}/cognite/neat/_graph/transformers/_value_type.py
RENAMED
|
@@ -4,7 +4,7 @@ from typing import Any, cast
|
|
|
4
4
|
from urllib.parse import quote
|
|
5
5
|
|
|
6
6
|
import rdflib
|
|
7
|
-
from rdflib import RDF, Literal, Namespace, URIRef
|
|
7
|
+
from rdflib import RDF, RDFS, Literal, Namespace, URIRef
|
|
8
8
|
from rdflib.query import ResultRow
|
|
9
9
|
|
|
10
10
|
from cognite.neat._constants import NEAT
|
|
@@ -78,8 +78,8 @@ class SplitMultiValueProperty(BaseTransformerStandardised):
|
|
|
78
78
|
|
|
79
79
|
new_property = URIRef(f"{old_property}_{remove_namespace_from_uri(value_type)}")
|
|
80
80
|
|
|
81
|
-
row_output.add_triples.
|
|
82
|
-
row_output.remove_triples.
|
|
81
|
+
row_output.add_triples.add(cast(Triple, (subject, new_property, object)))
|
|
82
|
+
row_output.remove_triples.add(cast(Triple, (subject, old_property, object)))
|
|
83
83
|
|
|
84
84
|
row_output.instances_modified_count += 1
|
|
85
85
|
|
|
@@ -143,8 +143,8 @@ class ConvertLiteral(BaseTransformerStandardised):
|
|
|
143
143
|
PropertyDataTypeConversionWarning(str(instance), self._type_name, self._property_name, str(e)),
|
|
144
144
|
stacklevel=2,
|
|
145
145
|
)
|
|
146
|
-
row_output.add_triples.
|
|
147
|
-
row_output.remove_triples.
|
|
146
|
+
row_output.add_triples.add((instance, self.subject_predicate, rdflib.Literal(converted_value))) # type: ignore[arg-type]
|
|
147
|
+
row_output.remove_triples.add((instance, self.subject_predicate, literal)) # type: ignore[arg-type]
|
|
148
148
|
row_output.instances_modified_count += 1
|
|
149
149
|
|
|
150
150
|
return row_output
|
|
@@ -221,15 +221,15 @@ class LiteralToEntity(BaseTransformerStandardised):
|
|
|
221
221
|
namespace = Namespace(get_namespace(instance)) # type: ignore[arg-type]
|
|
222
222
|
entity_type = namespace[self.entity_type]
|
|
223
223
|
new_entity = namespace[f"{self.entity_type}_{quote(value)!s}"]
|
|
224
|
-
row_output.add_triples.
|
|
224
|
+
row_output.add_triples.add((new_entity, RDF.type, entity_type))
|
|
225
225
|
row_output.instances_added_count += 1 # we add one new entity
|
|
226
226
|
|
|
227
227
|
if self.new_property is not None:
|
|
228
|
-
row_output.add_triples.
|
|
228
|
+
row_output.add_triples.add((new_entity, namespace[self.new_property], rdflib.Literal(value))) # type: ignore[arg-type]
|
|
229
229
|
row_output.instances_modified_count += 1 # we modify the new entity
|
|
230
230
|
|
|
231
|
-
row_output.add_triples.
|
|
232
|
-
row_output.remove_triples.
|
|
231
|
+
row_output.add_triples.add((instance, self.subject_predicate, new_entity)) # type: ignore[arg-type]
|
|
232
|
+
row_output.remove_triples.add((instance, self.subject_predicate, literal)) # type: ignore[arg-type]
|
|
233
233
|
row_output.instances_modified_count += 1 # we modify the old entity
|
|
234
234
|
|
|
235
235
|
return row_output
|
|
@@ -300,18 +300,22 @@ class ConnectionToLiteral(BaseTransformerStandardised):
|
|
|
300
300
|
instance, object_entity = cast(tuple[URIRef, URIRef], query_result_row)
|
|
301
301
|
value = remove_namespace_from_uri(object_entity)
|
|
302
302
|
|
|
303
|
-
row_output.add_triples.
|
|
304
|
-
row_output.remove_triples.
|
|
303
|
+
row_output.add_triples.add((instance, self.subject_predicate, rdflib.Literal(value)))
|
|
304
|
+
row_output.remove_triples.add((instance, self.subject_predicate, object_entity))
|
|
305
305
|
row_output.instances_modified_count += 1
|
|
306
306
|
|
|
307
307
|
return row_output
|
|
308
308
|
|
|
309
309
|
|
|
310
|
-
class
|
|
311
|
-
description = "Set the
|
|
310
|
+
class SetType(BaseTransformerStandardised):
|
|
311
|
+
description = "Set the type of an instance based on a property"
|
|
312
312
|
|
|
313
313
|
def __init__(
|
|
314
|
-
self,
|
|
314
|
+
self,
|
|
315
|
+
subject_type: URIRef,
|
|
316
|
+
subject_predicate: URIRef,
|
|
317
|
+
drop_property: bool = False,
|
|
318
|
+
namespace: Namespace | None = None,
|
|
315
319
|
) -> None:
|
|
316
320
|
self.subject_type = subject_type
|
|
317
321
|
self.subject_predicate = subject_predicate
|
|
@@ -350,9 +354,12 @@ class SetNeatType(BaseTransformerStandardised):
|
|
|
350
354
|
|
|
351
355
|
instance, object_literal = cast(tuple[URIRef, Literal], query_result_row)
|
|
352
356
|
if self.drop_property:
|
|
353
|
-
row_output.remove_triples.
|
|
357
|
+
row_output.remove_triples.add((instance, self.subject_predicate, object_literal))
|
|
354
358
|
|
|
355
|
-
row_output.
|
|
359
|
+
row_output.remove_triples.add((instance, RDF.type, self.subject_type))
|
|
360
|
+
new_type = self._namespace[quote(object_literal.toPython())]
|
|
361
|
+
row_output.add_triples.add((instance, RDF.type, new_type))
|
|
362
|
+
row_output.add_triples.add((new_type, RDFS.subClassOf, self.subject_type))
|
|
356
363
|
row_output.instances_modified_count += 1
|
|
357
364
|
|
|
358
365
|
return row_output
|
|
@@ -9,6 +9,7 @@ from ._external import (
|
|
|
9
9
|
FileReadError,
|
|
10
10
|
FileTypeUnexpectedError,
|
|
11
11
|
NeatYamlError,
|
|
12
|
+
OxigraphStorageLockedError,
|
|
12
13
|
)
|
|
13
14
|
from ._general import NeatImportError, NeatTypeError, NeatValueError, RegexViolationError
|
|
14
15
|
from ._properties import (
|
|
@@ -51,6 +52,7 @@ __all__ = [
|
|
|
51
52
|
"NeatTypeError",
|
|
52
53
|
"NeatValueError",
|
|
53
54
|
"NeatYamlError",
|
|
55
|
+
"OxigraphStorageLockedError",
|
|
54
56
|
"PropertyDefinitionDuplicatedError",
|
|
55
57
|
"PropertyDefinitionError",
|
|
56
58
|
"PropertyMappingDuplicatedError",
|
|
@@ -23,6 +23,14 @@ class FileReadError(NeatError, RuntimeError):
|
|
|
23
23
|
reason: str
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
@dataclass(unsafe_hash=True)
|
|
27
|
+
class OxigraphStorageLockedError(NeatError, RuntimeError):
|
|
28
|
+
"""Oxigraph on-disk storage locked at the path {filepath}"""
|
|
29
|
+
|
|
30
|
+
fix = "Delete LOCK file in the {filepath} folder to unlock the storage or use another storage path"
|
|
31
|
+
filepath: Path
|
|
32
|
+
|
|
33
|
+
|
|
26
34
|
@dataclass(unsafe_hash=True)
|
|
27
35
|
class FileNotFoundNeatError(NeatError, FileNotFoundError):
|
|
28
36
|
"""File {filepath} not found"""
|
|
@@ -21,7 +21,7 @@ class ResourceRegexViolationWarning(ResourceNeatWarning):
|
|
|
21
21
|
|
|
22
22
|
fix = (
|
|
23
23
|
"Either export the data model and make the necessary changes manually"
|
|
24
|
-
" or run
|
|
24
|
+
" or run fix.data_model.cdf_compliant_external_ids."
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
location: str
|
|
@@ -72,7 +72,7 @@ class YAMLExporter(BaseExporter[VerifiedRules, str]):
|
|
|
72
72
|
"""
|
|
73
73
|
# model_dump_json ensures that the output is in JSON format,
|
|
74
74
|
# if we don't do this, we will get Enums and other types that are not serializable to YAML
|
|
75
|
-
json_output = rules.dump(mode="json", exclude_none=True, exclude_unset=True)
|
|
75
|
+
json_output = rules.dump(mode="json", sort=True, exclude_none=True, exclude_unset=True)
|
|
76
76
|
if self.output == "json":
|
|
77
77
|
return json.dumps(json_output)
|
|
78
78
|
elif self.output == "yaml":
|