Skip to content

Commit de84b5e

Browse files
committed
Add agriparcels
1 parent dec5d41 commit de84b5e

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

import-data

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,107 @@ curl -s -o /dev/null -X POST 'http://'"${CONTEXT_BROKER}"'/ngsi-ld/v1/entityOper
219219
}
220220
]'
221221

222+
echo -e "Creating farmer's fields"
223+
curl -s -o /dev/null -X POST 'http://'"${CONTEXT_BROKER}"'/ngsi-ld/v1/entityOperations/upsert?options=update' \
224+
-H 'Content-Type: application/json' \
225+
-H 'Link: <'"${TUTORIAL_DATA_MODELS_CONTEXT}"'>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
226+
-H 'Accept: application/ld+json' \
227+
-d '[
228+
{
229+
"id": "urn:ngsi-ld:AgriParcel:001",
230+
"type": "AgriParcel",
231+
"name": {
232+
"type": "Property", "value": "Wheatfield"
233+
},
234+
"cropType": {
235+
"type": "Relationship",
236+
"object": "urn:ngsi-ld:AgriCrop:BuckWheat"
237+
},
238+
"cropStatus": {
239+
"type": "VocabProperty",
240+
"vocab": "seeded"
241+
},
242+
"temperature": {
243+
"type": "Property",
244+
"value": 15.4, "unitCode": "CEL",
245+
"observedAt": "2024-01-01T15:00:00.000Z"
246+
}
247+
},
248+
{
249+
"id": "urn:ngsi-ld:AgriParcel:002",
250+
"type": "AgriParcel",
251+
"name": {
252+
"type": "Property", "value": "Cornfield"
253+
},
254+
"cropStatus": {
255+
"type": "VocabProperty",
256+
"vocab": "growing"
257+
},
258+
"cropType": {
259+
"type": "Relationship",
260+
"object": "urn:ngsi-ld:AgriCrop:Corn"
261+
}
262+
},
263+
{
264+
"id": "urn:ngsi-ld:AgriParcel:003",
265+
"type": "AgriParcel",
266+
"name": {
267+
"type": "Property", "value": "North Pasture"
268+
},
269+
"cropStatus": {
270+
"type": "VocabProperty",
271+
"vocab": "maturing"
272+
},
273+
"cropType": {
274+
"type": "Relationship",
275+
"object": "urn:ngsi-ld:AgriCrop:Grass"
276+
}
277+
},
278+
{
279+
"id": "urn:ngsi-ld:AgriParcel:004",
280+
"type": "AgriParcel",
281+
"name": {
282+
"type": "Property", "value": "East Pasture"
283+
},
284+
"cropStatus": {
285+
"type": "VocabProperty",
286+
"vocab": "maturing"
287+
},
288+
"cropType": {
289+
"type": "Relationship",
290+
"object": "urn:ngsi-ld:AgriCrop:Grass"
291+
}
292+
},
293+
{
294+
"id": "urn:ngsi-ld:AgriParcel:005",
295+
"type": "AgriParcel",
296+
"name": {
297+
"type": "Property", "value": "Water Meadow"
298+
},
299+
"cropStatus": {
300+
"type": "VocabProperty",
301+
"vocab": "maturing"
302+
},
303+
"cropType": {
304+
"type": "Relationship",
305+
"object": "urn:ngsi-ld:AgriCrop:Grass"
306+
}
307+
},
308+
{
309+
"id": "urn:ngsi-ld:AgriParcel:006",
310+
"type": "AgriParcel",
311+
"name": {
312+
"type": "Property", "value": "The Paddock"
313+
},
314+
"cropStatus": {
315+
"type": "VocabProperty",
316+
"vocab": "maturing"
317+
},
318+
"cropType": {
319+
"type": "Relationship",
320+
"object": "urn:ngsi-ld:AgriCrop:Grass"
321+
}
322+
}
323+
]'
324+
222325
echo -e " \033[1;32mdone\033[0m"

0 commit comments

Comments
 (0)