From 22411716ed9ab9503c1348c429cf12017bf34e83 Mon Sep 17 00:00:00 2001 From: Jose Manuel Cantera Date: Wed, 14 Nov 2018 12:32:59 +0100 Subject: [PATCH] API Examples from WI-009 --- ...ContextSourceRegistration-example_C.3.json | 77 +++++++++++++++++++ examples/EntityTemportal-example_C5.5.3.json | 31 ++++++++ examples/Entity_temporalValues_C.5.6.3.json | 34 ++++++++ examples/OffStreetParking_C2.3.json | 36 +++++++++ examples/OffStreetParking_keyValues_C2.3.json | 15 ++++ examples/Subscription-example_C.4.json | 35 +++++++++ examples/Vehicle_C2.2.js | 23 ++++++ examples/Vehicle_MultiAttribute_C2.2.json | 30 ++++++++ examples/Vehicle_keyValues_C2.2.json | 12 +++ 9 files changed, 293 insertions(+) create mode 100644 examples/ContextSourceRegistration-example_C.3.json create mode 100644 examples/EntityTemportal-example_C5.5.3.json create mode 100644 examples/Entity_temporalValues_C.5.6.3.json create mode 100644 examples/OffStreetParking_C2.3.json create mode 100644 examples/OffStreetParking_keyValues_C2.3.json create mode 100644 examples/Subscription-example_C.4.json create mode 100644 examples/Vehicle_C2.2.js create mode 100644 examples/Vehicle_MultiAttribute_C2.2.json create mode 100644 examples/Vehicle_keyValues_C2.2.json diff --git a/examples/ContextSourceRegistration-example_C.3.json b/examples/ContextSourceRegistration-example_C.3.json new file mode 100644 index 0000000..7180da3 --- /dev/null +++ b/examples/ContextSourceRegistration-example_C.3.json @@ -0,0 +1,77 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:csr1a3456", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "properties": [ + "brandName", + "speed" + ], + "relationships": [ + "isParked" + ] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "properties": [ + "availableSotNumber", + "totalSpotNumber" + ], + "relationships": [ + "isNextToBuilding" + ] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.0, + 0.0 + ], + [ + 101.0, + 0.0 + ], + [ + 101.0, + 1.0 + ], + [ + 100.0, + 1.0 + ], + [ + 100.0, + 0.0 + ] + ] + ] + }, + "timestamp": { + "start": " 2017-11-29T14:53:15" + }, + "@context": [ + "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", + "http://example.org/cim/commonTerms.jsonld", + "http://example.org/cim/vehicle.jsonld", + "http://example.org/cim/parking.jsonld" + ] +} diff --git a/examples/EntityTemportal-example_C5.5.3.json b/examples/EntityTemportal-example_C5.5.3.json new file mode 100644 index 0000000..89bcacd --- /dev/null +++ b/examples/EntityTemportal-example_C5.5.3.json @@ -0,0 +1,31 @@ +{ + "id": "urn:ngsi-ld:Vehicle:B9211", + "type": "Vehicle", + "brandName": [ + { + "type": "Property", + "value": "Volvo" + } + ], + "speed": [ + { + "type": "Property", + "value": 120, + "observedAt": "2018-08-01T12:03:00" + }, + { + "type": "Property", + "value": 80, + "observedAt": "2018-08-01T12:05:00" + }, + { + "type": "Property", + "value": 100, + "observedAt": "2018-08-01T12:07:00" + } + ], + "@context": [ + "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", + "http://example.org/ngsi-ld/vehicle.jsonld" + ] +} diff --git a/examples/Entity_temporalValues_C.5.6.3.json b/examples/Entity_temporalValues_C.5.6.3.json new file mode 100644 index 0000000..75f0ffb --- /dev/null +++ b/examples/Entity_temporalValues_C.5.6.3.json @@ -0,0 +1,34 @@ +{ + "id": "urn:ngsi-ld:Vehicle:B9211", + "type": "Vehicle", + "brandName": { + "type": "Property", + "values": [ + [ + "Volvo", + "" + ] + ] + }, + "speed": { + "type": "Property", + "values": [ + [ + 120, + "2018-08-01T12:03:00" + ], + [ + 80, + "2018-08-01T12:05:00" + ], + [ + 100, + "2018-08-01T12:07:00" + ] + ] + }, + "@context": [ + "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", + "http://example.org/ngsi-ld/vehicle.jsonld" + ] +} diff --git a/examples/OffStreetParking_C2.3.json b/examples/OffStreetParking_C2.3.json new file mode 100644 index 0000000..f76e3d0 --- /dev/null +++ b/examples/OffStreetParking_C2.3.json @@ -0,0 +1,36 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:Downtown1", + "type": "OffStreetParking", + "name": { + "type": "Property", + "value": "Downtown One" + }, + "availableSpotNumber": { + "type": "Property", + "value": 121, + "observedAt": "2017-07-29T12:05:02", + "reliability": { + "type": "Property", + "value": 0.7 + }, + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Camera:C1" + } + }, + "totalSpotNumber": { + "type": "Property", + "value": 200 + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [-8.5, 41.2] + } + }, + "@context": [ + "http://uri.etsi.org/ngsi-ld/coreContext.jsonld", + "http://example.org/cim/parking.jsonld" + ] +} diff --git a/examples/OffStreetParking_keyValues_C2.3.json b/examples/OffStreetParking_keyValues_C2.3.json new file mode 100644 index 0000000..6748537 --- /dev/null +++ b/examples/OffStreetParking_keyValues_C2.3.json @@ -0,0 +1,15 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:Downtown1", + "type": "OffStreetParking", + "name": "Downtown One", + "availableSpotNumber": 121, + "totalSpotNumber": 200, + "location": { + "type": "Point", + "coordinates": [-8.5, 41.2] + }, + "@context": [ + "http://uri.etsi.org/ngsi-ld/coreContext.jsonld", + "http://example.org/cim/parking.jsonld" + ] +} diff --git a/examples/Subscription-example_C.4.json b/examples/Subscription-example_C.4.json new file mode 100644 index 0000000..5813eae --- /dev/null +++ b/examples/Subscription-example_C.4.json @@ -0,0 +1,35 @@ +{ + "id": "urn:ngsi-ld:Subscription:mySubscription", + "type": "Subscription", + "entities": [ + { + "type": "Vehicle" + } + ], + "watchedAttributes": [ + "speed" + ], + "q": "speed>50", + "geoQ": { + "georel": "near;maxDistance==2000", + "geometry": "Point", + "coordinates": [ + -1, + 100 + ] + }, + "notification": { + "attributes": [ + "speed" + ], + "format": "keyValues", + "endpoint": { + "uri": "http://my.endpoint.org/notify", + "accept": "application/json" + } + }, + "@context": [ + "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", + "http://example.org/cim/vehicle.jsonld" + ] +} diff --git a/examples/Vehicle_C2.2.js b/examples/Vehicle_C2.2.js new file mode 100644 index 0000000..858bf6e --- /dev/null +++ b/examples/Vehicle_C2.2.js @@ -0,0 +1,23 @@ +{ + "id": "urn:ngsi-ld:Vehicle:A4567", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } + }, + "@context": [ + "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", + "http://example.org/cim/commonTerms.jsonld", + "http://example.org/cim/vehicle.jsonld", + "http://example.org/cim/parking.jsonld" + ] +} diff --git a/examples/Vehicle_MultiAttribute_C2.2.json b/examples/Vehicle_MultiAttribute_C2.2.json new file mode 100644 index 0000000..a6bf18f --- /dev/null +++ b/examples/Vehicle_MultiAttribute_C2.2.json @@ -0,0 +1,30 @@ +{ + "id": "urn:ngsi-ld:Vehicle:A4567", + "type": "Vehicle", + "speed#1": { + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "speed#2": { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }, + "@context": [ + "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", + { + "speed#1": "http://example.org/speed", + "speed#2": "http://example.org/speed", + "source": "http://example.org/hasSource" + } + ] +} \ No newline at end of file diff --git a/examples/Vehicle_keyValues_C2.2.json b/examples/Vehicle_keyValues_C2.2.json new file mode 100644 index 0000000..1d3eb4e --- /dev/null +++ b/examples/Vehicle_keyValues_C2.2.json @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Vehicle:A4567", + "type": "Vehicle", + "brandName": "Mercedes", + "isParked": "urn:ngsi-ld:OffStreetParking:Downtown1", + "@context": [ + "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json", + "http://example.org/cim/commonTerms.jsonld", + "http://example.org/cim/vehicle.jsonld", + "http://example.org/cim/parking.jsonld" + ] +} -- GitLab