cognite-neat 0.105.2__py3-none-any.whl → 0.106.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.
- cognite/neat/_config.py +6 -260
- cognite/neat/_graph/extractors/_classic_cdf/_base.py +26 -13
- cognite/neat/_graph/extractors/_classic_cdf/_classic.py +4 -1
- cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +2 -2
- cognite/neat/_graph/loaders/_rdf2dms.py +7 -2
- cognite/neat/_graph/transformers/_base.py +4 -8
- cognite/neat/_graph/transformers/_classic_cdf.py +51 -41
- cognite/neat/_graph/transformers/_rdfpath.py +1 -1
- cognite/neat/_issues/warnings/_external.py +1 -1
- cognite/neat/_rules/importers/_rdf/_inference2rules.py +4 -2
- cognite/neat/_rules/models/mapping/_classic2core.yaml +70 -58
- cognite/neat/_rules/transformers/_mapping.py +3 -2
- cognite/neat/_session/_base.py +6 -7
- cognite/neat/_session/_inspect.py +6 -2
- cognite/neat/_session/_mapping.py +6 -8
- cognite/neat/_session/_prepare.py +9 -10
- cognite/neat/_session/_read.py +35 -26
- cognite/neat/_session/_set.py +9 -0
- cognite/neat/_session/_state.py +3 -1
- cognite/neat/_session/_to.py +11 -13
- cognite/neat/_store/_graph_store.py +33 -28
- cognite/neat/_utils/collection_.py +32 -11
- cognite/neat/_version.py +1 -1
- {cognite_neat-0.105.2.dist-info → cognite_neat-0.106.0.dist-info}/METADATA +1 -7
- {cognite_neat-0.105.2.dist-info → cognite_neat-0.106.0.dist-info}/RECORD +28 -28
- {cognite_neat-0.105.2.dist-info → cognite_neat-0.106.0.dist-info}/LICENSE +0 -0
- {cognite_neat-0.105.2.dist-info → cognite_neat-0.106.0.dist-info}/WHEEL +0 -0
- {cognite_neat-0.105.2.dist-info → cognite_neat-0.106.0.dist-info}/entry_points.txt +0 -0
|
@@ -2,16 +2,19 @@ containers:
|
|
|
2
2
|
- container: ClassicEquipment
|
|
3
3
|
neatId: http://purl.org/cognite/neat/neatId_bb7e4121_bc17_46c7_a93d_c855f710ccbe
|
|
4
4
|
used_for: node
|
|
5
|
+
- container: ClassicSourceSystem
|
|
6
|
+
neatId: http://purl.org/cognite/neat/neatId_57fcf04b_a65f_4fc5_92e6_e9e7ac5d6876
|
|
7
|
+
used_for: node
|
|
5
8
|
enum:
|
|
6
9
|
- collection: timeseriesType
|
|
7
10
|
description: Time series with double floating point data points.
|
|
8
11
|
name: numeric
|
|
9
|
-
neatId: http://purl.org/cognite/neat/
|
|
12
|
+
neatId: http://purl.org/cognite/neat/neatId_a7441186_75bb_4d36_a6bc_59b4da0e0262
|
|
10
13
|
value: numeric
|
|
11
14
|
- collection: timeseriesType
|
|
12
15
|
description: Time series with string data points.
|
|
13
16
|
name: string
|
|
14
|
-
neatId: http://purl.org/cognite/neat/
|
|
17
|
+
neatId: http://purl.org/cognite/neat/neatId_df06ec7f_5412_4e48_872f_84e5234d5857
|
|
15
18
|
value: string
|
|
16
19
|
metadata:
|
|
17
20
|
created: '2024-08-29T13:49:56.696000'
|
|
@@ -28,7 +31,7 @@ properties:
|
|
|
28
31
|
description: An automatically updated list of activities related to the asset.
|
|
29
32
|
is_list: true
|
|
30
33
|
name: Activities
|
|
31
|
-
neatId: http://purl.org/cognite/neat/
|
|
34
|
+
neatId: http://purl.org/cognite/neat/neatId_4487a4a9_6e1e_4fde_871c_de37ea8134eb
|
|
32
35
|
value_type: ClassicEvent
|
|
33
36
|
view: ClassicAsset
|
|
34
37
|
view_property: activities
|
|
@@ -36,7 +39,7 @@ properties:
|
|
|
36
39
|
description: An automatically updated list of assets with this asset as their parent.
|
|
37
40
|
is_list: true
|
|
38
41
|
name: Children
|
|
39
|
-
neatId: http://purl.org/cognite/neat/
|
|
42
|
+
neatId: http://purl.org/cognite/neat/neatId_04c63f13_3088_4d24_9494_7f6948feb498
|
|
40
43
|
value_type: ClassicAsset
|
|
41
44
|
view: ClassicAsset
|
|
42
45
|
view_property: children
|
|
@@ -45,7 +48,7 @@ properties:
|
|
|
45
48
|
description: Description of the instance
|
|
46
49
|
immutable: false
|
|
47
50
|
is_list: false
|
|
48
|
-
neatId: http://purl.org/cognite/neat/
|
|
51
|
+
neatId: http://purl.org/cognite/neat/neatId_1852e4a8_af30_4461_9f92_5364f9ab2830
|
|
49
52
|
nullable: true
|
|
50
53
|
value_type: text
|
|
51
54
|
view: ClassicAsset
|
|
@@ -54,7 +57,7 @@ properties:
|
|
|
54
57
|
description: An automatically updated list of equipment related to the asset.
|
|
55
58
|
is_list: true
|
|
56
59
|
name: Equipment
|
|
57
|
-
neatId: http://purl.org/cognite/neat/
|
|
60
|
+
neatId: http://purl.org/cognite/neat/neatId_46d2b553_9e62_4cb8_bdd7_7bcea1f5d989
|
|
58
61
|
value_type: ClassicEquipment
|
|
59
62
|
view: ClassicAsset
|
|
60
63
|
view_property: equipment
|
|
@@ -62,7 +65,7 @@ properties:
|
|
|
62
65
|
description: An automatically updated list of files related to the asset.
|
|
63
66
|
is_list: true
|
|
64
67
|
name: Files
|
|
65
|
-
neatId: http://purl.org/cognite/neat/
|
|
68
|
+
neatId: http://purl.org/cognite/neat/neatId_e515ea88_f19d_4069_b88d_b3244fd87cf4
|
|
66
69
|
value_type: ClassicFile
|
|
67
70
|
view: ClassicAsset
|
|
68
71
|
view_property: files
|
|
@@ -71,7 +74,7 @@ properties:
|
|
|
71
74
|
description: Text based labels for generic use, limited to 1000
|
|
72
75
|
immutable: false
|
|
73
76
|
is_list: true
|
|
74
|
-
neatId: http://purl.org/cognite/neat/
|
|
77
|
+
neatId: http://purl.org/cognite/neat/neatId_6ef04862_dc69_4bb8_8c57_14b08ea03206
|
|
75
78
|
nullable: true
|
|
76
79
|
value_type: text
|
|
77
80
|
view: ClassicAsset
|
|
@@ -82,7 +85,7 @@ properties:
|
|
|
82
85
|
immutable: false
|
|
83
86
|
index: name
|
|
84
87
|
is_list: false
|
|
85
|
-
neatId: http://purl.org/cognite/neat/
|
|
88
|
+
neatId: http://purl.org/cognite/neat/neatId_9047eb7a_03c2_4696_8453_14a93a29d9c0
|
|
86
89
|
nullable: true
|
|
87
90
|
value_type: text
|
|
88
91
|
view: ClassicAsset
|
|
@@ -94,7 +97,7 @@ properties:
|
|
|
94
97
|
immutable: false
|
|
95
98
|
is_list: false
|
|
96
99
|
name: Parent
|
|
97
|
-
neatId: http://purl.org/cognite/neat/
|
|
100
|
+
neatId: http://purl.org/cognite/neat/neatId_3755d55a_169d_4f39_ac85_4132177b835d
|
|
98
101
|
nullable: true
|
|
99
102
|
value_type: ClassicAsset
|
|
100
103
|
view: ClassicAsset
|
|
@@ -107,7 +110,7 @@ properties:
|
|
|
107
110
|
immutable: false
|
|
108
111
|
is_list: true
|
|
109
112
|
name: Path
|
|
110
|
-
neatId: http://purl.org/cognite/neat/
|
|
113
|
+
neatId: http://purl.org/cognite/neat/neatId_11622da5_9e91_4699_b69c_174b054a1a93
|
|
111
114
|
nullable: true
|
|
112
115
|
value_type: ClassicAsset
|
|
113
116
|
view: ClassicAsset
|
|
@@ -119,7 +122,7 @@ properties:
|
|
|
119
122
|
immutable: false
|
|
120
123
|
is_list: false
|
|
121
124
|
name: Root
|
|
122
|
-
neatId: http://purl.org/cognite/neat/
|
|
125
|
+
neatId: http://purl.org/cognite/neat/neatId_11138a07_144c_4998_a51d_4fbced64ce3d
|
|
123
126
|
nullable: true
|
|
124
127
|
value_type: ClassicAsset
|
|
125
128
|
view: ClassicAsset
|
|
@@ -131,7 +134,7 @@ properties:
|
|
|
131
134
|
immutable: false
|
|
132
135
|
index: source
|
|
133
136
|
is_list: false
|
|
134
|
-
neatId: http://purl.org/cognite/neat/
|
|
137
|
+
neatId: http://purl.org/cognite/neat/neatId_ff3bfe41_eb4c_416a_89b6_e525fce2fbfc
|
|
135
138
|
nullable: true
|
|
136
139
|
value_type: ClassicSourceSystem
|
|
137
140
|
view: ClassicAsset
|
|
@@ -140,7 +143,7 @@ properties:
|
|
|
140
143
|
description: An automatically updated list of time series related to the asset.
|
|
141
144
|
is_list: true
|
|
142
145
|
name: Time series
|
|
143
|
-
neatId: http://purl.org/cognite/neat/
|
|
146
|
+
neatId: http://purl.org/cognite/neat/neatId_53bf067f_d9de_4ef0_945c_8024e9ed8981
|
|
144
147
|
value_type: ClassicTimeSeries
|
|
145
148
|
view: ClassicAsset
|
|
146
149
|
view_property: timeSeries
|
|
@@ -148,7 +151,7 @@ properties:
|
|
|
148
151
|
description: An automatically updated list of activities related to the equipment.
|
|
149
152
|
is_list: true
|
|
150
153
|
name: Activities
|
|
151
|
-
neatId: http://purl.org/cognite/neat/
|
|
154
|
+
neatId: http://purl.org/cognite/neat/neatId_c25997c1_a8c4_4c29_9517_3188cfe433b4
|
|
152
155
|
value_type: ClassicEvent
|
|
153
156
|
view: ClassicEquipment
|
|
154
157
|
view_property: activities
|
|
@@ -159,7 +162,7 @@ properties:
|
|
|
159
162
|
immutable: false
|
|
160
163
|
is_list: false
|
|
161
164
|
name: Asset
|
|
162
|
-
neatId: http://purl.org/cognite/neat/
|
|
165
|
+
neatId: http://purl.org/cognite/neat/neatId_5e08021f_2315_4b48_a769_b824abc215a0
|
|
163
166
|
nullable: true
|
|
164
167
|
value_type: ClassicAsset
|
|
165
168
|
view: ClassicEquipment
|
|
@@ -168,7 +171,7 @@ properties:
|
|
|
168
171
|
container_property: classicEquipmentGUID
|
|
169
172
|
immutable: false
|
|
170
173
|
is_list: false
|
|
171
|
-
neatId: http://purl.org/cognite/neat/
|
|
174
|
+
neatId: http://purl.org/cognite/neat/neatId_d22d3e64_b57e_4fef_921f_6aa05cbc563b
|
|
172
175
|
nullable: true
|
|
173
176
|
value_type: text
|
|
174
177
|
view: ClassicEquipment
|
|
@@ -180,7 +183,7 @@ properties:
|
|
|
180
183
|
immutable: false
|
|
181
184
|
is_list: true
|
|
182
185
|
name: Files
|
|
183
|
-
neatId: http://purl.org/cognite/neat/
|
|
186
|
+
neatId: http://purl.org/cognite/neat/neatId_3bd8dc76_ccec_4790_afc1_ad4c5dbdcadb
|
|
184
187
|
nullable: true
|
|
185
188
|
value_type: ClassicFile
|
|
186
189
|
view: ClassicEquipment
|
|
@@ -192,7 +195,7 @@ properties:
|
|
|
192
195
|
immutable: false
|
|
193
196
|
index: source
|
|
194
197
|
is_list: false
|
|
195
|
-
neatId: http://purl.org/cognite/neat/
|
|
198
|
+
neatId: http://purl.org/cognite/neat/neatId_4f64197b_ac89_4963_bdd5_527e7b1f6d4b
|
|
196
199
|
nullable: true
|
|
197
200
|
value_type: ClassicSourceSystem
|
|
198
201
|
view: ClassicEquipment
|
|
@@ -201,7 +204,7 @@ properties:
|
|
|
201
204
|
description: An automatically updated list of time series related to the equipment.
|
|
202
205
|
is_list: true
|
|
203
206
|
name: Time series
|
|
204
|
-
neatId: http://purl.org/cognite/neat/
|
|
207
|
+
neatId: http://purl.org/cognite/neat/neatId_e8c0570d_3a83_4b4d_8a7c_93e73a066e0c
|
|
205
208
|
value_type: ClassicTimeSeries
|
|
206
209
|
view: ClassicEquipment
|
|
207
210
|
view_property: timeSeries
|
|
@@ -210,7 +213,7 @@ properties:
|
|
|
210
213
|
description: Alternative names for the node
|
|
211
214
|
immutable: false
|
|
212
215
|
is_list: true
|
|
213
|
-
neatId: http://purl.org/cognite/neat/
|
|
216
|
+
neatId: http://purl.org/cognite/neat/neatId_01fd6860_7ec4_435a_b333_5efb28847ee2
|
|
214
217
|
nullable: true
|
|
215
218
|
value_type: text
|
|
216
219
|
view: ClassicEvent
|
|
@@ -222,7 +225,7 @@ properties:
|
|
|
222
225
|
immutable: false
|
|
223
226
|
is_list: true
|
|
224
227
|
name: Assets
|
|
225
|
-
neatId: http://purl.org/cognite/neat/
|
|
228
|
+
neatId: http://purl.org/cognite/neat/neatId_762c38a0_4342_4fe1_a5eb_076f143ed32c
|
|
226
229
|
nullable: true
|
|
227
230
|
value_type: ClassicAsset
|
|
228
231
|
view: ClassicEvent
|
|
@@ -232,7 +235,7 @@ properties:
|
|
|
232
235
|
description: Description of the instance
|
|
233
236
|
immutable: false
|
|
234
237
|
is_list: false
|
|
235
|
-
neatId: http://purl.org/cognite/neat/
|
|
238
|
+
neatId: http://purl.org/cognite/neat/neatId_d044458b_3784_40a5_a96c_e05447dfad5a
|
|
236
239
|
nullable: true
|
|
237
240
|
value_type: text
|
|
238
241
|
view: ClassicEvent
|
|
@@ -243,7 +246,7 @@ properties:
|
|
|
243
246
|
immutable: false
|
|
244
247
|
index: endTime
|
|
245
248
|
is_list: false
|
|
246
|
-
neatId: http://purl.org/cognite/neat/
|
|
249
|
+
neatId: http://purl.org/cognite/neat/neatId_6a1842cc_35ea_4585_a288_f5b75e3032a5
|
|
247
250
|
nullable: true
|
|
248
251
|
value_type: timestamp
|
|
249
252
|
view: ClassicEvent
|
|
@@ -255,7 +258,7 @@ properties:
|
|
|
255
258
|
immutable: false
|
|
256
259
|
is_list: true
|
|
257
260
|
name: Equipment
|
|
258
|
-
neatId: http://purl.org/cognite/neat/
|
|
261
|
+
neatId: http://purl.org/cognite/neat/neatId_02efaf0e_d311_4b1f_9cbd_fa43c6141606
|
|
259
262
|
nullable: true
|
|
260
263
|
value_type: ClassicEquipment
|
|
261
264
|
view: ClassicEvent
|
|
@@ -265,7 +268,7 @@ properties:
|
|
|
265
268
|
description: Text based labels for generic use, limited to 1000
|
|
266
269
|
immutable: false
|
|
267
270
|
is_list: true
|
|
268
|
-
neatId: http://purl.org/cognite/neat/
|
|
271
|
+
neatId: http://purl.org/cognite/neat/neatId_1632b445_a660_4acf_a1b9_9450ee5369bd
|
|
269
272
|
nullable: true
|
|
270
273
|
value_type: text
|
|
271
274
|
view: ClassicEvent
|
|
@@ -277,7 +280,7 @@ properties:
|
|
|
277
280
|
immutable: false
|
|
278
281
|
index: source
|
|
279
282
|
is_list: false
|
|
280
|
-
neatId: http://purl.org/cognite/neat/
|
|
283
|
+
neatId: http://purl.org/cognite/neat/neatId_c7d05e34_c8e9_4762_ac2b_bba369371e16
|
|
281
284
|
nullable: true
|
|
282
285
|
value_type: ClassicSourceSystem
|
|
283
286
|
view: ClassicEvent
|
|
@@ -288,7 +291,7 @@ properties:
|
|
|
288
291
|
immutable: false
|
|
289
292
|
index: startTime
|
|
290
293
|
is_list: false
|
|
291
|
-
neatId: http://purl.org/cognite/neat/
|
|
294
|
+
neatId: http://purl.org/cognite/neat/neatId_3ab83d7f_ef84_40ea_a303_311e1e145e92
|
|
292
295
|
nullable: true
|
|
293
296
|
value_type: timestamp
|
|
294
297
|
view: ClassicEvent
|
|
@@ -300,7 +303,7 @@ properties:
|
|
|
300
303
|
immutable: false
|
|
301
304
|
is_list: true
|
|
302
305
|
name: Time series
|
|
303
|
-
neatId: http://purl.org/cognite/neat/
|
|
306
|
+
neatId: http://purl.org/cognite/neat/neatId_a0c5e084_cdf1_49cf_9d39_0997c06d2f3b
|
|
304
307
|
nullable: true
|
|
305
308
|
value_type: ClassicTimeSeries
|
|
306
309
|
view: ClassicEvent
|
|
@@ -312,7 +315,7 @@ properties:
|
|
|
312
315
|
immutable: false
|
|
313
316
|
is_list: true
|
|
314
317
|
name: Assets
|
|
315
|
-
neatId: http://purl.org/cognite/neat/
|
|
318
|
+
neatId: http://purl.org/cognite/neat/neatId_6d6a510a_dac6_441f_b064_c605944fa171
|
|
316
319
|
nullable: true
|
|
317
320
|
value_type: ClassicAsset
|
|
318
321
|
view: ClassicFile
|
|
@@ -324,7 +327,7 @@ properties:
|
|
|
324
327
|
immutable: false
|
|
325
328
|
is_list: false
|
|
326
329
|
name: Directory
|
|
327
|
-
neatId: http://purl.org/cognite/neat/
|
|
330
|
+
neatId: http://purl.org/cognite/neat/neatId_bdeed1bb_4733_47d8_8522_62983487a7b5
|
|
328
331
|
nullable: true
|
|
329
332
|
value_type: text
|
|
330
333
|
view: ClassicFile
|
|
@@ -333,7 +336,7 @@ properties:
|
|
|
333
336
|
description: An automatically updated list of equipment this file is related to.
|
|
334
337
|
is_list: true
|
|
335
338
|
name: Equipment
|
|
336
|
-
neatId: http://purl.org/cognite/neat/
|
|
339
|
+
neatId: http://purl.org/cognite/neat/neatId_527cc7c9_d504_41a7_b25d_f64ba2906a99
|
|
337
340
|
value_type: ClassicEquipment
|
|
338
341
|
view: ClassicFile
|
|
339
342
|
view_property: equipment
|
|
@@ -342,7 +345,7 @@ properties:
|
|
|
342
345
|
description: Text based labels for generic use, limited to 1000
|
|
343
346
|
immutable: false
|
|
344
347
|
is_list: true
|
|
345
|
-
neatId: http://purl.org/cognite/neat/
|
|
348
|
+
neatId: http://purl.org/cognite/neat/neatId_6e9f9ada_cb78_4a64_b760_4de968df9838
|
|
346
349
|
nullable: true
|
|
347
350
|
value_type: text
|
|
348
351
|
view: ClassicFile
|
|
@@ -353,7 +356,7 @@ properties:
|
|
|
353
356
|
immutable: false
|
|
354
357
|
is_list: false
|
|
355
358
|
name: MIME type
|
|
356
|
-
neatId: http://purl.org/cognite/neat/
|
|
359
|
+
neatId: http://purl.org/cognite/neat/neatId_b914ea9d_5c61_46cf_a3d1_c8798b2ac726
|
|
357
360
|
nullable: true
|
|
358
361
|
value_type: text
|
|
359
362
|
view: ClassicFile
|
|
@@ -364,7 +367,7 @@ properties:
|
|
|
364
367
|
immutable: false
|
|
365
368
|
index: name
|
|
366
369
|
is_list: false
|
|
367
|
-
neatId: http://purl.org/cognite/neat/
|
|
370
|
+
neatId: http://purl.org/cognite/neat/neatId_71b469c1_9ff5_4e8e_a715_6d3dbd1f979c
|
|
368
371
|
nullable: true
|
|
369
372
|
value_type: text
|
|
370
373
|
view: ClassicFile
|
|
@@ -376,7 +379,7 @@ properties:
|
|
|
376
379
|
immutable: false
|
|
377
380
|
index: source
|
|
378
381
|
is_list: false
|
|
379
|
-
neatId: http://purl.org/cognite/neat/
|
|
382
|
+
neatId: http://purl.org/cognite/neat/neatId_9ab00833_033e_4c3d_9b61_7f338f8bce0a
|
|
380
383
|
nullable: true
|
|
381
384
|
value_type: ClassicSourceSystem
|
|
382
385
|
view: ClassicFile
|
|
@@ -387,7 +390,7 @@ properties:
|
|
|
387
390
|
immutable: false
|
|
388
391
|
index: sourceCreatedTime
|
|
389
392
|
is_list: false
|
|
390
|
-
neatId: http://purl.org/cognite/neat/
|
|
393
|
+
neatId: http://purl.org/cognite/neat/neatId_47b69049_7cb9_4e0f_ad9e_21c88fc5c3f6
|
|
391
394
|
nullable: true
|
|
392
395
|
value_type: timestamp
|
|
393
396
|
view: ClassicFile
|
|
@@ -398,16 +401,25 @@ properties:
|
|
|
398
401
|
immutable: false
|
|
399
402
|
index: sourceUpdatedTime
|
|
400
403
|
is_list: false
|
|
401
|
-
neatId: http://purl.org/cognite/neat/
|
|
404
|
+
neatId: http://purl.org/cognite/neat/neatId_4e4a3955_b4fe_4e15_aad0_3248a00c5b3b
|
|
402
405
|
nullable: true
|
|
403
406
|
value_type: timestamp
|
|
404
407
|
view: ClassicFile
|
|
405
408
|
view_property: sourceModifiedTime
|
|
409
|
+
- container: ClassicSourceSystem
|
|
410
|
+
container_property: classicSourceSystemGUID
|
|
411
|
+
immutable: false
|
|
412
|
+
is_list: false
|
|
413
|
+
neatId: http://purl.org/cognite/neat/neatId_baba86c4_fed1_4faf_8e48_b5f1e8179a50
|
|
414
|
+
nullable: true
|
|
415
|
+
value_type: text
|
|
416
|
+
view: ClassicSourceSystem
|
|
417
|
+
view_property: classicSourceSystemGUID
|
|
406
418
|
- container: cdf_cdm:CogniteDescribable
|
|
407
419
|
container_property: name
|
|
408
420
|
immutable: false
|
|
409
421
|
is_list: false
|
|
410
|
-
neatId: http://purl.org/cognite/neat/
|
|
422
|
+
neatId: http://purl.org/cognite/neat/neatId_198ce929_258a_4605_a3a9_8d1bb58abe82
|
|
411
423
|
nullable: true
|
|
412
424
|
value_type: text
|
|
413
425
|
view: ClassicSourceSystem
|
|
@@ -417,7 +429,7 @@ properties:
|
|
|
417
429
|
to.
|
|
418
430
|
is_list: true
|
|
419
431
|
name: Activities
|
|
420
|
-
neatId: http://purl.org/cognite/neat/
|
|
432
|
+
neatId: http://purl.org/cognite/neat/neatId_eb1527e5_e163_4d50_bcee_dd2546b7691f
|
|
421
433
|
value_type: ClassicEvent
|
|
422
434
|
view: ClassicTimeSeries
|
|
423
435
|
view_property: activities
|
|
@@ -428,7 +440,7 @@ properties:
|
|
|
428
440
|
immutable: false
|
|
429
441
|
is_list: true
|
|
430
442
|
name: Assets
|
|
431
|
-
neatId: http://purl.org/cognite/neat/
|
|
443
|
+
neatId: http://purl.org/cognite/neat/neatId_bf108d22_f528_46b0_b7a6_51bda3a58531
|
|
432
444
|
nullable: true
|
|
433
445
|
value_type: ClassicAsset
|
|
434
446
|
view: ClassicTimeSeries
|
|
@@ -438,7 +450,7 @@ properties:
|
|
|
438
450
|
description: Description of the instance
|
|
439
451
|
immutable: false
|
|
440
452
|
is_list: false
|
|
441
|
-
neatId: http://purl.org/cognite/neat/
|
|
453
|
+
neatId: http://purl.org/cognite/neat/neatId_6bcc87bd_4d61_4298_a038_780a67e57484
|
|
442
454
|
nullable: true
|
|
443
455
|
value_type: text
|
|
444
456
|
view: ClassicTimeSeries
|
|
@@ -450,7 +462,7 @@ properties:
|
|
|
450
462
|
immutable: false
|
|
451
463
|
is_list: true
|
|
452
464
|
name: Equipment
|
|
453
|
-
neatId: http://purl.org/cognite/neat/
|
|
465
|
+
neatId: http://purl.org/cognite/neat/neatId_1fc3b262_51f2_444b_b105_2e5bf1feb3df
|
|
454
466
|
nullable: true
|
|
455
467
|
value_type: ClassicEquipment
|
|
456
468
|
view: ClassicTimeSeries
|
|
@@ -462,7 +474,7 @@ properties:
|
|
|
462
474
|
immutable: false
|
|
463
475
|
is_list: false
|
|
464
476
|
name: Is step
|
|
465
|
-
neatId: http://purl.org/cognite/neat/
|
|
477
|
+
neatId: http://purl.org/cognite/neat/neatId_8e6d672b_00c5_4687_ba59_1617af6f5171
|
|
466
478
|
nullable: false
|
|
467
479
|
value_type: boolean
|
|
468
480
|
view: ClassicTimeSeries
|
|
@@ -473,7 +485,7 @@ properties:
|
|
|
473
485
|
immutable: true
|
|
474
486
|
is_list: false
|
|
475
487
|
name: Type
|
|
476
|
-
neatId: http://purl.org/cognite/neat/
|
|
488
|
+
neatId: http://purl.org/cognite/neat/neatId_133afe5d_e988_4dc0_9464_e262154122f6
|
|
477
489
|
nullable: false
|
|
478
490
|
value_type: enum(collection=timeseriesType)
|
|
479
491
|
view: ClassicTimeSeries
|
|
@@ -483,7 +495,7 @@ properties:
|
|
|
483
495
|
description: Alternative names for the node
|
|
484
496
|
immutable: false
|
|
485
497
|
is_list: true
|
|
486
|
-
neatId: http://purl.org/cognite/neat/
|
|
498
|
+
neatId: http://purl.org/cognite/neat/neatId_1301f5c0_ece7_42d5_af43_58e25d279f70
|
|
487
499
|
nullable: true
|
|
488
500
|
value_type: text
|
|
489
501
|
view: ClassicTimeSeries
|
|
@@ -494,7 +506,7 @@ properties:
|
|
|
494
506
|
immutable: false
|
|
495
507
|
index: name
|
|
496
508
|
is_list: false
|
|
497
|
-
neatId: http://purl.org/cognite/neat/
|
|
509
|
+
neatId: http://purl.org/cognite/neat/neatId_a6e3b986_c429_4aae_9c1b_b42981022f5e
|
|
498
510
|
nullable: true
|
|
499
511
|
value_type: text
|
|
500
512
|
view: ClassicTimeSeries
|
|
@@ -504,7 +516,7 @@ properties:
|
|
|
504
516
|
description: Text based labels for generic use, limited to 1000
|
|
505
517
|
immutable: false
|
|
506
518
|
is_list: true
|
|
507
|
-
neatId: http://purl.org/cognite/neat/
|
|
519
|
+
neatId: http://purl.org/cognite/neat/neatId_235a9058_8375_4bcf_8b86_340bdf3afa06
|
|
508
520
|
nullable: true
|
|
509
521
|
value_type: text
|
|
510
522
|
view: ClassicTimeSeries
|
|
@@ -516,7 +528,7 @@ properties:
|
|
|
516
528
|
immutable: false
|
|
517
529
|
index: source
|
|
518
530
|
is_list: false
|
|
519
|
-
neatId: http://purl.org/cognite/neat/
|
|
531
|
+
neatId: http://purl.org/cognite/neat/neatId_b5d6ecd8_d48b_439d_892c_3d6e1bc7ffca
|
|
520
532
|
nullable: true
|
|
521
533
|
value_type: ClassicSourceSystem
|
|
522
534
|
view: ClassicTimeSeries
|
|
@@ -527,7 +539,7 @@ properties:
|
|
|
527
539
|
immutable: false
|
|
528
540
|
is_list: false
|
|
529
541
|
name: Source unit
|
|
530
|
-
neatId: http://purl.org/cognite/neat/
|
|
542
|
+
neatId: http://purl.org/cognite/neat/neatId_9d17617a_accf_4f20_8e81_bd11209abc51
|
|
531
543
|
nullable: true
|
|
532
544
|
value_type: text
|
|
533
545
|
view: ClassicTimeSeries
|
|
@@ -539,7 +551,7 @@ properties:
|
|
|
539
551
|
immutable: false
|
|
540
552
|
is_list: false
|
|
541
553
|
name: Unit
|
|
542
|
-
neatId: http://purl.org/cognite/neat/
|
|
554
|
+
neatId: http://purl.org/cognite/neat/neatId_89977822_3f57_4ba1_90a8_73b68fb2cd10
|
|
543
555
|
nullable: true
|
|
544
556
|
value_type: cdf_cdm:CogniteUnit(version=v1)
|
|
545
557
|
view: ClassicTimeSeries
|
|
@@ -548,43 +560,43 @@ views:
|
|
|
548
560
|
- description: Represents a single unit of measurement
|
|
549
561
|
implements: cdf_cdm:CogniteDescribable(version=v1)
|
|
550
562
|
in_model: true
|
|
551
|
-
neatId: http://purl.org/cognite/neat/
|
|
563
|
+
neatId: http://purl.org/cognite/neat/neatId_9c0f10f7_a746_4752_886a_fef5ae5ca498
|
|
552
564
|
view: cdf_cdm:CogniteUnit(version=v1)
|
|
553
565
|
- description: Assets represent systems that support industrial functions or processes.
|
|
554
566
|
Assets are often called 'functional location'.
|
|
555
567
|
implements: cdf_cdm:CogniteAsset(version=v1)
|
|
556
568
|
in_model: true
|
|
557
569
|
name: Asset
|
|
558
|
-
neatId: http://purl.org/cognite/neat/
|
|
570
|
+
neatId: http://purl.org/cognite/neat/neatId_f0b71466_ea9c_411a_b623_b2dc1878d7d3
|
|
559
571
|
view: ClassicAsset
|
|
560
572
|
- description: Equipment represents physical supplies or devices.
|
|
561
573
|
implements: cdf_cdm:CogniteEquipment(version=v1)
|
|
562
574
|
in_model: true
|
|
563
575
|
name: Equipment
|
|
564
|
-
neatId: http://purl.org/cognite/neat/
|
|
576
|
+
neatId: http://purl.org/cognite/neat/neatId_ca8401a4_c0c3_404b_96a2_d3ba5285448c
|
|
565
577
|
view: ClassicEquipment
|
|
566
578
|
- description: Represents activities. Activities typically happen over a period and
|
|
567
579
|
have a start and end time.
|
|
568
580
|
implements: cdf_cdm:CogniteActivity(version=v1)
|
|
569
581
|
in_model: true
|
|
570
582
|
name: Activity
|
|
571
|
-
neatId: http://purl.org/cognite/neat/
|
|
583
|
+
neatId: http://purl.org/cognite/neat/neatId_ddb890e4_2a78_4df8_a974_9be423eedb32
|
|
572
584
|
view: ClassicEvent
|
|
573
585
|
- description: Represents files.
|
|
574
586
|
implements: cdf_cdm:CogniteFile(version=v1)
|
|
575
587
|
in_model: true
|
|
576
588
|
name: File
|
|
577
|
-
neatId: http://purl.org/cognite/neat/
|
|
589
|
+
neatId: http://purl.org/cognite/neat/neatId_5fd23b0c_ed87_45d0_87ab_09e10dec0c4e
|
|
578
590
|
view: ClassicFile
|
|
579
591
|
- description: The CogniteSourceSystem core concept is used to standardize the way
|
|
580
592
|
source system is stored.
|
|
581
593
|
implements: cdf_cdm:CogniteSourceSystem(version=v1)
|
|
582
594
|
in_model: true
|
|
583
|
-
neatId: http://purl.org/cognite/neat/
|
|
595
|
+
neatId: http://purl.org/cognite/neat/neatId_7aed8567_2ca4_46ec_a71a_73922134219e
|
|
584
596
|
view: ClassicSourceSystem
|
|
585
597
|
- description: Represents a series of data points in time order.
|
|
586
598
|
implements: cdf_cdm:CogniteTimeSeries(version=v1)
|
|
587
599
|
in_model: true
|
|
588
600
|
name: Time series
|
|
589
|
-
neatId: http://purl.org/cognite/neat/
|
|
601
|
+
neatId: http://purl.org/cognite/neat/neatId_c2e7d495_ae3d_4d33_abdd_d3e257dcc6b5
|
|
590
602
|
view: ClassicTimeSeries
|
|
@@ -172,8 +172,9 @@ class RuleMapper(RulesTransformer[DMSRules, DMSRules]):
|
|
|
172
172
|
# All connections must be included in the rules. This is to update the
|
|
173
173
|
# ValueTypes of the implemented views.
|
|
174
174
|
new_rules.properties.append(mapping_prop)
|
|
175
|
-
elif
|
|
176
|
-
# All properties
|
|
175
|
+
elif "guid" in mapping_prop.view_property.casefold():
|
|
176
|
+
# All guid properties are included. Theses are necessary to get an appropriate
|
|
177
|
+
# filter on the resulting view.
|
|
177
178
|
new_rules.properties.append(mapping_prop)
|
|
178
179
|
else:
|
|
179
180
|
# Skipping mapped properties that are not in the input rules.
|
cognite/neat/_session/_base.py
CHANGED
|
@@ -74,16 +74,15 @@ class NeatSession:
|
|
|
74
74
|
verbose: bool = True,
|
|
75
75
|
load_engine: Literal["newest", "cache", "skip"] = "cache",
|
|
76
76
|
) -> None:
|
|
77
|
-
self._client = NeatClient(client) if client else None
|
|
78
77
|
self._verbose = verbose
|
|
79
|
-
self._state = SessionState(store_type=storage)
|
|
80
|
-
self.read = ReadAPI(self._state,
|
|
81
|
-
self.to = ToAPI(self._state,
|
|
82
|
-
self.prepare = PrepareAPI(self.
|
|
78
|
+
self._state = SessionState(store_type=storage, client=NeatClient(client) if client else None)
|
|
79
|
+
self.read = ReadAPI(self._state, verbose)
|
|
80
|
+
self.to = ToAPI(self._state, verbose)
|
|
81
|
+
self.prepare = PrepareAPI(self._state, verbose)
|
|
83
82
|
self.show = ShowAPI(self._state)
|
|
84
83
|
self.set = SetAPI(self._state, verbose)
|
|
85
84
|
self.inspect = InspectAPI(self._state)
|
|
86
|
-
self.mapping = MappingAPI(self._state
|
|
85
|
+
self.mapping = MappingAPI(self._state)
|
|
87
86
|
self.drop = DropAPI(self._state)
|
|
88
87
|
self.opt = OptAPI()
|
|
89
88
|
self.opt._display()
|
|
@@ -119,7 +118,7 @@ class NeatSession:
|
|
|
119
118
|
neat.verify()
|
|
120
119
|
```
|
|
121
120
|
"""
|
|
122
|
-
transformer = VerifyAnyRules(validate=True, client=self.
|
|
121
|
+
transformer = VerifyAnyRules(validate=True, client=self._state.client) # type: ignore[var-annotated]
|
|
123
122
|
issues = self._state.rule_transform(transformer)
|
|
124
123
|
if not issues.has_errors:
|
|
125
124
|
rules = self._state.rule_store.last_verified_rule
|
|
@@ -91,9 +91,13 @@ class InspectIssues:
|
|
|
91
91
|
return_dataframe: bool = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
92
92
|
) -> pd.DataFrame | None:
|
|
93
93
|
"""Returns the issues of the current data model."""
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
if self._state.rule_store.provenance:
|
|
95
|
+
issues = self._state.rule_store.last_issues
|
|
96
|
+
elif self._state.instances.store.provenance:
|
|
97
|
+
issues = self._state.instances.store.provenance[-1].target_entity.issues
|
|
98
|
+
else:
|
|
96
99
|
self._print("No issues found.")
|
|
100
|
+
return pd.DataFrame() if return_dataframe else None
|
|
97
101
|
|
|
98
102
|
if issues and search is not None:
|
|
99
103
|
unique_types = {type(issue).__name__ for issue in issues}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from cognite.neat._client import NeatClient
|
|
2
1
|
from cognite.neat._issues import IssueList
|
|
3
2
|
from cognite.neat._rules.models import DMSRules
|
|
4
3
|
from cognite.neat._rules.models.mapping import load_classic_to_core_mapping
|
|
@@ -10,15 +9,14 @@ from .exceptions import NeatSessionError, session_class_wrapper
|
|
|
10
9
|
|
|
11
10
|
@session_class_wrapper
|
|
12
11
|
class MappingAPI:
|
|
13
|
-
def __init__(self, state: SessionState
|
|
14
|
-
self.data_model = DataModelMappingAPI(state
|
|
12
|
+
def __init__(self, state: SessionState):
|
|
13
|
+
self.data_model = DataModelMappingAPI(state)
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
@session_class_wrapper
|
|
18
17
|
class DataModelMappingAPI:
|
|
19
|
-
def __init__(self, state: SessionState
|
|
18
|
+
def __init__(self, state: SessionState):
|
|
20
19
|
self._state = state
|
|
21
|
-
self._client = client
|
|
22
20
|
|
|
23
21
|
def classic_to_core(self, company_prefix: str, use_parent_property_name: bool = True) -> IssueList:
|
|
24
22
|
"""Map classic types to core types.
|
|
@@ -44,13 +42,13 @@ class DataModelMappingAPI:
|
|
|
44
42
|
# Todo better hint of what you should do.
|
|
45
43
|
raise NeatSessionError(f"Expected DMSRules, got {type(rules)}")
|
|
46
44
|
|
|
47
|
-
if self.
|
|
45
|
+
if self._state.client is None:
|
|
48
46
|
raise NeatSessionError("Client is required to map classic to core")
|
|
49
47
|
|
|
50
48
|
transformers = [
|
|
51
49
|
RuleMapper(load_classic_to_core_mapping(company_prefix, rules.metadata.space, rules.metadata.version)),
|
|
52
|
-
IncludeReferenced(self.
|
|
50
|
+
IncludeReferenced(self._state.client),
|
|
53
51
|
]
|
|
54
52
|
if use_parent_property_name:
|
|
55
|
-
transformers.append(AsParentPropertyId(self.
|
|
53
|
+
transformers.append(AsParentPropertyId(self._state.client))
|
|
56
54
|
return self._state.rule_transform(*transformers)
|
|
@@ -4,7 +4,6 @@ from typing import Any, Literal, cast
|
|
|
4
4
|
from cognite.client.data_classes.data_modeling import DataModelIdentifier
|
|
5
5
|
from rdflib import URIRef
|
|
6
6
|
|
|
7
|
-
from cognite.neat._client import NeatClient
|
|
8
7
|
from cognite.neat._constants import (
|
|
9
8
|
get_default_prefixes_and_namespaces,
|
|
10
9
|
)
|
|
@@ -47,10 +46,10 @@ class PrepareAPI:
|
|
|
47
46
|
inferring a data model or exporting the knowledge graph to a desired destination.
|
|
48
47
|
"""
|
|
49
48
|
|
|
50
|
-
def __init__(self,
|
|
49
|
+
def __init__(self, state: SessionState, verbose: bool) -> None:
|
|
51
50
|
self._state = state
|
|
52
51
|
self._verbose = verbose
|
|
53
|
-
self.data_model = DataModelPrepareAPI(
|
|
52
|
+
self.data_model = DataModelPrepareAPI(state, verbose)
|
|
54
53
|
self.instances = InstancePrepareAPI(state, verbose)
|
|
55
54
|
|
|
56
55
|
|
|
@@ -391,8 +390,7 @@ class DataModelPrepareAPI:
|
|
|
391
390
|
to a desired destination.
|
|
392
391
|
"""
|
|
393
392
|
|
|
394
|
-
def __init__(self,
|
|
395
|
-
self._client = client
|
|
393
|
+
def __init__(self, state: SessionState, verbose: bool) -> None:
|
|
396
394
|
self._state = state
|
|
397
395
|
self._verbose = verbose
|
|
398
396
|
|
|
@@ -507,14 +505,15 @@ class DataModelPrepareAPI:
|
|
|
507
505
|
self._state.rule_store.last_verified_dms_rules
|
|
508
506
|
).imported_views_and_containers_ids()
|
|
509
507
|
transformers: list[RulesTransformer] = []
|
|
510
|
-
|
|
508
|
+
client = self._state.client
|
|
509
|
+
if (view_ids or container_ids) and client is None:
|
|
511
510
|
raise NeatSessionError(
|
|
512
511
|
"No client provided. You are referencing unknown views and containers in your data model, "
|
|
513
512
|
"NEAT needs a client to lookup the definitions. "
|
|
514
513
|
"Please set the client in the session, NeatSession(client=client)."
|
|
515
514
|
)
|
|
516
|
-
elif (view_ids or container_ids) and
|
|
517
|
-
transformers.append(IncludeReferenced(
|
|
515
|
+
elif (view_ids or container_ids) and client:
|
|
516
|
+
transformers.append(IncludeReferenced(client, include_properties=True))
|
|
518
517
|
|
|
519
518
|
transformers.append(
|
|
520
519
|
ToDataProductModel(
|
|
@@ -539,13 +538,13 @@ class DataModelPrepareAPI:
|
|
|
539
538
|
|
|
540
539
|
def include_referenced(self) -> IssueList:
|
|
541
540
|
"""Include referenced views and containers in the data model."""
|
|
542
|
-
if self.
|
|
541
|
+
if self._state.client is None:
|
|
543
542
|
raise NeatSessionError(
|
|
544
543
|
"No client provided. You are referencing unknown views and containers in your data model, "
|
|
545
544
|
"NEAT needs a client to lookup the definitions. "
|
|
546
545
|
"Please set the client in the session, NeatSession(client=client)."
|
|
547
546
|
)
|
|
548
|
-
return self._state.rule_transform(IncludeReferenced(self.
|
|
547
|
+
return self._state.rule_transform(IncludeReferenced(self._state.client))
|
|
549
548
|
|
|
550
549
|
def add_implements_to_classes(self, suffix: Literal["Edge"], implements: str = "Edge") -> IssueList:
|
|
551
550
|
"""All classes with the suffix will have the implements property set to the given value.
|