cognite-neat 0.96.5__tar.gz → 0.97.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.96.5 → cognite_neat-0.97.0}/PKG-INFO +5 -3
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_constants.py +4 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/__init__.py +3 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_base.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_dexpi.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_dms.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_iodd.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_mock_graph_generator.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_rdf_file.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/loaders/_rdf2dms.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/queries/_base.py +1 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/transformers/__init__.py +3 -1
- cognite_neat-0.97.0/cognite/neat/_graph/transformers/_rdfpath.py +109 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/errors/__init__.py +2 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/errors/_properties.py +12 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/warnings/__init__.py +2 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/warnings/_models.py +11 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/__init__.py +11 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_base.py +7 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_dms2rules.py +12 -3
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +17 -2
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_spreadsheet2rules.py +5 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/asset/_rules.py +6 -2
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/asset/_rules_input.py +6 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/data_types.py +6 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/dms/_exporter.py +16 -3
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/dms/_rules.py +37 -12
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/dms/_rules_input.py +8 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/dms/_validation.py +64 -2
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/domain.py +10 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/entities/_loaders.py +3 -5
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/information/_rules.py +6 -2
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/information/_rules_input.py +6 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/transformers/_base.py +7 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/transformers/_converters.py +56 -4
- cognite_neat-0.97.0/cognite/neat/_session/_base.py +188 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_session/_inspect.py +12 -4
- cognite_neat-0.97.0/cognite/neat/_session/_prepare.py +241 -0
- cognite_neat-0.97.0/cognite/neat/_session/_read.py +254 -0
- cognite_neat-0.97.0/cognite/neat/_session/_set.py +42 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_session/_show.py +171 -45
- cognite_neat-0.97.0/cognite/neat/_session/_state.py +148 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_session/_to.py +16 -17
- cognite_neat-0.97.0/cognite/neat/_session/engine/__init__.py +4 -0
- cognite_neat-0.97.0/cognite/neat/_session/engine/_import.py +7 -0
- cognite_neat-0.97.0/cognite/neat/_session/engine/_interface.py +24 -0
- cognite_neat-0.97.0/cognite/neat/_session/engine/_load.py +129 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_session/exceptions.py +13 -3
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_shared.py +6 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_store/_base.py +3 -24
- cognite_neat-0.97.0/cognite/neat/_store/_provenance.py +269 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/rdf_.py +34 -1
- cognite_neat-0.97.0/cognite/neat/_utils/reader/__init__.py +3 -0
- cognite_neat-0.97.0/cognite/neat/_utils/reader/_base.py +162 -0
- cognite_neat-0.97.0/cognite/neat/_version.py +2 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/pyproject.toml +9 -6
- cognite_neat-0.96.5/cognite/neat/_graph/models.py +0 -7
- cognite_neat-0.96.5/cognite/neat/_graph/transformers/_rdfpath.py +0 -50
- cognite_neat-0.96.5/cognite/neat/_session/_base.py +0 -117
- cognite_neat-0.96.5/cognite/neat/_session/_prepare.py +0 -118
- cognite_neat-0.96.5/cognite/neat/_session/_read.py +0 -147
- cognite_neat-0.96.5/cognite/neat/_session/_set.py +0 -23
- cognite_neat-0.96.5/cognite/neat/_session/_state.py +0 -99
- cognite_neat-0.96.5/cognite/neat/_store/_provenance.py +0 -126
- cognite_neat-0.96.5/cognite/neat/_version.py +0 -1
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/LICENSE +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/README.md +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/configuration.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/explorer.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/routers/configuration.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/routers/crud.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/routers/metrics.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/routers/workflows.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/utils/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/utils/logging.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/main.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/monitoring/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/monitoring/metrics.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/index.html +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css.map +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.LICENSE.txt +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.map +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/package-lock.json +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/package.json +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/favicon.ico +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/img/architect-icon.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/img/developer-icon.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/img/sme-icon.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/index.html +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/logo192.png +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/manifest.json +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/public/robots.txt +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/App.css +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/App.js +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/App.test.js +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/MainContainer.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/JsonViewer.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/LocalUploader.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/OverviewComponentEditorDialog.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/StepEditorDialog.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/TabPanel.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/Utils.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowDeleteDialog.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowExecutionReport.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowImportExportDialog.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowMetadataDialog.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/index.css +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/index.js +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/logo.svg +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/reportWebVitals.js +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/setupTests.js +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/types/WorkflowTypes.ts +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/views/AboutView.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/views/ConfigView.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/views/GlobalConfigView.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/src/views/WorkflowView.tsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_app/ui/neat-app/tsconfig.json +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/_shared.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/loaders/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/loaders/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/loaders/_rdf2asset.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/queries/_construct.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/queries/_shared.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/transformers/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/transformers/_iodd.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/transformers/_value_type.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/errors/_external.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/errors/_resources.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/errors/_workflow.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/warnings/_general.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/warnings/_properties.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/warnings/_resources.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/_shared.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/analysis/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/analysis/_asset.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/analysis/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/analysis/_dms.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/analysis/_information.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/catalog/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2classes.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2metadata.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2properties.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2rules.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/_base_rules.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/_types.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/asset/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/asset/_validation.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/dms/_schema.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/information/_validation.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/mapping/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/transformers/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/transformers/_mapping.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/transformers/_pipelines.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/transformers/_verification.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_session/_wizard.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/auth.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/cdf/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/cdf/data_classes.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/cdf/loaders/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/cdf/loaders/_base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/cdf/loaders/_data_modeling.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/cdf/loaders/_ingestion.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/upload.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/base.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/cdf_store.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/examples/Export_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/manager.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/model.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps/step_model.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/steps_registry.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/tasks.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/triggers.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_workflows/utils.py +0 -0
- {cognite_neat-0.96.5 → cognite_neat-0.97.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.97.0
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Home-page: https://cognite-neat.readthedocs-hosted.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -16,18 +16,19 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Provides-Extra: docs
|
|
18
18
|
Provides-Extra: google
|
|
19
|
-
Provides-Extra: graphql
|
|
20
19
|
Provides-Extra: oxi
|
|
21
20
|
Provides-Extra: service
|
|
22
21
|
Requires-Dist: PyYAML
|
|
23
22
|
Requires-Dist: backports.strenum (>=1.2,<2.0) ; python_version < "3.11"
|
|
24
23
|
Requires-Dist: cognite-sdk (>=7.54.6,<8.0.0)
|
|
24
|
+
Requires-Dist: elementpath (>=4.0.0,<5.0.0)
|
|
25
25
|
Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0) ; python_version < "3.11"
|
|
26
26
|
Requires-Dist: fastapi (>=0,<1) ; extra == "service" or extra == "all"
|
|
27
27
|
Requires-Dist: google-api-python-client ; extra == "google"
|
|
28
28
|
Requires-Dist: google-auth-oauthlib ; extra == "google"
|
|
29
29
|
Requires-Dist: gspread ; extra == "google"
|
|
30
|
-
Requires-Dist:
|
|
30
|
+
Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
|
|
31
|
+
Requires-Dist: lxml (>=5.3.0,<6.0.0)
|
|
31
32
|
Requires-Dist: mkdocs ; extra == "docs"
|
|
32
33
|
Requires-Dist: mkdocs-autorefs (>=0.5.0,<0.6.0) ; extra == "docs"
|
|
33
34
|
Requires-Dist: mkdocs-git-authors-plugin ; extra == "docs"
|
|
@@ -40,6 +41,7 @@ Requires-Dist: mkdocstrings[python] ; extra == "docs"
|
|
|
40
41
|
Requires-Dist: networkx (>=3.4.2,<4.0.0)
|
|
41
42
|
Requires-Dist: openpyxl
|
|
42
43
|
Requires-Dist: oxrdflib[oxigraph] (>=0.3.3,<0.4.0) ; extra == "oxi" or extra == "all"
|
|
44
|
+
Requires-Dist: packaging (>=22.0,<25.0)
|
|
43
45
|
Requires-Dist: pandas
|
|
44
46
|
Requires-Dist: prometheus-client (>=0,<1) ; extra == "service" or extra == "all"
|
|
45
47
|
Requires-Dist: pydantic (>=2,<3)
|
|
@@ -36,6 +36,7 @@ COGNITE_MODELS = (
|
|
|
36
36
|
DataModelId("cdf_cdm", "CogniteCore", "v1"),
|
|
37
37
|
DataModelId("cdf_idm", "CogniteProcessIndustries", "v1"),
|
|
38
38
|
)
|
|
39
|
+
COGNITE_SPACES = frozenset(model.space for model in COGNITE_MODELS)
|
|
39
40
|
DMS_LISTABLE_PROPERTY_LIMIT = 1000
|
|
40
41
|
|
|
41
42
|
EXAMPLE_RULES = PACKAGE_DIRECTORY / "_rules" / "examples"
|
|
@@ -43,10 +44,12 @@ EXAMPLE_GRAPHS = PACKAGE_DIRECTORY / "_graph" / "examples"
|
|
|
43
44
|
EXAMPLE_WORKFLOWS = PACKAGE_DIRECTORY / "_workflows" / "examples"
|
|
44
45
|
|
|
45
46
|
DEFAULT_SPACE_URI = "http://purl.org/cognite/{space}#"
|
|
46
|
-
DEFAULT_NAMESPACE = Namespace("http://purl.org/cognite/neat
|
|
47
|
+
DEFAULT_NAMESPACE = Namespace("http://purl.org/cognite/neat/")
|
|
48
|
+
CDF_NAMESPACE = Namespace("https://cognitedata.com/")
|
|
47
49
|
DEFAULT_BASE_URI = URIRef(DEFAULT_NAMESPACE)
|
|
48
50
|
CLASSIC_CDF_NAMESPACE = Namespace("http://purl.org/cognite/cdf-classic#")
|
|
49
51
|
UNKNOWN_TYPE = DEFAULT_NAMESPACE.UnknownType
|
|
52
|
+
XML_SCHEMA_NAMESPACE = Namespace("http://www.w3.org/2001/XMLSchema#")
|
|
50
53
|
|
|
51
54
|
|
|
52
55
|
def get_default_prefixes() -> dict[str, Namespace]:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from cognite.neat._session.engine._interface import Extractor as EngineExtractor
|
|
2
|
+
|
|
1
3
|
from ._base import BaseExtractor
|
|
2
4
|
from ._classic_cdf._assets import AssetsExtractor
|
|
3
5
|
from ._classic_cdf._classic import ClassicGraphExtractor
|
|
@@ -48,6 +50,7 @@ TripleExtractors = (
|
|
|
48
50
|
| DMSExtractor
|
|
49
51
|
| ClassicGraphExtractor
|
|
50
52
|
| DataSetExtractor
|
|
53
|
+
| EngineExtractor
|
|
51
54
|
)
|
|
52
55
|
|
|
53
56
|
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py
RENAMED
|
@@ -7,7 +7,7 @@ from cognite.client import CogniteClient
|
|
|
7
7
|
from cognite.client.data_classes import Asset, AssetFilter, AssetList
|
|
8
8
|
from rdflib import RDF, Literal, Namespace
|
|
9
9
|
|
|
10
|
-
from cognite.neat.
|
|
10
|
+
from cognite.neat._shared import Triple
|
|
11
11
|
|
|
12
12
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
13
13
|
from ._labels import LabelsExtractor
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py
RENAMED
|
@@ -10,7 +10,7 @@ from rdflib import XSD, Literal, Namespace, URIRef
|
|
|
10
10
|
|
|
11
11
|
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
12
12
|
from cognite.neat._graph.extractors._base import BaseExtractor
|
|
13
|
-
from cognite.neat.
|
|
13
|
+
from cognite.neat._shared import Triple
|
|
14
14
|
from cognite.neat._utils.auxiliary import string_to_ideal_type
|
|
15
15
|
|
|
16
16
|
T_CogniteResource = TypeVar("T_CogniteResource", bound=CogniteResource)
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py
RENAMED
|
@@ -7,7 +7,7 @@ from rdflib import Namespace
|
|
|
7
7
|
|
|
8
8
|
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
9
9
|
from cognite.neat._graph.extractors._base import BaseExtractor
|
|
10
|
-
from cognite.neat.
|
|
10
|
+
from cognite.neat._shared import Triple
|
|
11
11
|
from cognite.neat._utils.collection_ import chunker
|
|
12
12
|
from cognite.neat._utils.rdf_ import remove_namespace_from_uri
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ from cognite.client.data_classes import DataSet, DataSetList
|
|
|
7
7
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
8
8
|
from rdflib import RDF, Literal, Namespace
|
|
9
9
|
|
|
10
|
-
from cognite.neat.
|
|
10
|
+
from cognite.neat._shared import Triple
|
|
11
11
|
|
|
12
12
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
13
13
|
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_events.py
RENAMED
|
@@ -6,7 +6,7 @@ from cognite.client import CogniteClient
|
|
|
6
6
|
from cognite.client.data_classes import Event, EventFilter, EventList
|
|
7
7
|
from rdflib import RDF, Literal, Namespace
|
|
8
8
|
|
|
9
|
-
from cognite.neat.
|
|
9
|
+
from cognite.neat._shared import Triple
|
|
10
10
|
|
|
11
11
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
12
12
|
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_files.py
RENAMED
|
@@ -6,7 +6,7 @@ from cognite.client import CogniteClient
|
|
|
6
6
|
from cognite.client.data_classes import FileMetadata, FileMetadataFilter, FileMetadataList
|
|
7
7
|
from rdflib import RDF, Literal, Namespace
|
|
8
8
|
|
|
9
|
-
from cognite.neat.
|
|
9
|
+
from cognite.neat._shared import Triple
|
|
10
10
|
|
|
11
11
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
12
12
|
from ._labels import LabelsExtractor
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py
RENAMED
|
@@ -7,7 +7,7 @@ from cognite.client import CogniteClient
|
|
|
7
7
|
from cognite.client.data_classes import Label, LabelDefinition, LabelDefinitionList
|
|
8
8
|
from rdflib import RDF, Literal, Namespace
|
|
9
9
|
|
|
10
|
-
from cognite.neat.
|
|
10
|
+
from cognite.neat._shared import Triple
|
|
11
11
|
|
|
12
12
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ from cognite.client import CogniteClient
|
|
|
7
7
|
from cognite.client.data_classes import Relationship, RelationshipList
|
|
8
8
|
from rdflib import RDF, Literal, Namespace
|
|
9
9
|
|
|
10
|
-
from cognite.neat.
|
|
10
|
+
from cognite.neat._shared import Triple
|
|
11
11
|
from cognite.neat._utils.auxiliary import create_sha256_hash
|
|
12
12
|
|
|
13
13
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
@@ -6,7 +6,7 @@ from cognite.client import CogniteClient
|
|
|
6
6
|
from cognite.client.data_classes import Sequence, SequenceFilter, SequenceList
|
|
7
7
|
from rdflib import RDF, Literal, Namespace
|
|
8
8
|
|
|
9
|
-
from cognite.neat.
|
|
9
|
+
from cognite.neat._shared import Triple
|
|
10
10
|
|
|
11
11
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@ from cognite.client.data_classes import TimeSeries, TimeSeriesFilter, TimeSeries
|
|
|
7
7
|
from pydantic import AnyHttpUrl, ValidationError
|
|
8
8
|
from rdflib import RDF, Literal, Namespace, URIRef
|
|
9
9
|
|
|
10
|
-
from cognite.neat.
|
|
10
|
+
from cognite.neat._shared import Triple
|
|
11
11
|
|
|
12
12
|
from ._base import DEFAULT_SKIP_METADATA_VALUES, ClassicCDFBaseExtractor, InstanceIdPrefix
|
|
13
13
|
|
|
@@ -8,7 +8,7 @@ from rdflib import RDF, RDFS, XSD, Literal, Namespace, URIRef
|
|
|
8
8
|
|
|
9
9
|
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
10
10
|
from cognite.neat._graph.extractors._base import BaseExtractor
|
|
11
|
-
from cognite.neat.
|
|
11
|
+
from cognite.neat._shared import Triple
|
|
12
12
|
from cognite.neat._utils.rdf_ import as_neat_compliant_uri
|
|
13
13
|
from cognite.neat._utils.xml_ import get_children, iterate_tree
|
|
14
14
|
|
|
@@ -8,8 +8,8 @@ from cognite.client.data_classes.data_modeling.instances import Instance, Proper
|
|
|
8
8
|
from rdflib import RDF, XSD, Literal, Namespace, URIRef
|
|
9
9
|
|
|
10
10
|
from cognite.neat._constants import DEFAULT_SPACE_URI
|
|
11
|
-
from cognite.neat._graph.models import Triple
|
|
12
11
|
from cognite.neat._issues.errors import ResourceRetrievalError
|
|
12
|
+
from cognite.neat._shared import Triple
|
|
13
13
|
|
|
14
14
|
from ._base import BaseExtractor
|
|
15
15
|
|
|
@@ -11,8 +11,8 @@ from rdflib import RDF, XSD, Literal, Namespace, URIRef
|
|
|
11
11
|
|
|
12
12
|
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
13
13
|
from cognite.neat._graph.extractors._base import BaseExtractor
|
|
14
|
-
from cognite.neat._graph.models import Triple
|
|
15
14
|
from cognite.neat._issues.errors import FileReadError, NeatValueError
|
|
15
|
+
from cognite.neat._shared import Triple
|
|
16
16
|
from cognite.neat._utils.rdf_ import remove_namespace_from_uri
|
|
17
17
|
from cognite.neat._utils.text import to_camel
|
|
18
18
|
from cognite.neat._utils.xml_ import get_children
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_graph/extractors/_mock_graph_generator.py
RENAMED
|
@@ -11,13 +11,13 @@ import numpy
|
|
|
11
11
|
import pandas as pd
|
|
12
12
|
from rdflib import RDF, Literal, Namespace, URIRef
|
|
13
13
|
|
|
14
|
-
from cognite.neat._graph.models import Triple
|
|
15
14
|
from cognite.neat._rules._constants import EntityTypes
|
|
16
15
|
from cognite.neat._rules.analysis import InformationAnalysis
|
|
17
16
|
from cognite.neat._rules.models import DMSRules, InformationRules
|
|
18
17
|
from cognite.neat._rules.models.data_types import DataType
|
|
19
18
|
from cognite.neat._rules.models.entities import ClassEntity
|
|
20
19
|
from cognite.neat._rules.models.information import InformationProperty
|
|
20
|
+
from cognite.neat._shared import Triple
|
|
21
21
|
from cognite.neat._utils.rdf_ import remove_namespace_from_uri
|
|
22
22
|
|
|
23
23
|
from ._base import BaseExtractor
|
|
@@ -8,9 +8,9 @@ from rdflib.util import guess_format
|
|
|
8
8
|
from cognite.neat._constants import DEFAULT_BASE_URI
|
|
9
9
|
from cognite.neat._graph._shared import rdflib_to_mime_types
|
|
10
10
|
from cognite.neat._graph.extractors._base import BaseExtractor
|
|
11
|
-
from cognite.neat._graph.models import Triple
|
|
12
11
|
from cognite.neat._issues._base import IssueList
|
|
13
12
|
from cognite.neat._issues.errors import FileNotFoundNeatError, FileTypeUnexpectedError
|
|
13
|
+
from cognite.neat._shared import Triple
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class RdfFileExtractor(BaseExtractor):
|
|
@@ -16,7 +16,6 @@ from pydantic import BaseModel, ValidationInfo, create_model, field_validator
|
|
|
16
16
|
from rdflib import RDF
|
|
17
17
|
|
|
18
18
|
from cognite.neat._graph._tracking import LogTracker, Tracker
|
|
19
|
-
from cognite.neat._graph.models import InstanceType
|
|
20
19
|
from cognite.neat._issues import IssueList, NeatIssue, NeatIssueList
|
|
21
20
|
from cognite.neat._issues.errors import (
|
|
22
21
|
ResourceConvertionError,
|
|
@@ -27,6 +26,7 @@ from cognite.neat._issues.errors import (
|
|
|
27
26
|
from cognite.neat._issues.warnings import PropertyTypeNotSupportedWarning
|
|
28
27
|
from cognite.neat._rules.models import DMSRules
|
|
29
28
|
from cognite.neat._rules.models.data_types import _DATA_TYPE_BY_DMS_TYPE, Json
|
|
29
|
+
from cognite.neat._shared import InstanceType
|
|
30
30
|
from cognite.neat._store import NeatGraphStore
|
|
31
31
|
from cognite.neat._utils.auxiliary import create_sha256_hash
|
|
32
32
|
from cognite.neat._utils.upload import UploadResult
|
|
@@ -8,10 +8,10 @@ from rdflib import Literal as RdfLiteral
|
|
|
8
8
|
from rdflib.query import ResultRow
|
|
9
9
|
|
|
10
10
|
from cognite.neat._constants import UNKNOWN_TYPE
|
|
11
|
-
from cognite.neat._graph.models import InstanceType
|
|
12
11
|
from cognite.neat._rules._constants import EntityTypes
|
|
13
12
|
from cognite.neat._rules.models.entities import ClassEntity
|
|
14
13
|
from cognite.neat._rules.models.information import InformationRules
|
|
14
|
+
from cognite.neat._shared import InstanceType
|
|
15
15
|
from cognite.neat._utils.rdf_ import remove_namespace_from_uri
|
|
16
16
|
|
|
17
17
|
from ._construct import build_construct_query
|
|
@@ -7,7 +7,7 @@ from ._classic_cdf import (
|
|
|
7
7
|
AssetTimeSeriesConnector,
|
|
8
8
|
RelationshipToSchemaTransformer,
|
|
9
9
|
)
|
|
10
|
-
from ._rdfpath import AddSelfReferenceProperty
|
|
10
|
+
from ._rdfpath import AddSelfReferenceProperty, MakeConnectionOnExactMatch
|
|
11
11
|
from ._value_type import SplitMultiValueProperty
|
|
12
12
|
|
|
13
13
|
__all__ = [
|
|
@@ -20,6 +20,7 @@ __all__ = [
|
|
|
20
20
|
"AddSelfReferenceProperty",
|
|
21
21
|
"SplitMultiValueProperty",
|
|
22
22
|
"RelationshipToSchemaTransformer",
|
|
23
|
+
"MakeConnectionOnExactMatch",
|
|
23
24
|
]
|
|
24
25
|
|
|
25
26
|
Transformers = (
|
|
@@ -32,4 +33,5 @@ Transformers = (
|
|
|
32
33
|
| AddSelfReferenceProperty
|
|
33
34
|
| SplitMultiValueProperty
|
|
34
35
|
| RelationshipToSchemaTransformer
|
|
36
|
+
| MakeConnectionOnExactMatch
|
|
35
37
|
)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
from typing import cast
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
from rdflib import Graph, URIRef
|
|
5
|
+
|
|
6
|
+
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
7
|
+
from cognite.neat._rules.analysis import InformationAnalysis
|
|
8
|
+
from cognite.neat._rules.models._rdfpath import RDFPath, SingleProperty
|
|
9
|
+
from cognite.neat._rules.models.information import InformationRules
|
|
10
|
+
from cognite.neat._shared import Triple
|
|
11
|
+
from cognite.neat._utils.rdf_ import add_triples_in_batch, remove_namespace_from_uri
|
|
12
|
+
|
|
13
|
+
from ._base import BaseTransformer
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ReduceHopTraversal(BaseTransformer):
|
|
17
|
+
"""ReduceHopTraversal is a transformer that reduces the number of hops to direct connection."""
|
|
18
|
+
|
|
19
|
+
...
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AddSelfReferenceProperty(BaseTransformer):
|
|
23
|
+
description: str = "Adds property that contains id of reference to all references of given class in Rules"
|
|
24
|
+
_use_only_once: bool = True
|
|
25
|
+
_need_changes = frozenset({})
|
|
26
|
+
_ref_template: str = """SELECT ?s WHERE {{?s a <{type_}>}}"""
|
|
27
|
+
|
|
28
|
+
def __init__(
|
|
29
|
+
self,
|
|
30
|
+
rules: InformationRules,
|
|
31
|
+
):
|
|
32
|
+
self.rules = rules
|
|
33
|
+
self.properties = InformationAnalysis(rules).all_reference_transformations()
|
|
34
|
+
|
|
35
|
+
def transform(self, graph: Graph) -> None:
|
|
36
|
+
for property_ in self.properties:
|
|
37
|
+
prefix = property_.transformation.traversal.class_.prefix
|
|
38
|
+
suffix = property_.transformation.traversal.class_.suffix
|
|
39
|
+
|
|
40
|
+
namespace = self.rules.prefixes[prefix] if prefix in self.rules.prefixes else self.rules.metadata.namespace
|
|
41
|
+
|
|
42
|
+
for (reference,) in graph.query(self._ref_template.format(type_=namespace[suffix])): # type: ignore [misc]
|
|
43
|
+
graph.add(
|
|
44
|
+
(
|
|
45
|
+
reference,
|
|
46
|
+
self.rules.metadata.namespace[property_.property_],
|
|
47
|
+
reference,
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
traversal = SingleProperty.from_string(
|
|
52
|
+
class_=property_.class_.id,
|
|
53
|
+
property_=f"{self.rules.metadata.prefix}:{property_.property_}",
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
property_.transformation = RDFPath(traversal=traversal)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class MakeConnectionOnExactMatch(BaseTransformer):
|
|
60
|
+
description: str = "Adds property that contains id of reference to all references of given class in Rules"
|
|
61
|
+
_use_only_once: bool = True
|
|
62
|
+
_need_changes = frozenset({})
|
|
63
|
+
_ref_template: str = """SELECT DISTINCT ?subject ?object
|
|
64
|
+
WHERE {{
|
|
65
|
+
?subject a <{subject_type}> .
|
|
66
|
+
?subject <{subject_predicate}> ?value .
|
|
67
|
+
?object <{object_predicate}> ?value .
|
|
68
|
+
?object a <{object_type}> .
|
|
69
|
+
}}"""
|
|
70
|
+
|
|
71
|
+
def __init__(
|
|
72
|
+
self,
|
|
73
|
+
subject_type: URIRef,
|
|
74
|
+
subject_predicate: URIRef,
|
|
75
|
+
object_type: URIRef,
|
|
76
|
+
object_predicate: URIRef,
|
|
77
|
+
connection: URIRef | str | None = None,
|
|
78
|
+
limit: int | None = None,
|
|
79
|
+
):
|
|
80
|
+
self.subject_type = subject_type
|
|
81
|
+
self.subject_predicate = subject_predicate
|
|
82
|
+
self.object_type = object_type
|
|
83
|
+
self.object_predicate = object_predicate
|
|
84
|
+
|
|
85
|
+
self.connection = (
|
|
86
|
+
DEFAULT_NAMESPACE[quote(connection.strip())]
|
|
87
|
+
if isinstance(connection, str)
|
|
88
|
+
else connection or DEFAULT_NAMESPACE[remove_namespace_from_uri(self.object_type).lower()]
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
self.limit = limit
|
|
92
|
+
|
|
93
|
+
def transform(self, graph: Graph) -> None:
|
|
94
|
+
query = self._ref_template.format(
|
|
95
|
+
subject_type=self.subject_type,
|
|
96
|
+
subject_predicate=self.subject_predicate,
|
|
97
|
+
object_type=self.object_type,
|
|
98
|
+
object_predicate=self.object_predicate,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
if self.limit and isinstance(self.limit, int) and self.limit > 0:
|
|
102
|
+
query += f" LIMIT {self.limit}"
|
|
103
|
+
|
|
104
|
+
triples: list[Triple] = []
|
|
105
|
+
for subject, object in graph.query(query): # type: ignore [misc]
|
|
106
|
+
triples.append(cast(Triple, (subject, self.connection, object)))
|
|
107
|
+
|
|
108
|
+
print(f"Found {len(triples)} connections. Adding them to the graph...")
|
|
109
|
+
add_triples_in_batch(graph, triples)
|
|
@@ -16,6 +16,7 @@ from ._properties import (
|
|
|
16
16
|
PropertyMappingDuplicatedError,
|
|
17
17
|
PropertyNotFoundError,
|
|
18
18
|
PropertyTypeNotSupportedError,
|
|
19
|
+
ReversedConnectionNotFeasibleError,
|
|
19
20
|
)
|
|
20
21
|
from ._resources import (
|
|
21
22
|
ResourceChangedError,
|
|
@@ -68,6 +69,7 @@ __all__ = [
|
|
|
68
69
|
"PropertyMappingDuplicatedError",
|
|
69
70
|
"RowError",
|
|
70
71
|
"NeatTypeError",
|
|
72
|
+
"ReversedConnectionNotFeasibleError",
|
|
71
73
|
]
|
|
72
74
|
|
|
73
75
|
_NEAT_ERRORS_BY_NAME = {error.__name__: error for error in _get_subclasses(NeatError, include_base=True)}
|
|
@@ -32,6 +32,18 @@ class PropertyTypeNotSupportedError(PropertyError[T_Identifier]):
|
|
|
32
32
|
property_type: str
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
@dataclass(unsafe_hash=True)
|
|
36
|
+
class ReversedConnectionNotFeasibleError(PropertyError[T_Identifier]):
|
|
37
|
+
"""The {resource_type} {property_name} with identifier {identifier} of the view {target_view_id} cannot be made
|
|
38
|
+
since view {source_view_id} does not have direct connection {direct_connection} defined,
|
|
39
|
+
or {direct_connection} value type is not {target_view_id}
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
target_view_id: str
|
|
43
|
+
source_view_id: str
|
|
44
|
+
direct_connection: str
|
|
45
|
+
|
|
46
|
+
|
|
35
47
|
# This is a generic error that should be used sparingly
|
|
36
48
|
@dataclass(unsafe_hash=True)
|
|
37
49
|
class PropertyDefinitionError(PropertyError[T_Identifier]):
|
|
@@ -20,6 +20,7 @@ from ._models import (
|
|
|
20
20
|
PrincipleMatchingSpaceAndVersionWarning,
|
|
21
21
|
PrincipleOneModelOneSpaceWarning,
|
|
22
22
|
PrincipleSolutionBuildsOnEnterpriseWarning,
|
|
23
|
+
UndefinedViewWarning,
|
|
23
24
|
UserModelingWarning,
|
|
24
25
|
)
|
|
25
26
|
from ._properties import (
|
|
@@ -62,6 +63,7 @@ __all__ = [
|
|
|
62
63
|
"PrincipleSolutionBuildsOnEnterpriseWarning",
|
|
63
64
|
"NotSupportedViewContainerLimitWarning",
|
|
64
65
|
"NotSupportedHasDataFilterLimitWarning",
|
|
66
|
+
"UndefinedViewWarning",
|
|
65
67
|
"user_modeling",
|
|
66
68
|
]
|
|
67
69
|
|
|
@@ -92,6 +92,17 @@ class NotSupportedHasDataFilterLimitWarning(CDFNotSupportedWarning):
|
|
|
92
92
|
limit: int = DMS_VIEW_CONTAINER_SIZE_LIMIT
|
|
93
93
|
|
|
94
94
|
|
|
95
|
+
@dataclass(unsafe_hash=True)
|
|
96
|
+
class UndefinedViewWarning(UserModelingWarning):
|
|
97
|
+
"""Undefined view {value_type} has been referred as value type for property <{view_property}> of view {view_id}."""
|
|
98
|
+
|
|
99
|
+
fix = "Define views which are used as value types."
|
|
100
|
+
|
|
101
|
+
view_id: str
|
|
102
|
+
value_type: str
|
|
103
|
+
view_property: str
|
|
104
|
+
|
|
105
|
+
|
|
95
106
|
@dataclass(unsafe_hash=True)
|
|
96
107
|
class EnterpriseModelNotBuildOnTopOfCDMWarning(UserModelingWarning):
|
|
97
108
|
"""Enterprise data model being build on top {reference_model_id}. This is not recommended."""
|
|
@@ -19,6 +19,17 @@ __all__ = [
|
|
|
19
19
|
"InferenceImporter",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
|
+
RulesImporters = (
|
|
23
|
+
OWLImporter
|
|
24
|
+
| IMFImporter
|
|
25
|
+
| DMSImporter
|
|
26
|
+
| ExcelImporter
|
|
27
|
+
| GoogleSheetImporter
|
|
28
|
+
| DTDLImporter
|
|
29
|
+
| YAMLImporter
|
|
30
|
+
| InferenceImporter
|
|
31
|
+
)
|
|
32
|
+
|
|
22
33
|
|
|
23
34
|
def _repr_html_() -> str:
|
|
24
35
|
import pandas as pd
|
|
@@ -8,8 +8,10 @@ from typing import Any, Generic, Literal
|
|
|
8
8
|
from pydantic import ValidationError
|
|
9
9
|
from rdflib import Namespace
|
|
10
10
|
|
|
11
|
+
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
11
12
|
from cognite.neat._issues import IssueList, NeatError, NeatWarning
|
|
12
13
|
from cognite.neat._rules._shared import ReadRules, T_InputRules
|
|
14
|
+
from cognite.neat._store._provenance import Agent as ProvenanceAgent
|
|
13
15
|
from cognite.neat._utils.auxiliary import class_html_doc
|
|
14
16
|
|
|
15
17
|
|
|
@@ -46,6 +48,11 @@ class BaseImporter(ABC, Generic[T_InputRules]):
|
|
|
46
48
|
def _repr_html_(cls) -> str:
|
|
47
49
|
return class_html_doc(cls)
|
|
48
50
|
|
|
51
|
+
@property
|
|
52
|
+
def agent(self) -> ProvenanceAgent:
|
|
53
|
+
"""Provenance agent for the importer."""
|
|
54
|
+
return ProvenanceAgent(id_=DEFAULT_NAMESPACE[f"agent/{type(self).__name__}"])
|
|
55
|
+
|
|
49
56
|
|
|
50
57
|
class _FutureResult:
|
|
51
58
|
def __init__(self) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from collections import Counter
|
|
2
2
|
from collections.abc import Collection, Sequence
|
|
3
|
-
from datetime import datetime
|
|
3
|
+
from datetime import datetime, timezone
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import Literal, cast
|
|
6
6
|
|
|
@@ -104,6 +104,7 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
104
104
|
Returns:
|
|
105
105
|
DMSImporter: DMSImporter instance
|
|
106
106
|
"""
|
|
107
|
+
|
|
107
108
|
data_model_ids = [data_model_id, reference_model_id] if reference_model_id else [data_model_id]
|
|
108
109
|
data_models = client.data_modeling.data_models.retrieve(data_model_ids, inline_views=True)
|
|
109
110
|
|
|
@@ -128,7 +129,9 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
128
129
|
DMSSchema(),
|
|
129
130
|
[
|
|
130
131
|
ResourceRetrievalError(
|
|
131
|
-
dm.DataModelId.load(reference_model_id),
|
|
132
|
+
dm.DataModelId.load(reference_model_id),
|
|
133
|
+
"data model",
|
|
134
|
+
"Data Model is missing in CDF",
|
|
132
135
|
)
|
|
133
136
|
],
|
|
134
137
|
)
|
|
@@ -201,7 +204,10 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
201
204
|
@classmethod
|
|
202
205
|
def from_zip_file(cls, zip_file: str | Path) -> "DMSImporter":
|
|
203
206
|
if Path(zip_file).suffix != ".zip":
|
|
204
|
-
return cls(
|
|
207
|
+
return cls(
|
|
208
|
+
DMSSchema(),
|
|
209
|
+
[FileTypeUnexpectedError(Path(zip_file), frozenset([".zip"]))],
|
|
210
|
+
)
|
|
205
211
|
issue_list = IssueList()
|
|
206
212
|
with _handle_issues(issue_list) as _:
|
|
207
213
|
schema = DMSSchema.from_zip(zip_file)
|
|
@@ -210,10 +216,12 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
210
216
|
def to_rules(self) -> ReadRules[DMSInputRules]:
|
|
211
217
|
if self.issue_list.has_errors:
|
|
212
218
|
# In case there were errors during the import, the to_rules method will return None
|
|
219
|
+
self._end = datetime.now(timezone.utc)
|
|
213
220
|
return ReadRules(None, self.issue_list, {})
|
|
214
221
|
|
|
215
222
|
if not self.root_schema.data_model:
|
|
216
223
|
self.issue_list.append(ResourceMissingIdentifierError("data model", type(self.root_schema).__name__))
|
|
224
|
+
self._end = datetime.now(timezone.utc)
|
|
217
225
|
return ReadRules(None, self.issue_list, {})
|
|
218
226
|
|
|
219
227
|
model = self.root_schema.data_model
|
|
@@ -240,6 +248,7 @@ class DMSImporter(BaseImporter[DMSInputRules]):
|
|
|
240
248
|
has_reference=reference is not None,
|
|
241
249
|
)
|
|
242
250
|
user_rules.reference = reference
|
|
251
|
+
self._end = datetime.now(timezone.utc)
|
|
243
252
|
|
|
244
253
|
return ReadRules(user_rules, self.issue_list, {})
|
|
245
254
|
|
{cognite_neat-0.96.5 → cognite_neat-0.97.0}/cognite/neat/_rules/importers/_rdf/_inference2rules.py
RENAMED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
from collections import Counter, defaultdict
|
|
2
|
+
from collections.abc import Mapping
|
|
2
3
|
from datetime import datetime
|
|
3
4
|
from pathlib import Path
|
|
4
|
-
from typing import cast
|
|
5
|
+
from typing import ClassVar, cast
|
|
5
6
|
|
|
6
|
-
from rdflib import RDF
|
|
7
|
+
from rdflib import RDF, URIRef
|
|
7
8
|
from rdflib import Literal as RdfLiteral
|
|
8
9
|
|
|
9
10
|
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
10
11
|
from cognite.neat._issues.warnings import PropertyValueTypeUndefinedWarning
|
|
12
|
+
from cognite.neat._rules.models import data_types
|
|
11
13
|
from cognite.neat._rules.models._base_rules import MatchType
|
|
12
14
|
from cognite.neat._rules.models.data_types import AnyURI
|
|
13
15
|
from cognite.neat._rules.models.entities._single_value import UnknownEntity
|
|
@@ -41,13 +43,24 @@ class InferenceImporter(BaseRDFImporter):
|
|
|
41
43
|
Use the factory methods to create a triple store from sources such as
|
|
42
44
|
RDF files, JSON files, YAML files, XML files, or directly from a graph store.
|
|
43
45
|
|
|
46
|
+
ClassVars:
|
|
47
|
+
overwrite_data_types: Mapping of data types to be overwritten. The InferenceImporter will overwrite
|
|
48
|
+
32-bit integer and 32-bit float data types to 64-bit integer and 64-bit float data types
|
|
49
|
+
|
|
44
50
|
Args:
|
|
45
51
|
issue_list: Issue list to store issues
|
|
46
52
|
graph: Knowledge graph
|
|
47
53
|
max_number_of_instance: Maximum number of instances to be used in inference
|
|
48
54
|
prefix: Prefix to be used for the inferred model
|
|
55
|
+
|
|
56
|
+
|
|
49
57
|
"""
|
|
50
58
|
|
|
59
|
+
overwrite_data_types: ClassVar[Mapping[URIRef, URIRef]] = {
|
|
60
|
+
data_types.Integer.as_xml_uri_ref(): data_types.Long.as_xml_uri_ref(),
|
|
61
|
+
data_types.Float.as_xml_uri_ref(): data_types.Double.as_xml_uri_ref(),
|
|
62
|
+
}
|
|
63
|
+
|
|
51
64
|
@classmethod
|
|
52
65
|
def from_graph_store(
|
|
53
66
|
cls,
|
|
@@ -140,6 +153,8 @@ class InferenceImporter(BaseRDFImporter):
|
|
|
140
153
|
continue
|
|
141
154
|
|
|
142
155
|
property_id = remove_namespace_from_uri(property_uri)
|
|
156
|
+
if isinstance(data_type_uri, URIRef):
|
|
157
|
+
data_type_uri = self.overwrite_data_types.get(data_type_uri, data_type_uri)
|
|
143
158
|
|
|
144
159
|
if value_type_uri := (data_type_uri or object_type_uri):
|
|
145
160
|
value_type_id = remove_namespace_from_uri(value_type_uri)
|