Skip to content

Commit ec912e8

Browse files
committed
Add agriparcels
1 parent 7327d79 commit ec912e8

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
@@ -220,6 +220,109 @@ curl -s -o /dev/null -X POST 'http://'"${CONTEXT_BROKER}"'/ngsi-ld/v1/entityOper
220220
}
221221
]'
222222

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

225328
curl -s -o /dev/null -X POST 'http://'"${CONTEXT_BROKER}"'/ngsi-ld/v1/csourceRegistrations/' \

0 commit comments

Comments
 (0)