cognite-neat 0.106.0__tar.gz → 0.108.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.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/PKG-INFO +2 -2
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_constants.py +35 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/_shared.py +4 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/__init__.py +5 -1
- cognite_neat-0.108.0/cognite/neat/_graph/extractors/_base.py +58 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +128 -14
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +156 -12
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +50 -12
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +26 -1
- cognite_neat-0.108.0/cognite/neat/_graph/extractors/_dms.py +307 -0
- cognite_neat-0.108.0/cognite/neat/_graph/extractors/_dms_graph.py +199 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_mock_graph_generator.py +1 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_rdf_file.py +33 -5
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/loaders/__init__.py +1 -3
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/loaders/_rdf2dms.py +123 -19
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/queries/_base.py +140 -84
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/queries/_construct.py +2 -2
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/transformers/__init__.py +8 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/transformers/_base.py +9 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/transformers/_classic_cdf.py +90 -3
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/transformers/_rdfpath.py +3 -3
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/transformers/_value_type.py +106 -45
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/errors/_resources.py +1 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/warnings/__init__.py +0 -2
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/warnings/_models.py +1 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/warnings/_properties.py +0 -8
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/analysis/_base.py +1 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/analysis/_information.py +14 -13
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/catalog/__init__.py +1 -0
- cognite_neat-0.108.0/cognite/neat/_rules/catalog/classic_model.xlsx +0 -0
- cognite_neat-0.108.0/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/_rules2instance_template.py +3 -3
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/__init__.py +3 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_dms2rules.py +7 -5
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +1 -2
- cognite_neat-0.108.0/cognite/neat/_rules/importers/_rdf/__init__.py +5 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_rdf/_base.py +2 -2
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +242 -19
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/_base_rules.py +13 -15
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/_types.py +5 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/dms/_rules.py +51 -10
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/dms/_rules_input.py +4 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/information/_rules.py +48 -5
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/information/_rules_input.py +6 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/mapping/_classic2core.py +4 -5
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/transformers/__init__.py +10 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/transformers/_converters.py +300 -62
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_base.py +57 -10
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_drop.py +5 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_inspect.py +3 -2
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_mapping.py +17 -6
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_prepare.py +0 -47
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_read.py +115 -10
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_set.py +27 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_show.py +4 -4
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_state.py +12 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_to.py +43 -2
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_wizard.py +1 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/exceptions.py +8 -3
- cognite_neat-0.108.0/cognite/neat/_store/_graph_store.py +687 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_store/_rules_store.py +130 -1
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/auth.py +3 -1
- cognite_neat-0.108.0/cognite/neat/_version.py +2 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/pyproject.toml +1 -1
- cognite_neat-0.106.0/cognite/neat/_graph/extractors/_base.py +0 -26
- cognite_neat-0.106.0/cognite/neat/_graph/extractors/_dms.py +0 -158
- cognite_neat-0.106.0/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- cognite_neat-0.106.0/cognite/neat/_rules/importers/_rdf/__init__.py +0 -5
- cognite_neat-0.106.0/cognite/neat/_store/_graph_store.py +0 -492
- cognite_neat-0.106.0/cognite/neat/_version.py +0 -2
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/LICENSE +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/README.md +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/_api/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/_api/data_modeling_loaders.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/_api/schema.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/_api_client.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/data_classes/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/data_classes/data_modeling.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/data_classes/neat_sequence.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/data_classes/schema.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_client/testing.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_iodd.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/loaders/_base.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/queries/_shared.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/transformers/_iodd.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/_base.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/errors/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/errors/_external.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/errors/_properties.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/errors/_workflow.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/warnings/_general.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/warnings/_resources.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/_shared.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/analysis/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/analysis/_dms.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/catalog/hello_world_pump.xlsx +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_base.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_rdf/_imf2rules.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_rdf/_owl2rules.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/data_types.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/information/_validation.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/models/mapping/_classic2core.yaml +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/transformers/_base.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/transformers/_mapping.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_rules/transformers/_verification.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/_collector.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/engine/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/engine/_import.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/engine/_interface.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_session/engine/_load.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_store/_provenance.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_store/exceptions.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/graph_transformations_report.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/io_.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/rdf_.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/reader/__init__.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/reader/_base.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/upload.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/py.typed +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.108.0
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
|
-
Home-page: https://cognite-neat.readthedocs-hosted.com/
|
|
6
5
|
License: Apache-2.0
|
|
7
6
|
Author: Nikola Vasiljevic
|
|
8
7
|
Author-email: nikola.vasiljevic@cognite.com
|
|
@@ -54,6 +53,7 @@ Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
|
|
|
54
53
|
Requires-Dist: typing_extensions (>=4.8,<5.0) ; python_version < "3.11"
|
|
55
54
|
Requires-Dist: urllib3 (>=2,<3)
|
|
56
55
|
Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
|
|
56
|
+
Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
|
|
57
57
|
Project-URL: Repository, https://github.com/cognitedata/neat
|
|
58
58
|
Description-Content-Type: text/markdown
|
|
59
59
|
|
|
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING
|
|
|
5
5
|
from cognite.client import data_modeling as dm
|
|
6
6
|
from cognite.client.data_classes.data_modeling.ids import DataModelId
|
|
7
7
|
from rdflib import DC, DCTERMS, FOAF, OWL, RDF, RDFS, SH, SKOS, XSD, Namespace, URIRef
|
|
8
|
+
from rdflib.namespace import DefinedNamespace
|
|
8
9
|
|
|
9
10
|
from cognite import neat
|
|
10
11
|
|
|
@@ -73,10 +74,22 @@ DEFAULT_NAMESPACE = Namespace("http://purl.org/cognite/neat/")
|
|
|
73
74
|
CDF_NAMESPACE = Namespace("https://cognitedata.com/")
|
|
74
75
|
DEFAULT_BASE_URI = URIRef(DEFAULT_NAMESPACE)
|
|
75
76
|
CLASSIC_CDF_NAMESPACE = Namespace("http://purl.org/cognite/cdf-classic#")
|
|
76
|
-
UNKNOWN_TYPE = DEFAULT_NAMESPACE.UnknownType
|
|
77
77
|
XML_SCHEMA_NAMESPACE = Namespace("http://www.w3.org/2001/XMLSchema#")
|
|
78
78
|
|
|
79
79
|
|
|
80
|
+
class NEAT(DefinedNamespace):
|
|
81
|
+
"""
|
|
82
|
+
NEAT internal data model used for internal purposes of the NEAT library
|
|
83
|
+
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
_fail = True
|
|
87
|
+
_NS = Namespace("http://thisisneat.io/internal/")
|
|
88
|
+
|
|
89
|
+
type: URIRef # type property used to express a type of a subject
|
|
90
|
+
UnknownType: URIRef # Unknown type used to express that the type of a subject is unknown
|
|
91
|
+
|
|
92
|
+
|
|
80
93
|
def get_default_prefixes_and_namespaces() -> dict[str, Namespace]:
|
|
81
94
|
return {
|
|
82
95
|
"owl": OWL._NS,
|
|
@@ -154,3 +167,24 @@ READONLY_PROPERTIES_BY_CONTAINER: Mapping[dm.ContainerId, frozenset[str]] = {
|
|
|
154
167
|
|
|
155
168
|
def is_readonly_property(container: dm.ContainerId, property_: str) -> bool:
|
|
156
169
|
return container in READONLY_PROPERTIES_BY_CONTAINER and property_ in READONLY_PROPERTIES_BY_CONTAINER[container]
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
DMS_RESERVED_PROPERTIES = frozenset(
|
|
173
|
+
{
|
|
174
|
+
"createdTime",
|
|
175
|
+
"deletedTime",
|
|
176
|
+
"edge_id",
|
|
177
|
+
"extensions",
|
|
178
|
+
"externalId",
|
|
179
|
+
"lastUpdatedTime",
|
|
180
|
+
"node_id",
|
|
181
|
+
"project_id",
|
|
182
|
+
"property_group",
|
|
183
|
+
"seq",
|
|
184
|
+
"space",
|
|
185
|
+
"version",
|
|
186
|
+
"tg_table_name",
|
|
187
|
+
"startNode",
|
|
188
|
+
"endNode",
|
|
189
|
+
}
|
|
190
|
+
)
|
|
@@ -7,6 +7,10 @@ MIMETypes: TypeAlias = Literal[
|
|
|
7
7
|
RDFTypes: TypeAlias = Literal["xml", "rdf", "owl", "n3", "ttl", "turtle", "nt", "nq", "nquads", "trig"]
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
def quad_formats() -> list[str]:
|
|
11
|
+
return ["trig", "nquads", "nq", "nt"]
|
|
12
|
+
|
|
13
|
+
|
|
10
14
|
def rdflib_to_oxi_type(rdflib_format: str) -> str | None:
|
|
11
15
|
"""Convert an RDFlib format to a MIME type.
|
|
12
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from cognite.neat._session.engine._interface import Extractor as EngineExtractor
|
|
2
2
|
|
|
3
|
-
from ._base import BaseExtractor
|
|
3
|
+
from ._base import BaseExtractor, KnowledgeGraphExtractor
|
|
4
4
|
from ._classic_cdf._assets import AssetsExtractor
|
|
5
5
|
from ._classic_cdf._classic import ClassicGraphExtractor
|
|
6
6
|
from ._classic_cdf._data_sets import DataSetExtractor
|
|
@@ -12,6 +12,7 @@ from ._classic_cdf._sequences import SequencesExtractor
|
|
|
12
12
|
from ._classic_cdf._timeseries import TimeSeriesExtractor
|
|
13
13
|
from ._dexpi import DexpiExtractor
|
|
14
14
|
from ._dms import DMSExtractor
|
|
15
|
+
from ._dms_graph import DMSGraphExtractor
|
|
15
16
|
from ._iodd import IODDExtractor
|
|
16
17
|
from ._mock_graph_generator import MockGraphGenerator
|
|
17
18
|
from ._rdf_file import RdfFileExtractor
|
|
@@ -21,11 +22,13 @@ __all__ = [
|
|
|
21
22
|
"BaseExtractor",
|
|
22
23
|
"ClassicGraphExtractor",
|
|
23
24
|
"DMSExtractor",
|
|
25
|
+
"DMSGraphExtractor",
|
|
24
26
|
"DataSetExtractor",
|
|
25
27
|
"DexpiExtractor",
|
|
26
28
|
"EventsExtractor",
|
|
27
29
|
"FilesExtractor",
|
|
28
30
|
"IODDExtractor",
|
|
31
|
+
"KnowledgeGraphExtractor",
|
|
29
32
|
"LabelsExtractor",
|
|
30
33
|
"MockGraphGenerator",
|
|
31
34
|
"RdfFileExtractor",
|
|
@@ -51,6 +54,7 @@ TripleExtractors = (
|
|
|
51
54
|
| ClassicGraphExtractor
|
|
52
55
|
| DataSetExtractor
|
|
53
56
|
| EngineExtractor
|
|
57
|
+
| DMSGraphExtractor
|
|
54
58
|
)
|
|
55
59
|
|
|
56
60
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
from collections.abc import Iterable
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from rdflib import URIRef
|
|
6
|
+
|
|
7
|
+
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
8
|
+
from cognite.neat._rules.models import InformationRules
|
|
9
|
+
from cognite.neat._shared import Triple
|
|
10
|
+
from cognite.neat._utils.auxiliary import class_html_doc
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from cognite.neat._store._provenance import Agent as ProvenanceAgent
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BaseExtractor:
|
|
17
|
+
"""This is the base class for all extractors. It defines the interface that
|
|
18
|
+
extractors must implement.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def _get_activity_names(self) -> list[str]:
|
|
22
|
+
"""Returns the name of the activities that the extractor performs,
|
|
23
|
+
i.e., the actions that it performs when you call extract().."""
|
|
24
|
+
# This method can be overridden by subclasses that runs multiple extractors
|
|
25
|
+
# for example the ClassicGraphExtractor
|
|
26
|
+
return [type(self).__name__]
|
|
27
|
+
|
|
28
|
+
@abstractmethod
|
|
29
|
+
def extract(self) -> Iterable[Triple]:
|
|
30
|
+
raise NotImplementedError()
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def _repr_html_(cls) -> str:
|
|
34
|
+
return class_html_doc(cls)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class KnowledgeGraphExtractor(BaseExtractor):
|
|
38
|
+
"""A knowledge graph extractor extracts triples with a schema"""
|
|
39
|
+
|
|
40
|
+
@abstractmethod
|
|
41
|
+
def get_information_rules(self) -> InformationRules:
|
|
42
|
+
"""Returns the information rules that the extractor uses."""
|
|
43
|
+
raise NotImplementedError()
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def description(self) -> str:
|
|
47
|
+
return self.__doc__.strip().split("\n")[0] if self.__doc__ else "Missing"
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def source_uri(self) -> URIRef:
|
|
51
|
+
raise NotImplementedError
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def agent(self) -> "ProvenanceAgent":
|
|
55
|
+
"""Provenance agent for the importer."""
|
|
56
|
+
from cognite.neat._store._provenance import Agent as ProvenanceAgent
|
|
57
|
+
|
|
58
|
+
return ProvenanceAgent(id_=DEFAULT_NAMESPACE[f"agent/{type(self).__name__}"])
|
{cognite_neat-0.106.0 → cognite_neat-0.108.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import re
|
|
3
3
|
import sys
|
|
4
|
+
import typing
|
|
5
|
+
import urllib.parse
|
|
4
6
|
import warnings
|
|
5
7
|
from abc import ABC, abstractmethod
|
|
6
8
|
from collections.abc import Callable, Iterable, Sequence, Set
|
|
@@ -16,7 +18,8 @@ from rdflib import RDF, XSD, Literal, Namespace, URIRef
|
|
|
16
18
|
|
|
17
19
|
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
18
20
|
from cognite.neat._graph.extractors._base import BaseExtractor
|
|
19
|
-
from cognite.neat._issues.
|
|
21
|
+
from cognite.neat._issues.errors import NeatValueError
|
|
22
|
+
from cognite.neat._issues.warnings import CDFAuthWarning, NeatValueWarning
|
|
20
23
|
from cognite.neat._shared import Triple
|
|
21
24
|
from cognite.neat._utils.auxiliary import string_to_ideal_type
|
|
22
25
|
from cognite.neat._utils.collection_ import iterate_progress_bar_if_above_config_threshold
|
|
@@ -72,6 +75,8 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
72
75
|
camel_case (bool, optional): Whether to use camelCase instead of snake_case for property names.
|
|
73
76
|
Defaults to True.
|
|
74
77
|
as_write (bool, optional): Whether to use the write/request format of the items. Defaults to False.
|
|
78
|
+
prefix (str, optional): A prefix to add to the rdf type. Defaults to None.
|
|
79
|
+
identifier (Literal["id", "externalId"], optional): The identifier to use. Defaults to "id".
|
|
75
80
|
"""
|
|
76
81
|
|
|
77
82
|
_default_rdf_type: str
|
|
@@ -89,6 +94,8 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
89
94
|
skip_metadata_values: Set[str] | None = DEFAULT_SKIP_METADATA_VALUES,
|
|
90
95
|
camel_case: bool = True,
|
|
91
96
|
as_write: bool = False,
|
|
97
|
+
prefix: str | None = None,
|
|
98
|
+
identifier: typing.Literal["id", "externalId"] = "id",
|
|
92
99
|
):
|
|
93
100
|
self.namespace = namespace or DEFAULT_NAMESPACE
|
|
94
101
|
self.items = items
|
|
@@ -99,9 +106,19 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
99
106
|
self.skip_metadata_values = skip_metadata_values
|
|
100
107
|
self.camel_case = camel_case
|
|
101
108
|
self.as_write = as_write
|
|
109
|
+
self.prefix = prefix
|
|
110
|
+
self.identifier = identifier
|
|
111
|
+
# If identifier=externalId, we need to keep track of the external ids
|
|
112
|
+
# and use them in linking of Files, Sequences, TimeSeries, and Events.
|
|
113
|
+
self.asset_external_ids_by_id: dict[int, str] = {}
|
|
114
|
+
self.lookup_dataset_external_id: Callable[[int], str] | None = None
|
|
115
|
+
# Used by the ClassicGraphExtractor to log URIRefs
|
|
116
|
+
self._log_urirefs = False
|
|
117
|
+
self._uriref_by_external_id: dict[str, URIRef] = {}
|
|
102
118
|
|
|
103
119
|
def extract(self) -> Iterable[Triple]:
|
|
104
120
|
"""Extracts an asset with the given asset_id."""
|
|
121
|
+
from ._assets import AssetsExtractor
|
|
105
122
|
|
|
106
123
|
if self.total is not None and self.total > 0:
|
|
107
124
|
to_iterate = iterate_progress_bar_if_above_config_threshold(
|
|
@@ -109,21 +126,40 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
109
126
|
)
|
|
110
127
|
else:
|
|
111
128
|
to_iterate = self.items
|
|
129
|
+
if self.identifier == "externalId" and isinstance(self, AssetsExtractor):
|
|
130
|
+
to_iterate = self._store_asset_external_ids(to_iterate) # type: ignore[attr-defined]
|
|
131
|
+
|
|
112
132
|
for no, asset in enumerate(to_iterate):
|
|
113
133
|
yield from self._item2triples(asset)
|
|
114
134
|
if self.limit and no >= self.limit:
|
|
115
135
|
break
|
|
116
136
|
|
|
137
|
+
def _store_asset_external_ids(self, items: Iterable[T_CogniteResource]) -> Iterable[T_CogniteResource]:
|
|
138
|
+
for item in items:
|
|
139
|
+
if hasattr(item, "id") and hasattr(item, "external_id"):
|
|
140
|
+
self.asset_external_ids_by_id[item.id] = item.external_id
|
|
141
|
+
yield item
|
|
142
|
+
|
|
117
143
|
def _item2triples(self, item: T_CogniteResource) -> list[Triple]:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
144
|
+
if self.identifier == "id":
|
|
145
|
+
id_value: str | None
|
|
146
|
+
if hasattr(item, "id"):
|
|
147
|
+
id_value = str(item.id)
|
|
148
|
+
else:
|
|
149
|
+
id_value = self._fallback_id(item)
|
|
150
|
+
if id_value is None:
|
|
151
|
+
return []
|
|
152
|
+
id_suffix = id_value
|
|
153
|
+
elif self.identifier == "externalId":
|
|
154
|
+
if not hasattr(item, "external_id"):
|
|
155
|
+
return []
|
|
156
|
+
id_suffix = self._external_id_as_uri_suffix(item.external_id)
|
|
121
157
|
else:
|
|
122
|
-
|
|
123
|
-
if id_value is None:
|
|
124
|
-
return []
|
|
158
|
+
raise NeatValueError(f"Unknown identifier {self.identifier}")
|
|
125
159
|
|
|
126
|
-
id_ = self.namespace[f"{self._instance_id_prefix}{
|
|
160
|
+
id_ = self.namespace[f"{self._instance_id_prefix}{id_suffix}"]
|
|
161
|
+
if self._log_urirefs and hasattr(item, "external_id"):
|
|
162
|
+
self._uriref_by_external_id[item.external_id] = id_
|
|
127
163
|
|
|
128
164
|
type_ = self._get_rdf_type(item)
|
|
129
165
|
|
|
@@ -152,10 +188,25 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
152
188
|
"""This can be overridden to handle special cases for the item."""
|
|
153
189
|
return []
|
|
154
190
|
|
|
191
|
+
@classmethod
|
|
192
|
+
def _external_id_as_uri_suffix(cls, external_id: str | None) -> str:
|
|
193
|
+
if external_id == "":
|
|
194
|
+
warnings.warn(NeatValueWarning(f"Empty external id in {cls._default_rdf_type}"), stacklevel=2)
|
|
195
|
+
return "empty"
|
|
196
|
+
elif external_id == "\x00":
|
|
197
|
+
warnings.warn(NeatValueWarning(f"Null external id in {cls._default_rdf_type}"), stacklevel=2)
|
|
198
|
+
return "null"
|
|
199
|
+
elif external_id is None:
|
|
200
|
+
warnings.warn(NeatValueWarning(f"None external id in {cls._default_rdf_type}"), stacklevel=2)
|
|
201
|
+
return "None"
|
|
202
|
+
# The external ID needs to pass the ^[^\\x00]{1,256}$ regex for the DMS API.
|
|
203
|
+
# In addition, neat internals requires the external ID to be a valid URI.
|
|
204
|
+
return urllib.parse.quote(external_id)
|
|
205
|
+
|
|
155
206
|
def _fallback_id(self, item: T_CogniteResource) -> str | None:
|
|
156
207
|
raise AttributeError(
|
|
157
208
|
f"Item of type {type(item)} does not have an id attribute. "
|
|
158
|
-
|
|
209
|
+
"Please implement the _fallback_id method in the extractor."
|
|
159
210
|
)
|
|
160
211
|
|
|
161
212
|
def _metadata_to_triples(self, id_: URIRef, metadata: dict[str, str]) -> Iterable[Triple]:
|
|
@@ -174,13 +225,34 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
174
225
|
type_ = self._default_rdf_type
|
|
175
226
|
if self.to_type:
|
|
176
227
|
type_ = self.to_type(item) or type_
|
|
228
|
+
if self.prefix:
|
|
229
|
+
type_ = f"{self.prefix}{type_}"
|
|
177
230
|
return self._SPACE_PATTERN.sub("_", type_)
|
|
178
231
|
|
|
179
232
|
def _as_object(self, raw: Any, key: str) -> Literal | URIRef:
|
|
233
|
+
"""Return properly formatted object part of s-p-o triple"""
|
|
180
234
|
if key in {"data_set_id", "dataSetId"}:
|
|
181
|
-
|
|
235
|
+
if self.identifier == "externalId" and self.lookup_dataset_external_id:
|
|
236
|
+
try:
|
|
237
|
+
data_set_external_id = self.lookup_dataset_external_id(raw)
|
|
238
|
+
except KeyError:
|
|
239
|
+
return Literal("Unknown data set")
|
|
240
|
+
else:
|
|
241
|
+
return self.namespace[
|
|
242
|
+
f"{InstanceIdPrefix.data_set}{self._external_id_as_uri_suffix(data_set_external_id)}"
|
|
243
|
+
]
|
|
244
|
+
else:
|
|
245
|
+
return self.namespace[f"{InstanceIdPrefix.data_set}{raw}"]
|
|
182
246
|
elif key in {"assetId", "asset_id", "assetIds", "asset_ids", "parentId", "rootId", "parent_id", "root_id"}:
|
|
183
|
-
|
|
247
|
+
if self.identifier == "id":
|
|
248
|
+
return self.namespace[f"{InstanceIdPrefix.asset}{raw}"]
|
|
249
|
+
else:
|
|
250
|
+
try:
|
|
251
|
+
asset_external_id = self._external_id_as_uri_suffix(self.asset_external_ids_by_id[raw])
|
|
252
|
+
except KeyError:
|
|
253
|
+
return Literal("Unknown asset", datatype=XSD.string)
|
|
254
|
+
else:
|
|
255
|
+
return self.namespace[f"{InstanceIdPrefix.asset}{asset_external_id}"]
|
|
184
256
|
elif key in {
|
|
185
257
|
"startTime",
|
|
186
258
|
"endTime",
|
|
@@ -218,9 +290,23 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
218
290
|
skip_metadata_values: Set[str] | None = DEFAULT_SKIP_METADATA_VALUES,
|
|
219
291
|
camel_case: bool = True,
|
|
220
292
|
as_write: bool = False,
|
|
293
|
+
prefix: str | None = None,
|
|
294
|
+
identifier: typing.Literal["id", "externalId"] = "id",
|
|
221
295
|
):
|
|
222
296
|
total, items = cls._handle_no_access(lambda: cls._from_dataset(client, data_set_external_id))
|
|
223
|
-
return cls(
|
|
297
|
+
return cls(
|
|
298
|
+
items,
|
|
299
|
+
namespace,
|
|
300
|
+
to_type,
|
|
301
|
+
total,
|
|
302
|
+
limit,
|
|
303
|
+
unpack_metadata,
|
|
304
|
+
skip_metadata_values,
|
|
305
|
+
camel_case,
|
|
306
|
+
as_write,
|
|
307
|
+
prefix,
|
|
308
|
+
identifier,
|
|
309
|
+
)
|
|
224
310
|
|
|
225
311
|
@classmethod
|
|
226
312
|
@abstractmethod
|
|
@@ -241,9 +327,23 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
241
327
|
skip_metadata_values: Set[str] | None = DEFAULT_SKIP_METADATA_VALUES,
|
|
242
328
|
camel_case: bool = True,
|
|
243
329
|
as_write: bool = False,
|
|
330
|
+
prefix: str | None = None,
|
|
331
|
+
identifier: typing.Literal["id", "externalId"] = "id",
|
|
244
332
|
):
|
|
245
333
|
total, items = cls._handle_no_access(lambda: cls._from_hierarchy(client, root_asset_external_id))
|
|
246
|
-
return cls(
|
|
334
|
+
return cls(
|
|
335
|
+
items,
|
|
336
|
+
namespace,
|
|
337
|
+
to_type,
|
|
338
|
+
total,
|
|
339
|
+
limit,
|
|
340
|
+
unpack_metadata,
|
|
341
|
+
skip_metadata_values,
|
|
342
|
+
camel_case,
|
|
343
|
+
as_write,
|
|
344
|
+
prefix,
|
|
345
|
+
identifier,
|
|
346
|
+
)
|
|
247
347
|
|
|
248
348
|
@classmethod
|
|
249
349
|
@abstractmethod
|
|
@@ -263,9 +363,23 @@ class ClassicCDFBaseExtractor(BaseExtractor, ABC, Generic[T_CogniteResource]):
|
|
|
263
363
|
skip_metadata_values: Set[str] | None = DEFAULT_SKIP_METADATA_VALUES,
|
|
264
364
|
camel_case: bool = True,
|
|
265
365
|
as_write: bool = False,
|
|
366
|
+
prefix: str | None = None,
|
|
367
|
+
identifier: typing.Literal["id", "externalId"] = "id",
|
|
266
368
|
):
|
|
267
369
|
total, items = cls._from_file(file_path)
|
|
268
|
-
return cls(
|
|
370
|
+
return cls(
|
|
371
|
+
items,
|
|
372
|
+
namespace,
|
|
373
|
+
to_type,
|
|
374
|
+
total,
|
|
375
|
+
limit,
|
|
376
|
+
unpack_metadata,
|
|
377
|
+
skip_metadata_values,
|
|
378
|
+
camel_case,
|
|
379
|
+
as_write,
|
|
380
|
+
prefix,
|
|
381
|
+
identifier,
|
|
382
|
+
)
|
|
269
383
|
|
|
270
384
|
@classmethod
|
|
271
385
|
@abstractmethod
|