cognite-neat 0.97.3__tar.gz → 0.98.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.97.3 → cognite_neat-0.98.0}/PKG-INFO +2 -1
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/loaders/__init__.py +1 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/warnings/_models.py +9 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/_shared.py +3 -8
- cognite_neat-0.98.0/cognite/neat/_rules/analysis/__init__.py +4 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/analysis/_base.py +2 -23
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/analysis/_dms.py +4 -10
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/analysis/_information.py +2 -10
- cognite_neat-0.98.0/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_rules2excel.py +15 -72
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_rules2ontology.py +4 -4
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_base.py +3 -4
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_dms2rules.py +17 -40
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +1 -7
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +7 -10
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_base.py +17 -29
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2classes.py +2 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2metadata.py +5 -10
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2properties.py +1 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +30 -18
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2classes.py +2 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2metadata.py +5 -8
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2properties.py +1 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_shared.py +25 -140
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_spreadsheet2rules.py +10 -41
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/__init__.py +2 -16
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/_base_rules.py +98 -52
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/dms/_exporter.py +7 -160
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/dms/_rules.py +18 -126
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/dms/_rules_input.py +20 -48
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/dms/_schema.py +11 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/dms/_validation.py +9 -107
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/information/_rules.py +19 -114
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/information/_rules_input.py +32 -41
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/information/_validation.py +34 -102
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/transformers/__init__.py +1 -4
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/transformers/_converters.py +18 -195
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/transformers/_mapping.py +1 -5
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/transformers/_verification.py +0 -14
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_base.py +34 -13
- cognite_neat-0.98.0/cognite/neat/_session/_collector.py +126 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_inspect.py +5 -5
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_prepare.py +4 -4
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_read.py +62 -9
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_set.py +2 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_show.py +11 -11
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_to.py +24 -11
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/exceptions.py +20 -3
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_store/_provenance.py +2 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/auxiliary.py +19 -0
- cognite_neat-0.98.0/cognite/neat/_version.py +2 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/data_contracts.py +2 -10
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/current/rules_exporter.py +6 -46
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/current/rules_validator.py +2 -7
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/pyproject.toml +2 -2
- cognite_neat-0.97.3/cognite/neat/_graph/loaders/_rdf2asset.py +0 -416
- cognite_neat-0.97.3/cognite/neat/_rules/analysis/__init__.py +0 -5
- cognite_neat-0.97.3/cognite/neat/_rules/analysis/_asset.py +0 -173
- cognite_neat-0.97.3/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- cognite_neat-0.97.3/cognite/neat/_rules/models/asset/__init__.py +0 -13
- cognite_neat-0.97.3/cognite/neat/_rules/models/asset/_rules.py +0 -109
- cognite_neat-0.97.3/cognite/neat/_rules/models/asset/_rules_input.py +0 -101
- cognite_neat-0.97.3/cognite/neat/_rules/models/asset/_validation.py +0 -45
- cognite_neat-0.97.3/cognite/neat/_rules/models/domain.py +0 -136
- cognite_neat-0.97.3/cognite/neat/_version.py +0 -2
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/LICENSE +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/README.md +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/configuration.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/explorer.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/routers/configuration.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/routers/crud.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/routers/metrics.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/routers/workflows.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/utils/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/utils/logging.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/main.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/monitoring/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/monitoring/metrics.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/index.html +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css.map +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.LICENSE.txt +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.map +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/package-lock.json +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/package.json +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/favicon.ico +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/img/architect-icon.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/img/developer-icon.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/img/sme-icon.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/index.html +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/logo192.png +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/manifest.json +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/public/robots.txt +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/App.css +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/App.js +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/App.test.js +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/MainContainer.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/JsonViewer.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/LocalUploader.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/OverviewComponentEditorDialog.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/StepEditorDialog.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/TabPanel.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/Utils.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowDeleteDialog.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowExecutionReport.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowImportExportDialog.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowMetadataDialog.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/index.css +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/index.js +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/logo.svg +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/reportWebVitals.js +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/setupTests.js +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/types/WorkflowTypes.ts +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/views/AboutView.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/views/ConfigView.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/views/GlobalConfigView.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/src/views/WorkflowView.tsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_app/ui/neat-app/tsconfig.json +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_constants.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/_shared.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_dms.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_iodd.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/loaders/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/loaders/_rdf2dms.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/queries/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/queries/_construct.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/queries/_shared.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/transformers/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/transformers/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/transformers/_iodd.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/transformers/_rdfpath.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_graph/transformers/_value_type.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/errors/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/errors/_external.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/errors/_properties.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/errors/_resources.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/errors/_workflow.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/warnings/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/warnings/_general.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/warnings/_properties.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/warnings/_resources.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/catalog/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2rules.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/_types.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/data_types.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/mapping/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/transformers/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/transformers/_pipelines.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_state.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/_wizard.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/engine/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/engine/_import.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/engine/_interface.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_session/engine/_load.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_store/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/auth.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/cdf/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/cdf/data_classes.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/cdf/loaders/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/cdf/loaders/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/cdf/loaders/_data_modeling.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/cdf/loaders/_ingestion.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/rdf_.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/reader/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/reader/_base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/upload.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/base.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/cdf_store.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/examples/Export_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/manager.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/model.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps/step_model.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/steps_registry.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/tasks.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/triggers.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_workflows/utils.py +0 -0
- {cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.98.0
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Home-page: https://cognite-neat.readthedocs-hosted.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -29,6 +29,7 @@ Requires-Dist: google-auth-oauthlib ; extra == "google"
|
|
|
29
29
|
Requires-Dist: gspread ; extra == "google"
|
|
30
30
|
Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
|
|
31
31
|
Requires-Dist: lxml (>=5.3.0,<6.0.0) ; extra == "all"
|
|
32
|
+
Requires-Dist: mixpanel (>=4.10.1,<5.0.0)
|
|
32
33
|
Requires-Dist: mkdocs ; extra == "docs"
|
|
33
34
|
Requires-Dist: mkdocs-autorefs (>=0.5.0,<0.6.0) ; extra == "docs"
|
|
34
35
|
Requires-Dist: mkdocs-git-authors-plugin ; extra == "docs"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
from ._base import BaseLoader, CDFLoader
|
|
2
|
-
from ._rdf2asset import AssetLoader
|
|
3
2
|
from ._rdf2dms import DMSLoader
|
|
4
3
|
|
|
5
|
-
__all__ = ["BaseLoader", "CDFLoader", "DMSLoader"
|
|
4
|
+
__all__ = ["BaseLoader", "CDFLoader", "DMSLoader"]
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
def _repr_html_() -> str:
|
|
@@ -92,6 +92,15 @@ class NotSupportedHasDataFilterLimitWarning(CDFNotSupportedWarning):
|
|
|
92
92
|
limit: int = DMS_VIEW_CONTAINER_SIZE_LIMIT
|
|
93
93
|
|
|
94
94
|
|
|
95
|
+
@dataclass(unsafe_hash=True)
|
|
96
|
+
class UndefinedClassWarning(UserModelingWarning):
|
|
97
|
+
"""Class {class_id} has no explicit properties defined neither implements other class"""
|
|
98
|
+
|
|
99
|
+
fix = "Define properties for class or inherit properties by implementing another class."
|
|
100
|
+
|
|
101
|
+
class_id: str
|
|
102
|
+
|
|
103
|
+
|
|
95
104
|
@dataclass(unsafe_hash=True)
|
|
96
105
|
class UndefinedViewWarning(UserModelingWarning):
|
|
97
106
|
"""Undefined view {value_type} has been referred as value type for property <{view_property}> of view {view_id}."""
|
|
@@ -4,20 +4,15 @@ from typing import Any, Generic, TypeAlias, TypeVar
|
|
|
4
4
|
|
|
5
5
|
from cognite.neat._issues import IssueList
|
|
6
6
|
from cognite.neat._rules.models import (
|
|
7
|
-
AssetRules,
|
|
8
7
|
DMSRules,
|
|
9
|
-
DomainRules,
|
|
10
8
|
InformationRules,
|
|
11
9
|
)
|
|
12
|
-
from cognite.neat._rules.models.asset._rules_input import AssetInputRules
|
|
13
10
|
from cognite.neat._rules.models.dms._rules_input import DMSInputRules
|
|
14
11
|
from cognite.neat._rules.models.information._rules_input import InformationInputRules
|
|
15
12
|
|
|
16
|
-
VerifiedRules: TypeAlias =
|
|
17
|
-
InputRules: TypeAlias =
|
|
18
|
-
Rules: TypeAlias =
|
|
19
|
-
AssetInputRules | DMSInputRules | InformationInputRules | DomainRules | InformationRules | DMSRules | AssetRules
|
|
20
|
-
)
|
|
13
|
+
VerifiedRules: TypeAlias = InformationRules | DMSRules
|
|
14
|
+
InputRules: TypeAlias = DMSInputRules | InformationInputRules
|
|
15
|
+
Rules: TypeAlias = DMSInputRules | InformationInputRules | InformationRules | DMSRules
|
|
21
16
|
T_Rules = TypeVar("T_Rules", bound=Rules)
|
|
22
17
|
T_VerifiedRules = TypeVar("T_VerifiedRules", bound=VerifiedRules)
|
|
23
18
|
T_InputRules = TypeVar("T_InputRules", bound=InputRules)
|
|
@@ -14,7 +14,6 @@ from cognite.neat._rules.models._rdfpath import RDFPath
|
|
|
14
14
|
from cognite.neat._rules.models.entities import (
|
|
15
15
|
ClassEntity,
|
|
16
16
|
Entity,
|
|
17
|
-
ReferenceEntity,
|
|
18
17
|
)
|
|
19
18
|
from cognite.neat._rules.models.information import InformationProperty
|
|
20
19
|
from cognite.neat._utils.rdf_ import get_inheritance_path
|
|
@@ -76,10 +75,6 @@ class BaseAnalysis(ABC, Generic[T_Rules, T_Class, T_Property, T_ClassEntity, T_P
|
|
|
76
75
|
def _get_properties(self) -> list[T_Property]:
|
|
77
76
|
raise NotImplementedError
|
|
78
77
|
|
|
79
|
-
@abstractmethod
|
|
80
|
-
def _get_reference(self, class_or_property: T_Class | T_Property) -> ReferenceEntity | None:
|
|
81
|
-
raise NotImplementedError
|
|
82
|
-
|
|
83
78
|
@abstractmethod
|
|
84
79
|
def _get_cls_entity(self, class_: T_Class | T_Property) -> T_ClassEntity:
|
|
85
80
|
raise NotImplementedError
|
|
@@ -92,10 +87,6 @@ class BaseAnalysis(ABC, Generic[T_Rules, T_Class, T_Property, T_ClassEntity, T_P
|
|
|
92
87
|
def _get_cls_parents(self, class_: T_Class) -> list[T_ClassEntity] | None:
|
|
93
88
|
raise NotImplementedError
|
|
94
89
|
|
|
95
|
-
@abstractmethod
|
|
96
|
-
def _get_reference_rules(self) -> T_Rules | None:
|
|
97
|
-
raise NotImplementedError
|
|
98
|
-
|
|
99
90
|
@classmethod
|
|
100
91
|
@abstractmethod
|
|
101
92
|
def _set_cls_entity(cls, property_: T_Property, class_: T_ClassEntity) -> None:
|
|
@@ -111,23 +102,11 @@ class BaseAnalysis(ABC, Generic[T_Rules, T_Class, T_Property, T_ClassEntity, T_P
|
|
|
111
102
|
|
|
112
103
|
@property
|
|
113
104
|
def directly_referred_classes(self) -> set[ClassEntity]:
|
|
114
|
-
|
|
115
|
-
if ref_rules is None:
|
|
116
|
-
return set()
|
|
117
|
-
prefix = ref_rules.metadata.get_prefix()
|
|
118
|
-
return {
|
|
119
|
-
ref.as_class_entity()
|
|
120
|
-
for class_ in self._get_classes()
|
|
121
|
-
if isinstance((ref := self._get_reference(class_)), ReferenceEntity) and ref.prefix == prefix
|
|
122
|
-
}
|
|
105
|
+
raise NotImplementedError
|
|
123
106
|
|
|
124
107
|
@property
|
|
125
108
|
def inherited_referred_classes(self) -> set[ClassEntity]:
|
|
126
|
-
|
|
127
|
-
inherited_referred_classes = []
|
|
128
|
-
for class_ in dir_referred_classes:
|
|
129
|
-
inherited_referred_classes.extend(self.class_inheritance_path(class_))
|
|
130
|
-
return set(inherited_referred_classes)
|
|
109
|
+
raise NotImplementedError
|
|
131
110
|
|
|
132
111
|
# Todo Lru cache this method.
|
|
133
112
|
def class_parent_pairs(self) -> dict[T_ClassEntity, list[T_ClassEntity]]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from cognite.neat._constants import DMS_LISTABLE_PROPERTY_LIMIT
|
|
2
2
|
from cognite.neat._rules.models.dms import DMSProperty, DMSRules, DMSView
|
|
3
|
-
from cognite.neat._rules.models.entities import
|
|
3
|
+
from cognite.neat._rules.models.entities import ViewEntity
|
|
4
4
|
|
|
5
5
|
from ._base import BaseAnalysis
|
|
6
6
|
|
|
@@ -14,21 +14,12 @@ class DMSAnalysis(BaseAnalysis[DMSRules, DMSView, DMSProperty, ViewEntity, str])
|
|
|
14
14
|
def _get_properties(self) -> list[DMSProperty]:
|
|
15
15
|
return list(self.rules.properties)
|
|
16
16
|
|
|
17
|
-
def _get_reference(self, class_or_property: DMSView | DMSProperty) -> ReferenceEntity | None:
|
|
18
|
-
return class_or_property.reference if isinstance(class_or_property.reference, ReferenceEntity) else None
|
|
19
|
-
|
|
20
17
|
def _get_cls_entity(self, class_: DMSView | DMSProperty) -> ViewEntity:
|
|
21
18
|
return class_.view
|
|
22
19
|
|
|
23
|
-
def _get_prop_entity(self, property_: DMSProperty) -> str:
|
|
24
|
-
return property_.property_
|
|
25
|
-
|
|
26
20
|
def _get_cls_parents(self, class_: DMSView) -> list[ViewEntity] | None:
|
|
27
21
|
return list(class_.implements) if class_.implements else None
|
|
28
22
|
|
|
29
|
-
def _get_reference_rules(self) -> DMSRules | None:
|
|
30
|
-
return self.rules.reference
|
|
31
|
-
|
|
32
23
|
@classmethod
|
|
33
24
|
def _set_cls_entity(cls, property_: DMSProperty, class_: ViewEntity) -> None:
|
|
34
25
|
property_.view = class_
|
|
@@ -41,3 +32,6 @@ class DMSAnalysis(BaseAnalysis[DMSRules, DMSView, DMSProperty, ViewEntity, str])
|
|
|
41
32
|
|
|
42
33
|
def subset_rules(self, desired_classes: set[ViewEntity]) -> DMSRules:
|
|
43
34
|
raise NotImplementedError()
|
|
35
|
+
|
|
36
|
+
def _get_prop_entity(self, property_: DMSProperty) -> str:
|
|
37
|
+
return property_.view_property
|
|
@@ -12,7 +12,7 @@ from cognite.neat._rules.models._rdfpath import (
|
|
|
12
12
|
SelfReferenceProperty,
|
|
13
13
|
SingleProperty,
|
|
14
14
|
)
|
|
15
|
-
from cognite.neat._rules.models.entities import ClassEntity
|
|
15
|
+
from cognite.neat._rules.models.entities import ClassEntity
|
|
16
16
|
from cognite.neat._rules.models.entities._multi_value import MultiValueTypeInfo
|
|
17
17
|
from cognite.neat._rules.models.information import (
|
|
18
18
|
InformationClass,
|
|
@@ -34,9 +34,6 @@ class InformationAnalysis(BaseAnalysis[InformationRules, InformationClass, Infor
|
|
|
34
34
|
def _get_max_occurrence(self, property_: InformationProperty) -> int | float | None:
|
|
35
35
|
return property_.max_count
|
|
36
36
|
|
|
37
|
-
def _get_reference(self, class_or_property: InformationClass | InformationProperty) -> ReferenceEntity | None:
|
|
38
|
-
return class_or_property.reference if isinstance(class_or_property.reference, ReferenceEntity) else None
|
|
39
|
-
|
|
40
37
|
def _get_cls_entity(self, class_: InformationClass | InformationProperty) -> ClassEntity:
|
|
41
38
|
return class_.class_
|
|
42
39
|
|
|
@@ -48,10 +45,7 @@ class InformationAnalysis(BaseAnalysis[InformationRules, InformationClass, Infor
|
|
|
48
45
|
return property_.property_
|
|
49
46
|
|
|
50
47
|
def _get_cls_parents(self, class_: InformationClass) -> list[ClassEntity] | None:
|
|
51
|
-
return list(class_.
|
|
52
|
-
|
|
53
|
-
def _get_reference_rules(self) -> InformationRules | None:
|
|
54
|
-
return self.rules.reference
|
|
48
|
+
return list(class_.implements or []) or None
|
|
55
49
|
|
|
56
50
|
def _get_properties(self) -> list[InformationProperty]:
|
|
57
51
|
return list(self.rules.properties)
|
|
@@ -154,8 +148,6 @@ class InformationAnalysis(BaseAnalysis[InformationRules, InformationClass, Infor
|
|
|
154
148
|
If it fails, it will return a partial rules with a warning message, validated
|
|
155
149
|
only with base Pydantic validators.
|
|
156
150
|
"""
|
|
157
|
-
if self.rules.metadata.schema_ is not SchemaCompleteness.complete:
|
|
158
|
-
raise ValueError("Rules are not complete cannot perform reduction!")
|
|
159
151
|
class_as_dict = self.as_class_dict()
|
|
160
152
|
class_parents_pairs = self.class_parent_pairs()
|
|
161
153
|
defined_classes = self.defined_classes(consider_inheritance=True)
|
|
Binary file
|
|
@@ -13,17 +13,13 @@ from openpyxl.styles import Alignment, Border, Font, PatternFill, Side
|
|
|
13
13
|
from openpyxl.worksheet.worksheet import Worksheet
|
|
14
14
|
from rdflib import Namespace
|
|
15
15
|
|
|
16
|
-
from cognite.neat._constants import COGNITE_MODELS
|
|
17
16
|
from cognite.neat._rules._shared import VerifiedRules
|
|
18
17
|
from cognite.neat._rules.models import (
|
|
19
|
-
DataModelType,
|
|
20
18
|
ExtensionCategory,
|
|
21
19
|
SchemaCompleteness,
|
|
22
20
|
SheetRow,
|
|
23
21
|
)
|
|
24
22
|
from cognite.neat._rules.models.dms import DMSMetadata
|
|
25
|
-
from cognite.neat._rules.models.dms._rules import DMSRules
|
|
26
|
-
from cognite.neat._rules.models.domain import DomainMetadata
|
|
27
23
|
from cognite.neat._rules.models.information import InformationMetadata
|
|
28
24
|
from cognite.neat._rules.models.information._rules import InformationRules
|
|
29
25
|
|
|
@@ -40,23 +36,13 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
|
|
|
40
36
|
on the different styles.
|
|
41
37
|
output_role: The role to use for the exported spreadsheet. If provided, the rules will be converted to
|
|
42
38
|
this role formate before being written to excel. If not provided, the role from the rules will be used.
|
|
43
|
-
dump_as: This determines how the rules are written to the Excel file. An Excel file has up to three sets of
|
|
44
|
-
sheets: user, last, and reference. The user sheets are used for inputting rules from a user. The last sheets
|
|
45
|
-
are used for the last version of the same model as the user, while the reference sheets are used for
|
|
46
|
-
the model the user is building on. The options are:
|
|
47
|
-
* "user": The rules are written to the user sheets. This is used when you want to modify the rules
|
|
48
|
-
directly and potentially change the model. This is useful when you have imported the data model
|
|
49
|
-
from outside CDF and you want to modify it before you write it to CDF.
|
|
50
|
-
* "last": The rules are written to the last sheets. This is used when you want to extend the rules,
|
|
51
|
-
but have validation that you are not breaking the existing model. This is used when you want to
|
|
52
|
-
change a model that has already been published to CDF and that model is in production.
|
|
53
|
-
* "reference": The rules are written to the reference sheets. This is typically used when you want to build
|
|
54
|
-
a new solution on top of an enterprise model.
|
|
55
39
|
new_model_id: The new model ID to use for the exported spreadsheet. This is only applicable if the input
|
|
56
40
|
rules have 'is_reference' set. If provided, the model ID will be used to automatically create the
|
|
57
41
|
new metadata sheet in the Excel file. The model id is expected to be a tuple of (prefix, title)
|
|
58
42
|
(space, external_id) for InformationRules and DMSRules respectively.
|
|
59
43
|
|
|
44
|
+
sheet_prefix: The prefix to use for the sheet names in the Excel file. Defaults to an empty string.
|
|
45
|
+
|
|
60
46
|
The following styles are available:
|
|
61
47
|
|
|
62
48
|
- "none": No styling is applied.
|
|
@@ -80,16 +66,17 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
|
|
|
80
66
|
dump_options = get_args(DumpOptions)
|
|
81
67
|
|
|
82
68
|
def __init__(
|
|
83
|
-
self,
|
|
69
|
+
self,
|
|
70
|
+
styling: Style = "default",
|
|
71
|
+
new_model_id: tuple[str, str] | None = None,
|
|
72
|
+
sheet_prefix: str | None = None,
|
|
84
73
|
):
|
|
74
|
+
self.sheet_prefix = sheet_prefix or ""
|
|
85
75
|
if styling not in self.style_options:
|
|
86
76
|
raise ValueError(f"Invalid styling: {styling}. Valid options are {self.style_options}")
|
|
87
|
-
if dump_as not in self.dump_options:
|
|
88
|
-
raise ValueError(f"Invalid dump_as: {dump_as}. Valid options are {self.dump_options}")
|
|
89
77
|
self.styling = styling
|
|
90
78
|
self._styling_level = self.style_options.index(styling)
|
|
91
79
|
self.new_model_id = new_model_id
|
|
92
|
-
self.dump_as = dump_as
|
|
93
80
|
|
|
94
81
|
def export_to_file(self, rules: VerifiedRules, filepath: Path) -> None:
|
|
95
82
|
"""Exports transformation rules to excel file."""
|
|
@@ -105,43 +92,10 @@ class ExcelExporter(BaseExporter[VerifiedRules, Workbook]):
|
|
|
105
92
|
# Remove default sheet named "Sheet"
|
|
106
93
|
workbook.remove(workbook["Sheet"])
|
|
107
94
|
|
|
108
|
-
dumped_user_rules: dict[str, Any]
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
action = {"last": "update", "reference": "create"}[self.dump_as]
|
|
113
|
-
metadata_creator = _MetadataCreator(action, self.new_model_id) # type: ignore[arg-type]
|
|
114
|
-
|
|
115
|
-
dumped_user_rules = {
|
|
116
|
-
"Metadata": metadata_creator.create(rules.metadata),
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if self.dump_as == "last":
|
|
120
|
-
dumped_last_rules = rules.dump(by_alias=True)
|
|
121
|
-
if rules.reference:
|
|
122
|
-
dumped_reference_rules = rules.reference.dump(by_alias=True, as_reference=True)
|
|
123
|
-
elif self.dump_as == "reference":
|
|
124
|
-
dumped_reference_rules = rules.dump(by_alias=True, as_reference=True)
|
|
125
|
-
else:
|
|
126
|
-
dumped_user_rules = rules.dump(by_alias=True)
|
|
127
|
-
if rules.last:
|
|
128
|
-
dumped_last_rules = rules.last.dump(by_alias=True)
|
|
129
|
-
if rules.reference:
|
|
130
|
-
dumped_reference_rules = rules.reference.dump(by_alias=True, as_reference=True)
|
|
131
|
-
|
|
132
|
-
self._write_metadata_sheet(workbook, dumped_user_rules["Metadata"])
|
|
133
|
-
self._write_sheets(workbook, dumped_user_rules, rules)
|
|
134
|
-
if dumped_last_rules:
|
|
135
|
-
self._write_sheets(workbook, dumped_last_rules, rules, sheet_prefix="Last")
|
|
136
|
-
self._write_metadata_sheet(workbook, dumped_last_rules["Metadata"], sheet_prefix="Last")
|
|
137
|
-
|
|
138
|
-
if dumped_reference_rules:
|
|
139
|
-
if isinstance(rules.reference, DMSRules):
|
|
140
|
-
sheet_prefix = "CDM" if rules.reference.metadata.as_data_model_id() in COGNITE_MODELS else "Ref"
|
|
141
|
-
else:
|
|
142
|
-
sheet_prefix = "Ref"
|
|
143
|
-
self._write_sheets(workbook, dumped_reference_rules, rules, sheet_prefix=sheet_prefix)
|
|
144
|
-
self._write_metadata_sheet(workbook, dumped_reference_rules["Metadata"], sheet_prefix=sheet_prefix)
|
|
95
|
+
dumped_user_rules: dict[str, Any] = rules.dump(by_alias=True)
|
|
96
|
+
|
|
97
|
+
self._write_metadata_sheet(workbook, dumped_user_rules["Metadata"], sheet_prefix=self.sheet_prefix)
|
|
98
|
+
self._write_sheets(workbook, dumped_user_rules, rules, sheet_prefix=self.sheet_prefix)
|
|
145
99
|
|
|
146
100
|
if isinstance(rules, InformationRules) and rules.prefixes:
|
|
147
101
|
self._write_prefixes_sheet(workbook, rules.prefixes)
|
|
@@ -274,9 +228,9 @@ class _MetadataCreator:
|
|
|
274
228
|
new_model_id: tuple[str, str] | None = None,
|
|
275
229
|
):
|
|
276
230
|
self.action = action
|
|
277
|
-
self.new_model_id = new_model_id or ("
|
|
231
|
+
self.new_model_id = new_model_id or ("YOUR_SPACE", "YOUR_EXTERNAL_ID")
|
|
278
232
|
|
|
279
|
-
def create(self, metadata:
|
|
233
|
+
def create(self, metadata: InformationMetadata | DMSMetadata) -> dict[str, Any]:
|
|
280
234
|
now = datetime.now(timezone.utc).replace(microsecond=0, tzinfo=None)
|
|
281
235
|
if self.action == "update":
|
|
282
236
|
output = json.loads(metadata.model_dump_json(by_alias=True))
|
|
@@ -290,13 +244,6 @@ class _MetadataCreator:
|
|
|
290
244
|
output["creator"] = self.creator_name
|
|
291
245
|
return output
|
|
292
246
|
|
|
293
|
-
# Action "create"
|
|
294
|
-
if isinstance(metadata, DomainMetadata):
|
|
295
|
-
output = {field_alias: None for field_alias in metadata.model_dump(by_alias=True).keys()}
|
|
296
|
-
output["role"] = metadata.role.value
|
|
297
|
-
output["creator"] = self.creator_name
|
|
298
|
-
return output
|
|
299
|
-
|
|
300
247
|
new_metadata = self._create_new_info(now)
|
|
301
248
|
if isinstance(metadata, DMSMetadata):
|
|
302
249
|
from cognite.neat._rules.transformers._converters import _InformationRulesConverter
|
|
@@ -314,13 +261,9 @@ class _MetadataCreator:
|
|
|
314
261
|
return created
|
|
315
262
|
|
|
316
263
|
def _create_new_info(self, now: datetime) -> InformationMetadata:
|
|
317
|
-
prefix = self.new_model_id[0]
|
|
318
264
|
return InformationMetadata(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
extension=ExtensionCategory.addition,
|
|
322
|
-
prefix=prefix,
|
|
323
|
-
namespace=f"http://purl.org/neat/{prefix}/", # type: ignore[arg-type]
|
|
265
|
+
space=self.new_model_id[0],
|
|
266
|
+
external_id=self.new_model_id[1],
|
|
324
267
|
description=None,
|
|
325
268
|
version="1",
|
|
326
269
|
created=now,
|
{cognite_neat-0.97.3 → cognite_neat-0.98.0}/cognite/neat/_rules/exporters/_rules2ontology.py
RENAMED
|
@@ -247,9 +247,9 @@ class OWLClass(OntologyModel):
|
|
|
247
247
|
|
|
248
248
|
@classmethod
|
|
249
249
|
def from_class(cls, definition: InformationClass, namespace: Namespace, prefixes: dict) -> Self:
|
|
250
|
-
if definition.
|
|
250
|
+
if definition.implements and isinstance(definition.implements, list):
|
|
251
251
|
sub_class_of = []
|
|
252
|
-
for parent_class in definition.
|
|
252
|
+
for parent_class in definition.implements:
|
|
253
253
|
try:
|
|
254
254
|
sub_class_of.append(prefixes[str(parent_class.prefix)][str(parent_class.suffix)])
|
|
255
255
|
except KeyError:
|
|
@@ -524,8 +524,8 @@ class SHACLNodeShape(OntologyModel):
|
|
|
524
524
|
def from_rules(
|
|
525
525
|
cls, class_definition: InformationClass, property_definitions: list[InformationProperty], namespace: Namespace
|
|
526
526
|
) -> "SHACLNodeShape":
|
|
527
|
-
if class_definition.
|
|
528
|
-
parent = [namespace[str(parent.suffix) + "Shape"] for parent in class_definition.
|
|
527
|
+
if class_definition.implements:
|
|
528
|
+
parent = [namespace[str(parent.suffix) + "Shape"] for parent in class_definition.implements]
|
|
529
529
|
else:
|
|
530
530
|
parent = None
|
|
531
531
|
return cls(
|
|
@@ -6,7 +6,6 @@ from datetime import datetime
|
|
|
6
6
|
from typing import Any, Generic, Literal
|
|
7
7
|
|
|
8
8
|
from pydantic import ValidationError
|
|
9
|
-
from rdflib import Namespace
|
|
10
9
|
|
|
11
10
|
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
12
11
|
from cognite.neat._issues import IssueList, NeatError, NeatWarning
|
|
@@ -33,11 +32,11 @@ class BaseImporter(ABC, Generic[T_InputRules]):
|
|
|
33
32
|
creator = getpass.getuser()
|
|
34
33
|
|
|
35
34
|
return {
|
|
36
|
-
"prefix": "neat",
|
|
37
35
|
"schema": "partial",
|
|
38
|
-
"
|
|
36
|
+
"space": "neat",
|
|
37
|
+
"external_id": "NeatImportedDataModel",
|
|
39
38
|
"version": "0.1.0",
|
|
40
|
-
"
|
|
39
|
+
"name": "Neat Imported Data Model",
|
|
41
40
|
"created": datetime.now().replace(microsecond=0).isoformat(),
|
|
42
41
|
"updated": datetime.now().replace(microsecond=0).isoformat(),
|
|
43
42
|
"creator": creator,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from collections import Counter
|
|
2
|
-
from collections.abc import Collection, Sequence
|
|
2
|
+
from collections.abc import Collection, Iterable, Sequence
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import Literal, cast
|
|
@@ -30,10 +30,8 @@ from cognite.neat._issues.warnings import (
|
|
|
30
30
|
from cognite.neat._rules._shared import ReadRules
|
|
31
31
|
from cognite.neat._rules.importers._base import BaseImporter, _handle_issues
|
|
32
32
|
from cognite.neat._rules.models import (
|
|
33
|
-
DataModelType,
|
|
34
33
|
DMSInputRules,
|
|
35
34
|
DMSSchema,
|
|
36
|
-
SchemaCompleteness,
|
|
37
35
|
)
|
|
38
36
|
from cognite.neat._rules.models.data_types import DataType, Enum
|
|
39
37
|
from cognite.neat._rules.models.dms import (
|
|
@@ -86,6 +84,14 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
86
84
|
self._all_containers_by_id.update(schema.reference.containers.items())
|
|
87
85
|
self._all_views_by_id.update(schema.reference.views.items())
|
|
88
86
|
|
|
87
|
+
def update_referenced_containers(self, containers: Iterable[dm.ContainerApply]) -> None:
|
|
88
|
+
"""Update the referenced containers. This is useful to add Cognite containers identified after the root schema
|
|
89
|
+
is read"""
|
|
90
|
+
for container in containers:
|
|
91
|
+
if container.as_id() in self._all_containers_by_id:
|
|
92
|
+
continue
|
|
93
|
+
self._all_containers_by_id[container.as_id()] = container
|
|
94
|
+
|
|
89
95
|
@classmethod
|
|
90
96
|
def from_data_model_id(
|
|
91
97
|
cls,
|
|
@@ -180,9 +186,6 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
180
186
|
created = now
|
|
181
187
|
updated = now
|
|
182
188
|
return DMSInputMetadata(
|
|
183
|
-
schema_="complete",
|
|
184
|
-
data_model_type="solution" if has_reference else "enterprise",
|
|
185
|
-
extension="addition",
|
|
186
189
|
space=model.space,
|
|
187
190
|
external_id=model.external_id,
|
|
188
191
|
name=model.name or model.external_id,
|
|
@@ -226,28 +229,12 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
226
229
|
|
|
227
230
|
model = self.root_schema.data_model
|
|
228
231
|
|
|
229
|
-
schema_completeness = SchemaCompleteness.complete
|
|
230
|
-
data_model_type = DataModelType.enterprise
|
|
231
|
-
reference: DMSInputRules | None = None
|
|
232
|
-
if (ref_schema := self.root_schema.reference) and (ref_model := ref_schema.data_model):
|
|
233
|
-
# Reference should always be an enterprise model.
|
|
234
|
-
reference = self._create_rule_components(
|
|
235
|
-
ref_model,
|
|
236
|
-
ref_schema,
|
|
237
|
-
self.ref_metadata or self._create_default_metadata(list(ref_schema.views.values()), is_ref=True),
|
|
238
|
-
DataModelType.enterprise,
|
|
239
|
-
)
|
|
240
|
-
data_model_type = DataModelType.solution
|
|
241
|
-
|
|
242
232
|
user_rules = self._create_rule_components(
|
|
243
233
|
model,
|
|
244
234
|
self.root_schema,
|
|
245
235
|
self.metadata,
|
|
246
|
-
data_model_type,
|
|
247
|
-
schema_completeness,
|
|
248
|
-
has_reference=reference is not None,
|
|
249
236
|
)
|
|
250
|
-
|
|
237
|
+
|
|
251
238
|
self._end = datetime.now(timezone.utc)
|
|
252
239
|
|
|
253
240
|
return ReadRules(user_rules, self.issue_list, {})
|
|
@@ -257,9 +244,6 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
257
244
|
data_model: dm.DataModelApply,
|
|
258
245
|
schema: DMSSchema,
|
|
259
246
|
metadata: DMSInputMetadata | None = None,
|
|
260
|
-
data_model_type: DataModelType | None = None,
|
|
261
|
-
schema_completeness: SchemaCompleteness | None = None,
|
|
262
|
-
has_reference: bool = False,
|
|
263
247
|
) -> DMSInputRules:
|
|
264
248
|
properties: list[DMSInputProperty] = []
|
|
265
249
|
for view_id, view in schema.views.items():
|
|
@@ -274,11 +258,7 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
274
258
|
view.as_id() if isinstance(view, dm.View | dm.ViewApply) else view for view in data_model.views or []
|
|
275
259
|
}
|
|
276
260
|
|
|
277
|
-
metadata = metadata or DMSInputMetadata.from_data_model(data_model
|
|
278
|
-
if data_model_type is not None:
|
|
279
|
-
metadata.data_model_type = str(data_model_type) # type: ignore[assignment]
|
|
280
|
-
if schema_completeness is not None:
|
|
281
|
-
metadata.schema_ = str(schema_completeness) # type: ignore[assignment]
|
|
261
|
+
metadata = metadata or DMSInputMetadata.from_data_model(data_model)
|
|
282
262
|
|
|
283
263
|
enum = self._create_enum_collections(schema.containers.values())
|
|
284
264
|
|
|
@@ -301,9 +281,6 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
301
281
|
now = datetime.now().replace(microsecond=0)
|
|
302
282
|
space = Counter(view.space for view in views).most_common(1)[0][0]
|
|
303
283
|
return DMSInputMetadata(
|
|
304
|
-
schema_="complete",
|
|
305
|
-
extension="addition",
|
|
306
|
-
data_model_type="enterprise" if is_ref else "solution",
|
|
307
284
|
space=space,
|
|
308
285
|
external_id="Unknown",
|
|
309
286
|
version="0.1.0",
|
|
@@ -351,8 +328,6 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
351
328
|
return None
|
|
352
329
|
|
|
353
330
|
return DMSInputProperty(
|
|
354
|
-
class_=str(class_entity),
|
|
355
|
-
property_=prop_id,
|
|
356
331
|
description=prop.description,
|
|
357
332
|
name=prop.name,
|
|
358
333
|
connection=self._get_connection_type(prop),
|
|
@@ -361,10 +336,12 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
361
336
|
nullable=self._get_nullable(prop),
|
|
362
337
|
immutable=self._get_immutable(prop),
|
|
363
338
|
default=self._get_default(prop),
|
|
364
|
-
container=
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
container_property=
|
|
339
|
+
container=(
|
|
340
|
+
str(ContainerEntity.from_id(prop.container)) if isinstance(prop, dm.MappedPropertyApply) else None
|
|
341
|
+
),
|
|
342
|
+
container_property=(
|
|
343
|
+
prop.container_property_identifier if isinstance(prop, dm.MappedPropertyApply) else None
|
|
344
|
+
),
|
|
368
345
|
view=str(view_entity),
|
|
369
346
|
view_property=prop_id,
|
|
370
347
|
index=self._get_index(prop, prop_id),
|
|
@@ -99,8 +99,7 @@ class _DTDLConverter:
|
|
|
99
99
|
class_=item.id_.as_class_id(),
|
|
100
100
|
name=item.display_name,
|
|
101
101
|
description=item.description,
|
|
102
|
-
|
|
103
|
-
parent=[parent.as_class_id() for parent in item.extends or []] or None,
|
|
102
|
+
implements=[parent.as_class_id() for parent in item.extends or []] or None,
|
|
104
103
|
)
|
|
105
104
|
self.classes.append(class_)
|
|
106
105
|
for sub_item_or_id in item.contents or []:
|
|
@@ -135,7 +134,6 @@ class _DTDLConverter:
|
|
|
135
134
|
property_=item.name,
|
|
136
135
|
name=item.display_name,
|
|
137
136
|
description=item.description,
|
|
138
|
-
comment=item.comment,
|
|
139
137
|
value_type=value_type,
|
|
140
138
|
min_count=min_count,
|
|
141
139
|
max_count=max_count,
|
|
@@ -181,7 +179,6 @@ class _DTDLConverter:
|
|
|
181
179
|
property_=item.name,
|
|
182
180
|
name=item.display_name,
|
|
183
181
|
description=item.description,
|
|
184
|
-
comment=item.comment,
|
|
185
182
|
value_type=value_type,
|
|
186
183
|
min_count=0,
|
|
187
184
|
max_count=1,
|
|
@@ -201,7 +198,6 @@ class _DTDLConverter:
|
|
|
201
198
|
property_=item.name,
|
|
202
199
|
name=item.display_name,
|
|
203
200
|
description=item.description,
|
|
204
|
-
comment=item.comment,
|
|
205
201
|
value_type=value_type,
|
|
206
202
|
min_count=0,
|
|
207
203
|
max_count=1,
|
|
@@ -233,7 +229,6 @@ class _DTDLConverter:
|
|
|
233
229
|
description=item.description,
|
|
234
230
|
min_count=item.min_multiplicity or 0,
|
|
235
231
|
max_count=item.max_multiplicity or 1,
|
|
236
|
-
comment=item.comment,
|
|
237
232
|
value_type=value_type,
|
|
238
233
|
)
|
|
239
234
|
self.properties.append(prop)
|
|
@@ -255,7 +250,6 @@ class _DTDLConverter:
|
|
|
255
250
|
class_=item.id_.as_class_id(),
|
|
256
251
|
name=item.display_name,
|
|
257
252
|
description=item.description,
|
|
258
|
-
comment=item.comment,
|
|
259
253
|
)
|
|
260
254
|
self.classes.append(class_)
|
|
261
255
|
|
|
@@ -17,7 +17,7 @@ from cognite.neat._rules._shared import ReadRules
|
|
|
17
17
|
from cognite.neat._rules.importers._base import BaseImporter
|
|
18
18
|
from cognite.neat._rules.importers._dtdl2rules.dtdl_converter import _DTDLConverter
|
|
19
19
|
from cognite.neat._rules.importers._dtdl2rules.spec import DTDL_CLS_BY_TYPE_BY_SPEC, DTDLBase, Interface
|
|
20
|
-
from cognite.neat._rules.models import InformationInputRules
|
|
20
|
+
from cognite.neat._rules.models import InformationInputRules
|
|
21
21
|
from cognite.neat._rules.models.information import InformationInputMetadata
|
|
22
22
|
from cognite.neat._utils.text import humanize_collection, to_pascal
|
|
23
23
|
|
|
@@ -31,7 +31,7 @@ class DTDLImporter(BaseImporter[InformationInputRules]):
|
|
|
31
31
|
|
|
32
32
|
Args:
|
|
33
33
|
items (Sequence[DTDLBase]): A sequence of DTDLBase objects.
|
|
34
|
-
|
|
34
|
+
name (str, optional): Name of the data model. Defaults to None.
|
|
35
35
|
read_issues (list[ValidationIssue], optional): A list of issues that occurred during reading. Defaults to None.
|
|
36
36
|
schema (SchemaCompleteness, optional): Schema completeness. Defaults to SchemaCompleteness.partial.
|
|
37
37
|
|
|
@@ -40,14 +40,12 @@ class DTDLImporter(BaseImporter[InformationInputRules]):
|
|
|
40
40
|
def __init__(
|
|
41
41
|
self,
|
|
42
42
|
items: Sequence[DTDLBase],
|
|
43
|
-
|
|
43
|
+
name: str | None = None,
|
|
44
44
|
read_issues: list[NeatIssue] | None = None,
|
|
45
|
-
schema: SchemaCompleteness = SchemaCompleteness.partial,
|
|
46
45
|
) -> None:
|
|
47
46
|
self._items = items
|
|
48
|
-
self.
|
|
47
|
+
self.name = name
|
|
49
48
|
self._read_issues = IssueList(read_issues)
|
|
50
|
-
self._schema_completeness = schema
|
|
51
49
|
|
|
52
50
|
@classmethod
|
|
53
51
|
def _from_file_content(cls, file_content: str, filepath: Path) -> Iterable[DTDLBase | NeatIssue]:
|
|
@@ -130,17 +128,16 @@ class DTDLImporter(BaseImporter[InformationInputRules]):
|
|
|
130
128
|
converter.convert(self._items)
|
|
131
129
|
|
|
132
130
|
metadata = self._default_metadata()
|
|
133
|
-
metadata["schema"] = self._schema_completeness.value
|
|
134
131
|
|
|
135
|
-
if self.
|
|
136
|
-
metadata["
|
|
132
|
+
if self.name:
|
|
133
|
+
metadata["name"] = to_pascal(self.name)
|
|
137
134
|
try:
|
|
138
135
|
most_common_prefix = converter.get_most_common_prefix()
|
|
139
136
|
except ValueError:
|
|
140
137
|
# No prefixes are defined so we just use the default prefix...
|
|
141
138
|
...
|
|
142
139
|
else:
|
|
143
|
-
metadata["
|
|
140
|
+
metadata["space"] = most_common_prefix
|
|
144
141
|
|
|
145
142
|
rules = InformationInputRules(
|
|
146
143
|
metadata=InformationInputMetadata.load(metadata),
|