SlideShare a Scribd company logo
1 of 23
Download to read offline
NGSI-LD Concise Payloads and Merge-
Patch Operations
Advanced and Experimental Features in Orion LD
Jason Fox, Technical Evangelist, FIWARE Foundation
1
Concise Format supported by Orion-LD
Potentially NGSI-LD 1.6.1
▪ Want to increase uptake of NGSI-LD by lowering barriers to entry for new
developers
▪ Remove the misconception that NGSI-LD is just "JSON-LD with type
attributes"
▪ Remove redundancy in payloads, to make it easier to for users to update
and consume context data. But any new payloads must still be:
▪ JSON-LD documents.
▪ Compatible with existing formats.
▪ Suitable for CRUD
▪ Lossless
▪ Try to get some mechanism for a simple value update like the NGSI-v2's
update value endpoint legitimately supported
Normalized Property
Concise Property
Concise Property Format
Input and Output format. Potentially NGSI-LD 1.6.1
Super Concise Property
▪ type is optional
▪ value is optional (if no sub-attributes present)
The concise format is shorter than normalized
but unlike key-values it is still lossless.
2
{
"temperature": {
"type" : "Property",
"value" : 100,
}
}
{
"temperature": {
"value" : 100,
}
}
{
"temperature": 100
}
Normalized GeoProperty
Concise GeoProperty
Concise GeoProperty format
Input and Output format. Potentially NGSI-LD 1.6.1
Super Concise GeoProperty
▪ type is optional
▪ value is optional (if no sub-attributes
present)
▪ GeoProperty is inferred if the type is a
supported GeoJSON type.
3
{
"location": {
"type" : "GeoProperty",
"value" : {
"type": "Point",
"coordinates": [-73.97, 40.77]
}
}
}
{
"location": {
"value" : {
"type": "Point",
"coordinates": [-73.97, 40.77]
}
}
}
{
"location": {
"type": "Point",
"coordinates": [-73.97, 40.77]
}
}
Normalized Relationship Concise Relationship
Concise Relationship format
Input and Output format. Potentially NGSI-LD 1.6.1
▪ type is optional
▪ object is mandatory
.
4
{
"providedBy": {
"type" : "Relationship",
"object" : "urn:ngsi-ld:Entity:001"
}
}
{
"providedBy": {
"object" : "urn:ngsi-ld:Entity:001"
}
}
Concise LanguageProperty (as Map)
Concise LanguageProperty (as Property)
Normalized LanguageProperty
Concise LanguageProperty format
Input and Output format. Potentially NGSI-LD 1.6.1
▪ type is optional
▪ languageMap is mandatory
.
5
{
"name": {
"type": "LanguageProperty",
"languageMap": {
"el": "Κωνσταντινούπολις",
"en": "Constantinople",
"tr": "İstanbul"
}
}
}
{
"name": {
"languageMap": {
"el": "Κωνσταντινούπολις",
"en": "Constantinople",
"tr": "İstanbul"
}
}
}
{
"name": {
"value": "Constantinople",
"lang": "en"
}
}
Orion-LD supports Concise Format for all /entities endpoints
Potentially all brokers by NGSI-LD 1.6.1
▪ GET {{orion-ld}}/ngsi-ld/v1/entities/?options=concise
▪ POST .{{orion-ld}}/ngsi-ld/v1/entities/
▪ GET {{orion-ld}/ngsi-ld/v1/entities/<entity-id>?options=concise
▪ POST PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs
▪ PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs/<attr-id>
▪ Plus all relevant Batch Operation endpoints:
POST .{{orion-ld}}/ngsi-ld/v1/entityOperations/xxx
6
New Context-Broker Operations in Orion-LD .
7
Eight HTTP Methods - What do they mean?
▪ GET Retrieve data from server
▪ POST Send data to server to create or update a resource
▪ DELETE Delete an existing resource
▪ PATCH Apply partial modifications to a resource
▪ PUT Overwrite/Replace an existing resource
▪ OPTIONS Preflight Request - What operations are available?
HEAD Retrieve data from server (Headers Only)
▪ TRACE Message loop-back for debugging
8
Two new PUT Operations
▪ Replace a Complete Entity
PUT {{orion}}/ngsi-ld/v1/entities/<entity-id>
▪ Overwrite an Entire Attribute
PUT {{orion}}/ngsi-ld/v1/entities/<entity-id>/attrs/<attr-id>
▪ Supports normalized and concise payloads
▪ Pedantically Orion-LD "misuses" this HTTP verb as the operation is not
completely idempotent - the modifiedAt system attribute is still updated whenever
a PUT occurs
▪ Batch Operation Equivalent:
POST {{any-broker}}/ngsi-ld/v1/entityOperations/update?options=overwrite
9
One new PATCH Endpoint
▪ Merge an Entity
PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>
▪ Merge Patch rather than existing Partial Update Patch
▪ Supports normalized, concise and key-values payloads
PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?options=keyValues
▪ Supports the update of a common observedAt Property-of-a-Property
PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?observedAt=XXX-XXX
▪ Supports payloads including Language Maps as a Property
PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?lang=fr
10
PATCH Endpoints
● Partial Update Operations
● Merge Operations
11
Original Entity
Result: Updated Entity
Partial Update of an Entity
PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs
Normalized Payload:
▪ value updated to 100
▪ observedAt updated
▪ unitCode removed
▪ Other Attributes unchanged
temperature attribute replaced with payload
contents
12
{
"id": "urn:ngsi-ld:Sensor:001",
"type": "TemperatureSensor",
"temperature": {
"type" : "Property",
"value" : 25,
"unitCode": "CEL"
"observedAt": "2022-01-01"
}
}
{
"id": "urn:ngsi-ld:Sensor:001",
"type": "TemperatureSensor",
"temperature": {
"type" : "Property",
"value" : 100,
"observedAt": "2022-03-14"
}
}
{
"temperature": {
"type" : "Property",
"value" : 100,
"observedAt": "2022-03-14"
}
}
Original Entity
Result: Updated Entity
Partial Update of an Attribute
PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs/temperature
Normalized Payload:
▪ value updated to 100
▪ observedAt updated
▪ unitCode not removed
▪ Other Attributes unchanged
temperature sub-attribute replaced with
payload contents
13
{
"id": "urn:ngsi-ld:Sensor:001",
"type": "TemperatureSensor",
"temperature": {
"type" : "Property",
"value" : 25,
"unitCode": "CEL”,
"observedAt": "2022-01-01"
}
}
{
"id": "urn:ngsi-ld:Sensor:001",
"type": "TemperatureSensor",
"temperature": {
"type" : "Property",
"value" : 100,
"unitCode": "CEL"
"observedAt": "2022-03-14"
}
}
{
"type" : "Property",
"value" : 100,
"observedAt": "2022-03-14"
}
Original Entity
Result: Merged Entity
🆕 Merge of an Entity (1) - Normalized Payload Support
PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>
Normalized Payload:
▪ value updated to 100
▪ observedAt not removed
▪ unitCode not removed
▪ Other Attributes unchanged
Values from the payload contents merged with
existing entity. Unchanged data does not need to
be supplied
14
{
"id": "urn:ngsi-ld:Sensor:001",
"type": "TemperatureSensor",
"temperature": {
"type" : "Property",
"value" : 25,
"unitCode": "CEL”,
"observedAt": "2022-01-01"
}
}
{
"id": "urn:ngsi-ld:Sensor:001",
"type": "TemperatureSensor",
"temperature": {
"type" : "Property",
"value" : 100,
"unitCode": "CEL”,
"observedAt": "2022-01-01”
}
}
{
"temperature": {
"type" : "Property",
"value" : 100,
}
}
Normalized Payload
Concise Property Payload
Merge of an Entity (2) - Concise Payload Support
PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>
Super Concise Property
▪ value updated to 100
▪ observedAt not removed
▪ Other sub-attributes (e.g. unitCode)
not removed
▪ Other Attributes unchanged
Values from the payload contents merged with
existing entity.
15
{
"temperature": {
"type" : "Property",
"value" : 100,
}
}
{
"temperature": {
"value" : 100,
}
}
{
"temperature" 100
}
Merge means unchanged data no longer needs to be supplied
Key-Values Payload (Lossy)
Merge of an Entity (3) - Key-Values Payload Support
PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?options=keyValues
Result
▪ name - Property type is maintained. value updated
▪ spouse - Relationship type is maintained. object updated
▪ Other attributes (e.g. born) remain unchanged
▪ All sub-attributes remain unchanged
Values from the payload contents intelligently merged with existing entity.
16
{
"name": "John Ono Lennon",
"spouse": "http://dbpedia.org/resource/Yoko_Ono"
}
Indicates a lossy payload where only values have been supplied
Normalized as Map (Lossless)
Normalized as Property (Lossy?)
Merge of an Entity (4) - Key-Values and LanguageMap Support
PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?options=keyValues&lang=en
Key-Values as Property (Lossy)
Result:
▪ en key of the languageMap updated to "Istanbul"
LanguageMaps have a dual identity as both a
JSON Object and a simple String. Supply a default
lang to indicate a default language to use in a
merge operation if necessary.
17
{
"name": {
"type": "LanguageProperty",
"languageMap": {
"el": "Κωνσταντινούπολις",
"en": "Constantinople",
"tr": "İstanbul"
}
}
}
{
"name": "Istanbul"
}
{
"name": {
"type": "Property",
"value": "Constantinople",
"lang": "en"
}
}
Normalized Payload
Concise Property Payload
Merge of an Entity (5) - Timestamp support
PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?observedAt=XX-XX-XX
Super Concise Property
▪ value updated to 100
▪ observedAt updated (only where present)
▪ Other sub-attributes (e.g. unitCode)
not removed
▪ Other Attributes unchanged
Values from the payload contents merged with
existing entity.
18
{
"temperature": {
"type" : "Property",
"value" : 100,
}
}
{
"temperature": {
"value" : 100,
}
}
{
"temperature": 100
}
common updated ßobservedAt available for attributes
JSON literal null and PATCH Endpoints.
{"@type":"@json" "@value": null}
19
JSON-LD does not support direct use of null
Invalid JSON-LD
20
JSON-LD 1.1 Specification - § 4.2.2. JSON Literals
Generally, when a JSON-LD processor encounters null, the associated entry or value
is removed. However, null is a valid JSON token; when used as the value of a JSON
literal, a null value will be preserved.
{
"temperature": {
"type" : "Property",
"value" : 100,
"precision": null
}
}
NGSI-LD states PATCH uses null to indicate deletion
▪ Always encode null as a JSON literal
▪ null is useable to delete attributes on PATCH endpoints only:
• Partial Update
• Merge
Valid NGSI-LD
▪ Attempting to set any type, value or object directly to an encoded JSON
literal null results in a 400 Bad Request
21
{
"temperature": {
"type" : "Property",
"value" : 100,
"precision": {"@type":"@json" "@value": null}
}
}
Thank you!
http://fiware.org
Follow @FIWARE on Twitter

More Related Content

Similar to NGSI-LD Concise Payloads and Merge-Patch Operations

Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Fermin Galan
 
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214Fermin Galan
 
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Fermin Galan
 
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Fermin Galan
 
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 -  NGSI-LD Advanced Operations | Train the Trainers ProgramSession 5 -  NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 - NGSI-LD Advanced Operations | Train the Trainers ProgramFIWARE
 
NGSIv2 Overview for Developers That Already Know NGSIv1 20180716
NGSIv2 Overview for Developers That Already Know NGSIv1 20180716NGSIv2 Overview for Developers That Already Know NGSIv1 20180716
NGSIv2 Overview for Developers That Already Know NGSIv1 20180716Fermin Galan
 
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...Fermin Galan
 
FIWARE Training: NGSI-LD Advanced Operations
FIWARE Training: NGSI-LD Advanced OperationsFIWARE Training: NGSI-LD Advanced Operations
FIWARE Training: NGSI-LD Advanced OperationsFIWARE
 
NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1Fermin Galan
 
FIWARE Training: NGSI-LD Introduction
FIWARE Training: NGSI-LD IntroductionFIWARE Training: NGSI-LD Introduction
FIWARE Training: NGSI-LD IntroductionFIWARE
 
NGSI-LD Introduction
NGSI-LD IntroductionNGSI-LD Introduction
NGSI-LD IntroductionFIWARE
 
NGSIv2 Overview for Developers that Already Know NGSIv1
NGSIv2 Overview for Developers that Already Know NGSIv1NGSIv2 Overview for Developers that Already Know NGSIv1
NGSIv2 Overview for Developers that Already Know NGSIv1FIWARE
 
NGSI-LD IoT Agents
NGSI-LD IoT AgentsNGSI-LD IoT Agents
NGSI-LD IoT AgentsFIWARE
 
NGSI-LD Advanced Operations
NGSI-LD Advanced OperationsNGSI-LD Advanced Operations
NGSI-LD Advanced OperationsFIWARE
 
FIWARE Global Summit - FIWARE Context Information Management
FIWARE Global Summit - FIWARE Context Information ManagementFIWARE Global Summit - FIWARE Context Information Management
FIWARE Global Summit - FIWARE Context Information ManagementFIWARE
 
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...Lucas Jellema
 

Similar to NGSI-LD Concise Payloads and Merge-Patch Operations (20)

Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
 
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
 
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
 
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
 
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 -  NGSI-LD Advanced Operations | Train the Trainers ProgramSession 5 -  NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
 
NGSIv2 Overview for Developers That Already Know NGSIv1 20180716
NGSIv2 Overview for Developers That Already Know NGSIv1 20180716NGSIv2 Overview for Developers That Already Know NGSIv1 20180716
NGSIv2 Overview for Developers That Already Know NGSIv1 20180716
 
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
 
FIWARE Training: NGSI-LD Advanced Operations
FIWARE Training: NGSI-LD Advanced OperationsFIWARE Training: NGSI-LD Advanced Operations
FIWARE Training: NGSI-LD Advanced Operations
 
NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1
 
FIWARE Training: NGSI-LD Introduction
FIWARE Training: NGSI-LD IntroductionFIWARE Training: NGSI-LD Introduction
FIWARE Training: NGSI-LD Introduction
 
NGSI-LD Introduction
NGSI-LD IntroductionNGSI-LD Introduction
NGSI-LD Introduction
 
NGSIv2 Overview for Developers that Already Know NGSIv1
NGSIv2 Overview for Developers that Already Know NGSIv1NGSIv2 Overview for Developers that Already Know NGSIv1
NGSIv2 Overview for Developers that Already Know NGSIv1
 
NGSI-LD IoT Agents
NGSI-LD IoT AgentsNGSI-LD IoT Agents
NGSI-LD IoT Agents
 
NGSI-LD Advanced Operations
NGSI-LD Advanced OperationsNGSI-LD Advanced Operations
NGSI-LD Advanced Operations
 
FIWARE Global Summit - FIWARE Context Information Management
FIWARE Global Summit - FIWARE Context Information ManagementFIWARE Global Summit - FIWARE Context Information Management
FIWARE Global Summit - FIWARE Context Information Management
 
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
Singpore Oracle Sessions III - What is truly useful in Oracle Database 12c fo...
 
Core Context Management
Core Context ManagementCore Context Management
Core Context Management
 

More from FIWARE

Behm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxFIWARE
 
Katharina Hogrebe Herne Digital Days.pdf
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdfFIWARE
 
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxChristoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxFIWARE
 
Behm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxFIWARE
 
Evangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxFIWARE
 
Lukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxLukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxFIWARE
 
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxPierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxFIWARE
 
Dennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptxDennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptxFIWARE
 
Ulrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxUlrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxFIWARE
 
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxAleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxFIWARE
 
Water Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfWater Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfFIWARE
 
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxCameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxFIWARE
 
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptxFiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptxFIWARE
 
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxBoris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxFIWARE
 
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....FIWARE
 
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfAbdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfFIWARE
 
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFIWARE
 
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptxHTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptxFIWARE
 
WE_LoRaWAN _ IoT.pptx
WE_LoRaWAN  _ IoT.pptxWE_LoRaWAN  _ IoT.pptx
WE_LoRaWAN _ IoT.pptxFIWARE
 
EU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptxEU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptxFIWARE
 

More from FIWARE (20)

Behm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptx
 
Katharina Hogrebe Herne Digital Days.pdf
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdf
 
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxChristoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
 
Behm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptx
 
Evangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptx
 
Lukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxLukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptx
 
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxPierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
 
Dennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptxDennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptx
 
Ulrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxUlrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptx
 
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxAleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
 
Water Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfWater Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdf
 
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxCameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
 
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptxFiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
 
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxBoris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
 
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
 
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfAbdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
 
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
 
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptxHTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
 
WE_LoRaWAN _ IoT.pptx
WE_LoRaWAN  _ IoT.pptxWE_LoRaWAN  _ IoT.pptx
WE_LoRaWAN _ IoT.pptx
 
EU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptxEU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptx
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

NGSI-LD Concise Payloads and Merge-Patch Operations

  • 1. NGSI-LD Concise Payloads and Merge- Patch Operations Advanced and Experimental Features in Orion LD Jason Fox, Technical Evangelist, FIWARE Foundation
  • 2. 1 Concise Format supported by Orion-LD Potentially NGSI-LD 1.6.1 ▪ Want to increase uptake of NGSI-LD by lowering barriers to entry for new developers ▪ Remove the misconception that NGSI-LD is just "JSON-LD with type attributes" ▪ Remove redundancy in payloads, to make it easier to for users to update and consume context data. But any new payloads must still be: ▪ JSON-LD documents. ▪ Compatible with existing formats. ▪ Suitable for CRUD ▪ Lossless ▪ Try to get some mechanism for a simple value update like the NGSI-v2's update value endpoint legitimately supported
  • 3. Normalized Property Concise Property Concise Property Format Input and Output format. Potentially NGSI-LD 1.6.1 Super Concise Property ▪ type is optional ▪ value is optional (if no sub-attributes present) The concise format is shorter than normalized but unlike key-values it is still lossless. 2 { "temperature": { "type" : "Property", "value" : 100, } } { "temperature": { "value" : 100, } } { "temperature": 100 }
  • 4. Normalized GeoProperty Concise GeoProperty Concise GeoProperty format Input and Output format. Potentially NGSI-LD 1.6.1 Super Concise GeoProperty ▪ type is optional ▪ value is optional (if no sub-attributes present) ▪ GeoProperty is inferred if the type is a supported GeoJSON type. 3 { "location": { "type" : "GeoProperty", "value" : { "type": "Point", "coordinates": [-73.97, 40.77] } } } { "location": { "value" : { "type": "Point", "coordinates": [-73.97, 40.77] } } } { "location": { "type": "Point", "coordinates": [-73.97, 40.77] } }
  • 5. Normalized Relationship Concise Relationship Concise Relationship format Input and Output format. Potentially NGSI-LD 1.6.1 ▪ type is optional ▪ object is mandatory . 4 { "providedBy": { "type" : "Relationship", "object" : "urn:ngsi-ld:Entity:001" } } { "providedBy": { "object" : "urn:ngsi-ld:Entity:001" } }
  • 6. Concise LanguageProperty (as Map) Concise LanguageProperty (as Property) Normalized LanguageProperty Concise LanguageProperty format Input and Output format. Potentially NGSI-LD 1.6.1 ▪ type is optional ▪ languageMap is mandatory . 5 { "name": { "type": "LanguageProperty", "languageMap": { "el": "Κωνσταντινούπολις", "en": "Constantinople", "tr": "İstanbul" } } } { "name": { "languageMap": { "el": "Κωνσταντινούπολις", "en": "Constantinople", "tr": "İstanbul" } } } { "name": { "value": "Constantinople", "lang": "en" } }
  • 7. Orion-LD supports Concise Format for all /entities endpoints Potentially all brokers by NGSI-LD 1.6.1 ▪ GET {{orion-ld}}/ngsi-ld/v1/entities/?options=concise ▪ POST .{{orion-ld}}/ngsi-ld/v1/entities/ ▪ GET {{orion-ld}/ngsi-ld/v1/entities/<entity-id>?options=concise ▪ POST PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs ▪ PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs/<attr-id> ▪ Plus all relevant Batch Operation endpoints: POST .{{orion-ld}}/ngsi-ld/v1/entityOperations/xxx 6
  • 9. Eight HTTP Methods - What do they mean? ▪ GET Retrieve data from server ▪ POST Send data to server to create or update a resource ▪ DELETE Delete an existing resource ▪ PATCH Apply partial modifications to a resource ▪ PUT Overwrite/Replace an existing resource ▪ OPTIONS Preflight Request - What operations are available? HEAD Retrieve data from server (Headers Only) ▪ TRACE Message loop-back for debugging 8
  • 10. Two new PUT Operations ▪ Replace a Complete Entity PUT {{orion}}/ngsi-ld/v1/entities/<entity-id> ▪ Overwrite an Entire Attribute PUT {{orion}}/ngsi-ld/v1/entities/<entity-id>/attrs/<attr-id> ▪ Supports normalized and concise payloads ▪ Pedantically Orion-LD "misuses" this HTTP verb as the operation is not completely idempotent - the modifiedAt system attribute is still updated whenever a PUT occurs ▪ Batch Operation Equivalent: POST {{any-broker}}/ngsi-ld/v1/entityOperations/update?options=overwrite 9
  • 11. One new PATCH Endpoint ▪ Merge an Entity PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id> ▪ Merge Patch rather than existing Partial Update Patch ▪ Supports normalized, concise and key-values payloads PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?options=keyValues ▪ Supports the update of a common observedAt Property-of-a-Property PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?observedAt=XXX-XXX ▪ Supports payloads including Language Maps as a Property PATCH {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?lang=fr 10
  • 12. PATCH Endpoints ● Partial Update Operations ● Merge Operations 11
  • 13. Original Entity Result: Updated Entity Partial Update of an Entity PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs Normalized Payload: ▪ value updated to 100 ▪ observedAt updated ▪ unitCode removed ▪ Other Attributes unchanged temperature attribute replaced with payload contents 12 { "id": "urn:ngsi-ld:Sensor:001", "type": "TemperatureSensor", "temperature": { "type" : "Property", "value" : 25, "unitCode": "CEL" "observedAt": "2022-01-01" } } { "id": "urn:ngsi-ld:Sensor:001", "type": "TemperatureSensor", "temperature": { "type" : "Property", "value" : 100, "observedAt": "2022-03-14" } } { "temperature": { "type" : "Property", "value" : 100, "observedAt": "2022-03-14" } }
  • 14. Original Entity Result: Updated Entity Partial Update of an Attribute PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>/attrs/temperature Normalized Payload: ▪ value updated to 100 ▪ observedAt updated ▪ unitCode not removed ▪ Other Attributes unchanged temperature sub-attribute replaced with payload contents 13 { "id": "urn:ngsi-ld:Sensor:001", "type": "TemperatureSensor", "temperature": { "type" : "Property", "value" : 25, "unitCode": "CEL”, "observedAt": "2022-01-01" } } { "id": "urn:ngsi-ld:Sensor:001", "type": "TemperatureSensor", "temperature": { "type" : "Property", "value" : 100, "unitCode": "CEL" "observedAt": "2022-03-14" } } { "type" : "Property", "value" : 100, "observedAt": "2022-03-14" }
  • 15. Original Entity Result: Merged Entity 🆕 Merge of an Entity (1) - Normalized Payload Support PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id> Normalized Payload: ▪ value updated to 100 ▪ observedAt not removed ▪ unitCode not removed ▪ Other Attributes unchanged Values from the payload contents merged with existing entity. Unchanged data does not need to be supplied 14 { "id": "urn:ngsi-ld:Sensor:001", "type": "TemperatureSensor", "temperature": { "type" : "Property", "value" : 25, "unitCode": "CEL”, "observedAt": "2022-01-01" } } { "id": "urn:ngsi-ld:Sensor:001", "type": "TemperatureSensor", "temperature": { "type" : "Property", "value" : 100, "unitCode": "CEL”, "observedAt": "2022-01-01” } } { "temperature": { "type" : "Property", "value" : 100, } }
  • 16. Normalized Payload Concise Property Payload Merge of an Entity (2) - Concise Payload Support PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id> Super Concise Property ▪ value updated to 100 ▪ observedAt not removed ▪ Other sub-attributes (e.g. unitCode) not removed ▪ Other Attributes unchanged Values from the payload contents merged with existing entity. 15 { "temperature": { "type" : "Property", "value" : 100, } } { "temperature": { "value" : 100, } } { "temperature" 100 } Merge means unchanged data no longer needs to be supplied
  • 17. Key-Values Payload (Lossy) Merge of an Entity (3) - Key-Values Payload Support PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?options=keyValues Result ▪ name - Property type is maintained. value updated ▪ spouse - Relationship type is maintained. object updated ▪ Other attributes (e.g. born) remain unchanged ▪ All sub-attributes remain unchanged Values from the payload contents intelligently merged with existing entity. 16 { "name": "John Ono Lennon", "spouse": "http://dbpedia.org/resource/Yoko_Ono" } Indicates a lossy payload where only values have been supplied
  • 18. Normalized as Map (Lossless) Normalized as Property (Lossy?) Merge of an Entity (4) - Key-Values and LanguageMap Support PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?options=keyValues&lang=en Key-Values as Property (Lossy) Result: ▪ en key of the languageMap updated to "Istanbul" LanguageMaps have a dual identity as both a JSON Object and a simple String. Supply a default lang to indicate a default language to use in a merge operation if necessary. 17 { "name": { "type": "LanguageProperty", "languageMap": { "el": "Κωνσταντινούπολις", "en": "Constantinople", "tr": "İstanbul" } } } { "name": "Istanbul" } { "name": { "type": "Property", "value": "Constantinople", "lang": "en" } }
  • 19. Normalized Payload Concise Property Payload Merge of an Entity (5) - Timestamp support PATCH . {{orion-ld}}/ngsi-ld/v1/entities/<entity-id>?observedAt=XX-XX-XX Super Concise Property ▪ value updated to 100 ▪ observedAt updated (only where present) ▪ Other sub-attributes (e.g. unitCode) not removed ▪ Other Attributes unchanged Values from the payload contents merged with existing entity. 18 { "temperature": { "type" : "Property", "value" : 100, } } { "temperature": { "value" : 100, } } { "temperature": 100 } common updated ßobservedAt available for attributes
  • 20. JSON literal null and PATCH Endpoints. {"@type":"@json" "@value": null} 19
  • 21. JSON-LD does not support direct use of null Invalid JSON-LD 20 JSON-LD 1.1 Specification - § 4.2.2. JSON Literals Generally, when a JSON-LD processor encounters null, the associated entry or value is removed. However, null is a valid JSON token; when used as the value of a JSON literal, a null value will be preserved. { "temperature": { "type" : "Property", "value" : 100, "precision": null } }
  • 22. NGSI-LD states PATCH uses null to indicate deletion ▪ Always encode null as a JSON literal ▪ null is useable to delete attributes on PATCH endpoints only: • Partial Update • Merge Valid NGSI-LD ▪ Attempting to set any type, value or object directly to an encoded JSON literal null results in a 400 Bad Request 21 { "temperature": { "type" : "Property", "value" : 100, "precision": {"@type":"@json" "@value": null} } }