diff --git a/TR-0076-Integrating_NGSI-LD_API_in_oneM2M.md b/TR-0076-Integrating_NGSI-LD_API_in_oneM2M.md index 42f865f97232d0f2ba5f39b31da6ad73f428c3d6..724f26773ac2de64f8b9a8114cd3ed6a534e23eb 100644 --- a/TR-0076-Integrating_NGSI-LD_API_in_oneM2M.md +++ b/TR-0076-Integrating_NGSI-LD_API_in_oneM2M.md @@ -467,9 +467,10 @@ The basis for modelling the information required for this use case is the NGSI-L The query for parking sites within a given geographic area, e.g. around the current location of a car: ``` GET /ngsi-ld/v1/entities/?type=OnStreetParking,OffStreetParking&geoproperty=location&georel=near%3BmaxDistance==1000&geometry=Point&coordinates[-3.8040616,43.4631649] -Accept: application/json + +Accept: application/json Host: localhost:9090 -Link: <http://example.org/myContext.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" +Link: <http://example.org/myContext.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" ``` It queries for all NGSI-LD Entities of type OnStreetParking or OffStreetParking, and geographically scopes it with the circle around the geographic point with coordinates -3.8040616,43.4631649 and a radius of 1000m. @@ -486,7 +487,7 @@ Excerpt of result: "car" ] }, -"availableSpotNumber": { + "availableSpotNumber": { "type": "Property", "value": 3, "observedAt": "2018-09-12T12:00:00Z" @@ -521,6 +522,78 @@ In order to do this, the application needs to know the following: ## 6.3 Use Case: Query parking sites in the vicinity (UC2) +Use Case 2 (UC2) is about querying for a _free_ parking spot within the proximity of a car. +Figure 6.3-1 visualizes this scenario. + + + +**Figure 6.3-1: UC2 - Query for free parking spots in the proximity** + +The NGSI-LD Entity Type used is ParkingSpot, also from the NGSI-LD compatible Smart Data Model<a href="#_ref_i.5">[i.5]</a> on Parking. For this purpose, we are only interested in the following properties of each parking spot: +- categrory +- location +- name +- parkingSite (relation) +- status + +The query for parking spots within a given geographic area, e.g. within 100m around the current location of a car, filtered according to the status being _free_ and restricting the result to the elments: id, type, category, location, name and status: +``` +GET /ngsi-ld/v1/entities/?type=ParkingSpot&geoproperty=location&georel=near%3BmaxDistance==100&geometry=Point&coordinates=[-3.8040616,43.4631649]&q=status==“free”&pick=id,type,category,location,name,status + +Accept: application/json +Host: localhost:9090 +Link: <http://example.org/myContext.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" + +``` +Excerpt of result: +``` +[{ + "id": "urn:ngsi-ld:ParkingSpot:santander:daoiz_velarde_1_5:3", + "type": "ParkingSpot", + "category": { + "type": "Property", + "value": [ + "onStreet" + ] + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -3.80356167695194, + 43.46296641666926 + ] + } + }, + "name": { + "type": "Property", + "value": "A-13" + "status": { + "type": "Property", + "value": "free", + "observedAt": "2018-09-21T12:00:00Z“ + } +}, +... +``` + +The advantages for the application are the following: +- Application can reuqest information by specifying what it needs ("free parking spaces in the close vicinity") +- Application gets result with a single request (unless paging is required due to number of results) +- Application can gegographically scope the request +- Application can filter by status, i.e. only get “free” parking spaces +- Application can project to only get the properties and relationships they are interested in + + +In order to do this, the application needs to know the following: +- Data model: + - type: ParkingSpot + - GeoProperty name: location + - Property names: category, location, name and status – and its possible values (“free”) +- its current location +- Root URL: localhost:9090 + ## 6.4 Use Case: Retrieve or query agriculture parcel(s) modelled as composite digital twins (UC3) ## 6.5 Use Case: Subscribe to be notified when temperature is above/below threshold in building (UC4)