cognite-neat 0.100.1__tar.gz → 0.102.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.102.0/PKG-INFO +113 -0
- cognite_neat-0.102.0/README.md +48 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_constants.py +5 -1
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/loaders/_rdf2dms.py +1 -2
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/queries/_base.py +22 -2
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/queries/_shared.py +4 -4
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/transformers/__init__.py +17 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/transformers/_base.py +1 -1
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/transformers/_iodd.py +9 -4
- cognite_neat-0.102.0/cognite/neat/_graph/transformers/_prune_graph.py +257 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/_rules2dms.py +35 -13
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/_rules2excel.py +7 -2
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_dms2rules.py +51 -19
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_rdf/_base.py +2 -2
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/_base_rules.py +13 -9
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/dms/_rules.py +111 -39
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/information/_rules.py +52 -19
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_base.py +18 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_prepare.py +85 -2
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_read.py +3 -3
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_to.py +1 -1
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/engine/_load.py +3 -1
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_store/_base.py +23 -2
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/auth.py +6 -4
- cognite_neat-0.102.0/cognite/neat/_utils/reader/__init__.py +3 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/reader/_base.py +40 -35
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/text.py +12 -0
- cognite_neat-0.102.0/cognite/neat/_version.py +2 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/pyproject.toml +1 -1
- cognite_neat-0.100.1/PKG-INFO +0 -215
- cognite_neat-0.100.1/README.md +0 -150
- cognite_neat-0.100.1/cognite/neat/_graph/transformers/_prune_graph.py +0 -126
- cognite_neat-0.100.1/cognite/neat/_utils/reader/__init__.py +0 -3
- cognite_neat-0.100.1/cognite/neat/_version.py +0 -2
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/LICENSE +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/configuration.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/explorer.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/routers/configuration.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/routers/crud.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/routers/metrics.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/routers/workflows.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/utils/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/utils/logging.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/main.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/monitoring/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/monitoring/metrics.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/index.html +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css.map +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.LICENSE.txt +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.map +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/package-lock.json +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/package.json +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/favicon.ico +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/img/architect-icon.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/img/developer-icon.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/img/sme-icon.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/index.html +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/logo192.png +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/manifest.json +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/public/robots.txt +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/App.css +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/App.js +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/App.test.js +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/MainContainer.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/JsonViewer.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/LocalUploader.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/OverviewComponentEditorDialog.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/StepEditorDialog.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/TabPanel.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/Utils.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowDeleteDialog.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowExecutionReport.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowImportExportDialog.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/components/WorkflowMetadataDialog.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/index.css +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/index.js +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/logo.svg +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/reportWebVitals.js +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/setupTests.js +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/types/WorkflowTypes.ts +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/views/AboutView.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/views/ConfigView.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/views/GlobalConfigView.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/src/views/WorkflowView.tsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_app/ui/neat-app/tsconfig.json +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/_api/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/_api/data_modeling_loaders.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/_api/schema.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/_api_client.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/data_classes/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/data_classes/data_modeling.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_client/data_classes/schema.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/_shared.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_dms.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_iodd.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/loaders/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/loaders/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/queries/_construct.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/transformers/_rdfpath.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_graph/transformers/_value_type.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/errors/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/errors/_external.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/errors/_properties.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/errors/_resources.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/errors/_workflow.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/warnings/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/warnings/_general.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/warnings/_models.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/warnings/_properties.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/warnings/_resources.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/_shared.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/analysis/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/analysis/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/analysis/_dms.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/analysis/_information.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/catalog/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_rdf/_imf2rules.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_rdf/_owl2rules.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/_types.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/data_types.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/information/_validation.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/models/mapping/_classic2core.yaml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/transformers/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/transformers/_base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/transformers/_converters.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/transformers/_mapping.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/transformers/_pipelines.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_rules/transformers/_verification.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_collector.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_drop.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_inspect.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_mapping.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_set.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_show.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_state.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/_wizard.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/engine/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/engine/_import.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/engine/_interface.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_session/exceptions.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_store/_provenance.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/rdf_.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/upload.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/base.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/cdf_store.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/examples/Export_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/manager.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/model.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps/step_model.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/steps_registry.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/tasks.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/triggers.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/_workflows/utils.py +0 -0
- {cognite_neat-0.100.1 → cognite_neat-0.102.0}/cognite/neat/py.typed +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cognite-neat
|
|
3
|
+
Version: 0.102.0
|
|
4
|
+
Summary: Knowledge graph transformation
|
|
5
|
+
Home-page: https://cognite-neat.readthedocs-hosted.com/
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Author: Nikola Vasiljevic
|
|
8
|
+
Author-email: nikola.vasiljevic@cognite.com
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Provides-Extra: all
|
|
17
|
+
Provides-Extra: docs
|
|
18
|
+
Provides-Extra: google
|
|
19
|
+
Provides-Extra: oxi
|
|
20
|
+
Provides-Extra: service
|
|
21
|
+
Requires-Dist: PyYAML
|
|
22
|
+
Requires-Dist: backports.strenum (>=1.2,<2.0) ; python_version < "3.11"
|
|
23
|
+
Requires-Dist: cognite-sdk (>=7.54.6,<8.0.0)
|
|
24
|
+
Requires-Dist: elementpath (>=4.0.0,<5.0.0)
|
|
25
|
+
Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0) ; python_version < "3.11"
|
|
26
|
+
Requires-Dist: fastapi (>=0,<1) ; extra == "service" or extra == "all"
|
|
27
|
+
Requires-Dist: google-api-python-client ; extra == "google"
|
|
28
|
+
Requires-Dist: google-auth-oauthlib ; extra == "google"
|
|
29
|
+
Requires-Dist: gspread ; extra == "google"
|
|
30
|
+
Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
|
|
31
|
+
Requires-Dist: lxml (>=5.3.0,<6.0.0) ; extra == "all"
|
|
32
|
+
Requires-Dist: mixpanel (>=4.10.1,<5.0.0)
|
|
33
|
+
Requires-Dist: mkdocs ; extra == "docs"
|
|
34
|
+
Requires-Dist: mkdocs-autorefs (>=0.5.0,<0.6.0) ; extra == "docs"
|
|
35
|
+
Requires-Dist: mkdocs-git-authors-plugin ; extra == "docs"
|
|
36
|
+
Requires-Dist: mkdocs-git-revision-date-localized-plugin ; extra == "docs"
|
|
37
|
+
Requires-Dist: mkdocs-gitbook ; extra == "docs"
|
|
38
|
+
Requires-Dist: mkdocs-glightbox ; extra == "docs"
|
|
39
|
+
Requires-Dist: mkdocs-jupyter ; extra == "docs"
|
|
40
|
+
Requires-Dist: mkdocs-material-extensions ; extra == "docs"
|
|
41
|
+
Requires-Dist: mkdocstrings[python] ; extra == "docs"
|
|
42
|
+
Requires-Dist: networkx (>=3.4.2,<4.0.0)
|
|
43
|
+
Requires-Dist: openpyxl
|
|
44
|
+
Requires-Dist: oxrdflib[oxigraph] (>=0.4.0,<0.5.0) ; extra == "oxi" or extra == "all"
|
|
45
|
+
Requires-Dist: packaging (>=22.0,<25.0)
|
|
46
|
+
Requires-Dist: pandas
|
|
47
|
+
Requires-Dist: prometheus-client (>=0,<1) ; extra == "service" or extra == "all"
|
|
48
|
+
Requires-Dist: pydantic (>=2,<3)
|
|
49
|
+
Requires-Dist: pymdown-extensions ; extra == "docs"
|
|
50
|
+
Requires-Dist: pyoxigraph (==0.4.3) ; extra == "oxi" or extra == "all"
|
|
51
|
+
Requires-Dist: python-multipart (==0.0.9) ; extra == "service" or extra == "all"
|
|
52
|
+
Requires-Dist: pyvis (>=0.3.2,<0.4.0)
|
|
53
|
+
Requires-Dist: rdflib
|
|
54
|
+
Requires-Dist: requests
|
|
55
|
+
Requires-Dist: rich[jupyter] (>=13.7.1,<14.0.0)
|
|
56
|
+
Requires-Dist: schedule (>=1,<2) ; extra == "service" or extra == "all"
|
|
57
|
+
Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
|
|
58
|
+
Requires-Dist: typing_extensions (>=4.8,<5.0) ; python_version < "3.11"
|
|
59
|
+
Requires-Dist: urllib3 (>=2,<3)
|
|
60
|
+
Requires-Dist: uvicorn[standard] (>=0,<1) ; extra == "service" or extra == "all"
|
|
61
|
+
Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
|
|
62
|
+
Project-URL: Repository, https://github.com/cognitedata/neat
|
|
63
|
+
Description-Content-Type: text/markdown
|
|
64
|
+
|
|
65
|
+
# kNowlEdge grAph Transformer (NEAT)
|
|
66
|
+
|
|
67
|
+
[](https://github.com/cognitedata/neat/actions/workflows/release.yaml)
|
|
68
|
+
[](https://cognite-neat.readthedocs-hosted.com/en/latest/?badge=latest)
|
|
69
|
+
[](https://github.com/cognitedata/neat)
|
|
70
|
+
[](https://pypi.org/project/cognite-neat/)
|
|
71
|
+
[](https://pypistats.org/packages/cognite-neat)
|
|
72
|
+
[](https://hub.docker.com/r/cognite/neat)
|
|
73
|
+
[](https://github.com/cognitedata/neat/blob/master/LICENSE)
|
|
74
|
+
[](https://github.com/ambv/black)
|
|
75
|
+
[](https://github.com/astral-sh/ruff)
|
|
76
|
+
[](http://mypy-lang.org)
|
|
77
|
+
|
|
78
|
+
NEAT is a domain expert centric and developer friendly solution for rapid:
|
|
79
|
+
|
|
80
|
+
- semantic data modeling
|
|
81
|
+
- creation, transformation and enrichment of knowledge graphs
|
|
82
|
+
- and ingestion of the models and graphs into [Cognite Data Fusion](https://www.cognite.com/en/product/cognite_data_fusion_industrial_dataops_platform)
|
|
83
|
+
|
|
84
|
+
NEAT is using open and globally recognized standards maintained by the [World Wide Web Consortium (W3C)](https://www.w3.org/RDF/).
|
|
85
|
+
NEAT represents an essential tool for creation of standardized, machine-actionable, linked and semantic (meta)data.
|
|
86
|
+
|
|
87
|
+
> NEAT is an acronym derived from k**N**owl**Ed**ge gr**A**ph **T**ransformer hallucinated by GenAI.
|
|
88
|
+
|
|
89
|
+
## Installation
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install cognite-neat
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
The user interface for `NEAT` is a notebook-based environment. Once you have set up your notebook
|
|
98
|
+
environment, you start by creating a `CogniteClient` and instantiate a `NeatSession` object.
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from cognite.neat import NeatSession, get_cognite_client
|
|
102
|
+
|
|
103
|
+
client = get_cognite_client(".env")
|
|
104
|
+
|
|
105
|
+
neat = NeatSession(client)
|
|
106
|
+
|
|
107
|
+
neat.read.cdf.data_model(("my_space", "MyDataModel", "v1"))
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Documentation
|
|
111
|
+
|
|
112
|
+
For more information, see the [documentation](https://cognite-neat.readthedocs-hosted.com/en/latest/)
|
|
113
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# kNowlEdge grAph Transformer (NEAT)
|
|
2
|
+
|
|
3
|
+
[](https://github.com/cognitedata/neat/actions/workflows/release.yaml)
|
|
4
|
+
[](https://cognite-neat.readthedocs-hosted.com/en/latest/?badge=latest)
|
|
5
|
+
[](https://github.com/cognitedata/neat)
|
|
6
|
+
[](https://pypi.org/project/cognite-neat/)
|
|
7
|
+
[](https://pypistats.org/packages/cognite-neat)
|
|
8
|
+
[](https://hub.docker.com/r/cognite/neat)
|
|
9
|
+
[](https://github.com/cognitedata/neat/blob/master/LICENSE)
|
|
10
|
+
[](https://github.com/ambv/black)
|
|
11
|
+
[](https://github.com/astral-sh/ruff)
|
|
12
|
+
[](http://mypy-lang.org)
|
|
13
|
+
|
|
14
|
+
NEAT is a domain expert centric and developer friendly solution for rapid:
|
|
15
|
+
|
|
16
|
+
- semantic data modeling
|
|
17
|
+
- creation, transformation and enrichment of knowledge graphs
|
|
18
|
+
- and ingestion of the models and graphs into [Cognite Data Fusion](https://www.cognite.com/en/product/cognite_data_fusion_industrial_dataops_platform)
|
|
19
|
+
|
|
20
|
+
NEAT is using open and globally recognized standards maintained by the [World Wide Web Consortium (W3C)](https://www.w3.org/RDF/).
|
|
21
|
+
NEAT represents an essential tool for creation of standardized, machine-actionable, linked and semantic (meta)data.
|
|
22
|
+
|
|
23
|
+
> NEAT is an acronym derived from k**N**owl**Ed**ge gr**A**ph **T**ransformer hallucinated by GenAI.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install cognite-neat
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
The user interface for `NEAT` is a notebook-based environment. Once you have set up your notebook
|
|
34
|
+
environment, you start by creating a `CogniteClient` and instantiate a `NeatSession` object.
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from cognite.neat import NeatSession, get_cognite_client
|
|
38
|
+
|
|
39
|
+
client = get_cognite_client(".env")
|
|
40
|
+
|
|
41
|
+
neat = NeatSession(client)
|
|
42
|
+
|
|
43
|
+
neat.read.cdf.data_model(("my_space", "MyDataModel", "v1"))
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Documentation
|
|
47
|
+
|
|
48
|
+
For more information, see the [documentation](https://cognite-neat.readthedocs-hosted.com/en/latest/)
|
|
@@ -71,7 +71,7 @@ UNKNOWN_TYPE = DEFAULT_NAMESPACE.UnknownType
|
|
|
71
71
|
XML_SCHEMA_NAMESPACE = Namespace("http://www.w3.org/2001/XMLSchema#")
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
def
|
|
74
|
+
def get_default_prefixes_and_namespaces() -> dict[str, Namespace]:
|
|
75
75
|
return {
|
|
76
76
|
"owl": OWL._NS,
|
|
77
77
|
"rdf": RDF._NS,
|
|
@@ -84,6 +84,10 @@ def get_default_prefixes() -> dict[str, Namespace]:
|
|
|
84
84
|
"imf": Namespace("http://ns.imfid.org/imf#"),
|
|
85
85
|
"pav": Namespace("http://purl.org/pav/"),
|
|
86
86
|
"foaf": FOAF._NS,
|
|
87
|
+
"dexpi": Namespace("http://sandbox.dexpi.org/rdl/"),
|
|
88
|
+
"qudt": Namespace("https://qudt.org/vocab/unit/"),
|
|
89
|
+
"iodd": Namespace("http://www.io-link.com/IODD/2010/10/"),
|
|
90
|
+
"aml": Namespace("https://www.automationml.org/"),
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
|
|
@@ -156,7 +156,6 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
156
156
|
|
|
157
157
|
for identifier, properties in reader:
|
|
158
158
|
try:
|
|
159
|
-
print(view_id)
|
|
160
159
|
yield self._create_node(identifier, properties, pydantic_cls, view_id)
|
|
161
160
|
except ValueError as e:
|
|
162
161
|
error_node = ResourceCreationError(identifier, "node", error=str(e))
|
|
@@ -198,7 +197,7 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
198
197
|
json_fields: list[str] = []
|
|
199
198
|
for prop_name, prop in view.properties.items():
|
|
200
199
|
if isinstance(prop, dm.EdgeConnection):
|
|
201
|
-
edge_by_property[
|
|
200
|
+
edge_by_property[prop_name] = prop_name, prop
|
|
202
201
|
if isinstance(prop, dm.MappedProperty):
|
|
203
202
|
if isinstance(prop.type, dm.DirectRelation):
|
|
204
203
|
direct_relation_by_property[prop_name] = prop.type
|
|
@@ -209,7 +209,10 @@ class Queries:
|
|
|
209
209
|
elif (
|
|
210
210
|
isinstance(object_, URIRef)
|
|
211
211
|
and property_types
|
|
212
|
-
and
|
|
212
|
+
and (
|
|
213
|
+
property_types.get(property_, None) == EntityTypes.object_property
|
|
214
|
+
or property_types.get(property_, None) == EntityTypes.undefined
|
|
215
|
+
)
|
|
213
216
|
):
|
|
214
217
|
value = remove_namespace_from_uri(object_, validation="prefix")
|
|
215
218
|
|
|
@@ -233,7 +236,6 @@ class Queries:
|
|
|
233
236
|
else:
|
|
234
237
|
# we should not have multiple rdf:type values
|
|
235
238
|
continue
|
|
236
|
-
|
|
237
239
|
if property_values:
|
|
238
240
|
return (
|
|
239
241
|
identifier,
|
|
@@ -358,3 +360,21 @@ class Queries:
|
|
|
358
360
|
dropped_types[t] = len(instance_ids)
|
|
359
361
|
remove_instance_ids_in_batch(self.graph, instance_ids)
|
|
360
362
|
return dropped_types
|
|
363
|
+
|
|
364
|
+
def multi_type_instances(self) -> dict[str, list[str]]:
|
|
365
|
+
"""Find instances with multiple types"""
|
|
366
|
+
|
|
367
|
+
query = """
|
|
368
|
+
SELECT ?instance (GROUP_CONCAT(str(?type); SEPARATOR=",") AS ?types)
|
|
369
|
+
WHERE {
|
|
370
|
+
?instance a ?type .
|
|
371
|
+
}
|
|
372
|
+
GROUP BY ?instance
|
|
373
|
+
HAVING (COUNT(?type) > 1)
|
|
374
|
+
"""
|
|
375
|
+
|
|
376
|
+
result = {}
|
|
377
|
+
for instance, types in self.graph.query(query): # type: ignore
|
|
378
|
+
result[remove_namespace_from_uri(instance)] = remove_namespace_from_uri(types.split(","))
|
|
379
|
+
|
|
380
|
+
return result
|
|
@@ -6,7 +6,7 @@ from pydantic import BaseModel, ConfigDict, Field
|
|
|
6
6
|
from rdflib import Graph, Literal, Namespace
|
|
7
7
|
from rdflib.term import URIRef
|
|
8
8
|
|
|
9
|
-
from cognite.neat._constants import
|
|
9
|
+
from cognite.neat._constants import get_default_prefixes_and_namespaces
|
|
10
10
|
from cognite.neat._rules.models._rdfpath import (
|
|
11
11
|
Hop,
|
|
12
12
|
Step,
|
|
@@ -51,7 +51,7 @@ def generate_prefix_header(prefixes: dict[str, Namespace] | None = None) -> str:
|
|
|
51
51
|
Prefix header
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
prefixes = prefixes or
|
|
54
|
+
prefixes = prefixes or get_default_prefixes_and_namespaces()
|
|
55
55
|
|
|
56
56
|
return "".join(f"PREFIX {key}:<{value}>\n" for key, value in prefixes.items())
|
|
57
57
|
|
|
@@ -81,7 +81,7 @@ def get_predicate_id(
|
|
|
81
81
|
ID of predicate (aka property) connecting subject and object
|
|
82
82
|
"""
|
|
83
83
|
|
|
84
|
-
prefixes = prefixes or
|
|
84
|
+
prefixes = prefixes or get_default_prefixes_and_namespaces()
|
|
85
85
|
|
|
86
86
|
query = """
|
|
87
87
|
|
|
@@ -123,7 +123,7 @@ def hop2property_path(
|
|
|
123
123
|
str
|
|
124
124
|
Property path string for hop traversal (e.g. ^rdf:type/rdfs:subClassOf)
|
|
125
125
|
"""
|
|
126
|
-
prefixes = prefixes if prefixes else
|
|
126
|
+
prefixes = prefixes if prefixes else get_default_prefixes_and_namespaces()
|
|
127
127
|
|
|
128
128
|
# setting previous step to origin, as we are starting from there
|
|
129
129
|
previous_step = Step(class_=hop.class_, direction="origin")
|
|
@@ -7,6 +7,13 @@ from ._classic_cdf import (
|
|
|
7
7
|
AssetTimeSeriesConnector,
|
|
8
8
|
RelationshipAsEdgeTransformer,
|
|
9
9
|
)
|
|
10
|
+
from ._prune_graph import (
|
|
11
|
+
AttachPropertyFromTargetToSource,
|
|
12
|
+
PruneDanglingNodes,
|
|
13
|
+
PruneDeadEndEdges,
|
|
14
|
+
PruneInstancesOfUnknownType,
|
|
15
|
+
PruneTypes,
|
|
16
|
+
)
|
|
10
17
|
from ._rdfpath import AddSelfReferenceProperty, MakeConnectionOnExactMatch
|
|
11
18
|
from ._value_type import SplitMultiValueProperty
|
|
12
19
|
|
|
@@ -21,6 +28,11 @@ __all__ = [
|
|
|
21
28
|
"SplitMultiValueProperty",
|
|
22
29
|
"RelationshipAsEdgeTransformer",
|
|
23
30
|
"MakeConnectionOnExactMatch",
|
|
31
|
+
"AttachPropertyFromTargetToSource",
|
|
32
|
+
"PruneDanglingNodes",
|
|
33
|
+
"PruneTypes",
|
|
34
|
+
"PruneDeadEndEdges",
|
|
35
|
+
"PruneInstancesOfUnknownType",
|
|
24
36
|
]
|
|
25
37
|
|
|
26
38
|
Transformers = (
|
|
@@ -34,4 +46,9 @@ Transformers = (
|
|
|
34
46
|
| SplitMultiValueProperty
|
|
35
47
|
| RelationshipAsEdgeTransformer
|
|
36
48
|
| MakeConnectionOnExactMatch
|
|
49
|
+
| AttachPropertyFromTargetToSource
|
|
50
|
+
| PruneDanglingNodes
|
|
51
|
+
| PruneTypes
|
|
52
|
+
| PruneDeadEndEdges
|
|
53
|
+
| PruneInstancesOfUnknownType
|
|
37
54
|
)
|
|
@@ -2,12 +2,12 @@ from rdflib import Namespace
|
|
|
2
2
|
|
|
3
3
|
from cognite.neat._graph.extractors import IODDExtractor
|
|
4
4
|
|
|
5
|
-
from ._prune_graph import
|
|
5
|
+
from ._prune_graph import AttachPropertyFromTargetToSource, PruneDanglingNodes
|
|
6
6
|
|
|
7
7
|
IODD = Namespace("http://www.io-link.com/IODD/2010/10/")
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class IODDAttachPropertyFromTargetToSource(AttachPropertyFromTargetToSource):
|
|
11
11
|
_need_changes = frozenset(
|
|
12
12
|
{
|
|
13
13
|
str(IODDExtractor.__name__),
|
|
@@ -15,11 +15,16 @@ class IODDTwoHopFlattener(TwoHopFlattener):
|
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
def __init__(self):
|
|
18
|
-
super().__init__(
|
|
18
|
+
super().__init__(
|
|
19
|
+
target_node_type=IODD.TextObject,
|
|
20
|
+
target_property=IODD.value,
|
|
21
|
+
delete_target_node=True,
|
|
22
|
+
namespace=IODD,
|
|
23
|
+
)
|
|
19
24
|
|
|
20
25
|
|
|
21
26
|
class IODDPruneDanglingNodes(PruneDanglingNodes):
|
|
22
|
-
_need_changes = frozenset({str(IODDExtractor.__name__), str(
|
|
27
|
+
_need_changes = frozenset({str(IODDExtractor.__name__), str(IODDAttachPropertyFromTargetToSource.__name__)})
|
|
23
28
|
|
|
24
29
|
def __init__(self):
|
|
25
30
|
super().__init__(node_prune_types=[IODD.TextObject])
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
from typing import cast
|
|
2
|
+
|
|
3
|
+
from rdflib import Graph, Namespace, URIRef
|
|
4
|
+
|
|
5
|
+
from cognite.neat._constants import DEFAULT_NAMESPACE
|
|
6
|
+
from cognite.neat._shared import Triple
|
|
7
|
+
from cognite.neat._utils.rdf_ import as_neat_compliant_uri
|
|
8
|
+
from cognite.neat._utils.text import sentence_or_string_to_camel
|
|
9
|
+
|
|
10
|
+
from ._base import BaseTransformer
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AttachPropertyFromTargetToSource(BaseTransformer):
|
|
14
|
+
"""
|
|
15
|
+
Transformer that considers a TargetNode and SourceNode relationship, to extract a property that is attached to
|
|
16
|
+
the TargetNode, and attaches it to the SourceNode instead, while also deleting the edge between
|
|
17
|
+
the SourceNode and TargetNode.
|
|
18
|
+
This means that you no longer have to go via the SourceNode to TargetNode to extract
|
|
19
|
+
the desired property from TargetNode, you can get it directly from the SourceNode instead.
|
|
20
|
+
Further, there are two ways of defining the predicate for the new property to attach to
|
|
21
|
+
the SourceNode. The predicate that is used will either be the old predicate between the SourceNode and TargetNode,
|
|
22
|
+
or, the TargetNode may hold a property with a value for the new predicate to use.
|
|
23
|
+
In this case, the user must specify the name of this predicate property connected to the TargetNode.
|
|
24
|
+
Consider the following example for illustration:
|
|
25
|
+
|
|
26
|
+
Ex. AttachPropertyFromTargetToSource
|
|
27
|
+
Graph before transformation:
|
|
28
|
+
|
|
29
|
+
:SourceNode a :SourceType .
|
|
30
|
+
:SourceNode :sourceProperty :TargetNode .
|
|
31
|
+
|
|
32
|
+
:TargetNode a :TargetType .
|
|
33
|
+
:TargetNode :propertyWhichValueWeWant 'Target Value' .
|
|
34
|
+
:TargetNode :propertyWhichValueWeMightWantAsNameForNewProperty 'PropertyName'
|
|
35
|
+
|
|
36
|
+
Use case A after transformation - attach new property to SourceNode using old predicate:
|
|
37
|
+
|
|
38
|
+
:SourceNode a :SourceType .
|
|
39
|
+
:SourceNode :sourceProperty 'Target Value' .
|
|
40
|
+
|
|
41
|
+
Use case B after transformation - extract new predicate from one of the properties of the TargetNode:
|
|
42
|
+
|
|
43
|
+
:SourceNode a :SourceType .
|
|
44
|
+
:SourceNode :PropertyName 'Target Value' .
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
The user can provide a flag to decide if the intermediate target node should be removed from the graph or not
|
|
48
|
+
after connecting the target property to the source node. The example illustrates this.
|
|
49
|
+
The default however is False.
|
|
50
|
+
|
|
51
|
+
If delete_target_node is not set, the expected number of triples after this transformation should be the same as
|
|
52
|
+
before the transformation.
|
|
53
|
+
|
|
54
|
+
If delete_target_node is set, the expected number of triples should be:
|
|
55
|
+
#triples_before - #target_nodes * #target_nodes_properties
|
|
56
|
+
|
|
57
|
+
Number of triples after operation from above example: 5 - 1*3 = 2
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
target_node_type: RDF.type of edge Node
|
|
61
|
+
target_property: URIRef of the property that holds the value attached to the intermediate node
|
|
62
|
+
target_property_holding_new_property: URIRef of the property which value will be new
|
|
63
|
+
property that will be added to the source node
|
|
64
|
+
delete_target_node: bool if the intermediate Node and Edge between source Node
|
|
65
|
+
and target property should be deleted. Defaults to False.
|
|
66
|
+
convert_literal_to_uri: bool if the value of the new property should be converted to URIRef. Defaults to False.
|
|
67
|
+
namespace: Namespace to use when converting value to URIRef. Defaults to DEFAULT_NAMESPACE.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
description: str = "Attaches a target property from a target node that is connected to a source node."
|
|
71
|
+
|
|
72
|
+
_query_template_use_case_a: str = """
|
|
73
|
+
SELECT ?sourceNode ?sourceProperty ?targetNode ?newSourceProperty ?newSourcePropertyValue WHERE {{
|
|
74
|
+
?sourceNode ?sourceProperty ?targetNode .
|
|
75
|
+
BIND( <{target_property}> as ?newSourceProperty ) .
|
|
76
|
+
?targetNode a <{target_node_type}> .
|
|
77
|
+
?targetNode <{target_property}> ?newSourcePropertyValue . }}"""
|
|
78
|
+
|
|
79
|
+
_query_template_use_case_b: str = """
|
|
80
|
+
SELECT ?sourceNode ?sourceProperty ?targetNode ?newSourceProperty ?newSourcePropertyValue WHERE {{
|
|
81
|
+
?sourceNode ?sourceProperty ?targetNode .
|
|
82
|
+
?targetNode a <{target_node_type}> .
|
|
83
|
+
?targetNode <{target_property_holding_new_property_name}> ?newSourceProperty .
|
|
84
|
+
?targetNode <{target_property}> ?newSourcePropertyValue . }}"""
|
|
85
|
+
|
|
86
|
+
def __init__(
|
|
87
|
+
self,
|
|
88
|
+
target_node_type: URIRef,
|
|
89
|
+
target_property: URIRef,
|
|
90
|
+
target_property_holding_new_property: URIRef | None = None,
|
|
91
|
+
delete_target_node: bool = False,
|
|
92
|
+
convert_literal_to_uri: bool = False,
|
|
93
|
+
namespace: Namespace | None = None,
|
|
94
|
+
):
|
|
95
|
+
self.target_node_type = target_node_type
|
|
96
|
+
self.target_property = target_property
|
|
97
|
+
self.delete_target_node = delete_target_node
|
|
98
|
+
self.target_property_holding_new_property = target_property_holding_new_property
|
|
99
|
+
self.convert_literal_to_uri = convert_literal_to_uri
|
|
100
|
+
self.namespace = namespace or DEFAULT_NAMESPACE
|
|
101
|
+
|
|
102
|
+
def transform(self, graph) -> None:
|
|
103
|
+
nodes_to_delete: list[tuple] = []
|
|
104
|
+
|
|
105
|
+
if self.target_property_holding_new_property is not None:
|
|
106
|
+
query = self._query_template_use_case_b.format(
|
|
107
|
+
target_node_type=self.target_node_type,
|
|
108
|
+
target_property_holding_new_property_name=self.target_property_holding_new_property,
|
|
109
|
+
target_property=self.target_property,
|
|
110
|
+
)
|
|
111
|
+
else:
|
|
112
|
+
query = self._query_template_use_case_a.format(
|
|
113
|
+
target_node_type=self.target_node_type,
|
|
114
|
+
target_property=self.target_property,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
for (
|
|
118
|
+
source_node,
|
|
119
|
+
old_predicate,
|
|
120
|
+
target_node,
|
|
121
|
+
new_predicate_value,
|
|
122
|
+
new_property_value,
|
|
123
|
+
) in graph.query(query):
|
|
124
|
+
if self.target_property_holding_new_property is not None:
|
|
125
|
+
# Ensure new predicate is URI compliant as we are creating a new predicate
|
|
126
|
+
new_predicate_value_string = sentence_or_string_to_camel(str(new_predicate_value))
|
|
127
|
+
predicate = as_neat_compliant_uri(self.namespace[new_predicate_value_string])
|
|
128
|
+
else:
|
|
129
|
+
predicate = old_predicate
|
|
130
|
+
# Create new connection from source node to value
|
|
131
|
+
graph.add(
|
|
132
|
+
(
|
|
133
|
+
source_node,
|
|
134
|
+
predicate,
|
|
135
|
+
(self.namespace[new_property_value] if self.convert_literal_to_uri else new_property_value),
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
# Remove old relationship between source node and destination node
|
|
139
|
+
graph.remove((source_node, old_predicate, target_node))
|
|
140
|
+
|
|
141
|
+
nodes_to_delete.append(target_node)
|
|
142
|
+
|
|
143
|
+
if self.delete_target_node:
|
|
144
|
+
for target_node in nodes_to_delete:
|
|
145
|
+
# Remove triples with edges to target_node
|
|
146
|
+
graph.remove((None, None, target_node))
|
|
147
|
+
# Remove target node triple and its properties
|
|
148
|
+
graph.remove((target_node, None, None))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class PruneDanglingNodes(BaseTransformer):
|
|
152
|
+
"""
|
|
153
|
+
Knowledge graph pruner and resolver. Will remove rdf triples from graph that does not have connections
|
|
154
|
+
to other nodes, and traverse graph for specified types to resolve the value in the final node and link it to
|
|
155
|
+
the source node.
|
|
156
|
+
|
|
157
|
+
Ex. PruneDanglingNodes
|
|
158
|
+
|
|
159
|
+
Graph before pruning:
|
|
160
|
+
node(A, rdf:type(Pump)) -> node(B, rdf:type(Disc)),
|
|
161
|
+
node(C, rdf:type(Disc))
|
|
162
|
+
|
|
163
|
+
Graph after pruning of nodes rdf:type(Disc):
|
|
164
|
+
|
|
165
|
+
node(A, rd:type(Pump)) -> node(B, rdf:type(Disc))
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
node_prune_types: list of RDF types to prune from the Graph if they are stand-alone Nodes
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
description: str = "Prunes nodes of specific rdf types that do not have any connection to them."
|
|
172
|
+
_query_template = """
|
|
173
|
+
SELECT ?subject
|
|
174
|
+
WHERE {{
|
|
175
|
+
?subject a <{rdf_type}> .
|
|
176
|
+
FILTER NOT EXISTS {{ ?s ?p ?subject }}
|
|
177
|
+
}}
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
def __init__(
|
|
181
|
+
self,
|
|
182
|
+
node_prune_types: list[URIRef],
|
|
183
|
+
):
|
|
184
|
+
self.node_prune_types = node_prune_types
|
|
185
|
+
|
|
186
|
+
def transform(self, graph: Graph) -> None:
|
|
187
|
+
for type_ in self.node_prune_types:
|
|
188
|
+
for (subject,) in list(graph.query(self._query_template.format(rdf_type=type_))): # type: ignore
|
|
189
|
+
graph.remove((subject, None, None))
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class PruneTypes(BaseTransformer):
|
|
193
|
+
"""
|
|
194
|
+
Removes all the instances of specific type
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
description: str = "Prunes nodes of specific rdf types"
|
|
198
|
+
_query_template = """
|
|
199
|
+
SELECT ?subject
|
|
200
|
+
WHERE {{
|
|
201
|
+
?subject a <{rdf_type}> .
|
|
202
|
+
}}
|
|
203
|
+
"""
|
|
204
|
+
|
|
205
|
+
def __init__(
|
|
206
|
+
self,
|
|
207
|
+
node_prune_types: list[URIRef],
|
|
208
|
+
):
|
|
209
|
+
self.node_prune_types = node_prune_types
|
|
210
|
+
|
|
211
|
+
def transform(self, graph: Graph) -> None:
|
|
212
|
+
for type_ in self.node_prune_types:
|
|
213
|
+
for (subject,) in list(graph.query(self._query_template.format(rdf_type=type_))): # type: ignore
|
|
214
|
+
graph.remove((subject, None, None))
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class PruneDeadEndEdges(BaseTransformer):
|
|
218
|
+
"""
|
|
219
|
+
Removes all the triples where object is a node that is not found in graph
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
description: str = "Prunes the graph of specified rdf types that do not have connections to other nodes."
|
|
223
|
+
_query_template = """
|
|
224
|
+
SELECT ?subject ?predicate ?object
|
|
225
|
+
WHERE {
|
|
226
|
+
?subject ?predicate ?object .
|
|
227
|
+
FILTER (isIRI(?object) && ?predicate != rdf:type)
|
|
228
|
+
FILTER NOT EXISTS {?object ?p ?o .}
|
|
229
|
+
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
"""
|
|
233
|
+
|
|
234
|
+
def transform(self, graph: Graph) -> None:
|
|
235
|
+
for triple in graph.query(self._query_template):
|
|
236
|
+
graph.remove(cast(Triple, triple))
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class PruneInstancesOfUnknownType(BaseTransformer):
|
|
240
|
+
"""
|
|
241
|
+
Removes all the triples where object is a node that is not found in graph
|
|
242
|
+
"""
|
|
243
|
+
|
|
244
|
+
description: str = "Prunes the graph of specified rdf types that do not have connections to other nodes."
|
|
245
|
+
_query_template = """
|
|
246
|
+
SELECT DISTINCT ?subject
|
|
247
|
+
WHERE {
|
|
248
|
+
?subject ?p ?o .
|
|
249
|
+
FILTER NOT EXISTS {?subject a ?object .}
|
|
250
|
+
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
"""
|
|
254
|
+
|
|
255
|
+
def transform(self, graph: Graph) -> None:
|
|
256
|
+
for (subject,) in graph.query(self._query_template): # type: ignore
|
|
257
|
+
graph.remove((subject, None, None))
|