@@ -62,11 +62,11 @@ The tutorial uses [cUrl](https://ec.haxx.se/) commands throughout, but is also a
6262>
6363> — Sophocles, Oedipus at Colonus
6464
65- The NGSI-LD API is a flexible mechanism for producing context data in mulitple formats. This was demonstrated in the
65+ The NGSI-LD API is a flexible mechanism for producing context data in multiple formats. This was demonstrated in the
6666initial Getting Started [ tutorial] ( https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD ) where both
6767"normalized" and "key-values" pairs format were produced. The default, verbose data format is so-called "normalized"
68- NGSI-LD where every ** Property** is defined by ` "type": "Property ` and every ** Relationship** is defined by
69- ` "type": "Relationship ` . These keywords ( ` type ` , ` Property ` and ` Relationship ` ) are in turn strictly defined JSON-LD
68+ NGSI-LD where every ** Property** is defined by ` "type": "Property" ` and every ** Relationship** is defined by
69+ ` "type": "Relationship" ` . These keywords ( ` type ` , ` Property ` and ` Relationship ` ) are in turn strictly defined JSON-LD
7070terms which can be found in the core @context served with every request.
7171
7272## NGSI-LD Payloads
@@ -79,7 +79,7 @@ complete current state of each entity, with payloads all including sub-attribute
7979Properties-of-Relationships and other standard metadata terms like ` observedAt ` and ` unitCode ` . Furthermore normalized
8080payloads are exceedingly regular and parseable, and can easily be reduced down to the relevant ` value ` elements if such
8181an operation necessary. However with the normalized format, is necessary to repeatedly supply common defining attributes
82- such as ` "type": "Property ` throughout the payload to ensure that machines can fully understand the data represented.
82+ such as ` "type": "Property" ` throughout the payload to ensure that machines can fully understand the data represented.
8383
8484#### Normalized NGSI-LD using ` options=normalized `
8585
@@ -140,7 +140,7 @@ shorter and to the point, and not all information is returned by the request - s
140140Open in [ ** JSON-LD Playground** ] ( https://tinyurl.com/2p93h8p6 )
141141
142142This key-values payload matches the simple JSON-LD payload which can be seen on the front-page of the official
143- [ JSON-LD site] ( https://json-ld.org/ )
143+ [ JSON-LD site] ( https://json-ld.org/ ) .
144144
145145Both normalized and key-values NGSI-LD formats are valid JSON-LD, but since the key-values format is lossy, until
146146recently, all updates to an NGSI-LD context broker must be made using the normalized format.
@@ -149,7 +149,7 @@ recently, all updates to an NGSI-LD context broker must be made using the normal
149149
150150To make the API easier to use and reduce the burden on developers, NGSI-LD now accepts an intermediate "concise" format
151151which still offers all of the context data in the payload, but removes the redundancy of repeatedly adding
152- ` "type": "Property ` throughout each payload. The concise representation is a terser, lossless form of the normalized
152+ ` "type": "Property" ` throughout each payload. The concise representation is a terser, lossless form of the normalized
153153representation, where redundant "type" members are omitted and the following rules are applied:
154154
155155- Every ** Property** without further sub-attributes is represented by the Property value only.
@@ -186,7 +186,7 @@ Open in [**JSON-LD Playground**](https://tinyurl.com/32shtpp6)
186186It can be seen from the payload above that the concise format (like normalized) is also lossless as it still includes
187187Properties-of-Properties like ` unitCode ` (the units of the ` age ` attribute is obviously years following the UN/CEFACT
188188code ` ANN ` for example) and also clearly distinguishes between ** Properties** and ** Relationships** (since
189- ** Relationships** always have an ` object ` )
189+ ** Relationships** always have an ` object ` ).
190190
191191In summary, all NGSI-LD formats provide a structured, well-defined payloads, but the "normalized" format is verbose and
192192lossless, "key-values" is short and lossy, and third format - "concise" is a secondary, intermediate lossless format
@@ -197,7 +197,7 @@ designed to bridge the gap between the two.
197197For the purpose of this tutorial, a series of dummy agricultural IoT devices have been created, which will be attached
198198to the context broker. Details of the architecture and protocol used can be found in the
199199[ IoT Sensors tutorial] ( https://github.com/FIWARE/tutorials.IoT-Sensors/tree/NGSI-LD ) The state of each device can be
200- seen on the UltraLight device monitor web page found at: ` http://localhost:3000/device/monitor `
200+ seen on the UltraLight device monitor web page found at: ` http://localhost:3000/device/monitor ` .
201201
202202![ FIWARE Monitor] ( https://fiware.github.io/tutorials.Concise-Format/img/farm-devices.png )
203203
@@ -261,7 +261,7 @@ technology which allows to different components isolated into their respective e
261261[ YAML files] ( https://raw.githubusercontent.com/FIWARE/tutorials.Concise-Format/NGSI-LD/docker-compose.yml ) are used to
262262configure the required services for the application. This means all container services can be brought up in a single
263263command. Docker Compose is installed by default as part of Docker for Windows and Docker for Mac, however Linux users
264- will need to follow the instructions found [ here] ( https://docs.docker.com/compose/install/ )
264+ will need to follow the instructions found [ here] ( https://docs.docker.com/compose/install/ ) .
265265
266266You can check your current ** Docker** and ** Docker Compose** versions using the following commands:
267267
@@ -320,8 +320,8 @@ Create Operations map to HTTP POST.
320320
321321Any newly created entity must have `id` and `type` attributes and a valid `@context` definition. All other attributes
322322are optional and will depend on the system being modelled. If additional attributes are present though, a concise
323- **Property** must be encapsulated within a `value`. If a **Relationship** is added it ust be encapsulated within an
324- `object`
323+ **Property** must be encapsulated within a `value`. If a **Relationship** is added it must be encapsulated within an
324+ `object`.
325325
326326The response will be **201 - Created** if the operation is successful or **409 - Conflict** if the operation fails.
327327
@@ -390,13 +390,13 @@ The payload should consist of a JSON object holding the attribute names and valu
390390All ** Property** attributes with additional sub-attributes must have a ` value ` associated with them. All
391391** Relationship** attributes must have an ` object ` associated with them which holds the URN of another entity.
392392Well-defined common metadata elements such as ` unitCode ` can be provided as strings, all other metadata should be passed
393- as a JSON object with its own ` type ` and ` value ` attributes
393+ as a JSON object with its own ` type ` and ` value ` attributes.
394394
395395Subsequent requests using the same ` id ` will update the value of the attribute in the context.
396396
397397#### :four : Request:
398398
399- You can check to see if the new ** TemperatureSensor** can be found in the context by making a GET request
399+ You can check to see if the new ** TemperatureSensor** can be found in the context by making a GET request.
400400
401401``` console
402402curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
@@ -458,7 +458,7 @@ It can be seen that `"type": "Property"` can be optionally added to concise payl
458458This means that any normalized payload automatically a valid concise payload. Care should be taken when adding arrays
459459using NGSI-LD due to the existing constraints of JSON-LD. Effectively there is no difference between an array of one
460460entry ` "category": ["sensor"] ` and a simple string value ` "category": "sensor" ` . Furthermore, order within the array is
461- not maintained
461+ not maintained.
462462
463463> ** Note:** In NGSI-LD, an ordered array value could be encoded as a JSON Literal
464464> ` "category" : {"@type": "@json", "@value":[1,2,3]} ` .
@@ -535,7 +535,8 @@ For read operations the `@context` must be supplied in a `Link` header.
535535
536536### Read a Data Entity (concise)
537537
538- This example reads the state of an existing ** TemperatureSensor** entity with a known ` id ` and returns in concise formt
538+ This example reads the state of an existing ** TemperatureSensor** entity with a known ` id ` and returns in concise
539+ format.
539540
540541#### :seven : Request:
541542
@@ -549,7 +550,7 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperatu
549550
550551TemperatureSensor ` urn:ngsi-ld:TemperatureSensor:001 ` is returned as _ concise_ NGSI-LD. Additional metadata is returned
551552because ` options=sysAttrs ` . By default the ` @context ` is returned in the payload body (although this could be moved due
552- to content negotiation if the ` Accept:application/json ` had been set. The full response is shown below:
553+ to content negotiation if the ` Accept:application/json ` had been set) . The full response is shown below:
553554
554555``` jsonld
555556{
@@ -768,7 +769,7 @@ context will now contain four sensors.
768769
769770### List all Data Entities (filtered)
770771
771- This example lists the ` temperature ` attribute of all ** TemperatureSensor** entities in concise format
772+ This example lists the ` temperature ` attribute of all ** TemperatureSensor** entities in concise format.
772773
773774#### :one ::two : Request:
774775
@@ -870,7 +871,7 @@ The response details the selected attributes from the selected entities.
870871### Returning data as GeoJSON
871872
872873The concise format is also available for the GeoJSON format which can be requested by setting the ` Accept ` header to
873- ` application/geo+json ` and setting the ` options=concise ` parameter
874+ ` application/geo+json ` and setting the ` options=concise ` parameter.
874875
875876#### :one ::four : Request:
876877
@@ -977,7 +978,7 @@ Overwrite operations are mapped to HTTP PATCH:
977978
978979### Overwrite the value of an Attribute value
979980
980- This example updates the value of the ` category ` attribute of the Entity with ` id=urn:ngsi-ld:TemperatureSensor:001 `
981+ This example updates the value of the ` category ` attribute of the Entity with ` id=urn:ngsi-ld:TemperatureSensor:001 ` .
981982
982983#### :one ::five : Request:
983984
@@ -1086,7 +1087,7 @@ curl -iX POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/update?options=
10861087]'
10871088```
10881089
1089- Batch processing uses the ` /ngsi-ld/v1/entityOperations/update ` endpoint with a payload with the - ` options=replace `
1090+ Batch processing uses the ` /ngsi-ld/v1/entityOperations/update ` endpoint with a payload with the ` options=replace `
10901091parameter, this means we will overwrite existing entities. ` /ngsi-ld/v1/entityOperations/upsert ` could also be used if
10911092new entities are also to be created.
10921093
@@ -1095,7 +1096,7 @@ new entities are also to be created.
10951096### Concise Notification
10961097
10971098The concise format can also be used when generating a notification from a subscription. Simply set the
1098- ` format": "concise" ` within the ` notification ` element as shown
1099+ ` " format": "concise"` within the ` notification ` element as shown:
10991100
11001101#### :one ::nine : Request:
11011102
0 commit comments