cognite-neat 0.115.1__tar.gz → 0.116.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.115.1 → cognite_neat-0.116.1}/PKG-INFO +2 -2
- cognite_neat-0.116.1/cognite/neat/_alpha.py +24 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_constants.py +73 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_dms.py +16 -16
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/transformers/_converters.py +72 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_create.py +4 -11
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_prepare.py +3 -3
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_read.py +96 -14
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_subset.py +2 -2
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_to.py +3 -3
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/exceptions.py +2 -2
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_store/_rules_store.py +7 -0
- cognite_neat-0.116.1/cognite/neat/_version.py +2 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/pyproject.toml +2 -2
- cognite_neat-0.115.1/cognite/neat/_alpha.py +0 -23
- cognite_neat-0.115.1/cognite/neat/_version.py +0 -2
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/LICENSE +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/README.md +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/_api/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/_api/data_modeling_loaders.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/_api/schema.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/_api_client.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/data_classes/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/data_classes/data_modeling.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/data_classes/neat_sequence.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/data_classes/schema.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/testing.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/_shared.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_dict.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_dms_graph.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_iodd.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_raw.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/loaders/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/loaders/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/loaders/_rdf2dms.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/queries/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/transformers/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/transformers/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/transformers/_iodd.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/transformers/_rdfpath.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_graph/transformers/_value_type.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/_contextmanagers.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/_factory.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/errors/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/errors/_external.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/errors/_properties.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/errors/_resources.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/errors/_wrapper.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/warnings/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/warnings/_general.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/warnings/_models.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/warnings/_properties.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/warnings/_resources.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/_shared.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/analysis/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/analysis/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/catalog/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/catalog/classic_model.xlsx +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/catalog/hello_world_pump.xlsx +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_rdf/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_rdf/_imf2rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_rdf/_owl2rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/_base_rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/_types.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/data_types.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/dms/_rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/information/_rules.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/information/_validation.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/models/mapping/_classic2core.yaml +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/transformers/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/transformers/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/transformers/_mapping.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/transformers/_verification.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_collector.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_drop.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_explore.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_fix.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_inspect.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_mapping.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_set.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_show.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_state.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/_wizard.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/engine/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/engine/_import.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/engine/_interface.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_session/engine/_load.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_store/_graph_store.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_store/_provenance.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_store/exceptions.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/auth.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/graph_transformations_report.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/io_.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/rdf_.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/reader/__init__.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/reader/_base.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/upload.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.116.1
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: Nikola Vasiljevic
|
|
@@ -18,7 +18,7 @@ Provides-Extra: google
|
|
|
18
18
|
Provides-Extra: oxi
|
|
19
19
|
Requires-Dist: PyYAML
|
|
20
20
|
Requires-Dist: backports.strenum (>=1.2,<2.0) ; python_version < "3.11"
|
|
21
|
-
Requires-Dist: cognite-sdk (>=7.
|
|
21
|
+
Requires-Dist: cognite-sdk (>=7.73.4,<8.0.0)
|
|
22
22
|
Requires-Dist: elementpath (>=4.0.0,<5.0.0)
|
|
23
23
|
Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0) ; python_version < "3.11"
|
|
24
24
|
Requires-Dist: google-api-python-client ; extra == "google"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ExperimentalFeatureWarning(UserWarning):
|
|
5
|
+
def __init__(self, feature_name: str):
|
|
6
|
+
super().__init__(f"Experimental feature '{feature_name}' is subject to change without notice")
|
|
7
|
+
|
|
8
|
+
def warn(self) -> None:
|
|
9
|
+
warnings.warn(self, stacklevel=2)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ExperimentalFlags:
|
|
13
|
+
manual_rules_edit = ExperimentalFeatureWarning("enable_manual_edit")
|
|
14
|
+
same_space_properties_only_export = ExperimentalFeatureWarning("same-space-properties-only")
|
|
15
|
+
standardize_naming = ExperimentalFeatureWarning("standardize_naming")
|
|
16
|
+
standardize_space_and_version = ExperimentalFeatureWarning("standardize_space_and_version")
|
|
17
|
+
data_model_subsetting = ExperimentalFeatureWarning("data_model_subsetting")
|
|
18
|
+
core_data_model_subsetting = ExperimentalFeatureWarning("core_data_model_subsetting")
|
|
19
|
+
ontology_read = ExperimentalFeatureWarning("ontology_read")
|
|
20
|
+
imf_read = ExperimentalFeatureWarning("imf_read")
|
|
21
|
+
dexpi_read = ExperimentalFeatureWarning("dexpi_read")
|
|
22
|
+
aml_read = ExperimentalFeatureWarning("aml_read")
|
|
23
|
+
csv_read = ExperimentalFeatureWarning("csv_read")
|
|
24
|
+
to_ontology = ExperimentalFeatureWarning("to_ontology")
|
|
@@ -64,6 +64,79 @@ COGNITE_SPACES = frozenset(
|
|
|
64
64
|
"cdf_units",
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
|
+
|
|
68
|
+
COGNITE_CORE_CONCEPTS = frozenset(
|
|
69
|
+
{
|
|
70
|
+
"CogniteFile",
|
|
71
|
+
"CogniteCubeMap",
|
|
72
|
+
"CogniteCADRevision",
|
|
73
|
+
"CognitePointCloudVolume",
|
|
74
|
+
"Cognite360ImageAnnotation",
|
|
75
|
+
"CogniteAnnotation",
|
|
76
|
+
"CogniteUnit",
|
|
77
|
+
"CogniteAsset",
|
|
78
|
+
"Cognite3DObject",
|
|
79
|
+
"Cognite3DRevision",
|
|
80
|
+
"Cognite360Image",
|
|
81
|
+
"CogniteDiagramAnnotation",
|
|
82
|
+
"Cognite360ImageCollection",
|
|
83
|
+
"Cognite360ImageStation",
|
|
84
|
+
"CognitePointCloudModel",
|
|
85
|
+
"CogniteTimeSeries",
|
|
86
|
+
"Cognite3DTransformation",
|
|
87
|
+
"CogniteEquipment",
|
|
88
|
+
"Cognite360ImageModel",
|
|
89
|
+
"CogniteAssetClass",
|
|
90
|
+
"CogniteAssetType",
|
|
91
|
+
"CogniteEquipmentType",
|
|
92
|
+
"Cognite3DModel",
|
|
93
|
+
"CogniteCADModel",
|
|
94
|
+
"CognitePointCloudRevision",
|
|
95
|
+
"CogniteCADNode",
|
|
96
|
+
"CogniteFileCategory",
|
|
97
|
+
"CogniteActivity",
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
COGNITE_CORE_FEATURES = frozenset(
|
|
103
|
+
{
|
|
104
|
+
"CogniteDescribable",
|
|
105
|
+
"CogniteSourceable",
|
|
106
|
+
"CogniteSourceSystem",
|
|
107
|
+
"CogniteSchedulable",
|
|
108
|
+
"CogniteVisualizable",
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
COGNITE_3D_CONCEPTS = frozenset(
|
|
113
|
+
{
|
|
114
|
+
"Cognite3DModel",
|
|
115
|
+
"Cognite3DObject",
|
|
116
|
+
"Cognite3DRevision",
|
|
117
|
+
"Cognite3DTransformation",
|
|
118
|
+
"Cognite360Image",
|
|
119
|
+
"Cognite360ImageAnnotation",
|
|
120
|
+
"Cognite360ImageCollection",
|
|
121
|
+
"Cognite360ImageModel",
|
|
122
|
+
"Cognite360ImageStation",
|
|
123
|
+
"CogniteCADModel",
|
|
124
|
+
"CogniteCADNode",
|
|
125
|
+
"CogniteCADRevision",
|
|
126
|
+
"CogniteCubeMap",
|
|
127
|
+
"CognitePointCloudModel",
|
|
128
|
+
"CognitePointCloudRevision",
|
|
129
|
+
"CognitePointCloudVolume",
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
COGNITE_ANNOTATION = frozenset(
|
|
134
|
+
{
|
|
135
|
+
"CogniteAnnotation",
|
|
136
|
+
"CogniteDiagramAnnotation",
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
|
|
67
140
|
DMS_LISTABLE_PROPERTY_LIMIT = 1000
|
|
68
141
|
|
|
69
142
|
EXAMPLE_RULES = PACKAGE_DIRECTORY / "_rules" / "examples"
|
|
@@ -215,23 +215,23 @@ class _ViewInstanceIterator(Iterable[Instance]):
|
|
|
215
215
|
def count(self) -> int:
|
|
216
216
|
node_count = edge_count = 0
|
|
217
217
|
if self.view.used_for in ("node", "all"):
|
|
218
|
-
|
|
219
|
-
self.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
218
|
+
node_result = self.client.data_modeling.instances.aggregate(
|
|
219
|
+
view=self.view.as_id(),
|
|
220
|
+
aggregates=dm.aggregations.Count("externalId"),
|
|
221
|
+
instance_type="node",
|
|
222
|
+
space=self.instance_space,
|
|
223
|
+
).value
|
|
224
|
+
if node_result:
|
|
225
|
+
node_count = int(node_result)
|
|
226
226
|
if self.view.used_for in ("edge", "all"):
|
|
227
|
-
|
|
228
|
-
self.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
227
|
+
edge_result = self.client.data_modeling.instances.aggregate(
|
|
228
|
+
view=self.view.as_id(),
|
|
229
|
+
aggregates=dm.aggregations.Count("externalId"),
|
|
230
|
+
instance_type="edge",
|
|
231
|
+
space=self.instance_space,
|
|
232
|
+
).value
|
|
233
|
+
if edge_result:
|
|
234
|
+
edge_count = int(edge_result)
|
|
235
235
|
return node_count + edge_count
|
|
236
236
|
|
|
237
237
|
def __iter__(self) -> Iterator[Instance]:
|
{cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_rules/transformers/_converters.py
RENAMED
|
@@ -17,6 +17,8 @@ from rdflib import Namespace
|
|
|
17
17
|
from cognite.neat._client import NeatClient
|
|
18
18
|
from cognite.neat._client.data_classes.data_modeling import ContainerApplyDict, ViewApplyDict
|
|
19
19
|
from cognite.neat._constants import (
|
|
20
|
+
COGNITE_CORE_CONCEPTS,
|
|
21
|
+
COGNITE_CORE_FEATURES,
|
|
20
22
|
COGNITE_MODELS,
|
|
21
23
|
COGNITE_SPACES,
|
|
22
24
|
DMS_CONTAINER_PROPERTY_SIZE_LIMIT,
|
|
@@ -1802,6 +1804,76 @@ class _DMSRulesConverter:
|
|
|
1802
1804
|
)
|
|
1803
1805
|
|
|
1804
1806
|
|
|
1807
|
+
class _SubsetEditableCDMRules(VerifiedRulesTransformer[DMSRules, DMSRules]):
|
|
1808
|
+
"""Subsets editable CDM rules to only include desired set of CDM concepts.
|
|
1809
|
+
|
|
1810
|
+
!!! note "Platypus UI limitations"
|
|
1811
|
+
This is temporal solution to enable cleaner extension of core data model,
|
|
1812
|
+
assuring that Platypus UI will work correctly, including Data Model Editor,
|
|
1813
|
+
Query Explorer and Search.
|
|
1814
|
+
"""
|
|
1815
|
+
|
|
1816
|
+
def __init__(self, views: set[ViewEntity]):
|
|
1817
|
+
if not_in_cognite_core := {view.external_id for view in views} - COGNITE_CORE_CONCEPTS.union(
|
|
1818
|
+
COGNITE_CORE_FEATURES
|
|
1819
|
+
):
|
|
1820
|
+
raise NeatValueError(
|
|
1821
|
+
f"Concept(s) {', '.join(not_in_cognite_core)} is/are not part of the Cognite Core Data Model. Aborting."
|
|
1822
|
+
)
|
|
1823
|
+
|
|
1824
|
+
self._views = views
|
|
1825
|
+
|
|
1826
|
+
def transform(self, rules: DMSRules) -> DMSRules:
|
|
1827
|
+
# should check to make sure data model is based on the editable CDM
|
|
1828
|
+
# if not raise an error
|
|
1829
|
+
|
|
1830
|
+
subsetted_rules: dict[str, Any] = {
|
|
1831
|
+
"metadata": rules.metadata.model_copy(),
|
|
1832
|
+
"views": SheetList[DMSView](),
|
|
1833
|
+
"properties": SheetList[DMSProperty](),
|
|
1834
|
+
"containers": SheetList[DMSContainer](),
|
|
1835
|
+
"enum": rules.enum,
|
|
1836
|
+
"nodes": rules.nodes,
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
containers_to_keep = set()
|
|
1840
|
+
|
|
1841
|
+
if editable_views_to_keep := self._editable_views_to_keep(rules):
|
|
1842
|
+
for view in rules.views:
|
|
1843
|
+
if view.view in editable_views_to_keep or view.view.space in COGNITE_SPACES:
|
|
1844
|
+
subsetted_rules["views"].append(view)
|
|
1845
|
+
|
|
1846
|
+
for property_ in rules.properties:
|
|
1847
|
+
if property_.view in editable_views_to_keep and (
|
|
1848
|
+
isinstance(property_.value_type, DataType)
|
|
1849
|
+
or isinstance(property_.value_type, DMSUnknownEntity)
|
|
1850
|
+
or (isinstance(property_.value_type, ViewEntity) and property_.value_type in editable_views_to_keep)
|
|
1851
|
+
):
|
|
1852
|
+
subsetted_rules["properties"].append(property_)
|
|
1853
|
+
if property_.container:
|
|
1854
|
+
containers_to_keep.add(property_.container)
|
|
1855
|
+
|
|
1856
|
+
if rules.containers:
|
|
1857
|
+
for container in rules.containers:
|
|
1858
|
+
if container.container in containers_to_keep:
|
|
1859
|
+
subsetted_rules["containers"].append(container)
|
|
1860
|
+
try:
|
|
1861
|
+
return DMSRules.model_validate(subsetted_rules)
|
|
1862
|
+
except ValidationError as e:
|
|
1863
|
+
raise NeatValueError(f"Cannot subset rules: {e}") from e
|
|
1864
|
+
else:
|
|
1865
|
+
raise NeatValueError("Cannot subset rules: provided data model is not based on Core Data Model")
|
|
1866
|
+
|
|
1867
|
+
def _editable_views_to_keep(self, rules: DMSRules) -> set[ViewEntity]:
|
|
1868
|
+
return {
|
|
1869
|
+
view.view
|
|
1870
|
+
for view in rules.views
|
|
1871
|
+
if view.view.space not in COGNITE_SPACES
|
|
1872
|
+
and view.implements
|
|
1873
|
+
and any(implemented in self._views for implemented in view.implements)
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
|
|
1805
1877
|
class SubsetDMSRules(VerifiedRulesTransformer[DMSRules, DMSRules]):
|
|
1806
1878
|
"""Subsets DMSRules to only include the specified views."""
|
|
1807
1879
|
|
|
@@ -3,7 +3,6 @@ from typing import Literal
|
|
|
3
3
|
from cognite.client.data_classes.data_modeling import DataModelIdentifier
|
|
4
4
|
|
|
5
5
|
from cognite.neat._issues import IssueList
|
|
6
|
-
from cognite.neat._rules.models import DMSRules, InformationRules
|
|
7
6
|
from cognite.neat._rules.models.dms import DMSValidation
|
|
8
7
|
from cognite.neat._rules.transformers import (
|
|
9
8
|
IncludeReferenced,
|
|
@@ -29,7 +28,7 @@ class CreateAPI:
|
|
|
29
28
|
def enterprise_model(
|
|
30
29
|
self,
|
|
31
30
|
data_model_id: DataModelIdentifier,
|
|
32
|
-
org_name: str = "
|
|
31
|
+
org_name: str = "CopyOf",
|
|
33
32
|
dummy_property: str = "GUID",
|
|
34
33
|
) -> IssueList:
|
|
35
34
|
"""Uses the current data model as a basis to create enterprise data model
|
|
@@ -58,7 +57,7 @@ class CreateAPI:
|
|
|
58
57
|
- Charts
|
|
59
58
|
|
|
60
59
|
"""
|
|
61
|
-
last_rules = self.
|
|
60
|
+
last_rules = self._state.rule_store.last_verified_rules
|
|
62
61
|
issues = self._state.rule_transform(
|
|
63
62
|
ToEnterpriseModel(
|
|
64
63
|
new_model_id=data_model_id,
|
|
@@ -71,12 +70,6 @@ class CreateAPI:
|
|
|
71
70
|
self._state.last_reference = last_rules
|
|
72
71
|
return issues
|
|
73
72
|
|
|
74
|
-
def _get_last_rules(self) -> InformationRules | DMSRules | None:
|
|
75
|
-
if not self._state.rule_store.provenance:
|
|
76
|
-
return None
|
|
77
|
-
last_entity = self._state.rule_store.provenance[-1].target_entity
|
|
78
|
-
return last_entity.dms or last_entity.information
|
|
79
|
-
|
|
80
73
|
def solution_model(
|
|
81
74
|
self,
|
|
82
75
|
data_model_id: DataModelIdentifier,
|
|
@@ -110,7 +103,7 @@ class CreateAPI:
|
|
|
110
103
|
the containers in the solution data model space.
|
|
111
104
|
|
|
112
105
|
"""
|
|
113
|
-
last_rules = self.
|
|
106
|
+
last_rules = self._state.rule_store.last_verified_rules
|
|
114
107
|
issues = self._state.rule_transform(
|
|
115
108
|
ToSolutionModel(
|
|
116
109
|
new_model_id=data_model_id,
|
|
@@ -144,7 +137,7 @@ class CreateAPI:
|
|
|
144
137
|
If you set same-space, only the properties of the views in the same space as the data model
|
|
145
138
|
will be included.
|
|
146
139
|
"""
|
|
147
|
-
last_rules = self.
|
|
140
|
+
last_rules = self._state.rule_store.last_verified_rules
|
|
148
141
|
view_ids, container_ids = DMSValidation(
|
|
149
142
|
self._state.rule_store.last_verified_dms_rules
|
|
150
143
|
).imported_views_and_containers_ids()
|
|
@@ -4,7 +4,7 @@ from typing import Any
|
|
|
4
4
|
|
|
5
5
|
from rdflib import URIRef
|
|
6
6
|
|
|
7
|
-
from cognite.neat._alpha import
|
|
7
|
+
from cognite.neat._alpha import ExperimentalFlags
|
|
8
8
|
from cognite.neat._graph.transformers import (
|
|
9
9
|
ConnectionToLiteral,
|
|
10
10
|
ConvertLiteral,
|
|
@@ -273,7 +273,7 @@ class DataModelPrepareAPI:
|
|
|
273
273
|
For properties, the naming will be standardized to camelCase.
|
|
274
274
|
"""
|
|
275
275
|
warnings.filterwarnings("default")
|
|
276
|
-
|
|
276
|
+
ExperimentalFlags.standardize_naming.warn()
|
|
277
277
|
return self._state.rule_transform(StandardizeNaming())
|
|
278
278
|
|
|
279
279
|
def standardize_space_and_version(self) -> IssueList:
|
|
@@ -282,5 +282,5 @@ class DataModelPrepareAPI:
|
|
|
282
282
|
This method will standardize the space and version in the data model to the Cognite standard.
|
|
283
283
|
"""
|
|
284
284
|
warnings.filterwarnings("default")
|
|
285
|
-
|
|
285
|
+
ExperimentalFlags.standardize_space_and_version.warn()
|
|
286
286
|
return self._state.rule_transform(StandardizeSpaceAndVersion())
|
|
@@ -4,7 +4,7 @@ from typing import Any, Literal, cast
|
|
|
4
4
|
from cognite.client.data_classes.data_modeling import DataModelId, DataModelIdentifier
|
|
5
5
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
6
6
|
|
|
7
|
-
from cognite.neat._alpha import
|
|
7
|
+
from cognite.neat._alpha import ExperimentalFlags
|
|
8
8
|
from cognite.neat._client import NeatClient
|
|
9
9
|
from cognite.neat._constants import (
|
|
10
10
|
CLASSIC_CDF_NAMESPACE,
|
|
@@ -28,7 +28,12 @@ from cognite.neat._issues.errors import NeatValueError
|
|
|
28
28
|
from cognite.neat._issues.warnings import MissingCogniteClientWarning
|
|
29
29
|
from cognite.neat._rules import catalog, importers
|
|
30
30
|
from cognite.neat._rules.importers import BaseImporter
|
|
31
|
+
from cognite.neat._rules.models.entities._single_value import ViewEntity
|
|
31
32
|
from cognite.neat._rules.transformers import ClassicPrepareCore
|
|
33
|
+
from cognite.neat._rules.transformers._converters import (
|
|
34
|
+
ToEnterpriseModel,
|
|
35
|
+
_SubsetEditableCDMRules,
|
|
36
|
+
)
|
|
32
37
|
from cognite.neat._utils.reader import NeatReader
|
|
33
38
|
|
|
34
39
|
from ._state import SessionState
|
|
@@ -114,6 +119,86 @@ class CDFReadAPI(BaseReadAPI):
|
|
|
114
119
|
importer = importers.DMSImporter.from_data_model_id(cast(NeatClient, self._state.client), data_model_id)
|
|
115
120
|
return self._state.rule_import(importer)
|
|
116
121
|
|
|
122
|
+
def core_data_model(self, concepts: str | list[str]) -> IssueList:
|
|
123
|
+
"""Subset the data model to the desired concepts.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
concepts: The concepts to subset the data model to
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
IssueList: A list of issues that occurred during the transformation.
|
|
130
|
+
|
|
131
|
+
Example:
|
|
132
|
+
Read the CogniteCore data model and reduce the data model to only the 'CogniteAsset' concept.
|
|
133
|
+
```python
|
|
134
|
+
neat = NeatSession(CogniteClient())
|
|
135
|
+
|
|
136
|
+
neat.subset.data_model.core_data_model(concepts=["CogniteAsset", "CogniteEquipment"])
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
!!! note "Bundle of actions"
|
|
140
|
+
This method is a helper method that bundles the following actions:
|
|
141
|
+
- Imports the latest version of Cognite's Core Data Model (CDM)
|
|
142
|
+
- Makes editable copy of the CDM concepts
|
|
143
|
+
- Subsets the copy to the desired concepts to desired set of concepts
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
concepts = concepts if isinstance(concepts, list | set) else [concepts]
|
|
147
|
+
|
|
148
|
+
self._state._raise_exception_if_condition_not_met(
|
|
149
|
+
"Subset Core Data Model",
|
|
150
|
+
empty_rules_store_required=True,
|
|
151
|
+
client_required=True,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
warnings.filterwarnings("default")
|
|
155
|
+
ExperimentalFlags.core_data_model_subsetting.warn()
|
|
156
|
+
|
|
157
|
+
cdm_v1 = DataModelId.load(("cdf_cdm", "CogniteCore", "v1"))
|
|
158
|
+
importer: importers.DMSImporter = importers.DMSImporter.from_data_model_id(
|
|
159
|
+
cast(NeatClient, self._state.client), cdm_v1
|
|
160
|
+
)
|
|
161
|
+
issues = self._state.rule_import(importer)
|
|
162
|
+
|
|
163
|
+
if issues.has_errors:
|
|
164
|
+
return issues
|
|
165
|
+
|
|
166
|
+
cdm_rules = self._state.rule_store.last_verified_rules
|
|
167
|
+
|
|
168
|
+
issues.extend(
|
|
169
|
+
self._state.rule_transform(
|
|
170
|
+
ToEnterpriseModel(
|
|
171
|
+
new_model_id=("my_space", "MyCDMSubset", "v1"),
|
|
172
|
+
org_name="CopyOf",
|
|
173
|
+
dummy_property="GUID",
|
|
174
|
+
move_connections=True,
|
|
175
|
+
)
|
|
176
|
+
)
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
if issues.has_errors:
|
|
180
|
+
return issues
|
|
181
|
+
|
|
182
|
+
issues.extend(
|
|
183
|
+
self._state.rule_transform(
|
|
184
|
+
_SubsetEditableCDMRules(
|
|
185
|
+
views={
|
|
186
|
+
ViewEntity(
|
|
187
|
+
space=cdm_v1.space,
|
|
188
|
+
externalId=concept,
|
|
189
|
+
version=cast(str, cdm_v1.version),
|
|
190
|
+
)
|
|
191
|
+
for concept in concepts
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
)
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
if cdm_rules and not issues.has_errors:
|
|
198
|
+
self._state.last_reference = cdm_rules
|
|
199
|
+
|
|
200
|
+
return issues
|
|
201
|
+
|
|
117
202
|
def graph(
|
|
118
203
|
self,
|
|
119
204
|
data_model_id: DataModelIdentifier,
|
|
@@ -361,7 +446,7 @@ class ExcelReadAPI(BaseReadAPI):
|
|
|
361
446
|
|
|
362
447
|
if enable_manual_edit:
|
|
363
448
|
warnings.filterwarnings("default")
|
|
364
|
-
|
|
449
|
+
ExperimentalFlags.manual_rules_edit.warn()
|
|
365
450
|
else:
|
|
366
451
|
self._state._raise_exception_if_condition_not_met(
|
|
367
452
|
"Read Excel Rules",
|
|
@@ -430,7 +515,7 @@ class CSVReadAPI(BaseReadAPI):
|
|
|
430
515
|
|
|
431
516
|
def __call__(self, io: Any, type: str, primary_key: str) -> None:
|
|
432
517
|
warnings.filterwarnings("default")
|
|
433
|
-
|
|
518
|
+
ExperimentalFlags.csv_read.warn()
|
|
434
519
|
|
|
435
520
|
engine = import_engine()
|
|
436
521
|
engine.set.format = "csv"
|
|
@@ -488,7 +573,7 @@ class XMLReadAPI(BaseReadAPI):
|
|
|
488
573
|
- remove edges to nodes that do not exist in the extracted graph
|
|
489
574
|
"""
|
|
490
575
|
warnings.filterwarnings("default")
|
|
491
|
-
|
|
576
|
+
ExperimentalFlags.dexpi_read.warn()
|
|
492
577
|
|
|
493
578
|
self._state._raise_exception_if_condition_not_met(
|
|
494
579
|
"Read DEXPI file",
|
|
@@ -548,7 +633,7 @@ class XMLReadAPI(BaseReadAPI):
|
|
|
548
633
|
- remove edges to nodes that do not exist in the extracted graph
|
|
549
634
|
"""
|
|
550
635
|
warnings.filterwarnings("default")
|
|
551
|
-
|
|
636
|
+
ExperimentalFlags.aml_read.warn()
|
|
552
637
|
|
|
553
638
|
self._state._raise_exception_if_condition_not_met(
|
|
554
639
|
"Read AML file",
|
|
@@ -608,7 +693,7 @@ class RDFReadAPI(BaseReadAPI):
|
|
|
608
693
|
```
|
|
609
694
|
"""
|
|
610
695
|
warnings.filterwarnings("default")
|
|
611
|
-
|
|
696
|
+
ExperimentalFlags.ontology_read.warn()
|
|
612
697
|
|
|
613
698
|
self._state._raise_exception_if_condition_not_met(
|
|
614
699
|
"Read Ontology file",
|
|
@@ -631,7 +716,7 @@ class RDFReadAPI(BaseReadAPI):
|
|
|
631
716
|
```
|
|
632
717
|
"""
|
|
633
718
|
warnings.filterwarnings("default")
|
|
634
|
-
|
|
719
|
+
ExperimentalFlags.imf_read.warn()
|
|
635
720
|
|
|
636
721
|
self._state._raise_exception_if_condition_not_met(
|
|
637
722
|
"Read IMF file",
|
|
@@ -687,12 +772,6 @@ class Examples:
|
|
|
687
772
|
def __init__(self, state: SessionState) -> None:
|
|
688
773
|
self._state = state
|
|
689
774
|
|
|
690
|
-
@property
|
|
691
|
-
def _get_client(self) -> NeatClient:
|
|
692
|
-
if self._state.client is None:
|
|
693
|
-
raise NeatValueError("No client provided. Please provide a client to read a data model.")
|
|
694
|
-
return self._state.client
|
|
695
|
-
|
|
696
775
|
def nordic44(self) -> IssueList:
|
|
697
776
|
"""Reads the Nordic 44 knowledge graph into the NeatSession graph store."""
|
|
698
777
|
|
|
@@ -722,8 +801,11 @@ class Examples:
|
|
|
722
801
|
self._state._raise_exception_if_condition_not_met(
|
|
723
802
|
"Read Core Data Model example",
|
|
724
803
|
empty_rules_store_required=True,
|
|
804
|
+
client_required=True,
|
|
725
805
|
)
|
|
726
806
|
|
|
727
807
|
cdm_v1 = DataModelId.load(("cdf_cdm", "CogniteCore", "v1"))
|
|
728
|
-
importer: importers.DMSImporter = importers.DMSImporter.from_data_model_id(
|
|
808
|
+
importer: importers.DMSImporter = importers.DMSImporter.from_data_model_id(
|
|
809
|
+
cast(NeatClient, self._state.client), cdm_v1
|
|
810
|
+
)
|
|
729
811
|
return self._state.rule_import(importer)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import warnings
|
|
2
2
|
|
|
3
|
-
from cognite.neat._alpha import
|
|
3
|
+
from cognite.neat._alpha import ExperimentalFlags
|
|
4
4
|
from cognite.neat._issues._base import IssueList
|
|
5
5
|
from cognite.neat._rules.models.entities._single_value import ClassEntity, ViewEntity
|
|
6
6
|
from cognite.neat._rules.transformers import SubsetDMSRules, SubsetInformationRules
|
|
@@ -47,7 +47,7 @@ class SubsetAPI:
|
|
|
47
47
|
raise NeatSessionError("No rules to set the data model ID.")
|
|
48
48
|
|
|
49
49
|
warnings.filterwarnings("default")
|
|
50
|
-
|
|
50
|
+
ExperimentalFlags.data_model_subsetting.warn()
|
|
51
51
|
|
|
52
52
|
dms = self._state.rule_store.provenance[-1].target_entity.dms
|
|
53
53
|
information = self._state.rule_store.provenance[-1].target_entity.information
|
|
@@ -7,7 +7,7 @@ from typing import Any, Literal, cast, overload
|
|
|
7
7
|
from cognite.client import data_modeling as dm
|
|
8
8
|
from cognite.client.data_classes.data_modeling import DataModelIdentifier
|
|
9
9
|
|
|
10
|
-
from cognite.neat._alpha import
|
|
10
|
+
from cognite.neat._alpha import ExperimentalFlags
|
|
11
11
|
from cognite.neat._client._api_client import NeatClient
|
|
12
12
|
from cognite.neat._constants import COGNITE_MODELS
|
|
13
13
|
from cognite.neat._graph import loaders
|
|
@@ -52,7 +52,7 @@ class ToAPI:
|
|
|
52
52
|
```
|
|
53
53
|
"""
|
|
54
54
|
warnings.filterwarnings("default")
|
|
55
|
-
|
|
55
|
+
ExperimentalFlags.to_ontology.warn()
|
|
56
56
|
|
|
57
57
|
filepath = Path(io)
|
|
58
58
|
if filepath.suffix != ".ttl":
|
|
@@ -145,7 +145,7 @@ class ToAPI:
|
|
|
145
145
|
|
|
146
146
|
if include_properties == "same-space":
|
|
147
147
|
warnings.filterwarnings("default")
|
|
148
|
-
|
|
148
|
+
ExperimentalFlags.same_space_properties_only_export.warn()
|
|
149
149
|
|
|
150
150
|
exporter = exporters.ExcelExporter(
|
|
151
151
|
styling="maximal",
|
|
@@ -3,7 +3,7 @@ import warnings
|
|
|
3
3
|
from collections.abc import Callable
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
|
-
from cognite.neat._alpha import
|
|
6
|
+
from cognite.neat._alpha import ExperimentalFeatureWarning
|
|
7
7
|
from cognite.neat._issues.errors import CDFMissingClientError, NeatImportError
|
|
8
8
|
from cognite.neat._issues.errors._external import OxigraphStorageLockedError
|
|
9
9
|
from cognite.neat._issues.errors._general import NeatValueError
|
|
@@ -38,7 +38,7 @@ def _session_method_wrapper(func: Callable, cls_name: str):
|
|
|
38
38
|
with warnings.catch_warnings(record=True) as w:
|
|
39
39
|
result = func(*args, **kwargs)
|
|
40
40
|
for warning in w:
|
|
41
|
-
if isinstance(warning.message,
|
|
41
|
+
if isinstance(warning.message, ExperimentalFeatureWarning):
|
|
42
42
|
print(f"{_WARNING_PREFIX} {warning.message}")
|
|
43
43
|
|
|
44
44
|
return result
|
|
@@ -449,6 +449,13 @@ class NeatRulesStore:
|
|
|
449
449
|
raise EmptyStore()
|
|
450
450
|
return self.provenance[-1].target_entity.information
|
|
451
451
|
|
|
452
|
+
@property
|
|
453
|
+
def last_verified_rules(self) -> InformationRules | DMSRules | None:
|
|
454
|
+
if not self.provenance:
|
|
455
|
+
return None
|
|
456
|
+
last_entity = self.provenance[-1].target_entity
|
|
457
|
+
return last_entity.dms or last_entity.information
|
|
458
|
+
|
|
452
459
|
@property
|
|
453
460
|
def last_issues(self) -> IssueList | None:
|
|
454
461
|
return self._last_issues
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "cognite-neat"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.116.1"
|
|
4
4
|
readme = "README.md"
|
|
5
5
|
description = "Knowledge graph transformation"
|
|
6
6
|
authors = [
|
|
@@ -53,7 +53,7 @@ neat = "cognite.neat._app.main:run"
|
|
|
53
53
|
python = "^3.10"
|
|
54
54
|
# Core dependencies
|
|
55
55
|
pandas = "*"
|
|
56
|
-
cognite-sdk = "^7.
|
|
56
|
+
cognite-sdk = "^7.73.4"
|
|
57
57
|
rdflib = "*"
|
|
58
58
|
pydantic = "^2"
|
|
59
59
|
PyYAML = "*"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import warnings
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class AlphaWarning(UserWarning):
|
|
5
|
-
def __init__(self, feature_name: str):
|
|
6
|
-
super().__init__(f"Alpha feature '{feature_name}' is subject to change without notice")
|
|
7
|
-
|
|
8
|
-
def warn(self) -> None:
|
|
9
|
-
warnings.warn(self, stacklevel=2)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class AlphaFlags:
|
|
13
|
-
manual_rules_edit = AlphaWarning("enable_manual_edit")
|
|
14
|
-
same_space_properties_only_export = AlphaWarning("same-space-properties-only")
|
|
15
|
-
standardize_naming = AlphaWarning("standardize_naming")
|
|
16
|
-
standardize_space_and_version = AlphaWarning("standardize_space_and_version")
|
|
17
|
-
data_model_subsetting = AlphaWarning("data_model_subsetting")
|
|
18
|
-
ontology_read = AlphaWarning("ontology_read")
|
|
19
|
-
imf_read = AlphaWarning("imf_read")
|
|
20
|
-
dexpi_read = AlphaWarning("dexpi_read")
|
|
21
|
-
aml_read = AlphaWarning("aml_read")
|
|
22
|
-
csv_read = AlphaWarning("csv_read")
|
|
23
|
-
to_ontology = AlphaWarning("to_ontology")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/_api/data_modeling_loaders.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_neat-0.115.1 → cognite_neat-0.116.1}/cognite/neat/_client/data_classes/data_modeling.py
RENAMED
|
File without changes
|