cognite-neat 0.104.0__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 (141) 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 +1 -1
  10. cognite/neat/_graph/loaders/_rdf2dms.py +13 -2
  11. cognite/neat/_graph/transformers/__init__.py +3 -1
  12. cognite/neat/_graph/transformers/_classic_cdf.py +2 -1
  13. cognite/neat/_graph/transformers/_value_type.py +72 -0
  14. cognite/neat/_issues/__init__.py +0 -2
  15. cognite/neat/_issues/_base.py +19 -35
  16. cognite/neat/_issues/warnings/__init__.py +4 -1
  17. cognite/neat/_issues/warnings/_general.py +7 -0
  18. cognite/neat/_issues/warnings/_resources.py +11 -0
  19. cognite/neat/_rules/exporters/_rules2dms.py +35 -1
  20. cognite/neat/_rules/exporters/_rules2excel.py +2 -2
  21. cognite/neat/_rules/importers/_dms2rules.py +66 -55
  22. cognite/neat/_rules/models/_base_rules.py +4 -1
  23. cognite/neat/_rules/models/entities/_wrapped.py +10 -5
  24. cognite/neat/_rules/models/mapping/_classic2core.yaml +239 -38
  25. cognite/neat/_rules/transformers/__init__.py +8 -2
  26. cognite/neat/_rules/transformers/_converters.py +271 -188
  27. cognite/neat/_rules/transformers/_mapping.py +75 -59
  28. cognite/neat/_rules/transformers/_verification.py +2 -3
  29. cognite/neat/_session/_inspect.py +3 -1
  30. cognite/neat/_session/_prepare.py +112 -24
  31. cognite/neat/_session/_read.py +33 -70
  32. cognite/neat/_session/_state.py +2 -2
  33. cognite/neat/_session/_to.py +2 -2
  34. cognite/neat/_store/_rules_store.py +4 -8
  35. cognite/neat/_utils/reader/_base.py +27 -0
  36. cognite/neat/_version.py +1 -1
  37. {cognite_neat-0.104.0.dist-info → cognite_neat-0.105.0.dist-info}/METADATA +3 -2
  38. cognite_neat-0.105.0.dist-info/RECORD +179 -0
  39. {cognite_neat-0.104.0.dist-info → cognite_neat-0.105.0.dist-info}/WHEEL +1 -1
  40. cognite/neat/_app/api/__init__.py +0 -0
  41. cognite/neat/_app/api/asgi/metrics.py +0 -4
  42. cognite/neat/_app/api/configuration.py +0 -98
  43. cognite/neat/_app/api/context_manager/__init__.py +0 -3
  44. cognite/neat/_app/api/context_manager/manager.py +0 -16
  45. cognite/neat/_app/api/data_classes/__init__.py +0 -0
  46. cognite/neat/_app/api/data_classes/rest.py +0 -59
  47. cognite/neat/_app/api/explorer.py +0 -66
  48. cognite/neat/_app/api/routers/configuration.py +0 -25
  49. cognite/neat/_app/api/routers/crud.py +0 -102
  50. cognite/neat/_app/api/routers/metrics.py +0 -10
  51. cognite/neat/_app/api/routers/workflows.py +0 -224
  52. cognite/neat/_app/api/utils/__init__.py +0 -0
  53. cognite/neat/_app/api/utils/data_mapping.py +0 -17
  54. cognite/neat/_app/api/utils/logging.py +0 -26
  55. cognite/neat/_app/api/utils/query_templates.py +0 -92
  56. cognite/neat/_app/main.py +0 -17
  57. cognite/neat/_app/monitoring/__init__.py +0 -0
  58. cognite/neat/_app/monitoring/metrics.py +0 -69
  59. cognite/neat/_app/ui/index.html +0 -1
  60. cognite/neat/_app/ui/neat-app/.gitignore +0 -23
  61. cognite/neat/_app/ui/neat-app/README.md +0 -70
  62. cognite/neat/_app/ui/neat-app/build/asset-manifest.json +0 -14
  63. cognite/neat/_app/ui/neat-app/build/favicon.ico +0 -0
  64. cognite/neat/_app/ui/neat-app/build/img/architect-icon.svg +0 -116
  65. cognite/neat/_app/ui/neat-app/build/img/developer-icon.svg +0 -112
  66. cognite/neat/_app/ui/neat-app/build/img/sme-icon.svg +0 -34
  67. cognite/neat/_app/ui/neat-app/build/index.html +0 -1
  68. cognite/neat/_app/ui/neat-app/build/logo192.png +0 -0
  69. cognite/neat/_app/ui/neat-app/build/manifest.json +0 -25
  70. cognite/neat/_app/ui/neat-app/build/robots.txt +0 -3
  71. cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css +0 -2
  72. cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css.map +0 -1
  73. cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js +0 -3
  74. cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.LICENSE.txt +0 -88
  75. cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.map +0 -1
  76. cognite/neat/_app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -1
  77. cognite/neat/_app/ui/neat-app/package-lock.json +0 -18306
  78. cognite/neat/_app/ui/neat-app/package.json +0 -62
  79. cognite/neat/_app/ui/neat-app/public/favicon.ico +0 -0
  80. cognite/neat/_app/ui/neat-app/public/img/architect-icon.svg +0 -116
  81. cognite/neat/_app/ui/neat-app/public/img/developer-icon.svg +0 -112
  82. cognite/neat/_app/ui/neat-app/public/img/sme-icon.svg +0 -34
  83. cognite/neat/_app/ui/neat-app/public/index.html +0 -43
  84. cognite/neat/_app/ui/neat-app/public/logo192.png +0 -0
  85. cognite/neat/_app/ui/neat-app/public/manifest.json +0 -25
  86. cognite/neat/_app/ui/neat-app/public/robots.txt +0 -3
  87. cognite/neat/_app/ui/neat-app/src/App.css +0 -38
  88. cognite/neat/_app/ui/neat-app/src/App.js +0 -17
  89. cognite/neat/_app/ui/neat-app/src/App.test.js +0 -8
  90. cognite/neat/_app/ui/neat-app/src/MainContainer.tsx +0 -70
  91. cognite/neat/_app/ui/neat-app/src/components/JsonViewer.tsx +0 -43
  92. cognite/neat/_app/ui/neat-app/src/components/LocalUploader.tsx +0 -124
  93. cognite/neat/_app/ui/neat-app/src/components/OverviewComponentEditorDialog.tsx +0 -63
  94. cognite/neat/_app/ui/neat-app/src/components/StepEditorDialog.tsx +0 -511
  95. cognite/neat/_app/ui/neat-app/src/components/TabPanel.tsx +0 -36
  96. cognite/neat/_app/ui/neat-app/src/components/Utils.tsx +0 -56
  97. cognite/neat/_app/ui/neat-app/src/components/WorkflowDeleteDialog.tsx +0 -60
  98. cognite/neat/_app/ui/neat-app/src/components/WorkflowExecutionReport.tsx +0 -112
  99. cognite/neat/_app/ui/neat-app/src/components/WorkflowImportExportDialog.tsx +0 -67
  100. cognite/neat/_app/ui/neat-app/src/components/WorkflowMetadataDialog.tsx +0 -79
  101. cognite/neat/_app/ui/neat-app/src/index.css +0 -13
  102. cognite/neat/_app/ui/neat-app/src/index.js +0 -13
  103. cognite/neat/_app/ui/neat-app/src/logo.svg +0 -1
  104. cognite/neat/_app/ui/neat-app/src/reportWebVitals.js +0 -13
  105. cognite/neat/_app/ui/neat-app/src/setupTests.js +0 -5
  106. cognite/neat/_app/ui/neat-app/src/types/WorkflowTypes.ts +0 -388
  107. cognite/neat/_app/ui/neat-app/src/views/AboutView.tsx +0 -61
  108. cognite/neat/_app/ui/neat-app/src/views/ConfigView.tsx +0 -184
  109. cognite/neat/_app/ui/neat-app/src/views/GlobalConfigView.tsx +0 -180
  110. cognite/neat/_app/ui/neat-app/src/views/WorkflowView.tsx +0 -570
  111. cognite/neat/_app/ui/neat-app/tsconfig.json +0 -27
  112. cognite/neat/_workflows/__init__.py +0 -17
  113. cognite/neat/_workflows/base.py +0 -590
  114. cognite/neat/_workflows/cdf_store.py +0 -393
  115. cognite/neat/_workflows/examples/Export_DMS/workflow.yaml +0 -89
  116. cognite/neat/_workflows/examples/Export_Semantic_Data_Model/workflow.yaml +0 -66
  117. cognite/neat/_workflows/examples/Import_DMS/workflow.yaml +0 -65
  118. cognite/neat/_workflows/examples/Validate_Rules/workflow.yaml +0 -67
  119. cognite/neat/_workflows/examples/Validate_Solution_Model/workflow.yaml +0 -64
  120. cognite/neat/_workflows/manager.py +0 -292
  121. cognite/neat/_workflows/model.py +0 -203
  122. cognite/neat/_workflows/steps/__init__.py +0 -0
  123. cognite/neat/_workflows/steps/data_contracts.py +0 -109
  124. cognite/neat/_workflows/steps/lib/__init__.py +0 -0
  125. cognite/neat/_workflows/steps/lib/current/__init__.py +0 -6
  126. cognite/neat/_workflows/steps/lib/current/graph_extractor.py +0 -100
  127. cognite/neat/_workflows/steps/lib/current/graph_loader.py +0 -51
  128. cognite/neat/_workflows/steps/lib/current/graph_store.py +0 -48
  129. cognite/neat/_workflows/steps/lib/current/rules_exporter.py +0 -537
  130. cognite/neat/_workflows/steps/lib/current/rules_importer.py +0 -323
  131. cognite/neat/_workflows/steps/lib/current/rules_validator.py +0 -106
  132. cognite/neat/_workflows/steps/lib/io/__init__.py +0 -1
  133. cognite/neat/_workflows/steps/lib/io/io_steps.py +0 -393
  134. cognite/neat/_workflows/steps/step_model.py +0 -79
  135. cognite/neat/_workflows/steps_registry.py +0 -218
  136. cognite/neat/_workflows/tasks.py +0 -18
  137. cognite/neat/_workflows/triggers.py +0 -169
  138. cognite/neat/_workflows/utils.py +0 -19
  139. cognite_neat-0.104.0.dist-info/RECORD +0 -276
  140. {cognite_neat-0.104.0.dist-info → cognite_neat-0.105.0.dist-info}/LICENSE +0 -0
  141. {cognite_neat-0.104.0.dist-info → cognite_neat-0.105.0.dist-info}/entry_points.txt +0 -0
@@ -1,124 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import Button from '@mui/material/Button';
3
- import Dialog from '@mui/material/Dialog';
4
- import DialogActions from '@mui/material/DialogActions';
5
- import DialogContent from '@mui/material/DialogContent';
6
- import DialogTitle from '@mui/material/DialogTitle';
7
- import FormControl from '@mui/material/FormControl';
8
- import TextField from '@mui/material/TextField';
9
- import { Container } from '@mui/system';
10
- import React, { useEffect } from 'react';
11
- import { useState } from 'react';
12
- import FileUpload from 'react-mui-fileuploader';
13
- import { getNeatApiRootUrl, getSelectedWorkflowName } from './Utils';
14
- import FormControlLabel from '@mui/material/FormControlLabel';
15
- import Checkbox from '@mui/material/Checkbox';
16
- import FileUploadIcon from '@mui/icons-material/FileUpload';
17
-
18
- export default function LocalUploader(props: any) {
19
- const [dialogOpen, setDialogOpen] = useState(false);
20
- const [data, setData] = useState<any>({comments:"",author:""});
21
- const [error, setError] = useState<string>("");
22
- const handleDialogClickOpen = () => {
23
- setDialogOpen(true);
24
- };
25
- const [label,setLabel] = useState<string>("Upload File to NEAT local storage")
26
- const [postUploadConfigUpdate, setPostUploadConfigUpdate] = useState<boolean>(true);
27
- const [postUploadWorkflowStart , setPostUploadWorkflowStart] = useState<boolean>(false);
28
-
29
- // props.action
30
- useEffect(() => {
31
- setPostUploadWorkflowStart(props.action == "start_workflow");
32
- if (props.label){
33
- setLabel(props.label);
34
- }
35
- }, []);
36
-
37
- const handleDialogClose = () => {
38
- setDialogOpen(false);
39
- };
40
- const handleDialogPublish = () => {
41
- uploadFiles();
42
- };
43
- const handlePostUploadActionConfig = (name: string, value: any) => {
44
-
45
- if (name == "auto_config_update"){
46
- setPostUploadConfigUpdate(value);
47
- }else if (name == "auto_workflow_start"){
48
- setPostUploadWorkflowStart(value);
49
- }
50
- }
51
-
52
- const [filesToUpload, setFilesToUpload] = useState([])
53
-
54
- const handleFilesChange = (files) => {
55
- // Update chosen files
56
- setFilesToUpload([ ...files ])
57
- };
58
-
59
- const uploadFiles = () => {
60
- // Create a form and post it to server
61
- const neatApiRootUrl = getNeatApiRootUrl();
62
- const workflowName = getSelectedWorkflowName();
63
- let action = props.action;
64
- if (!action) {
65
- if (postUploadWorkflowStart && !postUploadConfigUpdate){
66
- action = "start_workflow"
67
- }else if (postUploadConfigUpdate && !postUploadWorkflowStart){
68
- action = "update_config"
69
- }else{
70
- action = "update_config_and_start_workflow"
71
- }
72
- }
73
- let formData = new FormData()
74
- filesToUpload.forEach((file) => formData.append("files", file))
75
-
76
- fetch(neatApiRootUrl+"/api/file/upload/"+props.workflowName+"/"+props.fileType+"/"+props.stepId+"/"+action, {
77
- method: "POST",
78
- body: formData
79
- }).then((response) => {
80
- if (response.ok) {
81
- setDialogOpen(false);
82
- return response.json();
83
- }else{
84
- setError(response.statusText);
85
- }
86
-
87
- }).then((data) => {
88
- const fileName = data.file_name;
89
- const fileHash = data.hash;
90
- props.onUpload(fileName, fileHash);
91
- setDialogOpen(false);
92
- }).catch((error) => {
93
- setError(error);
94
- } )
95
- }
96
-
97
- return (
98
- <React.Fragment>
99
- <Dialog open={dialogOpen} onClose={handleDialogClose}>
100
- <DialogTitle>Upload {props.type} to local storage</DialogTitle>
101
- <DialogContent>
102
- <FileUpload
103
- title="File uploader"
104
- multiFile={true}
105
- showPlaceholderImage={false}
106
- header="[Drag to drop the file here or click to select a file]"
107
- onFilesChange={handleFilesChange}
108
- onContextReady={(context) => {}}
109
- filesContainerHeight={100}
110
- />
111
- <FormControlLabel control={<Checkbox checked={postUploadConfigUpdate} onChange={(event) => { handlePostUploadActionConfig("auto_config_update", event.target.checked) }} />} label="Automatically update the references to file names and versions in all steps." />
112
- <FormControlLabel control={<Checkbox checked={postUploadWorkflowStart} onChange={(event) => { handlePostUploadActionConfig("auto_workflow_start", event.target.checked) }} />} label="Start the workflow once the upload has finished." />
113
- {error && <Container sx={{ color: 'red' }}>{error}</Container>}
114
-
115
- </DialogContent>
116
- <DialogActions>
117
- <Button onClick={handleDialogClose}>Cancel</Button>
118
- <Button onClick={handleDialogPublish}>Upload</Button>
119
- </DialogActions>
120
- </Dialog>
121
- <Button variant="outlined" sx={{ marginTop: 2, marginRight: 1 , width: "100%" , alignItems: 'center',justifyContent: 'center' }} onClick={handleDialogClickOpen} > {label} <FileUploadIcon sx={{marginLeft:1}} /> </Button>
122
- </React.Fragment>
123
- )
124
- }
@@ -1,63 +0,0 @@
1
- import Button from "@mui/material/Button"
2
- import Dialog from "@mui/material/Dialog"
3
- import DialogActions from "@mui/material/DialogActions"
4
- import DialogContent from "@mui/material/DialogContent"
5
- import DialogTitle from "@mui/material/DialogTitle"
6
- import FormControl from "@mui/material/FormControl"
7
- import TextField from "@mui/material/TextField"
8
- import { useEffect, useState } from "react"
9
- import { WorkflowSystemComponent } from "types/WorkflowTypes"
10
-
11
- export default function OverviewComponentEditorDialog(props: any)
12
- {
13
- const [dialogOpen, setDialogOpen] = useState(false);
14
- const [component, setComponent] = useState<WorkflowSystemComponent>(null);
15
- const handleDialogSave = () => {
16
- setDialogOpen(false);
17
- props.onClose(component,"save");
18
- };
19
- const handleDialogCancel = () => {
20
- setDialogOpen(false);
21
- props.onClose(component,"cancel");
22
- };
23
- const handleDelete = () => {
24
- setDialogOpen(false);
25
- props.onClose(component,"delete");
26
- };
27
- const handleStepConfigChange = (name: string, value: any) => {
28
-
29
- console.dir(component);
30
- let updComponent = Object.assign({},component);
31
- updComponent[name] = value;
32
-
33
- console.dir(updComponent);
34
- setComponent(updComponent);
35
- }
36
- useEffect(() => {
37
- if (props.open){
38
- setDialogOpen(true);
39
- setComponent(props.component);
40
- console.dir(props.component);
41
- }
42
- }, [props.open]);
43
-
44
-
45
-
46
- return (
47
- <Dialog open={dialogOpen} onClose={handleDialogCancel}>
48
- <DialogTitle>Component editor</DialogTitle>
49
- <DialogContent>
50
- <FormControl sx={{ width: 300 }} >
51
- <TextField sx={{ marginTop: 1 }} id="step-config-id" fullWidth label="Component id" size='small' variant="outlined" value={component?.id} onChange={(event) => { handleStepConfigChange("id", event.target.value) }} />
52
- <TextField sx={{ marginTop: 1 }} id="step-config-label" fullWidth label="Label" size='small' variant="outlined" value={component?.label} onChange={(event) => { handleStepConfigChange("label", event.target.value) }} />
53
- <TextField sx={{ marginTop: 1 }} id="step-config-descr" fullWidth label="Description" size='small' variant="outlined" value={component?.description} onChange={(event) => { handleStepConfigChange("description", event.target.value) }} />
54
- </FormControl>
55
- </DialogContent>
56
- <DialogActions>
57
- <Button variant="outlined" size="small" onClick={handleDialogSave}>Save</Button>
58
- <Button variant="outlined" size="small" onClick={handleDialogCancel}>Cancel</Button>
59
- <Button variant="outlined" size="small" color="error" onClick={handleDelete}>Delete</Button>
60
- </DialogActions>
61
- </Dialog>
62
- )
63
- }