cognite-neat 0.114.0__tar.gz → 0.115.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.114.0 → cognite_neat-0.115.1}/PKG-INFO +1 -1
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_constants.py +4 -1
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/loaders/_rdf2dms.py +4 -4
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/warnings/__init__.py +8 -1
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/warnings/_general.py +10 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/warnings/_properties.py +2 -2
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/_rules2excel.py +0 -10
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_dms2rules.py +25 -9
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/dms/_exporter.py +15 -2
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/dms/_rules.py +47 -12
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/dms/_rules_input.py +62 -3
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/information/_rules.py +0 -12
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/mapping/_classic2core.yaml +158 -152
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/transformers/_converters.py +22 -15
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/transformers/_mapping.py +1 -1
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_base.py +3 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_read.py +13 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_state.py +14 -3
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_store/_rules_store.py +14 -0
- cognite_neat-0.115.1/cognite/neat/_version.py +2 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/pyproject.toml +1 -1
- cognite_neat-0.114.0/cognite/neat/_version.py +0 -2
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/LICENSE +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/README.md +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_alpha.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/_api/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/_api/data_modeling_loaders.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/_api/schema.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/_api_client.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/data_classes/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/data_classes/data_modeling.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/data_classes/neat_sequence.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/data_classes/schema.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_client/testing.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/_shared.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_dict.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_dms.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_dms_graph.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_iodd.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_raw.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/loaders/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/loaders/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/queries/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/transformers/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/transformers/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/transformers/_iodd.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/transformers/_rdfpath.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_graph/transformers/_value_type.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/_contextmanagers.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/_factory.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/errors/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/errors/_external.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/errors/_properties.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/errors/_resources.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/errors/_wrapper.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/warnings/_models.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/warnings/_resources.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/_shared.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/analysis/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/analysis/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/catalog/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/catalog/classic_model.xlsx +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/catalog/hello_world_pump.xlsx +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_rdf/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_rdf/_imf2rules.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_rdf/_owl2rules.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/_base_rules.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/_types.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/data_types.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/information/_validation.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/transformers/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/transformers/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/transformers/_verification.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_collector.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_create.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_drop.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_explore.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_fix.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_inspect.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_mapping.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_prepare.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_set.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_show.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_subset.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_to.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/_wizard.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/engine/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/engine/_import.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/engine/_interface.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/engine/_load.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_session/exceptions.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_store/_graph_store.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_store/_provenance.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_store/exceptions.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/auth.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/graph_transformations_report.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/io_.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/rdf_.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/reader/__init__.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/reader/_base.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/upload.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/py.typed +0 -0
|
@@ -117,9 +117,12 @@ DEFAULT_URI = ""
|
|
|
117
117
|
|
|
118
118
|
DEFAULT_DOCS_URL = "https://cognite-neat.readthedocs-hosted.com/en/latest/"
|
|
119
119
|
|
|
120
|
+
# These are the API limits for the DMS API, https://docs.cognite.com/cdf/dm/dm_reference/dm_limits_and_restrictions
|
|
120
121
|
DMS_CONTAINER_PROPERTY_SIZE_LIMIT = 100
|
|
121
122
|
DMS_VIEW_CONTAINER_SIZE_LIMIT = 10
|
|
122
|
-
|
|
123
|
+
DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT = 100
|
|
124
|
+
DMS_PRIMITIVE_LIST_DEFAULT_LIMIT = 1000
|
|
125
|
+
DMS_CONTAINER_LIST_MAX_LIMIT = 2000
|
|
123
126
|
|
|
124
127
|
_ASSET_ROOT_PROPERTY = {
|
|
125
128
|
"connection": "direct",
|
|
@@ -21,7 +21,7 @@ from rdflib import RDF, URIRef
|
|
|
21
21
|
|
|
22
22
|
from cognite.neat._client import NeatClient
|
|
23
23
|
from cognite.neat._client._api_client import SchemaAPI
|
|
24
|
-
from cognite.neat._constants import
|
|
24
|
+
from cognite.neat._constants import DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT, is_readonly_property
|
|
25
25
|
from cognite.neat._issues import IssueList, NeatError, NeatIssue, catch_issues
|
|
26
26
|
from cognite.neat._issues.errors import (
|
|
27
27
|
AuthorizationError,
|
|
@@ -417,20 +417,20 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
417
417
|
ids = (self._create_instance_id(v, "node", stop_on_exception=True) for v in value)
|
|
418
418
|
result = [id_.dump(camel_case=True, include_instance_type=False) for id_ in ids]
|
|
419
419
|
# Todo: Account for max_list_limit
|
|
420
|
-
if len(result) <=
|
|
420
|
+
if len(result) <= DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT:
|
|
421
421
|
return result
|
|
422
422
|
warnings.warn(
|
|
423
423
|
PropertyDirectRelationLimitWarning(
|
|
424
424
|
identifier="unknown",
|
|
425
425
|
resource_type="view property",
|
|
426
426
|
property_name=cast(str, cls.model_fields[info.field_name].alias or info.field_name),
|
|
427
|
-
limit=
|
|
427
|
+
limit=DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT,
|
|
428
428
|
),
|
|
429
429
|
stacklevel=2,
|
|
430
430
|
)
|
|
431
431
|
# To get deterministic results, we sort by space and externalId
|
|
432
432
|
result.sort(key=lambda x: (x["space"], x["externalId"]))
|
|
433
|
-
return result[:
|
|
433
|
+
return result[:DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT]
|
|
434
434
|
elif value:
|
|
435
435
|
return self._create_instance_id(value[0], "node", stop_on_exception=True).dump(
|
|
436
436
|
camel_case=True, include_instance_type=False
|
|
@@ -13,7 +13,13 @@ from ._external import (
|
|
|
13
13
|
FileReadWarning,
|
|
14
14
|
FileTypeUnexpectedWarning,
|
|
15
15
|
)
|
|
16
|
-
from ._general import
|
|
16
|
+
from ._general import (
|
|
17
|
+
DeprecatedWarning,
|
|
18
|
+
MissingCogniteClientWarning,
|
|
19
|
+
NeatValueWarning,
|
|
20
|
+
NotSupportedWarning,
|
|
21
|
+
RegexViolationWarning,
|
|
22
|
+
)
|
|
17
23
|
from ._models import (
|
|
18
24
|
BreakingModelingPrincipleWarning,
|
|
19
25
|
CDFNotSupportedWarning,
|
|
@@ -50,6 +56,7 @@ __all__ = [
|
|
|
50
56
|
"CDFAuthWarning",
|
|
51
57
|
"CDFMaxIterationsWarning",
|
|
52
58
|
"CDFNotSupportedWarning",
|
|
59
|
+
"DeprecatedWarning",
|
|
53
60
|
"FileItemNotSupportedWarning",
|
|
54
61
|
"FileMissingRequiredFieldWarning",
|
|
55
62
|
"FileReadWarning",
|
|
@@ -34,3 +34,13 @@ class MissingCogniteClientWarning(NeatWarning):
|
|
|
34
34
|
"""Missing Cognite Client required for {functionality}"""
|
|
35
35
|
|
|
36
36
|
functionality: str
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@dataclass(unsafe_hash=True)
|
|
40
|
+
class DeprecatedWarning(NeatWarning):
|
|
41
|
+
"""{feature} is deprecated"""
|
|
42
|
+
|
|
43
|
+
extra = "{replacement}"
|
|
44
|
+
|
|
45
|
+
feature: str
|
|
46
|
+
replacement: str | None = None
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Generic
|
|
3
3
|
|
|
4
|
-
from cognite.neat._constants import
|
|
4
|
+
from cognite.neat._constants import DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT
|
|
5
5
|
from cognite.neat._issues._base import ResourceType
|
|
6
6
|
|
|
7
7
|
from ._resources import ResourceNeatWarning, T_Identifier, T_ReferenceIdentifier
|
|
@@ -79,7 +79,7 @@ class PropertyDirectRelationLimitWarning(PropertyWarning[T_Identifier]):
|
|
|
79
79
|
|
|
80
80
|
resource_type = "view"
|
|
81
81
|
|
|
82
|
-
limit: int =
|
|
82
|
+
limit: int = DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
@dataclass(unsafe_hash=True)
|
|
@@ -170,16 +170,12 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
|
|
|
170
170
|
dv_value_types = generate_data_validation(self._helper_sheet_name, "C", no_header_rows=0, no_rows=no_rows)
|
|
171
171
|
|
|
172
172
|
dv_immutable = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
|
|
173
|
-
dv_nullable = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
|
|
174
|
-
dv_is_list = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
|
|
175
173
|
dv_in_model = generate_data_validation(self._helper_sheet_name, "D", no_header_rows=0, no_rows=3)
|
|
176
174
|
dv_used_for = generate_data_validation(self._helper_sheet_name, "E", no_header_rows=0, no_rows=3)
|
|
177
175
|
|
|
178
176
|
workbook["Properties"].add_data_validation(dv_views)
|
|
179
177
|
workbook["Properties"].add_data_validation(dv_containers)
|
|
180
178
|
workbook["Properties"].add_data_validation(dv_value_types)
|
|
181
|
-
workbook["Properties"].add_data_validation(dv_nullable)
|
|
182
|
-
workbook["Properties"].add_data_validation(dv_is_list)
|
|
183
179
|
workbook["Properties"].add_data_validation(dv_immutable)
|
|
184
180
|
workbook["Views"].add_data_validation(dv_in_model)
|
|
185
181
|
workbook["Containers"].add_data_validation(dv_used_for)
|
|
@@ -194,12 +190,6 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
|
|
|
194
190
|
if column := find_column_with_value(workbook["Properties"], "Value Type"):
|
|
195
191
|
dv_value_types.add(f"{column}{3}:{column}{no_rows * 100}")
|
|
196
192
|
|
|
197
|
-
if column := find_column_with_value(workbook["Properties"], "Nullable"):
|
|
198
|
-
dv_nullable.add(f"{column}{3}:{column}{no_rows * 100}")
|
|
199
|
-
|
|
200
|
-
if column := find_column_with_value(workbook["Properties"], "Is List"):
|
|
201
|
-
dv_is_list.add(f"{column}{3}:{column}{no_rows * 100}")
|
|
202
|
-
|
|
203
193
|
if column := find_column_with_value(workbook["Properties"], "Immutable"):
|
|
204
194
|
dv_immutable.add(f"{column}{3}:{column}{no_rows * 100}")
|
|
205
195
|
|
|
@@ -7,8 +7,12 @@ from typing import Literal, cast
|
|
|
7
7
|
from cognite.client import data_modeling as dm
|
|
8
8
|
from cognite.client.data_classes.data_modeling import DataModelId, DataModelIdentifier
|
|
9
9
|
from cognite.client.data_classes.data_modeling.containers import BTreeIndex, InvertedIndex
|
|
10
|
+
from cognite.client.data_classes.data_modeling.data_types import (
|
|
11
|
+
DirectRelation,
|
|
12
|
+
ListablePropertyType,
|
|
13
|
+
PropertyTypeWithUnit,
|
|
14
|
+
)
|
|
10
15
|
from cognite.client.data_classes.data_modeling.data_types import Enum as DMSEnum
|
|
11
|
-
from cognite.client.data_classes.data_modeling.data_types import ListablePropertyType, PropertyTypeWithUnit
|
|
12
16
|
from cognite.client.data_classes.data_modeling.views import (
|
|
13
17
|
MultiEdgeConnectionApply,
|
|
14
18
|
MultiReverseDirectRelationApply,
|
|
@@ -19,6 +23,7 @@ from cognite.client.data_classes.data_modeling.views import (
|
|
|
19
23
|
from cognite.client.utils import ms_to_datetime
|
|
20
24
|
|
|
21
25
|
from cognite.neat._client import NeatClient
|
|
26
|
+
from cognite.neat._constants import DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT, DMS_PRIMITIVE_LIST_DEFAULT_LIMIT
|
|
22
27
|
from cognite.neat._issues import IssueList, MultiValueError, NeatIssue, catch_issues
|
|
23
28
|
from cognite.neat._issues.errors import (
|
|
24
29
|
FileTypeUnexpectedError,
|
|
@@ -336,8 +341,8 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
336
341
|
name=prop.name,
|
|
337
342
|
connection=self._get_connection_type(prop),
|
|
338
343
|
value_type=str(value_type),
|
|
339
|
-
|
|
340
|
-
|
|
344
|
+
min_count=self._get_min_count(prop),
|
|
345
|
+
max_count=self._get_max_count(prop),
|
|
341
346
|
immutable=self._get_immutable(prop),
|
|
342
347
|
default=self._get_default(prop),
|
|
343
348
|
container=(
|
|
@@ -419,9 +424,9 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
419
424
|
)
|
|
420
425
|
return None
|
|
421
426
|
|
|
422
|
-
def
|
|
427
|
+
def _get_min_count(self, prop: ViewPropertyApply) -> int | None:
|
|
423
428
|
if isinstance(prop, dm.MappedPropertyApply):
|
|
424
|
-
return self._container_prop_unsafe(prop).nullable
|
|
429
|
+
return int(not self._container_prop_unsafe(prop).nullable)
|
|
425
430
|
else:
|
|
426
431
|
return None
|
|
427
432
|
|
|
@@ -431,15 +436,26 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
431
436
|
else:
|
|
432
437
|
return None
|
|
433
438
|
|
|
434
|
-
def
|
|
439
|
+
def _get_max_count(self, prop: ViewPropertyApply) -> int | float | None:
|
|
435
440
|
if isinstance(prop, dm.MappedPropertyApply):
|
|
436
441
|
prop_type = self._container_prop_unsafe(prop).type
|
|
437
|
-
|
|
442
|
+
if isinstance(prop_type, ListablePropertyType):
|
|
443
|
+
if prop_type.is_list is False:
|
|
444
|
+
return 1
|
|
445
|
+
elif isinstance(prop_type.max_list_size, int):
|
|
446
|
+
return prop_type.max_list_size
|
|
447
|
+
elif isinstance(prop_type, DirectRelation):
|
|
448
|
+
return DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT
|
|
449
|
+
else:
|
|
450
|
+
return DMS_PRIMITIVE_LIST_DEFAULT_LIMIT
|
|
451
|
+
else:
|
|
452
|
+
return 1
|
|
438
453
|
elif isinstance(prop, MultiEdgeConnectionApply | MultiReverseDirectRelationApply):
|
|
439
|
-
return
|
|
454
|
+
return float("inf")
|
|
440
455
|
elif isinstance(prop, SingleEdgeConnectionApply | SingleReverseDirectRelationApply):
|
|
441
|
-
return
|
|
456
|
+
return 1
|
|
442
457
|
else:
|
|
458
|
+
# Unknown type.
|
|
443
459
|
return None
|
|
444
460
|
|
|
445
461
|
def _get_default(self, prop: ViewPropertyApply) -> str | None:
|
|
@@ -20,7 +20,11 @@ from cognite.neat._client.data_classes.data_modeling import (
|
|
|
20
20
|
ViewApplyDict,
|
|
21
21
|
)
|
|
22
22
|
from cognite.neat._client.data_classes.schema import DMSSchema
|
|
23
|
-
from cognite.neat._constants import
|
|
23
|
+
from cognite.neat._constants import (
|
|
24
|
+
COGNITE_SPACES,
|
|
25
|
+
DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT,
|
|
26
|
+
DMS_PRIMITIVE_LIST_DEFAULT_LIMIT,
|
|
27
|
+
)
|
|
24
28
|
from cognite.neat._issues.errors import NeatTypeError, NeatValueError, ResourceNotFoundError
|
|
25
29
|
from cognite.neat._issues.warnings import NotSupportedWarning, PropertyNotFoundWarning
|
|
26
30
|
from cognite.neat._issues.warnings.user_modeling import (
|
|
@@ -310,7 +314,16 @@ class _DMSExporter:
|
|
|
310
314
|
|
|
311
315
|
args: dict[str, Any] = {}
|
|
312
316
|
if issubclass(type_cls, ListablePropertyType):
|
|
313
|
-
args["is_list"] = prop.is_list or False
|
|
317
|
+
is_list = args["is_list"] = prop.is_list or False
|
|
318
|
+
if is_list:
|
|
319
|
+
if type_cls is dm.DirectRelation and prop.max_count == DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT:
|
|
320
|
+
# Use default of API.
|
|
321
|
+
args["max_list_size"] = None
|
|
322
|
+
elif type_cls is not dm.DirectRelation and prop.max_count == DMS_PRIMITIVE_LIST_DEFAULT_LIMIT:
|
|
323
|
+
# Use default of API.
|
|
324
|
+
args["max_list_size"] = None
|
|
325
|
+
else:
|
|
326
|
+
args["max_list_size"] = prop.max_count
|
|
314
327
|
if isinstance(prop.value_type, Double | Float) and isinstance(prop.value_type.unit, UnitEntity):
|
|
315
328
|
args["unit"] = prop.value_type.unit.as_reference()
|
|
316
329
|
if isinstance(prop.value_type, Enum):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import math
|
|
1
2
|
import warnings
|
|
2
3
|
from collections.abc import Hashable
|
|
3
4
|
from typing import TYPE_CHECKING, Any, ClassVar, Literal
|
|
@@ -8,6 +9,7 @@ from pydantic import Field, field_serializer, field_validator, model_validator
|
|
|
8
9
|
from pydantic_core.core_schema import SerializationInfo, ValidationInfo
|
|
9
10
|
|
|
10
11
|
from cognite.neat._client.data_classes.schema import DMSSchema
|
|
12
|
+
from cognite.neat._constants import DMS_CONTAINER_LIST_MAX_LIMIT
|
|
11
13
|
from cognite.neat._issues.errors import NeatValueError
|
|
12
14
|
from cognite.neat._issues.warnings._general import NeatValueWarning
|
|
13
15
|
from cognite.neat._rules.models._base_rules import (
|
|
@@ -102,22 +104,25 @@ class DMSProperty(SheetRow):
|
|
|
102
104
|
alias="Value Type",
|
|
103
105
|
description="Value type that the property can hold. It takes either subset of CDF primitive types or a View id",
|
|
104
106
|
)
|
|
105
|
-
|
|
107
|
+
min_count: int | None = Field(
|
|
108
|
+
alias="Min Count",
|
|
106
109
|
default=None,
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
description="Minimum number of values that the property can hold. "
|
|
111
|
+
"If no value is provided, the default value is `0`, "
|
|
112
|
+
"which means that the property is optional.",
|
|
113
|
+
)
|
|
114
|
+
max_count: int | float | None = Field(
|
|
115
|
+
alias="Max Count",
|
|
116
|
+
default=None,
|
|
117
|
+
description="Maximum number of values that the property can hold. "
|
|
118
|
+
"If no value is provided, the default value is `inf`, "
|
|
119
|
+
"which means that the property can hold any number of values (listable).",
|
|
109
120
|
)
|
|
110
121
|
immutable: bool | None = Field(
|
|
111
122
|
default=None,
|
|
112
123
|
alias="Immutable",
|
|
113
124
|
description="sed to indicate whether the property is can only be set once. Only applies to primitive type.",
|
|
114
125
|
)
|
|
115
|
-
is_list: bool | None = Field(
|
|
116
|
-
default=None,
|
|
117
|
-
alias="Is List",
|
|
118
|
-
description="Used to indicate whether the property holds single or multiple values (list). "
|
|
119
|
-
"Only applies to primitive types.",
|
|
120
|
-
)
|
|
121
126
|
default: bool | str | int | float | dict | None = Field(
|
|
122
127
|
None, alias="Default", description="Specifies default value for the property."
|
|
123
128
|
)
|
|
@@ -147,13 +152,43 @@ class DMSProperty(SheetRow):
|
|
|
147
152
|
description="Used to make connection between physical and logical data model aspect",
|
|
148
153
|
)
|
|
149
154
|
|
|
155
|
+
@property
|
|
156
|
+
def nullable(self) -> bool | None:
|
|
157
|
+
"""Used to indicate whether the property is required or not. Only applies to primitive type."""
|
|
158
|
+
return self.min_count in {0, None}
|
|
159
|
+
|
|
160
|
+
@property
|
|
161
|
+
def is_list(self) -> bool | None:
|
|
162
|
+
"""Used to indicate whether the property holds single or multiple values (list). "
|
|
163
|
+
"Only applies to primitive types."""
|
|
164
|
+
if self.max_count is None:
|
|
165
|
+
return None
|
|
166
|
+
return self.max_count is float("inf") or (isinstance(self.max_count, int | float) and self.max_count > 1)
|
|
167
|
+
|
|
150
168
|
def _identifier(self) -> tuple[Hashable, ...]:
|
|
151
169
|
return self.view, self.view_property
|
|
152
170
|
|
|
153
|
-
@field_validator("
|
|
171
|
+
@field_validator("min_count")
|
|
154
172
|
def direct_relation_must_be_nullable(cls, value: Any, info: ValidationInfo) -> None:
|
|
155
|
-
if info.data.get("connection") == "direct" and value
|
|
156
|
-
raise ValueError("Direct relation must
|
|
173
|
+
if info.data.get("connection") == "direct" and value not in {0, None}:
|
|
174
|
+
raise ValueError("Direct relation must have min count set to 0")
|
|
175
|
+
return value
|
|
176
|
+
|
|
177
|
+
@field_validator("max_count", mode="before")
|
|
178
|
+
def as_integer(cls, value: Any) -> Any:
|
|
179
|
+
if isinstance(value, float) and not math.isinf(value):
|
|
180
|
+
return int(value)
|
|
181
|
+
return value
|
|
182
|
+
|
|
183
|
+
@field_validator("max_count")
|
|
184
|
+
def max_list_size(cls, value: Any, info: ValidationInfo) -> Any:
|
|
185
|
+
if isinstance(info.data.get("connection"), EdgeEntity | ReverseConnectionEntity):
|
|
186
|
+
if value is not None and value != float("inf") and not (isinstance(value, int) and value == 1):
|
|
187
|
+
raise ValueError("Edge and reverse connections must have max count set to inf or 1")
|
|
188
|
+
return value
|
|
189
|
+
# We do not have a connection, so we can check the max list size.
|
|
190
|
+
if isinstance(value, int) and value > DMS_CONTAINER_LIST_MAX_LIMIT:
|
|
191
|
+
raise ValueError(f"Max list size cannot be greater than {DMS_CONTAINER_LIST_MAX_LIMIT}")
|
|
157
192
|
return value
|
|
158
193
|
|
|
159
194
|
@field_validator("value_type", mode="after")
|
{cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/dms/_rules_input.py
RENAMED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import re
|
|
2
|
+
import sys
|
|
3
|
+
import warnings
|
|
2
4
|
from dataclasses import dataclass
|
|
3
5
|
from datetime import datetime
|
|
4
6
|
from typing import Any, Literal
|
|
@@ -8,7 +10,8 @@ from cognite.client import data_modeling as dm
|
|
|
8
10
|
from cognite.client.data_classes.data_modeling import ContainerId, ViewId
|
|
9
11
|
from rdflib import Namespace, URIRef
|
|
10
12
|
|
|
11
|
-
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
13
|
+
from cognite.neat._constants import DEFAULT_NAMESPACE, DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT
|
|
14
|
+
from cognite.neat._issues.warnings import DeprecatedWarning
|
|
12
15
|
from cognite.neat._rules.models._base_input import InputComponent, InputRules
|
|
13
16
|
from cognite.neat._rules.models.data_types import DataType
|
|
14
17
|
from cognite.neat._rules.models.entities import (
|
|
@@ -26,6 +29,11 @@ from cognite.neat._utils.rdf_ import uri_display_name
|
|
|
26
29
|
|
|
27
30
|
from ._rules import _DEFAULT_VERSION, DMSContainer, DMSEnum, DMSMetadata, DMSNode, DMSProperty, DMSRules, DMSView
|
|
28
31
|
|
|
32
|
+
if sys.version_info >= (3, 11):
|
|
33
|
+
from typing import Self
|
|
34
|
+
else:
|
|
35
|
+
from typing_extensions import Self
|
|
36
|
+
|
|
29
37
|
|
|
30
38
|
@dataclass
|
|
31
39
|
class DMSInputMetadata(InputComponent[DMSMetadata]):
|
|
@@ -106,9 +114,9 @@ class DMSInputProperty(InputComponent[DMSProperty]):
|
|
|
106
114
|
name: str | None = None
|
|
107
115
|
description: str | None = None
|
|
108
116
|
connection: Literal["direct"] | ReverseConnectionEntity | EdgeEntity | str | None = None
|
|
109
|
-
|
|
117
|
+
min_count: int | None = None
|
|
118
|
+
max_count: int | float | None = None
|
|
110
119
|
immutable: bool | None = None
|
|
111
|
-
is_list: bool | None = None
|
|
112
120
|
default: str | int | dict | None = None
|
|
113
121
|
container: str | None = None
|
|
114
122
|
container_property: str | None = None
|
|
@@ -117,6 +125,19 @@ class DMSInputProperty(InputComponent[DMSProperty]):
|
|
|
117
125
|
neatId: str | URIRef | None = None
|
|
118
126
|
logical: str | URIRef | None = None
|
|
119
127
|
|
|
128
|
+
@property
|
|
129
|
+
def nullable(self) -> bool | None:
|
|
130
|
+
"""Used to indicate whether the property is required or not. Only applies to primitive type."""
|
|
131
|
+
return self.min_count in {0, None}
|
|
132
|
+
|
|
133
|
+
@property
|
|
134
|
+
def is_list(self) -> bool | None:
|
|
135
|
+
"""Used to indicate whether the property holds single or multiple values (list). "
|
|
136
|
+
"Only applies to primitive types."""
|
|
137
|
+
return self.max_count in {float("inf"), None} or (
|
|
138
|
+
isinstance(self.max_count, int | float) and self.max_count > 1
|
|
139
|
+
)
|
|
140
|
+
|
|
120
141
|
@classmethod
|
|
121
142
|
def _get_verified_cls(cls) -> type[DMSProperty]:
|
|
122
143
|
return DMSProperty
|
|
@@ -139,6 +160,44 @@ class DMSInputProperty(InputComponent[DMSProperty]):
|
|
|
139
160
|
def referenced_container(self, default_space: str) -> ContainerEntity | None:
|
|
140
161
|
return ContainerEntity.load(self.container, strict=True, space=default_space) if self.container else None
|
|
141
162
|
|
|
163
|
+
@classmethod
|
|
164
|
+
def _load(cls, data: dict[str, Any]) -> Self:
|
|
165
|
+
# For backwards compatability, we need to convert nullable and Is List to min and max count
|
|
166
|
+
for min_count_key, nullable_key in [("Min Count", "Nullable"), ("min_count", "nullable")]:
|
|
167
|
+
if nullable_key in data and min_count_key not in data:
|
|
168
|
+
if isinstance(data[nullable_key], bool | float):
|
|
169
|
+
data[min_count_key] = 0 if data[nullable_key] else 1
|
|
170
|
+
else:
|
|
171
|
+
data[min_count_key] = None
|
|
172
|
+
warnings.warn(
|
|
173
|
+
DeprecatedWarning(f"{nullable_key} column", replacement=f"{min_count_key} column"), stacklevel=2
|
|
174
|
+
)
|
|
175
|
+
data.pop(nullable_key)
|
|
176
|
+
break
|
|
177
|
+
for max_count_key, is_list_key, connection_key in [
|
|
178
|
+
("Max Count", "Is List", "Connection"),
|
|
179
|
+
("max_count", "is_list", "connection"),
|
|
180
|
+
]:
|
|
181
|
+
if is_list_key in data and max_count_key not in data:
|
|
182
|
+
if isinstance(data[is_list_key], bool | float):
|
|
183
|
+
if not data[is_list_key]:
|
|
184
|
+
data[max_count_key] = 1
|
|
185
|
+
elif "direct" in (data.get(connection_key, "") or "") and "edge" not in (
|
|
186
|
+
data.get(connection_key, "") or ""
|
|
187
|
+
):
|
|
188
|
+
data[max_count_key] = DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT
|
|
189
|
+
else:
|
|
190
|
+
# Reverse or edge connection
|
|
191
|
+
data[max_count_key] = float("inf")
|
|
192
|
+
else:
|
|
193
|
+
data[max_count_key] = 1
|
|
194
|
+
warnings.warn(
|
|
195
|
+
DeprecatedWarning(f"{is_list_key} column", replacement=f"{max_count_key} column"), stacklevel=2
|
|
196
|
+
)
|
|
197
|
+
data.pop(is_list_key)
|
|
198
|
+
break
|
|
199
|
+
return super()._load(data)
|
|
200
|
+
|
|
142
201
|
|
|
143
202
|
@dataclass
|
|
144
203
|
class DMSInputContainer(InputComponent[DMSContainer]):
|
{cognite_neat-0.114.0 → cognite_neat-0.115.1}/cognite/neat/_rules/models/information/_rules.py
RENAMED
|
@@ -237,18 +237,6 @@ class InformationProperty(SheetRow):
|
|
|
237
237
|
else:
|
|
238
238
|
return EntityTypes.undefined
|
|
239
239
|
|
|
240
|
-
@property
|
|
241
|
-
def is_mandatory(self) -> bool:
|
|
242
|
-
"""Returns True if property is mandatory."""
|
|
243
|
-
return self.min_count not in {0, None}
|
|
244
|
-
|
|
245
|
-
@property
|
|
246
|
-
def is_list(self) -> bool:
|
|
247
|
-
"""Returns True if property contains a list of values."""
|
|
248
|
-
return self.max_count in {float("inf"), None} or (
|
|
249
|
-
isinstance(self.max_count, int | float) and self.max_count > 1
|
|
250
|
-
)
|
|
251
|
-
|
|
252
240
|
|
|
253
241
|
class InformationRules(BaseRules):
|
|
254
242
|
metadata: InformationMetadata = Field(alias="Metadata", description="Metadata for the logical data model")
|