cognite-neat 0.103.1__py3-none-any.whl → 0.105.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.

Files changed (175) hide show
  1. cognite/neat/_client/_api/data_modeling_loaders.py +83 -23
  2. cognite/neat/_client/_api/schema.py +2 -1
  3. cognite/neat/_client/data_classes/neat_sequence.py +261 -0
  4. cognite/neat/_client/data_classes/schema.py +5 -1
  5. cognite/neat/_client/testing.py +33 -0
  6. cognite/neat/_constants.py +56 -0
  7. cognite/neat/_graph/extractors/_classic_cdf/_base.py +6 -5
  8. cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +225 -11
  9. cognite/neat/_graph/extractors/_mock_graph_generator.py +2 -2
  10. cognite/neat/_graph/loaders/_rdf2dms.py +13 -2
  11. cognite/neat/_graph/transformers/__init__.py +3 -1
  12. cognite/neat/_graph/transformers/_base.py +109 -1
  13. cognite/neat/_graph/transformers/_classic_cdf.py +6 -1
  14. cognite/neat/_graph/transformers/_prune_graph.py +103 -47
  15. cognite/neat/_graph/transformers/_rdfpath.py +41 -17
  16. cognite/neat/_graph/transformers/_value_type.py +188 -151
  17. cognite/neat/_issues/__init__.py +0 -2
  18. cognite/neat/_issues/_base.py +54 -43
  19. cognite/neat/_issues/warnings/__init__.py +4 -1
  20. cognite/neat/_issues/warnings/_general.py +7 -0
  21. cognite/neat/_issues/warnings/_resources.py +12 -1
  22. cognite/neat/_rules/_shared.py +18 -34
  23. cognite/neat/_rules/exporters/_base.py +28 -2
  24. cognite/neat/_rules/exporters/_rules2dms.py +39 -1
  25. cognite/neat/_rules/exporters/_rules2excel.py +13 -2
  26. cognite/neat/_rules/exporters/_rules2instance_template.py +4 -0
  27. cognite/neat/_rules/exporters/_rules2ontology.py +13 -1
  28. cognite/neat/_rules/exporters/_rules2yaml.py +4 -0
  29. cognite/neat/_rules/importers/_base.py +9 -0
  30. cognite/neat/_rules/importers/_dms2rules.py +80 -57
  31. cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +5 -2
  32. cognite/neat/_rules/importers/_rdf/_base.py +10 -8
  33. cognite/neat/_rules/importers/_rdf/_imf2rules.py +4 -0
  34. cognite/neat/_rules/importers/_rdf/_inference2rules.py +7 -0
  35. cognite/neat/_rules/importers/_rdf/_owl2rules.py +4 -0
  36. cognite/neat/_rules/importers/_spreadsheet2rules.py +17 -8
  37. cognite/neat/_rules/importers/_yaml2rules.py +21 -7
  38. cognite/neat/_rules/models/_base_input.py +1 -1
  39. cognite/neat/_rules/models/_base_rules.py +9 -1
  40. cognite/neat/_rules/models/dms/_rules.py +4 -0
  41. cognite/neat/_rules/models/dms/_rules_input.py +9 -0
  42. cognite/neat/_rules/models/entities/_wrapped.py +10 -5
  43. cognite/neat/_rules/models/information/_rules.py +4 -0
  44. cognite/neat/_rules/models/information/_rules_input.py +9 -0
  45. cognite/neat/_rules/models/mapping/_classic2core.py +2 -5
  46. cognite/neat/_rules/models/mapping/_classic2core.yaml +239 -38
  47. cognite/neat/_rules/transformers/__init__.py +13 -6
  48. cognite/neat/_rules/transformers/_base.py +41 -65
  49. cognite/neat/_rules/transformers/_converters.py +404 -234
  50. cognite/neat/_rules/transformers/_mapping.py +93 -72
  51. cognite/neat/_rules/transformers/_verification.py +50 -38
  52. cognite/neat/_session/_base.py +32 -121
  53. cognite/neat/_session/_inspect.py +5 -3
  54. cognite/neat/_session/_mapping.py +17 -105
  55. cognite/neat/_session/_prepare.py +138 -268
  56. cognite/neat/_session/_read.py +39 -195
  57. cognite/neat/_session/_set.py +6 -30
  58. cognite/neat/_session/_show.py +40 -21
  59. cognite/neat/_session/_state.py +49 -107
  60. cognite/neat/_session/_to.py +44 -33
  61. cognite/neat/_shared.py +23 -2
  62. cognite/neat/_store/_provenance.py +3 -82
  63. cognite/neat/_store/_rules_store.py +368 -10
  64. cognite/neat/_store/exceptions.py +23 -0
  65. cognite/neat/_utils/graph_transformations_report.py +36 -0
  66. cognite/neat/_utils/rdf_.py +8 -0
  67. cognite/neat/_utils/reader/_base.py +27 -0
  68. cognite/neat/_utils/spreadsheet.py +5 -4
  69. cognite/neat/_version.py +1 -1
  70. {cognite_neat-0.103.1.dist-info → cognite_neat-0.105.0.dist-info}/METADATA +3 -2
  71. cognite_neat-0.105.0.dist-info/RECORD +179 -0
  72. {cognite_neat-0.103.1.dist-info → cognite_neat-0.105.0.dist-info}/WHEEL +1 -1
  73. cognite/neat/_app/api/__init__.py +0 -0
  74. cognite/neat/_app/api/asgi/metrics.py +0 -4
  75. cognite/neat/_app/api/configuration.py +0 -98
  76. cognite/neat/_app/api/context_manager/__init__.py +0 -3
  77. cognite/neat/_app/api/context_manager/manager.py +0 -16
  78. cognite/neat/_app/api/data_classes/__init__.py +0 -0
  79. cognite/neat/_app/api/data_classes/rest.py +0 -59
  80. cognite/neat/_app/api/explorer.py +0 -66
  81. cognite/neat/_app/api/routers/configuration.py +0 -25
  82. cognite/neat/_app/api/routers/crud.py +0 -102
  83. cognite/neat/_app/api/routers/metrics.py +0 -10
  84. cognite/neat/_app/api/routers/workflows.py +0 -224
  85. cognite/neat/_app/api/utils/__init__.py +0 -0
  86. cognite/neat/_app/api/utils/data_mapping.py +0 -17
  87. cognite/neat/_app/api/utils/logging.py +0 -26
  88. cognite/neat/_app/api/utils/query_templates.py +0 -92
  89. cognite/neat/_app/main.py +0 -17
  90. cognite/neat/_app/monitoring/__init__.py +0 -0
  91. cognite/neat/_app/monitoring/metrics.py +0 -69
  92. cognite/neat/_app/ui/index.html +0 -1
  93. cognite/neat/_app/ui/neat-app/.gitignore +0 -23
  94. cognite/neat/_app/ui/neat-app/README.md +0 -70
  95. cognite/neat/_app/ui/neat-app/build/asset-manifest.json +0 -14
  96. cognite/neat/_app/ui/neat-app/build/favicon.ico +0 -0
  97. cognite/neat/_app/ui/neat-app/build/img/architect-icon.svg +0 -116
  98. cognite/neat/_app/ui/neat-app/build/img/developer-icon.svg +0 -112
  99. cognite/neat/_app/ui/neat-app/build/img/sme-icon.svg +0 -34
  100. cognite/neat/_app/ui/neat-app/build/index.html +0 -1
  101. cognite/neat/_app/ui/neat-app/build/logo192.png +0 -0
  102. cognite/neat/_app/ui/neat-app/build/manifest.json +0 -25
  103. cognite/neat/_app/ui/neat-app/build/robots.txt +0 -3
  104. cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css +0 -2
  105. cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css.map +0 -1
  106. cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js +0 -3
  107. cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.LICENSE.txt +0 -88
  108. cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.map +0 -1
  109. cognite/neat/_app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -1
  110. cognite/neat/_app/ui/neat-app/package-lock.json +0 -18306
  111. cognite/neat/_app/ui/neat-app/package.json +0 -62
  112. cognite/neat/_app/ui/neat-app/public/favicon.ico +0 -0
  113. cognite/neat/_app/ui/neat-app/public/img/architect-icon.svg +0 -116
  114. cognite/neat/_app/ui/neat-app/public/img/developer-icon.svg +0 -112
  115. cognite/neat/_app/ui/neat-app/public/img/sme-icon.svg +0 -34
  116. cognite/neat/_app/ui/neat-app/public/index.html +0 -43
  117. cognite/neat/_app/ui/neat-app/public/logo192.png +0 -0
  118. cognite/neat/_app/ui/neat-app/public/manifest.json +0 -25
  119. cognite/neat/_app/ui/neat-app/public/robots.txt +0 -3
  120. cognite/neat/_app/ui/neat-app/src/App.css +0 -38
  121. cognite/neat/_app/ui/neat-app/src/App.js +0 -17
  122. cognite/neat/_app/ui/neat-app/src/App.test.js +0 -8
  123. cognite/neat/_app/ui/neat-app/src/MainContainer.tsx +0 -70
  124. cognite/neat/_app/ui/neat-app/src/components/JsonViewer.tsx +0 -43
  125. cognite/neat/_app/ui/neat-app/src/components/LocalUploader.tsx +0 -124
  126. cognite/neat/_app/ui/neat-app/src/components/OverviewComponentEditorDialog.tsx +0 -63
  127. cognite/neat/_app/ui/neat-app/src/components/StepEditorDialog.tsx +0 -511
  128. cognite/neat/_app/ui/neat-app/src/components/TabPanel.tsx +0 -36
  129. cognite/neat/_app/ui/neat-app/src/components/Utils.tsx +0 -56
  130. cognite/neat/_app/ui/neat-app/src/components/WorkflowDeleteDialog.tsx +0 -60
  131. cognite/neat/_app/ui/neat-app/src/components/WorkflowExecutionReport.tsx +0 -112
  132. cognite/neat/_app/ui/neat-app/src/components/WorkflowImportExportDialog.tsx +0 -67
  133. cognite/neat/_app/ui/neat-app/src/components/WorkflowMetadataDialog.tsx +0 -79
  134. cognite/neat/_app/ui/neat-app/src/index.css +0 -13
  135. cognite/neat/_app/ui/neat-app/src/index.js +0 -13
  136. cognite/neat/_app/ui/neat-app/src/logo.svg +0 -1
  137. cognite/neat/_app/ui/neat-app/src/reportWebVitals.js +0 -13
  138. cognite/neat/_app/ui/neat-app/src/setupTests.js +0 -5
  139. cognite/neat/_app/ui/neat-app/src/types/WorkflowTypes.ts +0 -388
  140. cognite/neat/_app/ui/neat-app/src/views/AboutView.tsx +0 -61
  141. cognite/neat/_app/ui/neat-app/src/views/ConfigView.tsx +0 -184
  142. cognite/neat/_app/ui/neat-app/src/views/GlobalConfigView.tsx +0 -180
  143. cognite/neat/_app/ui/neat-app/src/views/WorkflowView.tsx +0 -570
  144. cognite/neat/_app/ui/neat-app/tsconfig.json +0 -27
  145. cognite/neat/_rules/transformers/_pipelines.py +0 -70
  146. cognite/neat/_workflows/__init__.py +0 -17
  147. cognite/neat/_workflows/base.py +0 -590
  148. cognite/neat/_workflows/cdf_store.py +0 -393
  149. cognite/neat/_workflows/examples/Export_DMS/workflow.yaml +0 -89
  150. cognite/neat/_workflows/examples/Export_Semantic_Data_Model/workflow.yaml +0 -66
  151. cognite/neat/_workflows/examples/Import_DMS/workflow.yaml +0 -65
  152. cognite/neat/_workflows/examples/Validate_Rules/workflow.yaml +0 -67
  153. cognite/neat/_workflows/examples/Validate_Solution_Model/workflow.yaml +0 -64
  154. cognite/neat/_workflows/manager.py +0 -292
  155. cognite/neat/_workflows/model.py +0 -203
  156. cognite/neat/_workflows/steps/__init__.py +0 -0
  157. cognite/neat/_workflows/steps/data_contracts.py +0 -109
  158. cognite/neat/_workflows/steps/lib/__init__.py +0 -0
  159. cognite/neat/_workflows/steps/lib/current/__init__.py +0 -6
  160. cognite/neat/_workflows/steps/lib/current/graph_extractor.py +0 -100
  161. cognite/neat/_workflows/steps/lib/current/graph_loader.py +0 -51
  162. cognite/neat/_workflows/steps/lib/current/graph_store.py +0 -48
  163. cognite/neat/_workflows/steps/lib/current/rules_exporter.py +0 -537
  164. cognite/neat/_workflows/steps/lib/current/rules_importer.py +0 -398
  165. cognite/neat/_workflows/steps/lib/current/rules_validator.py +0 -106
  166. cognite/neat/_workflows/steps/lib/io/__init__.py +0 -1
  167. cognite/neat/_workflows/steps/lib/io/io_steps.py +0 -393
  168. cognite/neat/_workflows/steps/step_model.py +0 -79
  169. cognite/neat/_workflows/steps_registry.py +0 -218
  170. cognite/neat/_workflows/tasks.py +0 -18
  171. cognite/neat/_workflows/triggers.py +0 -169
  172. cognite/neat/_workflows/utils.py +0 -19
  173. cognite_neat-0.103.1.dist-info/RECORD +0 -275
  174. {cognite_neat-0.103.1.dist-info → cognite_neat-0.105.0.dist-info}/LICENSE +0 -0
  175. {cognite_neat-0.103.1.dist-info → cognite_neat-0.105.0.dist-info}/entry_points.txt +0 -0
@@ -1,180 +0,0 @@
1
- import * as React from 'react';
2
- import Box from '@mui/material/Box';
3
- import Paper from '@mui/material/Paper';
4
- import Stack from '@mui/material/Stack';
5
- import { styled } from '@mui/material/styles';
6
- import Button from '@mui/material/Button';
7
- import TextField from '@mui/material/TextField';
8
- import LinearProgress from '@mui/material/LinearProgress';
9
- import { useState, useEffect } from 'react';
10
- import { getNeatApiRootUrl } from 'components/Utils';
11
- import FormControlLabel from '@mui/material/FormControlLabel';
12
- import Switch from '@mui/material/Switch';
13
- import LocalUploader from 'components/LocalUploader';
14
- import Typography from '@mui/material/Typography';
15
- import FileDownloadIcon from '@mui/icons-material/FileDownload';
16
-
17
- const Item = styled(Paper)(({ theme }) => ({
18
- backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff',
19
- ...theme.typography.body2,
20
- padding: theme.spacing(1),
21
- textAlign: 'left',
22
- color: theme.palette.text.secondary,
23
- }));
24
-
25
- export default function GlobalConfigView() {
26
- const [loading, setLoading] = React.useState(false);
27
- const [configs, setConfigs] = React.useState({
28
- "data_store_path": "",
29
- "cdf_client": {
30
- "project": "",
31
- "client_id": "",
32
- "base_url": "https://az-power-no-northeurope.cognitedata.com",
33
- "scopes": [
34
- "https://az-power-no-northeurope.cognitedata.com/.default"
35
- ],
36
- "token_url": "",
37
- "client_secret": "",
38
- "timeout": 60,
39
- "max_workers": 3,
40
-
41
- },
42
- "cdf_default_dataset_id": 0,
43
- "load_examples": true,
44
- "download_workflows_from_cdf": false,
45
- "workflow_downloader_filter": "",
46
- "log_level": "DEBUG",
47
- "log_format": "%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s",
48
- "stop_on_error": false
49
- });
50
-
51
- let initCdfResourcesResult:string = "";
52
-
53
- const [neatApiRootUrl, setNeatApiRootUrl] = useState(getNeatApiRootUrl());
54
-
55
- useEffect(() => {
56
- loadConfigs();
57
- }, []);
58
-
59
- const loadConfigs = () => {
60
- const url = neatApiRootUrl+"/api/configs/global";
61
- fetch(url).then((response) => response.json()).then((data) => {
62
- console.dir(data)
63
- setConfigs(data)
64
- }).catch((error) => {
65
- console.error('Error:', error);
66
- }).finally(() => { setLoading(false); });
67
- }
68
-
69
-
70
- const saveConfigButtonHandler = () => {
71
- console.dir(configs);
72
- setLoading(true);
73
- let url = neatApiRootUrl+"/api/configs/global";
74
-
75
- fetch(url, {
76
- method: "post", body: JSON.stringify(configs), headers: {
77
- 'Content-Type': 'application/json;charset=utf-8'
78
- }
79
- }).then((response) => response.json()).then((data) => {
80
- console.dir(data)
81
- }).catch((error) => {
82
- console.error('Error:', error);
83
- }).finally(() => { setLoading(false); });
84
- }
85
-
86
- const saveNeatApiConfigButtonHandler = () => {
87
- localStorage.setItem("neatApiRootUrl", neatApiRootUrl);
88
- }
89
-
90
- const handleConfigChange = (name, value) => {
91
- if (name == "neatApiRootUrl") {
92
- setNeatApiRootUrl(value);
93
- }else {
94
- setConfigs({ ...configs, [name]: value });
95
- }
96
- };
97
- const handleCdfConfigChange = (name, value) => {
98
- let new_config = {...configs};
99
- new_config.cdf_client[name] = value;
100
- setConfigs(new_config);
101
- };
102
-
103
- const initCdfResources = () => {
104
- setLoading(true);
105
- let url = neatApiRootUrl+"/api/cdf/init-neat-resources";
106
- // send post request
107
- fetch(url, {
108
- method: "post"})
109
- .then((response) => response.json())
110
- .then((data) => {
111
- console.dir(data)
112
- initCdfResourcesResult = data.result;
113
- }).catch((error) => {
114
- console.error('Error:', error);
115
- initCdfResourcesResult = "Error: "+error;
116
- }).finally(() => { setLoading(false); });
117
- }
118
-
119
- const onConfigUploaded = (fileName,fileHahs) => {
120
- loadConfigs();
121
- }
122
-
123
- const downloadConfigurationFile = () => {
124
- // open file in new tab
125
- window.open("/data/config.yaml", '_blank');
126
- }
127
-
128
-
129
- return (
130
- <Box sx={{ width: "70%" }}>
131
- <Stack spacing={2}>
132
- <Item>
133
- <h3>Global configurations</h3>
134
- <Box sx={{ minWidth: 200 }}>
135
- <Stack spacing={2} direction="column">
136
- <h4>CDF configurations</h4>
137
- <TextField id="project_name" label="Project name" size='small' variant="outlined" value={configs.cdf_client.project} onChange={(event) => { handleCdfConfigChange("project", event.target.value) }} />
138
- <TextField id="client_id" label="Client id" size='small' variant="outlined" value={configs.cdf_client.client_id} onChange={(event) => { handleCdfConfigChange("client_id", event.target.value) }} />
139
- <TextField id="client_secret" label="Client secret" type="password" size='small' variant="outlined" value={configs.cdf_client.client_secret} onChange={(event) => { handleCdfConfigChange("client_secret", event.target.value) }} />
140
- <TextField id="cdf_api_base_url" label="CDF api base url" size='small' variant="outlined" value={configs.cdf_client.base_url} onChange={(event) => { handleCdfConfigChange("base_url", event.target.value) }} />
141
- <TextField id="scopes" label="Scopes" size='small' variant="outlined" value={configs.cdf_client.scopes} onChange={(event) => { handleCdfConfigChange("scopes", event.target.value) }} />
142
- <TextField id="oidc_token_url" label="OIDC token url" size='small' variant="outlined" value={configs.cdf_client.token_url} onChange={(event) => { handleCdfConfigChange("token_url", event.target.value) }} />
143
- <TextField id="cdf_default_dataset_id" type="number" label="Default CDF dataset id.The dataset is used as workflow and rules storage." size='small' variant="outlined" value={configs.cdf_default_dataset_id} onChange={(event) => { handleConfigChange("cdf_default_dataset_id", event.target.value) }} />
144
- <TextField id="cdf_timeout" type="number" label="Cdf read timeout in seconds." size='small' variant="outlined" value={configs.cdf_client.timeout} onChange={(event) => { handleCdfConfigChange("timeout", event.target.value) }} />
145
- <TextField id="cdf_max_workers" type="number" label="Max number of client workers." size='small' variant="outlined" value={configs.cdf_client.max_workers} onChange={(event) => { handleCdfConfigChange("max_workers", event.target.value) }} />
146
-
147
- <h4>Storage and workflows</h4>
148
- <TextField id="data_store_path" label="Data directory.Is used as local workflow , rules and db storage." size='small' variant="outlined" value={configs.data_store_path} onChange={(event) => { handleConfigChange("data_store_path", event.target.value) }} />
149
- <FormControlLabel control={<Switch checked={configs.download_workflows_from_cdf} onChange={(event) => { handleConfigChange("download_workflows_from_cdf", event.target.checked) }} />} label="Automatically download workflows from CDF on startup" />
150
- <TextField id="workflow_downloader_filter" label="List of workflows or filters that will be used for downloading workflows" size='small' variant="outlined" value={configs.workflow_downloader_filter} onChange={(event) => { handleConfigChange("workflow_downloader_filter", event.target.value) }} />
151
- <FormControlLabel control={<Switch checked={configs.load_examples} onChange={(event) => { handleConfigChange("load_examples", event.target.checked) }} />} label="Load default examples" />
152
- <TextField id="log_level" label="Log level" size='small' variant="outlined" value={configs.log_level} onChange={(event) => { handleConfigChange("log_level", event.target.value) }} />
153
- <Button variant="contained" onClick={saveConfigButtonHandler}>Save</Button>
154
- {loading && (<LinearProgress />)}
155
- </Stack>
156
- </Box>
157
- </Item>
158
- <Item>
159
- <h3>Import/Export NEAT global configurations</h3>
160
- <Box sx={{ width: 500 }}>
161
-
162
-
163
- <Button variant="outlined" onClick={downloadConfigurationFile} sx={{ marginTop: 2, marginRight: 1 , width: 500 }} >Download configuration file <FileDownloadIcon sx={{marginLeft:1}} /> </Button>
164
-
165
- <LocalUploader fileType="global_config" action="none" stepId="none" label="Upload and apply configuration file" onUpload={onConfigUploaded} />
166
-
167
-
168
- </Box>
169
- </Item>
170
- <Item>
171
- <h3>Neat internal CDF resources (used for storing files and execution history)</h3>
172
- <Button variant="contained" onClick={initCdfResources}>Initialize CDF resources</Button>
173
-
174
- </Item>
175
-
176
-
177
- </Stack>
178
- </Box>
179
- );
180
- }