SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Scale Up for a Real Smart Future
Berlin, Germany
23-24 October, 2019
NGSI-LD: Hands On
Jason Fox, Senior Technical Evangelist,
FIWARE Foundation
Linked Data: JSON to JSON-LD
From: https://json-ld.org/
▪ JSON-LD is a lightweight Linked Data format. It is easy for humans to read and write. It is
based on the already successful JSON format and provides a way to help JSON data
interoperate at Web-scale.
▪ Linked Data empowers people that publish and use information on the Web. It is a way to
create a network of standards-based, machine-readable data across Web sites. It allows an
application to start at one piece of Linked Data, and follow embedded links to other pieces of
Linked Data that are hosted on different sites across the Web.
1
{
"@context": "https://json-ld.org/contexts/person.jsonld",
"@id": "http://dbpedia.org/resource/John_Lennon",
"name": "John Lennon",
"born": "1940-10-09",
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}
Linked Data: NGSI v2 to NGSI-LD
From: https://fiware-datamodels.readthedocs.io/en/latest/ngsi-ld_faq/index.html
▪ NGSI-LD is an evolution of the FIWARE NGSI v2 information model, and has been updated/improved to
support linked data (entity relationships), property graphs and semantics (exploiting the capabilities
offered by JSON-LD). This work has been conducted under the ETSI ISG Context Information
Management initiative.
▪ Creating proper machine-readable Linked Data is fundamental to NGSI-LD.
▪ NGSI-LD Payloads are valid JSON-LD
2
{
"@context": [
"https://fiware.github.io/data-models/context.jsonld",
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
],
"id": "http://dbpedia.org/resource/John_Lennon",
"type": "Person",
"name": {"type": "Property", "value": "John Lennon"},
"born": {"type": "Property", "value": "1940-10-09"},
"spouse": {"type": "Relationship", "object": "http://dbpedia.org/resource/Cynthia_Lennon" }
}
NGSI-LD: Evolution not Revolution
NGSI v2
▪ Well defined REST API for context data
using JSON payloads.
GET, POST and other HTTP verbs do
the things you expect
▪ CRUD operations -
/v2/entities endpoint
▪ Augment your context data -
/v2/registrations endpoint
▪ Push context data to other services -
/v2/subscriptions endpoint
3
NGSI-LD
▪ Well defined REST API for context data
using JSON and JSON-LD payloads.
GET, POST and other HTTP verbs do the
things you expect
▪ CRUD operations - /ngsi-
ld/v1/entities endpoint
▪ Augment your context data - /ngsi-
ld/v1/registrations endpoint
▪ Push context data to other services - /ngsi-
ld/v1/subscriptions endpoint
4
Demo: NGSI-LD - Properties
NGSI-LD Properties: Creating an Entity
NGSI v2
5
NGSI-LD
curl -iX POST 'http://localhost:1026/v2/entities' 
-H 'Content-Type: application/json' 
-d '{
"type": "Store", "id": "store001",
"category": { "type": "Array", "value": ["commercial"]},
"address": { "type": "PostalAddress", "value": {
"streetAddress": "Bornholmer Straße 65",
"addressRegion": "Berlin",
"addressLocality": "Prenzlauer Berg",
"postalCode": "10439"
},
"metadata": {
"verified": { "type": "Boolean","value": true}
}
},
"location": {"type": "geo:json",
"value": {"type": "Point", "coordinates": [13.3986, 52.5547]}
},
"name": {"type": "Text", "value": "Bösebrücke Einkauf"}
}'
curl -iX POST http://localhost:1026/ngsi-ld/v1/entities 
-H 'Content-Type: application/ld+json' 
-d '{
"type": "Building", "id": "urn:ngsi-ld:Building:store001",
"category": { "type": "Property", "value": ["commercial"]},
"address": { "type": "Property"," value": {
"streetAddress": "Bornholmer Straße 65",
"addressRegion": "Berlin",
"addressLocality": "Prenzlauer Berg",
"postalCode": "10439"
},
"verified": { "type": "Property", "value": true }
},
"location": { "type": "GeoProperty",
"value": { "type": "Point", "coordinates": [13.3986, 52.5547]}
},
"name": { "type": "Property", "value": "Bösebrücke Einkauf" },
"@context": [
"https://fiware.github.io/data-models/context.jsonld",
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
]
}'
NGSI-LD Properties: Creating an Entity
NGSI v2
6
NGSI-LD
curl -iX POST 'http://localhost:1026/v2/entities' 
-H 'Content-Type: application/json' 
-d '{
"type": "Store", "id": "store001",
"category": { "type": "Array", "value": ["commercial"]},
"address": { "type": "PostalAddress", "value": {
"streetAddress": "Bornholmer Straße 65",
"addressRegion": "Berlin",
"addressLocality": "Prenzlauer Berg",
"postalCode": "10439"
},
"metadata": {
"verified": { "type": "Boolean","value": true}
}
},
"location": {"type": "geo:json",
"value": {"type": "Point", "coordinates": [13.3986, 52.5547]}
},
"name": {"type": "Text", "value": "Bösebrücke Einkauf"}
}'
curl -iX POST http://localhost:1026/ngsi-ld/v1/entities 
-H 'Content-Type: application/ld+json' 
-d '{
"type": "Building", "id": "urn:ngsi-ld:Building:store001",
"category": { "type": "Property", "value": ["commercial"]},
"address": { "type": "Property"," value": {
"streetAddress": "Bornholmer Straße 65",
"addressRegion": "Berlin",
"addressLocality": "Prenzlauer Berg",
"postalCode": "10439"
},
"verified": { "type": "Property", "value": true }
},
"location": { "type": "GeoProperty",
"value": { "type": "Point", "coordinates": [13.3986, 52.5547]}
},
"name": { "type": "Property", "value": "Bösebrücke Einkauf" },
"@context": [
"https://fiware.github.io/data-models/context.jsonld",
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
]
}'
NGSI-LD Properties: Data Model
NGSI v2
▪ Entities
▪ Attributes
▪ MetaData
7
NGSI-LD
▪ Entities
▪ Properties
▪ Relationships
▪ Values
plus …
plus …
etc...
The NGSI LD data model is more
complex; the definitions of use are
more rigid which lead to a
navigable knowledge graph.
▪ Properties of Properties
▪ Properties of Relationships
▪ Relationships of Properties
▪ Relationships of Relationships
. ▪ Properties of Properties of Properties
▪ Relationships of Properties of Properties
▪ Properties of Properties of Relationships
▪ Relationships of Properties of Relationships
▪ Properties of Relationships of Properties
▪ Relationships of Relationships of Properties
▪ Properties of Relationships of Relationships
▪ Relationships of Relationships of Relationships
NGSI-LD Properties: Data Model
8
The Entity Example Notes
Has an id urn:ngsi-ld:Building:store001 URI/URN. id must be unique.
Has a type. https://uri.fiware.org/ns/
data-models#Building
● Fully qualified URI of a well defined data model
● Short-hand strings for types, mapped to fully qualified URIs through the JSON-LD
@context.
Has a series of properties name, address, category etc. This can be expanded into http://schema.org/address, which is
known as a fully qualified name (FQN).
Has a series of
properties-of-properties
a verified field for the address This is the equivalent of NGSI v2 metadata
Has a series of relationships managedBy The object corresponds to the URI/URN of another data entity.
Equivalent of NGSI v2 refXXX
Has a series of
properties-of-relationships
managedBy.since Holds additional information about a relationship.
This is the equivalent of metadata about a refXXX property
Has a series of
relationships-of-relationships
managedBy.subordinateTo holds the URI/URN of another relationship.
NGSI-LD Properties: Reading Entity Data
NGSI-LD
▪ Response is just a JSON payload plus an @context
▪ @context can be passed either in the Link header
or the payload body:
▪ Accept: application/ld+json to include
the @context as a JSON attribute
▪ Accept: application/json returns plain old
JSON objects - @context is passed as a Link header
▪ Just a minute what has happened to category?
9
curl -G -X GET 
'http://localhost:1026/ngsi-ld/v1/entities' 
-H 'Link: <https://fiware.github.io/data-models/context.jsonld>;
rel="http://www.w3.org/ns/json-ld#context";
type="application/ld+json"' 
-H 'Accept: application/ld+json' 
-d 'type=Building' 
-d 'options=keyValues'
[
{
"@context": "https://fiware.github.io/data-models/context.jsonld",
"id": "urn:ngsi-ld:Building:store001", "type": "Building",
"address": {
"streetAddress": "Bornholmer Straße 65",
"addressRegion": "Berlin",
"addressLocality": "Prenzlauer Berg",
"postalCode": "10439"
},
"name": "Bösebrücke Einkauf",
"category": [
"https://uri.fiware.org/ns/data-models#commercial"
],
"location": {
"type": "Point", "coordinates": [13.3986, 52.5547]
}
}
]
NGSI-LD Properties: What to call a location?
▪ location
▪ locatedAt
▪ geocoordinate
▪ geocoordinates
▪ place
▪ ubicación
▪ standort
▪ 置き場所
10
With NGSI-LD core @context a location is always
https://uri.etsi.org/ngsi-ld/location
NGSI-LD core @context
"@context": {
"ngsi-ld": "https://uri.etsi.org/ngsi-ld/",
"id": "@id",
"type": "@type",
"value": "https://uri.etsi.org/ngsi-ld/hasValue",
"object": {
"@id": "https://uri.etsi.org/ngsi-ld/hasObject",
"@type": "@id"
},
"Property": "https://uri.etsi.org/ngsi-ld/Property"
"Relationship": "https://uri.etsi.org/ngsi-ld/Relationship",
... etc.
"unitCode": "https://uri.etsi.org/ngsi-ld/unitCode",
"location": "https://uri.etsi.org/ngsi-ld/location",
... etc.
}
NGSI-LD Properties: @vocab and Enumerated Values
▪ An “address” is:
https://schema.org/address
▪ A “category” is:
https://uri.fiware.org/ns/data-models#category
▪ A category is an enum which takes a
set of values such as:
https://uri.fiware.org/ns/data-models#commercial
https://uri.fiware.org/ns/data-models#office
https://uri.fiware.org/ns/data-models#retail
https://uri.fiware.org/ns/data-models#residential
11
FIWARE Data Models @context
"@context": {
"type": "@type",
"id": "@id",
"schema": "https://schema.org/",
"fiware": "https://uri.fiware.org/ns/data-models#",
... etc.
"address": "schema:address",
"category": {
"@id" :"fiware:category",
"@type": "@vocab"
},
"commercial": "fiware:commercial",
"office": "fiware:office",
"retail": "fiware:retail",
"residential": "fiware:residential",
... etc.
}
With NGSI-LD Data Models, attributes and enums are well-defined in a computer-readable fashion
NGSI-LD Relationships: Traversing Edge Nodes
From: https://www.w3.org/TR/json-ld/#dfn-graph
A JSON-LD document serializes a dataset which is a collection of graphs
A graph is a labeled directed graph, i.e., a set of nodes connected by edges.
In NGSI-LD:
▪ Node = NGSI Entity
▪ Edge = A relationship attribute linking two NGSI Entities
Therefore NGSI Linked Data relies on three separate definitions:
1. A definition that a particular attribute within an NGSI entity really represents a link
2. A machine readable definition of that link in the Data Model (i.e. the @context)
3. A machine readable definition of the set of all types of links available (the @graph)
12
Creating proper machine-readable Linked Data is fundamental to NGSI-LD.
NGSI-LD Relationships: 1. Creating Entities
Relationship Links within an NGSI Entity are formally defined using:
"type": "Relationship" OR "@type": "https://uri.etsi.org/ngsi-ld/Relationship"
The attribute of the linked entity is an object rather than a value
13
curl -X POST 
http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001/attrs 
-H 'Content-Type: application/ld+json' 
-H 'fiware-servicepath: /' 
-d '{
"stocks": { "type": "Relationship","object": "urn:ngsi-ld:Product:001"},
"numberOfItems": {"type": "Property","value": 50},
"locatedIn" : {
"type": "Relationship", "object": "urn:ngsi-ld:Building:store001",
"requestedBy": {"type": "Relationship","object": "urn:ngsi-ld:Person:bob-the-manager"},
"installedBy": {"type": "Relationship","object": "urn:ngsi-ld:Person:employee001"},
"statusOfWork": {"type": "Property","value": "completed"}
},
"@context": "https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld"
}'
NGSI-LD Relationships: 2. Machine Readable Data Models
Relationship links within the @context are formally defined using: "@type": "@id"
14
FIWARE Data Models @context
"@context": {
"tutorial": "https://fiware.github.io/tutorials.Step-by-Step/schema/",
"Product": "tutorial:Product",
"Shelf": "tutorial:Shelf",
...etc
"installedBy": {
"@id": "tutorial:installedBy",
"@type": "@id"
},
"requestedBy": {
"@id": "tutorial:requestedBy",
"@type": "@id"
},
...etc
NGSI-LD Relationships: 3. Machine Readable Links
15
FIWARE Data Models @graph
"@graph": [
{
"@id": "tutorial:Product",
"@type": "rdfs:Class",
"rdfs:comment": [
{"@language": "en", "@value": "Product is sold in a Store."},
{"@language": "ja", "@value": "製品はストアで販売されている物"}],
"rdfs:label": [{"@language": "en", "@value": "Product"}, {"@language": "ja", "@value": "製品"}],
"rdfs:subClassOf": {"@id": "http://schema.org/Thing"}
},
… etc
{
"@id": "tutorial:requestedBy",
"@type": "https://uri.etsi.org/ngsi-ld/Relationship",
"schema:domainIncludes": [{"@id": "tutorial:Shelf"}, {"@id": "tutorial:StockOrder"}],
"schema:rangeIncludes": [{"@id": "schema:Person"}],
"rdfs:comment": [
{"@language": "en","@value": "Object requested by person."},
{"@language": "ja","@value": "人が要求したオブジェクト"}],
"rdfs:label": [{"@language": "en", "@value": "requested by"},{"@language": "ja", "@value": "要求者"}]
},
]
16
Demo: NGSI-LD - Relationships
17
Context Data as Linked Data - How does it help?
Linking Disparate Data
Sources
▪ Which crimes in which area are
not related to Jack?
▪ Does Jack only deal in
Cannabis?
▪ How is Jack related to
Raymond?
▪ Which other police officers
should Inspector Devy contact?
18
Context Data as Linked Data - How does it help?
Rich Text Snippets
Standard schema.org/Product data model
marked up as JSON-LD on the web. Interpreted by
third parties. Search Engine can display product
rating on screen. System “knows” if a product is out
of stock.
NGSI-LD Supermarket Tutorial
Third party ARV could “know” when a shelf needs filling and
retrieve goods from the warehouse
No need to reprogram for new customers if data follows the
fiware.org/ns/data-models, or the JSON-LD can be
converted to do so.
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
18

Contenu connexe

Tendances

Tendances (20)

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...
 
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 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramSession 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
 
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
 
FIWARE Global Summit - NGSI-LD - NGSI with Linked Data
FIWARE Global Summit - NGSI-LD - NGSI with Linked DataFIWARE Global Summit - NGSI-LD - NGSI with Linked Data
FIWARE Global Summit - NGSI-LD - NGSI with Linked Data
 
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
 
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...
 
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
 
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
 
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-...
 
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
 
NGSIv2 Overview for Developers That Already Know NGSIv1 20181218
NGSIv2 Overview for Developers That Already Know NGSIv1 20181218NGSIv2 Overview for Developers That Already Know NGSIv1 20181218
NGSIv2 Overview for Developers That Already Know NGSIv1 20181218
 
Orion Context Broker 1.15.0
Orion Context Broker 1.15.0Orion Context Broker 1.15.0
Orion Context Broker 1.15.0
 
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep DiveMongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
 
FIWARE Global Summit - Lessons from Building FIWARE Environment with IoT Agent
FIWARE Global Summit - Lessons from Building FIWARE Environment with IoT AgentFIWARE Global Summit - Lessons from Building FIWARE Environment with IoT Agent
FIWARE Global Summit - Lessons from Building FIWARE Environment with IoT Agent
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
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 ...
 
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 ...
 
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDBMongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
 

Similaire à FIWARE Global Summit - Hands-On NGSI-LD

FIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LDFIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LD
FIWARE
 
MVP Cloud OS Week Track 1 9 Sept: Data liberty
MVP Cloud OS Week Track 1 9 Sept: Data libertyMVP Cloud OS Week Track 1 9 Sept: Data liberty
MVP Cloud OS Week Track 1 9 Sept: Data liberty
csmyth501
 
FIWARE Training: IoT and Legacy
FIWARE Training: IoT and LegacyFIWARE Training: IoT and Legacy
FIWARE Training: IoT and Legacy
FIWARE
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
kriszyp
 
Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
Minsk MongoDB User Group
 
Characteristics of no sql databases
Characteristics of no sql databasesCharacteristics of no sql databases
Characteristics of no sql databases
Dipti Borkar
 

Similaire à FIWARE Global Summit - Hands-On NGSI-LD (20)

FIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LDFIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LD
 
JSON-LD and NGSI-LD
JSON-LD and NGSI-LDJSON-LD and NGSI-LD
JSON-LD and NGSI-LD
 
FIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LDFIWARE Training: JSON-LD and NGSI-LD
FIWARE Training: JSON-LD and NGSI-LD
 
FIWARE Wednesday Webinars - Introduction to NGSI-LD
FIWARE Wednesday Webinars - Introduction to NGSI-LDFIWARE Wednesday Webinars - Introduction to NGSI-LD
FIWARE Wednesday Webinars - Introduction to NGSI-LD
 
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
 
MVP Cloud OS Week Track 1 9 Sept: Data liberty
MVP Cloud OS Week Track 1 9 Sept: Data libertyMVP Cloud OS Week Track 1 9 Sept: Data liberty
MVP Cloud OS Week Track 1 9 Sept: Data liberty
 
MVP Cloud OS Week: 9 Sept, Track 1 Data Liberty
MVP Cloud OS Week: 9 Sept, Track 1 Data LibertyMVP Cloud OS Week: 9 Sept, Track 1 Data Liberty
MVP Cloud OS Week: 9 Sept, Track 1 Data Liberty
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction
 
FIWARE Training: IoT and Legacy
FIWARE Training: IoT and LegacyFIWARE Training: IoT and Legacy
FIWARE Training: IoT and Legacy
 
NGSI-LD IoT Agents
NGSI-LD IoT AgentsNGSI-LD IoT Agents
NGSI-LD IoT Agents
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
 
Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
 
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
 
Towards Interoperability between W3C Web of Things and NGSI-LD
Towards Interoperability between W3C Web of Things and NGSI-LDTowards Interoperability between W3C Web of Things and NGSI-LD
Towards Interoperability between W3C Web of Things and NGSI-LD
 
The LOD Gateway: Open Source Infrastructure for Linked Data
The LOD Gateway: Open Source Infrastructure for Linked DataThe LOD Gateway: Open Source Infrastructure for Linked Data
The LOD Gateway: Open Source Infrastructure for Linked Data
 
IFLA LIDASIG Open Session 2017: Introduction to Linked Data
IFLA LIDASIG Open Session 2017: Introduction to Linked DataIFLA LIDASIG Open Session 2017: Introduction to Linked Data
IFLA LIDASIG Open Session 2017: Introduction to Linked Data
 
Brief Introduction to REST
Brief Introduction to RESTBrief Introduction to REST
Brief Introduction to REST
 
Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...
 
Characteristics of no sql databases
Characteristics of no sql databasesCharacteristics of no sql databases
Characteristics of no sql databases
 

Plus de FIWARE

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
FIWARE
 
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
FIWARE
 
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.pdf
FIWARE
 
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
FIWARE
 

Plus de 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
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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...
 

FIWARE Global Summit - Hands-On NGSI-LD

  • 1. Scale Up for a Real Smart Future Berlin, Germany 23-24 October, 2019 NGSI-LD: Hands On Jason Fox, Senior Technical Evangelist, FIWARE Foundation
  • 2. Linked Data: JSON to JSON-LD From: https://json-ld.org/ ▪ JSON-LD is a lightweight Linked Data format. It is easy for humans to read and write. It is based on the already successful JSON format and provides a way to help JSON data interoperate at Web-scale. ▪ Linked Data empowers people that publish and use information on the Web. It is a way to create a network of standards-based, machine-readable data across Web sites. It allows an application to start at one piece of Linked Data, and follow embedded links to other pieces of Linked Data that are hosted on different sites across the Web. 1 { "@context": "https://json-ld.org/contexts/person.jsonld", "@id": "http://dbpedia.org/resource/John_Lennon", "name": "John Lennon", "born": "1940-10-09", "spouse": "http://dbpedia.org/resource/Cynthia_Lennon" }
  • 3. Linked Data: NGSI v2 to NGSI-LD From: https://fiware-datamodels.readthedocs.io/en/latest/ngsi-ld_faq/index.html ▪ NGSI-LD is an evolution of the FIWARE NGSI v2 information model, and has been updated/improved to support linked data (entity relationships), property graphs and semantics (exploiting the capabilities offered by JSON-LD). This work has been conducted under the ETSI ISG Context Information Management initiative. ▪ Creating proper machine-readable Linked Data is fundamental to NGSI-LD. ▪ NGSI-LD Payloads are valid JSON-LD 2 { "@context": [ "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ], "id": "http://dbpedia.org/resource/John_Lennon", "type": "Person", "name": {"type": "Property", "value": "John Lennon"}, "born": {"type": "Property", "value": "1940-10-09"}, "spouse": {"type": "Relationship", "object": "http://dbpedia.org/resource/Cynthia_Lennon" } }
  • 4. NGSI-LD: Evolution not Revolution NGSI v2 ▪ Well defined REST API for context data using JSON payloads. GET, POST and other HTTP verbs do the things you expect ▪ CRUD operations - /v2/entities endpoint ▪ Augment your context data - /v2/registrations endpoint ▪ Push context data to other services - /v2/subscriptions endpoint 3 NGSI-LD ▪ Well defined REST API for context data using JSON and JSON-LD payloads. GET, POST and other HTTP verbs do the things you expect ▪ CRUD operations - /ngsi- ld/v1/entities endpoint ▪ Augment your context data - /ngsi- ld/v1/registrations endpoint ▪ Push context data to other services - /ngsi- ld/v1/subscriptions endpoint
  • 5. 4 Demo: NGSI-LD - Properties
  • 6. NGSI-LD Properties: Creating an Entity NGSI v2 5 NGSI-LD curl -iX POST 'http://localhost:1026/v2/entities' -H 'Content-Type: application/json' -d '{ "type": "Store", "id": "store001", "category": { "type": "Array", "value": ["commercial"]}, "address": { "type": "PostalAddress", "value": { "streetAddress": "Bornholmer Straße 65", "addressRegion": "Berlin", "addressLocality": "Prenzlauer Berg", "postalCode": "10439" }, "metadata": { "verified": { "type": "Boolean","value": true} } }, "location": {"type": "geo:json", "value": {"type": "Point", "coordinates": [13.3986, 52.5547]} }, "name": {"type": "Text", "value": "Bösebrücke Einkauf"} }' curl -iX POST http://localhost:1026/ngsi-ld/v1/entities -H 'Content-Type: application/ld+json' -d '{ "type": "Building", "id": "urn:ngsi-ld:Building:store001", "category": { "type": "Property", "value": ["commercial"]}, "address": { "type": "Property"," value": { "streetAddress": "Bornholmer Straße 65", "addressRegion": "Berlin", "addressLocality": "Prenzlauer Berg", "postalCode": "10439" }, "verified": { "type": "Property", "value": true } }, "location": { "type": "GeoProperty", "value": { "type": "Point", "coordinates": [13.3986, 52.5547]} }, "name": { "type": "Property", "value": "Bösebrücke Einkauf" }, "@context": [ "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] }'
  • 7. NGSI-LD Properties: Creating an Entity NGSI v2 6 NGSI-LD curl -iX POST 'http://localhost:1026/v2/entities' -H 'Content-Type: application/json' -d '{ "type": "Store", "id": "store001", "category": { "type": "Array", "value": ["commercial"]}, "address": { "type": "PostalAddress", "value": { "streetAddress": "Bornholmer Straße 65", "addressRegion": "Berlin", "addressLocality": "Prenzlauer Berg", "postalCode": "10439" }, "metadata": { "verified": { "type": "Boolean","value": true} } }, "location": {"type": "geo:json", "value": {"type": "Point", "coordinates": [13.3986, 52.5547]} }, "name": {"type": "Text", "value": "Bösebrücke Einkauf"} }' curl -iX POST http://localhost:1026/ngsi-ld/v1/entities -H 'Content-Type: application/ld+json' -d '{ "type": "Building", "id": "urn:ngsi-ld:Building:store001", "category": { "type": "Property", "value": ["commercial"]}, "address": { "type": "Property"," value": { "streetAddress": "Bornholmer Straße 65", "addressRegion": "Berlin", "addressLocality": "Prenzlauer Berg", "postalCode": "10439" }, "verified": { "type": "Property", "value": true } }, "location": { "type": "GeoProperty", "value": { "type": "Point", "coordinates": [13.3986, 52.5547]} }, "name": { "type": "Property", "value": "Bösebrücke Einkauf" }, "@context": [ "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] }'
  • 8. NGSI-LD Properties: Data Model NGSI v2 ▪ Entities ▪ Attributes ▪ MetaData 7 NGSI-LD ▪ Entities ▪ Properties ▪ Relationships ▪ Values plus … plus … etc... The NGSI LD data model is more complex; the definitions of use are more rigid which lead to a navigable knowledge graph. ▪ Properties of Properties ▪ Properties of Relationships ▪ Relationships of Properties ▪ Relationships of Relationships . ▪ Properties of Properties of Properties ▪ Relationships of Properties of Properties ▪ Properties of Properties of Relationships ▪ Relationships of Properties of Relationships ▪ Properties of Relationships of Properties ▪ Relationships of Relationships of Properties ▪ Properties of Relationships of Relationships ▪ Relationships of Relationships of Relationships
  • 9. NGSI-LD Properties: Data Model 8 The Entity Example Notes Has an id urn:ngsi-ld:Building:store001 URI/URN. id must be unique. Has a type. https://uri.fiware.org/ns/ data-models#Building ● Fully qualified URI of a well defined data model ● Short-hand strings for types, mapped to fully qualified URIs through the JSON-LD @context. Has a series of properties name, address, category etc. This can be expanded into http://schema.org/address, which is known as a fully qualified name (FQN). Has a series of properties-of-properties a verified field for the address This is the equivalent of NGSI v2 metadata Has a series of relationships managedBy The object corresponds to the URI/URN of another data entity. Equivalent of NGSI v2 refXXX Has a series of properties-of-relationships managedBy.since Holds additional information about a relationship. This is the equivalent of metadata about a refXXX property Has a series of relationships-of-relationships managedBy.subordinateTo holds the URI/URN of another relationship.
  • 10. NGSI-LD Properties: Reading Entity Data NGSI-LD ▪ Response is just a JSON payload plus an @context ▪ @context can be passed either in the Link header or the payload body: ▪ Accept: application/ld+json to include the @context as a JSON attribute ▪ Accept: application/json returns plain old JSON objects - @context is passed as a Link header ▪ Just a minute what has happened to category? 9 curl -G -X GET 'http://localhost:1026/ngsi-ld/v1/entities' -H 'Link: <https://fiware.github.io/data-models/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' -H 'Accept: application/ld+json' -d 'type=Building' -d 'options=keyValues' [ { "@context": "https://fiware.github.io/data-models/context.jsonld", "id": "urn:ngsi-ld:Building:store001", "type": "Building", "address": { "streetAddress": "Bornholmer Straße 65", "addressRegion": "Berlin", "addressLocality": "Prenzlauer Berg", "postalCode": "10439" }, "name": "Bösebrücke Einkauf", "category": [ "https://uri.fiware.org/ns/data-models#commercial" ], "location": { "type": "Point", "coordinates": [13.3986, 52.5547] } } ]
  • 11. NGSI-LD Properties: What to call a location? ▪ location ▪ locatedAt ▪ geocoordinate ▪ geocoordinates ▪ place ▪ ubicación ▪ standort ▪ 置き場所 10 With NGSI-LD core @context a location is always https://uri.etsi.org/ngsi-ld/location NGSI-LD core @context "@context": { "ngsi-ld": "https://uri.etsi.org/ngsi-ld/", "id": "@id", "type": "@type", "value": "https://uri.etsi.org/ngsi-ld/hasValue", "object": { "@id": "https://uri.etsi.org/ngsi-ld/hasObject", "@type": "@id" }, "Property": "https://uri.etsi.org/ngsi-ld/Property" "Relationship": "https://uri.etsi.org/ngsi-ld/Relationship", ... etc. "unitCode": "https://uri.etsi.org/ngsi-ld/unitCode", "location": "https://uri.etsi.org/ngsi-ld/location", ... etc. }
  • 12. NGSI-LD Properties: @vocab and Enumerated Values ▪ An “address” is: https://schema.org/address ▪ A “category” is: https://uri.fiware.org/ns/data-models#category ▪ A category is an enum which takes a set of values such as: https://uri.fiware.org/ns/data-models#commercial https://uri.fiware.org/ns/data-models#office https://uri.fiware.org/ns/data-models#retail https://uri.fiware.org/ns/data-models#residential 11 FIWARE Data Models @context "@context": { "type": "@type", "id": "@id", "schema": "https://schema.org/", "fiware": "https://uri.fiware.org/ns/data-models#", ... etc. "address": "schema:address", "category": { "@id" :"fiware:category", "@type": "@vocab" }, "commercial": "fiware:commercial", "office": "fiware:office", "retail": "fiware:retail", "residential": "fiware:residential", ... etc. } With NGSI-LD Data Models, attributes and enums are well-defined in a computer-readable fashion
  • 13. NGSI-LD Relationships: Traversing Edge Nodes From: https://www.w3.org/TR/json-ld/#dfn-graph A JSON-LD document serializes a dataset which is a collection of graphs A graph is a labeled directed graph, i.e., a set of nodes connected by edges. In NGSI-LD: ▪ Node = NGSI Entity ▪ Edge = A relationship attribute linking two NGSI Entities Therefore NGSI Linked Data relies on three separate definitions: 1. A definition that a particular attribute within an NGSI entity really represents a link 2. A machine readable definition of that link in the Data Model (i.e. the @context) 3. A machine readable definition of the set of all types of links available (the @graph) 12 Creating proper machine-readable Linked Data is fundamental to NGSI-LD.
  • 14. NGSI-LD Relationships: 1. Creating Entities Relationship Links within an NGSI Entity are formally defined using: "type": "Relationship" OR "@type": "https://uri.etsi.org/ngsi-ld/Relationship" The attribute of the linked entity is an object rather than a value 13 curl -X POST http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001/attrs -H 'Content-Type: application/ld+json' -H 'fiware-servicepath: /' -d '{ "stocks": { "type": "Relationship","object": "urn:ngsi-ld:Product:001"}, "numberOfItems": {"type": "Property","value": 50}, "locatedIn" : { "type": "Relationship", "object": "urn:ngsi-ld:Building:store001", "requestedBy": {"type": "Relationship","object": "urn:ngsi-ld:Person:bob-the-manager"}, "installedBy": {"type": "Relationship","object": "urn:ngsi-ld:Person:employee001"}, "statusOfWork": {"type": "Property","value": "completed"} }, "@context": "https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld" }'
  • 15. NGSI-LD Relationships: 2. Machine Readable Data Models Relationship links within the @context are formally defined using: "@type": "@id" 14 FIWARE Data Models @context "@context": { "tutorial": "https://fiware.github.io/tutorials.Step-by-Step/schema/", "Product": "tutorial:Product", "Shelf": "tutorial:Shelf", ...etc "installedBy": { "@id": "tutorial:installedBy", "@type": "@id" }, "requestedBy": { "@id": "tutorial:requestedBy", "@type": "@id" }, ...etc
  • 16. NGSI-LD Relationships: 3. Machine Readable Links 15 FIWARE Data Models @graph "@graph": [ { "@id": "tutorial:Product", "@type": "rdfs:Class", "rdfs:comment": [ {"@language": "en", "@value": "Product is sold in a Store."}, {"@language": "ja", "@value": "製品はストアで販売されている物"}], "rdfs:label": [{"@language": "en", "@value": "Product"}, {"@language": "ja", "@value": "製品"}], "rdfs:subClassOf": {"@id": "http://schema.org/Thing"} }, … etc { "@id": "tutorial:requestedBy", "@type": "https://uri.etsi.org/ngsi-ld/Relationship", "schema:domainIncludes": [{"@id": "tutorial:Shelf"}, {"@id": "tutorial:StockOrder"}], "schema:rangeIncludes": [{"@id": "schema:Person"}], "rdfs:comment": [ {"@language": "en","@value": "Object requested by person."}, {"@language": "ja","@value": "人が要求したオブジェクト"}], "rdfs:label": [{"@language": "en", "@value": "requested by"},{"@language": "ja", "@value": "要求者"}] }, ]
  • 17. 16 Demo: NGSI-LD - Relationships
  • 18. 17 Context Data as Linked Data - How does it help? Linking Disparate Data Sources ▪ Which crimes in which area are not related to Jack? ▪ Does Jack only deal in Cannabis? ▪ How is Jack related to Raymond? ▪ Which other police officers should Inspector Devy contact?
  • 19. 18 Context Data as Linked Data - How does it help? Rich Text Snippets Standard schema.org/Product data model marked up as JSON-LD on the web. Interpreted by third parties. Search Engine can display product rating on screen. System “knows” if a product is out of stock. NGSI-LD Supermarket Tutorial Third party ARV could “know” when a shelf needs filling and retrieve goods from the warehouse No need to reprogram for new customers if data follows the fiware.org/ns/data-models, or the JSON-LD can be converted to do so.