cognite-neat 0.100.1__py3-none-any.whl → 0.101.0__py3-none-any.whl
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/_graph/loaders/_rdf2dms.py +0 -1
- cognite/neat/_graph/transformers/__init__.py +5 -0
- cognite/neat/_graph/transformers/_iodd.py +9 -4
- cognite/neat/_graph/transformers/_prune_graph.py +118 -61
- cognite/neat/_rules/exporters/_rules2dms.py +35 -13
- cognite/neat/_rules/models/_base_rules.py +13 -9
- cognite/neat/_rules/models/dms/_rules.py +111 -39
- cognite/neat/_rules/models/information/_rules.py +50 -17
- cognite/neat/_session/_base.py +18 -0
- cognite/neat/_session/_read.py +3 -3
- cognite/neat/_session/_to.py +1 -1
- cognite/neat/_utils/reader/__init__.py +2 -2
- cognite/neat/_utils/reader/_base.py +40 -35
- cognite/neat/_utils/text.py +12 -0
- cognite/neat/_version.py +1 -1
- cognite_neat-0.101.0.dist-info/METADATA +113 -0
- {cognite_neat-0.100.1.dist-info → cognite_neat-0.101.0.dist-info}/RECORD +20 -20
- cognite_neat-0.100.1.dist-info/METADATA +0 -215
- {cognite_neat-0.100.1.dist-info → cognite_neat-0.101.0.dist-info}/LICENSE +0 -0
- {cognite_neat-0.100.1.dist-info → cognite_neat-0.101.0.dist-info}/WHEEL +0 -0
- {cognite_neat-0.100.1.dist-info → cognite_neat-0.101.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: cognite-neat
|
|
3
|
-
Version: 0.100.1
|
|
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
|
-
This is python package handles transformation of domain knowledge graphs (more detailed, overarching) to app specific knowledge graphs.
|
|
79
|
-
Documenation available at [https://thisisneat.io](https://thisisneat.io).
|
|
80
|
-
|
|
81
|
-
## Quickstart
|
|
82
|
-
|
|
83
|
-
### Option 1 - Python Package
|
|
84
|
-
|
|
85
|
-
`neat` can be installed as a Python package, and a docker image for more robust execution and support such
|
|
86
|
-
as `graphdb` for caching. This quickstart guide uses the Python package.
|
|
87
|
-
|
|
88
|
-
### Option 2 - Docker container
|
|
89
|
-
|
|
90
|
-
Running NEAT as docker container :
|
|
91
|
-
`docker run -p 8000:8000 --name neat cognite/neat:latest`
|
|
92
|
-
|
|
93
|
-
Runnin NEAT as docker container with local data folder mounted :
|
|
94
|
-
`docker run -p 8000:8000 --name neat -v $(shell pwd)/docker/vol_data:/app/data cognite/neat:latest`
|
|
95
|
-
|
|
96
|
-
### Installation (Development setup)
|
|
97
|
-
|
|
98
|
-
Prerequisites:
|
|
99
|
-
|
|
100
|
-
- `poetry` installed on your system, [see installation](https://python-poetry.org/docs/).
|
|
101
|
-
- `npm` installed on your system, [see installation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
|
|
102
|
-
- `react-scripts` installed on your system, [`npm i react-scripts`](https://www.npmjs.com/package/react-scripts)
|
|
103
|
-
|
|
104
|
-
1. Clone this repo: `git clone git@github.com:cognitedata/neat.git`
|
|
105
|
-
2. Create wheel: `make build-python`. This will create a wheel in the `dist` folder.
|
|
106
|
-
3. Install wheel in your preferred environment, `pip install dist/neat-[NEAT_VERSTION]-py3-none-any.whl`
|
|
107
|
-
|
|
108
|
-
### Run Neat (Python Package)
|
|
109
|
-
|
|
110
|
-
Once installed you can run neat with the command
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
neat
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
This will open your browser and launch the neat application.
|
|
117
|
-
|
|
118
|
-
Note this will automatically create a `data` folder in your current working directory, which is populated
|
|
119
|
-
with default workflows, rule sheets, and source graphs. In addition, there is a `config.yaml` you can add
|
|
120
|
-
your CDF credentials to allow `neat` access CDF.
|
|
121
|
-
|
|
122
|
-

|
|
123
|
-
|
|
124
|
-
## Documentation
|
|
125
|
-
|
|
126
|
-
[Documentation](https://cognite-neat.readthedocs-hosted.com/en/latest/)
|
|
127
|
-
|
|
128
|
-

|
|
129
|
-
|
|
130
|
-
## Docker container build process
|
|
131
|
-
|
|
132
|
-
`make build-docker`
|
|
133
|
-
|
|
134
|
-
## Starting the application locally using GraphDB as external rdf store
|
|
135
|
-
|
|
136
|
-
Run the command :
|
|
137
|
-
|
|
138
|
-
` make compose-up`
|
|
139
|
-
|
|
140
|
-
The command starts NEAT container and GraphDB container and creates _vol_data_ and _vol_shared_ local folders that are mounted as volumes.
|
|
141
|
-
|
|
142
|
-
_vol_data_ - is mounted only in NEAT container. It contains `config.yaml`, `workflows`, `rules`. You can set `load_examples` to `true` to populate it with examples.
|
|
143
|
-
|
|
144
|
-
_vol_shared_ - is mounted to both containers and files placed here become automatically visible for GraphDB import process. Main intension is to write files from NEAT container and make them available for GraphDB for import.
|
|
145
|
-
|
|
146
|
-
## Web UI
|
|
147
|
-
|
|
148
|
-
`http://localhost:8000`
|
|
149
|
-
|
|
150
|
-
Open API docs :
|
|
151
|
-
|
|
152
|
-
`http://localhost:8000/docs`
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
## Workflows and configurations
|
|
156
|
-
|
|
157
|
-
All configurations are divided into 2 categories :
|
|
158
|
-
|
|
159
|
-
- global configurations - global for entire service , loaded at startup (config.yaml)
|
|
160
|
-
- workflow configurations - local to workflow , loaded from workflow manifest (.yaml)
|
|
161
|
-
|
|
162
|
-
## Global configurations
|
|
163
|
-
|
|
164
|
-
Global configurations loaded by the application during startup process, either from ENV variables or file.
|
|
165
|
-
|
|
166
|
-
The application tries to load the configuration as follows.
|
|
167
|
-
|
|
168
|
-
1. Try ENV variables. This is done by checking for the ENV variable `NEAT_CDF_PROJECT`, and if it exists load the rest
|
|
169
|
-
as they are listed below.
|
|
170
|
-
2. Try from file. This is done by checking the ENV variable `NEAT_CONFIG_PATH`, which defaults to `$(cwd)/config.yaml`,
|
|
171
|
-
for a path. The config file es expected to have the structure as shown below.
|
|
172
|
-
3. Exit. It the ENV variable `NEAT_CDF_PROJECT` and the config file does not exist, the applications exists.
|
|
173
|
-
|
|
174
|
-
### Env Variables
|
|
175
|
-
|
|
176
|
-
- NEAT_CDF_PROJECT
|
|
177
|
-
- NEAT_CDF_CLIENT_NAME
|
|
178
|
-
- NEAT_CDF_CLIENT_ID
|
|
179
|
-
- NEAT_CDF_CLIENT_SECRET
|
|
180
|
-
- NEAT_CDF_BASE_URL
|
|
181
|
-
- NEAT_CDF_TOKEN_URL
|
|
182
|
-
- NEAT_CDF_SCOPES
|
|
183
|
-
- NEAT_WORKFLOW_DOWNLOADER_FILTER - list of workflows or tags that must be loaded from CDF automatically during startup
|
|
184
|
-
- NEAT_DATA_PATH - local directory for workflow and rules storage
|
|
185
|
-
- NEAT_CDF_DEFAULT_DATASET_ID - default dataset id that is used for sharing workflows, rules fies and execution traces
|
|
186
|
-
- NEAT_LOG_LEVEL - supported logging levels `DEBUG` , `INFO` (default)
|
|
187
|
-
|
|
188
|
-
### Config file
|
|
189
|
-
|
|
190
|
-
```yaml
|
|
191
|
-
workflows_store_type: file
|
|
192
|
-
data_store_path: /app/data
|
|
193
|
-
|
|
194
|
-
cdf_client:
|
|
195
|
-
project: get-power-grid
|
|
196
|
-
client_id: "623c2450-cfc2-43d6-9036-10e14dad8ccf"
|
|
197
|
-
client_secret: "my-super-secret"
|
|
198
|
-
base_url: https://az-power-no-northeurope.cognitedata.com
|
|
199
|
-
scopes: [https://az-power-no-northeurope.cognitedata.com/.default]
|
|
200
|
-
token_url: https://login.microsoftonline.com/e55e1701-82f8-4c52-af10-28e4d942c589/oauth2/v2.0/token
|
|
201
|
-
|
|
202
|
-
cdf_default_dataset_id: 2626756768281823
|
|
203
|
-
workflow_downloader_filter:
|
|
204
|
-
- tag:grid
|
|
205
|
-
log_level: DEBUG
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## Automatic workflow loading from CDF during application startup
|
|
209
|
-
|
|
210
|
-
If `workflow_downloader_filter` is set, the app will try to download workflows from CDF based on provided filtering conditions .
|
|
211
|
-
Filtering format :
|
|
212
|
-
|
|
213
|
-
- `name:<workflows_name>=<workflow_version>` - loading workflow by name and version or latest by name if version is not set.
|
|
214
|
-
- `tag:<tag_name>`- loading all workflows that tagged with specific tag.
|
|
215
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|