Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the Trainers Program

FIWARE
FIWAREFIWARE
i4Trust Website
i4Trust Community
Connecting to Legacy Systems,
IoT and other Systems
Implementation Specific @context
"fiware": "https://uri.fiware.org/ns/data-models#",
"schema": "https://schema.org/",
"example": "https://example.com/datamodels.html/",
"Building": "fiware:Building",
"Device": "fiware:Device",
"FillingLevelSensor": "example:FillingLevelSensor",
"CowCollar": "example:CowCollar",
"TemperatureSensor": "example:TemperatureSensor",
"Tractor": "example:Tractor",
… etc
"accuracy": "fiware:accuracy",
"batteryLevel": "fiware:batteryLevel",
"category": "fiware:category",
"controlledAsset": "fiware:controlledAsset",
"controlledProperty": "fiware:controlledProperty",
"deviceState": "fiware:deviceState",
"ipAddress": "fiware:ipAddress",
"macAddress": "fiware:macAddress",
"mcc": "fiware:mcc",
"osVersion": "fiware:osVersion",
1
"actuator": "https://w3id.org/saref#actuator",
"filling": "https://w3id.org/saref#fillingLevel",
"temperature": "https://w3id.org/saref#temperature",
"sensor": "https://w3id.org/saref#sensor",
"status": "https://saref.etsi.org/core/status",
"state": "https://saref.etsi.org/core/hasState",
"heartRate":
"https://purl.bioontology.org/ontology/MESH/D006339",
… etc
"myCustomAttr": "example:mycustomAttr",
"secondCustomAttr": "example:2ndCustomAttr"
● Reuse common data models and ontologies
● Add use-case specific mappings where necessary
● Remember to map all entities types, attributes and
metadata attributes
Undefined terms will fallback to the default context
https://uri.etsi.org/ngsi-ld/default-context
Configuring an IoT Agent as NGSI-LD
iot-agent:
image: fiware/iotagent-ul:latest
hostname: iot-agent
container_name: fiware-iot-agent
networks:
- default
expose:
- "4041"
- "7896"
ports:
- "4041:4041"
- "7896:7896"
environment:
- IOTA_CB_HOST=orion
- IOTA_CB_PORT=1026
- IOTA_NORTH_PORT=4041
- IOTA_REGISTRY_TYPE=mongodb
- IOTA_TIMESTAMP=true
- IOTA_AUTOCAST=true
- IOTA_MONGO_HOST=mongo-db
- IOTA_MONGO_PORT=27017
- IOTA_MONGO_DB=iotagentul
- IOTA_HTTP_PORT=7896
- IOTA_PROVIDER_URL=http://iot-agent:4041
- IOTA_CB_NGSI_VERSION=ld
- IOTA_FALLBACK_TENANT=openiot
- IOTA_JSON_LD_CONTEXT=
http://../path/to/ngsi-context.jsonld
2
● Configure using ENV or config.js
Essentials
● IOTA_CB_NGSI_VERSION must be LD
● IOTA_JSON_LD_CONTEXT must point to a
hosted file
Useful
● IOTA_FALLBACK_TENANT if actuations
are required
● IOTA_TIMESTAMP
● IOTA_AUTOCAST
NGSI-LD Measures
▪ The IoT Device is using a known payload syntax
• Ultralight, JSON, SigFox, OPC-UA etc.
▪ The IoT Device sends a reading using the agreed
protocol
• HTTP, MQTT, AMPQ, LoRaWAN etc.
▪ The IoT Agent interprets the payload and
transforms the measure into NGSI-LD
▪ The only interface to the Context Broker is a
simple structured upsert of entities
• potentially including linked entities
3
Measure: “Device X in Building Y has registered 25°C”
curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' 
-H 'Content-Type: application/ld+json' 
-d '[
{
"@context": "http://example.com/context.json-ld",
"id": "urn:ngsi-ld:Device:thermometer1",
"type": "Device"
"temperature": {
"type": "Property",
"value": 25,
“observedAt": "2015-08-05T07:35:01.468Z",
"unitCode": "CEL",
"accuracy":{
"type": "Property", "value": 0.95,
"unitCode": "C62"
}
},
"controlledAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Building:building1"
}
}
]'
Provisioning an NGSI-LD Service Group
/iot/services endpoint defines
common elements across groups
of devices
▪ entity_type, attributes and
static_attributes correspond
to a data model found within
the @context file
▪ attributes and static_attributes
may have associated metadata.
▪ types should be defined as:
• Property
• Relationship
• A native JSON type
• A GeoJSON type
5
curl -s -o /dev/null -X POST 
'http://iot-agent:4041/iot/services' 
-H 'Content-Type: application/json' -H 'fiware-service: openiot' 
-d '{
"services": [
{
"apikey": "321701236",
"cbroker": "http://orion:1026",
"entity_type": "Device",
"resource": "/iot/d",
"protocol": "PDI-IoTA-UltraLight",
"transport": "HTTP",
"timezone": "Europe/Berlin",
"attributes": [
{ "object_id": "t", "name":"temperature", "type": "Float",
"metadata": {"unitCode": {"type": "Property","value": "CEL"}}
}
],
"static_attributes": [
{"name": "description",
"type":"Property", "value": "Thermometer"},
{"name": "category", "type":"Property", "value": ["sensor"]},
{"name": "controlledProperty",
"type": "Property", "value": "temperature"},
{"name": "supportedProtocol",
"type": "Property", "value": ["ul20"]}
]
}
]
}'
Provisioning NGSI-LD device
/iot/devices endpoint defines
additional data for an individual device
▪ attributes and static_attributes
can also be defined at the device level
- the standard rules about types apply
▪ Use link on a static_attribute to
update a linked Entity
6
curl -s -o /dev/null -X POST 
'http://iot-agent:4041/iot/devices' 
-H 'Content-Type: application/json' 
-H 'fiware-service: openiot' 
-H 'fiware-servicepath: /' 
-d '{
"devices": [
{
"device_id": "txhme001xxe",
"entity_name": "urn:ngsi-ld:Device:temperature001",
"entity_type": "Device",
"static_attributes": [
{
"name": "controlledAsset",
"type": "Relationship",
"value": "urn:ngsi-ld:Building:001",
"link": {
"attributes": ["temperature"],
"name": "providedBy",
"type": "Building"
}
}
]
}
]
GPS Measure: “GPS X has moved to location x,y”
With location payloads such as:
▪ As Ultralight String
gps|13.3501,52.5143
▪ As Ultralight Multiple attributes
lng|13.3501|lat|52.5143
▪ JSON as string value:
{"gps": "13.3501,52.5143"}
▪ JSON as array value:
{"gps": [13.3501, 52.5143]}
▪ JSON as GeoJSON:
{
"gps": {
"type": "Point",
"coordinates": [13.3501, 52.5143]
}
}
▪ etc...
7
Context Broker receives an NGSI-LD upsert
curl -L -X POST
'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' 
-H 'Content-Type: application/ld+json' 
-d '[
{
"@context": "http://example.com/context.json-ld",
"id": "urn:ngsi-ld:Device:gps1",
"type": "Device"
"location": {
"type": "GeoProperty",
"value": :{
"type": "Point",
"coordinates": [13.3501, 52.5143]
},
“observedAt": "2015-08-05T07:35:01.468Z"
},
"controlledAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Tractor:tractor1"
}
}
]'
Provisioning GPS Devices
GPS Provisioning from a single input
▪ Use location as the name of a geolocation attribute
▪ Set type=GeoProperty or any GeoJSON type
▪ Map an attribute object_id to NGSI-LD attribute name
Aliasing Latitude and Longitude as separate inputs
▪ Use location as the name of a geolocation attribute
▪ Set type=GeoProperty or any GeoJSON type
▪ Use expression aliasing to map multiple inputs to a String
▪ Remember GeoJSON uses Lng/Lan format
▪ Will only fire if both latitude and longitude are present in
the payload
All GeoProperty input values are automatically converted into GeoJSON in the NGSI-LD upsert
8
IoT Agent Device Provisioning
{
"object_id": "gps",
"name":"location",
"type": "geo:point"
}
{
"name": "location",
"type": "geo:json",
"expression": "${@lng}, ${@lat}"
}
NGSI-LD Actuations
▪ NGSI-LD actuation code is currently based on
the existing NGSI-v2 IoT Agent paradigm.
▪ Uses registrations and request forwarding
▪ Alternatively uses subscriptions and
notification payloads
▪ Both mechanisms supported by IoT Agents.
Internally syntax may change based on the
decisions of the ETSI committee, but since
the listening mechanism is internal to the
IoT Agent library it will be updated once the
proposed interface is finalized.
9
Command provisioning - via actuation registration:
“I am responsible for Attribute X”
IoT Agent Device Provisioning
10
Context Broker receives a Registration
curl -L -X POST 'http://localhost:4041/iot/devices' 
-H 'fiware-service: openiot' 
-H 'Content-Type: application/json' 
--data-raw '{
"devices": [
{
"device_id": "water001",
"protocol": "PDI-IoTA-UltraLight",
"transport": "HTTP",
"endpoint": "http://device:3001/iot/water001",
"entity_name": "urn:ngsi-ld:Device:water001",
"entity_type": "Device",
"commands": [
{
"name": "on",
"type": "command"
},
{
"name": "off",
"type": "command"
}
]
}
]
}'
curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/csourceRegistrations' 
-H 'NGSILD-Tenant: openiot' 
-H 'Content-Type: application/ld+json' 
-d '{
"@context": "http://context.json-ld",
"endpoint": "http://iotagent.com",
"information": [
{
"entities": [
{
"id": "urn:ngsi-ld:Device:water001",
"type": "Device"
}
],
"properties": [
"on",
"off"
]
}
],
"type": "ContextSourceRegistration"
}
'
Bidirectional attribute provisioning - actuation via subscription:
“Tell me when Attribute X changes”
11
Context Broker sends a Subscription
curl -L -X POST 'http://localhost:4041/iot/devices' 
-H 'fiware-service: openiot' 
-H 'fiware-servicepath: /' 
-H 'Content-Type: application/json' 
--data-raw '{
"devices": [
{
"device_id": "bell002",
"entity_name": "urn:ngsi-ld:Bell:002",
"entity_type": "Bell",
"protocol": "PDI-IoTA-UltraLight",
"transport": "HTTP",
"endpoint": "http://device:3001/iot/bell002",
"attributes": [
{ "name":"ring", "type":"Text",
"expression": "${@ring}",
"reverse": [
{
"object_id":"r", "type": "Text",
"expression": "${@ring}"
}
]
}
]
}
]
}'
{
"id": "urn:ngsi-ld:Notification:5fd0fa684eb81930c97005f3",
"type": "Notification",
"subscriptionId": "urn:ngsi-ld:Subscription:12345",
"notifiedAt": "2020-12-09T16:25:12.193Z",
"data": [
{
"id": "urn:ngsi-ld:Bell:002",
"type": "Bell",
"filling": {
"type": "Property",
"value": “ “,
}
}
]
}
Extending to legacy Systems via Upsert
12
Multiple options exist to architect this:
▪ Amend legacy processing component to use
NGSI directly as well as legacy protocol
▪ Upload a file as CSV via an Agent?
https://www.youtube.com/watch?v=HuEwI8wJKFU
▪ Create a separate chron-job to query legacy
system and upsert as NGSI?
Also consider using a database as an intermediary.
https://www.youtube.com/watch?v=_uLZDGFPlRA
function upsertToMongoDB(building) {
return new Promise((resolve, reject) => {
mongoDB
.upsert(
building.id, building.name,
building.address, building.verified)
.then(() => {
return resolve();
})
.catch((error) => {
return reject(error);
});
});
}
function duplicateBuildings(req, res) {
async function copyEntityData(building) {
await upsertToMongoDB(building);
}
req.body.data.forEach(copyEntityData);
res.status(204).send();
}
Extending to legacy Systems via Registration
“Tell me about X”, “I want to update X”
13
curl -L -X GET
'http://my-legacy-system/ngsi-ld/v1/entities/urn:ngsi-ld
:Building:store001?attrs=tweets' 
-H 'Link: <https://my-context/context.jsonld>;
rel="http://www.w3.org/ns/json-ld#context";
type="application/ld+json"' 
-H 'Content-Type: application/ld+json'
curl -L -X PATCH
'http://my-legacy-system/ngsi-ld/v1/entities/urn:ngsi-ld
:Building:store001/attrs/tweets' 
-H 'Link: <https://my-context/context.jsonld>;
rel="http://www.w3.org/ns/json-ld#context";
type="application/ld+json"' 
-H 'Content-Type: application/json' 
--data-raw '{
"type": "Property",
"value": [
"This must be Thursday",
"I never could get the hang of Thursdays."
]
} '
router.get('/ngsi-ld/v1/entities/:id',
NGSIProxy.getAsNgsiLD
);
router.patch(
'/ngsi-ld/v1/entities/:id/attrs',
NGSIProxy.updateEntity
);
function getAsNgsiLD(req, res) {
const response = doSomething(req);
if (req.headers.accept === 'application/json') {
res.set('Content-Type', 'application/json');
delete response['@context'];
} else {
res.set('Content-Type', 'application/ld+json');
}
res.send(response);
}
Extending to legacy Systems via Subscription
“Inform me about X so I can do something”
14
{
"id":
"urn:ngsi-ld:Notification:5fd0fa684eb81930c97005f3",
"type": "Notification",
"subscriptionId": "urn:ngsi-ld:Subscription:12345",
"notifiedAt": "2020-12-09T16:25:12.193Z",
"data": [
{
"id": "urn:ngsi-ld:Bell:002",
"type": "Bell",
"filling": {
"type": "Property",
"value": “ “,
}
}
]
}
router.post('/subscription/:type', (req, res) => {
_.forEach(req.body.data, (item) => {
doSomething(req, item);
});
res.status(204).send();
});
Useful links
JSON-LD
▪ Website: https://json-ld.org/
▪ Linked Data Video: https://www.youtube.com/watch?v=vioCbTo3C-4
▪ JSON-LD Video: https://www.youtube.com/watch?v=4x_xzT5eF5Q
NGSI-LD
▪ ETSI Specification:
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.03.01_60/gs_cim009v010301p.pdf
▪ NGSI-LD Video: https://www.youtube.com/watch?v=rZ13IyLpAtA
▪ Tutorials: https://ngsi-ld-tutorials.readthedocs.io/
Smart Data Models
▪ Website: http://smartdatamodels.org/
▪ Smart Cities Data Models Video: https://www.youtube.com/watch?v=dfMo0HnaIUQ
15
Thank you!
i4Trust has received funding from the European Union’s Horizon 2020
research and innovation programme under the Grant Agreement no 951975.
1 of 17

Recommended

Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program by
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 ProgramFIWARE
302 views75 slides
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program by
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
354 views34 slides
Creating a Context-Aware solution, Complex Event Processing with FIWARE Perseo by
Creating a Context-Aware solution, Complex Event Processing with FIWARE PerseoCreating a Context-Aware solution, Complex Event Processing with FIWARE Perseo
Creating a Context-Aware solution, Complex Event Processing with FIWARE PerseoFernando Lopez Aguilar
504 views27 slides
FIWARE Wednesday Webinars - Introduction to NGSI-LD by
FIWARE Wednesday Webinars - Introduction to NGSI-LDFIWARE Wednesday Webinars - Introduction to NGSI-LD
FIWARE Wednesday Webinars - Introduction to NGSI-LDFIWARE
857 views21 slides
FIWARE Training: IoT and Legacy by
FIWARE Training: IoT and LegacyFIWARE Training: IoT and Legacy
FIWARE Training: IoT and LegacyFIWARE
303 views17 slides
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2 by
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2FIWARE
1.2K views21 slides

More Related Content

What's hot

FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info... by
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...FIWARE
336 views21 slides
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things... by
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...FIWARE
365 views22 slides
Spring Data, Jongo & Co. by
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Tobias Trelle
4.5K views53 slides
Implementing and Visualizing Clickstream data with MongoDB by
Implementing and Visualizing Clickstream data with MongoDBImplementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDBMongoDB
4.7K views34 slides
MongoDB ClickStream and Visualization by
MongoDB ClickStream and VisualizationMongoDB ClickStream and Visualization
MongoDB ClickStream and VisualizationCameron Sim
3.2K views41 slides
FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ... by
FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ...FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ...
FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ...FIWARE
660 views46 slides

What's hot(20)

FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info... by FIWARE
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
FIWARE336 views
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things... by FIWARE
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE365 views
Spring Data, Jongo & Co. by Tobias Trelle
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.
Tobias Trelle4.5K views
Implementing and Visualizing Clickstream data with MongoDB by MongoDB
Implementing and Visualizing Clickstream data with MongoDBImplementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDB
MongoDB4.7K views
MongoDB ClickStream and Visualization by Cameron Sim
MongoDB ClickStream and VisualizationMongoDB ClickStream and Visualization
MongoDB ClickStream and Visualization
Cameron Sim3.2K views
FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ... by FIWARE
FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ...FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ...
FIWARE Global Summit - OpenMTC – An Open Source Implementation of the oneM2M ...
FIWARE660 views
Real World Application Performance with MongoDB by MongoDB
Real World Application Performance with MongoDBReal World Application Performance with MongoDB
Real World Application Performance with MongoDB
MongoDB2.3K views
Architecting An Enterprise Storage Platform Using Object Stores by Niraj Tolia
Architecting An Enterprise Storage Platform Using Object StoresArchitecting An Enterprise Storage Platform Using Object Stores
Architecting An Enterprise Storage Platform Using Object Stores
Niraj Tolia2.1K views
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S... by MongoDB
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...
MongoDB273 views
Joins and Other MongoDB 3.2 Aggregation Enhancements by Andrew Morgan
Joins and Other MongoDB 3.2 Aggregation EnhancementsJoins and Other MongoDB 3.2 Aggregation Enhancements
Joins and Other MongoDB 3.2 Aggregation Enhancements
Andrew Morgan10.4K views
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive by MongoDB
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
MongoDB525 views
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data by MongoDB
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB870 views
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB by 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
MongoDB293 views
Visualizing Mobile Broadband with MongoDB by MongoDB
Visualizing Mobile Broadband with MongoDBVisualizing Mobile Broadband with MongoDB
Visualizing Mobile Broadband with MongoDB
MongoDB828 views
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn... by MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
MongoDB318 views
PistonHead's use of MongoDB for Analytics by Andrew Morgan
PistonHead's use of MongoDB for AnalyticsPistonHead's use of MongoDB for Analytics
PistonHead's use of MongoDB for Analytics
Andrew Morgan10.3K views
Eagle6 Enterprise Situational Awareness by MongoDB
Eagle6 Enterprise Situational AwarenessEagle6 Enterprise Situational Awareness
Eagle6 Enterprise Situational Awareness
MongoDB736 views
FIWARE Wednesday Webinars - Architecting Your Smart Solution Powered by FIWARE by FIWARE
FIWARE Wednesday Webinars - Architecting Your Smart Solution Powered by FIWAREFIWARE Wednesday Webinars - Architecting Your Smart Solution Powered by FIWARE
FIWARE Wednesday Webinars - Architecting Your Smart Solution Powered by FIWARE
FIWARE530 views
MongoDB .local Toronto 2019: MongoDB Atlas Jumpstart by MongoDB
MongoDB .local Toronto 2019: MongoDB Atlas JumpstartMongoDB .local Toronto 2019: MongoDB Atlas Jumpstart
MongoDB .local Toronto 2019: MongoDB Atlas Jumpstart
MongoDB212 views

Similar to Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the Trainers Program

FIWARE Training: Connecting to Legacy Systems, IoT and other Systems by
FIWARE Training: Connecting to Legacy Systems, IoT and other SystemsFIWARE Training: Connecting to Legacy Systems, IoT and other Systems
FIWARE Training: Connecting to Legacy Systems, IoT and other SystemsFIWARE
35 views17 slides
Fiware io t_ul20_cpbr8 by
Fiware io t_ul20_cpbr8Fiware io t_ul20_cpbr8
Fiware io t_ul20_cpbr8FIWARE
1.1K views30 slides
Developing your first application using FIWARE by
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
1.7K views60 slides
Towards Interoperability between W3C Web of Things and NGSI-LD by
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-LDJosé Manuel Cantera Fonseca
159 views22 slides
Fiware IoT Proposal & Community by
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community TIDChile
604 views41 slides
NGSI-LD IoT Agents by
NGSI-LD IoT AgentsNGSI-LD IoT Agents
NGSI-LD IoT AgentsFIWARE
57 views20 slides

Similar to Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the Trainers Program(20)

FIWARE Training: Connecting to Legacy Systems, IoT and other Systems by FIWARE
FIWARE Training: Connecting to Legacy Systems, IoT and other SystemsFIWARE Training: Connecting to Legacy Systems, IoT and other Systems
FIWARE Training: Connecting to Legacy Systems, IoT and other Systems
FIWARE35 views
Fiware io t_ul20_cpbr8 by FIWARE
Fiware io t_ul20_cpbr8Fiware io t_ul20_cpbr8
Fiware io t_ul20_cpbr8
FIWARE1.1K views
Developing your first application using FIWARE by FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
FIWARE1.7K views
Fiware IoT Proposal & Community by TIDChile
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community
TIDChile604 views
NGSI-LD IoT Agents by FIWARE
NGSI-LD IoT AgentsNGSI-LD IoT Agents
NGSI-LD IoT Agents
FIWARE57 views
Fiware IoT_IDAS_intro_ul20_v2 by FIWARE
Fiware IoT_IDAS_intro_ul20_v2Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2
FIWARE8.3K views
Web of things introduction by 承翰 蔡
Web of things introductionWeb of things introduction
Web of things introduction
承翰 蔡1.1K views
Building the IOT Platform as a Service by Jesus Rodriguez
Building the IOT Platform as a ServiceBuilding the IOT Platform as a Service
Building the IOT Platform as a Service
Jesus Rodriguez5K views
(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices by Amazon Web Services
(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices
(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices
Amazon Web Services6.5K views
Anwendungsfaelle für Elasticsearch by Florian Hopf
Anwendungsfaelle für ElasticsearchAnwendungsfaelle für Elasticsearch
Anwendungsfaelle für Elasticsearch
Florian Hopf6.8K views
Developing your first application using FI-WARE by Fermin Galan
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
Fermin Galan17.4K views
Bending the IoT to your will with JavaScript by All Things Open
Bending the IoT to your will with JavaScriptBending the IoT to your will with JavaScript
Bending the IoT to your will with JavaScript
All Things Open111 views
Context Information Management in IoT enabled smart systems - the basics by Fernando Lopez Aguilar
Context Information Management in IoT enabled smart systems - the basicsContext Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basics
Orion Context Broker by TIDChile
Orion Context Broker Orion Context Broker
Orion Context Broker
TIDChile807 views
Testing API platform with Behat BDD tests by Stefan Adolf
Testing API platform with Behat BDD testsTesting API platform with Behat BDD tests
Testing API platform with Behat BDD tests
Stefan Adolf2.5K views
Canopy unconference preso by gregulator
Canopy unconference presoCanopy unconference preso
Canopy unconference preso
gregulator637 views

More from FIWARE

Behm_Herne_NeMo_akt.pptx by
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxFIWARE
14 views11 slides
Katharina Hogrebe Herne Digital Days.pdf by
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdfFIWARE
38 views25 slides
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx by
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxChristoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxFIWARE
46 views20 slides
Behm_Herne_NeMo.pptx by
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxFIWARE
18 views11 slides
Evangelists + iHubs Promo Slides.pptx by
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxFIWARE
22 views11 slides
Lukas Künzel Smart City Operating System.pptx by
Lukas Künzel Smart City Operating System.pptxLukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxFIWARE
36 views19 slides

More from FIWARE(20)

Behm_Herne_NeMo_akt.pptx by FIWARE
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptx
FIWARE14 views
Katharina Hogrebe Herne Digital Days.pdf by FIWARE
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdf
FIWARE38 views
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx by FIWARE
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxChristoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
FIWARE46 views
Behm_Herne_NeMo.pptx by FIWARE
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptx
FIWARE18 views
Evangelists + iHubs Promo Slides.pptx by FIWARE
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptx
FIWARE22 views
Lukas Künzel Smart City Operating System.pptx by FIWARE
Lukas Künzel Smart City Operating System.pptxLukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptx
FIWARE36 views
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx by FIWARE
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxPierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
FIWARE45 views
Dennis Wendland_The i4Trust Collaboration Programme.pptx by FIWARE
Dennis Wendland_The i4Trust Collaboration Programme.pptxDennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptx
FIWARE35 views
Ulrich Ahle_FIWARE.pptx by FIWARE
Ulrich Ahle_FIWARE.pptxUlrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptx
FIWARE40 views
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx by FIWARE
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxAleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
FIWARE4 views
Water Quality - Lukas Kuenzel.pdf by FIWARE
Water Quality - Lukas Kuenzel.pdfWater Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdf
FIWARE10 views
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx by FIWARE
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxCameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
FIWARE24 views
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx by FIWARE
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
FIWARE11 views
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx by FIWARE
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
FIWARE13 views
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces.... by 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....
FIWARE18 views
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf by FIWARE
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfAbdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
FIWARE15 views
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf by FIWARE
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FIWARE13 views
HTAG_Skalierung_Plattform_lokal_final_versand.pptx by FIWARE
HTAG_Skalierung_Plattform_lokal_final_versand.pptxHTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
FIWARE18 views
EU Opp_Clara Pezuela - German chapter.pptx by FIWARE
EU Opp_Clara Pezuela - German chapter.pptxEU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptx
FIWARE18 views
OSIH.pptx by FIWARE
OSIH.pptxOSIH.pptx
OSIH.pptx
FIWARE9 views

Recently uploaded

Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...ShapeBlue
101 views17 slides
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...ShapeBlue
117 views25 slides
NTGapps NTG LowCode Platform by
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform Mustafa Kuğu
365 views30 slides
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesShapeBlue
210 views15 slides
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...ShapeBlue
158 views20 slides
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
222 views23 slides

Recently uploaded(20)

Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue101 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue117 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu365 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue210 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue158 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue222 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue163 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue179 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc160 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker50 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely78 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays53 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue120 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue103 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue98 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue146 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue197 views
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue85 views

Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the Trainers Program

  • 1. i4Trust Website i4Trust Community Connecting to Legacy Systems, IoT and other Systems
  • 2. Implementation Specific @context "fiware": "https://uri.fiware.org/ns/data-models#", "schema": "https://schema.org/", "example": "https://example.com/datamodels.html/", "Building": "fiware:Building", "Device": "fiware:Device", "FillingLevelSensor": "example:FillingLevelSensor", "CowCollar": "example:CowCollar", "TemperatureSensor": "example:TemperatureSensor", "Tractor": "example:Tractor", … etc "accuracy": "fiware:accuracy", "batteryLevel": "fiware:batteryLevel", "category": "fiware:category", "controlledAsset": "fiware:controlledAsset", "controlledProperty": "fiware:controlledProperty", "deviceState": "fiware:deviceState", "ipAddress": "fiware:ipAddress", "macAddress": "fiware:macAddress", "mcc": "fiware:mcc", "osVersion": "fiware:osVersion", 1 "actuator": "https://w3id.org/saref#actuator", "filling": "https://w3id.org/saref#fillingLevel", "temperature": "https://w3id.org/saref#temperature", "sensor": "https://w3id.org/saref#sensor", "status": "https://saref.etsi.org/core/status", "state": "https://saref.etsi.org/core/hasState", "heartRate": "https://purl.bioontology.org/ontology/MESH/D006339", … etc "myCustomAttr": "example:mycustomAttr", "secondCustomAttr": "example:2ndCustomAttr" ● Reuse common data models and ontologies ● Add use-case specific mappings where necessary ● Remember to map all entities types, attributes and metadata attributes Undefined terms will fallback to the default context https://uri.etsi.org/ngsi-ld/default-context
  • 3. Configuring an IoT Agent as NGSI-LD iot-agent: image: fiware/iotagent-ul:latest hostname: iot-agent container_name: fiware-iot-agent networks: - default expose: - "4041" - "7896" ports: - "4041:4041" - "7896:7896" environment: - IOTA_CB_HOST=orion - IOTA_CB_PORT=1026 - IOTA_NORTH_PORT=4041 - IOTA_REGISTRY_TYPE=mongodb - IOTA_TIMESTAMP=true - IOTA_AUTOCAST=true - IOTA_MONGO_HOST=mongo-db - IOTA_MONGO_PORT=27017 - IOTA_MONGO_DB=iotagentul - IOTA_HTTP_PORT=7896 - IOTA_PROVIDER_URL=http://iot-agent:4041 - IOTA_CB_NGSI_VERSION=ld - IOTA_FALLBACK_TENANT=openiot - IOTA_JSON_LD_CONTEXT= http://../path/to/ngsi-context.jsonld 2 ● Configure using ENV or config.js Essentials ● IOTA_CB_NGSI_VERSION must be LD ● IOTA_JSON_LD_CONTEXT must point to a hosted file Useful ● IOTA_FALLBACK_TENANT if actuations are required ● IOTA_TIMESTAMP ● IOTA_AUTOCAST
  • 4. NGSI-LD Measures ▪ The IoT Device is using a known payload syntax • Ultralight, JSON, SigFox, OPC-UA etc. ▪ The IoT Device sends a reading using the agreed protocol • HTTP, MQTT, AMPQ, LoRaWAN etc. ▪ The IoT Agent interprets the payload and transforms the measure into NGSI-LD ▪ The only interface to the Context Broker is a simple structured upsert of entities • potentially including linked entities 3
  • 5. Measure: “Device X in Building Y has registered 25°C” curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' -H 'Content-Type: application/ld+json' -d '[ { "@context": "http://example.com/context.json-ld", "id": "urn:ngsi-ld:Device:thermometer1", "type": "Device" "temperature": { "type": "Property", "value": 25, “observedAt": "2015-08-05T07:35:01.468Z", "unitCode": "CEL", "accuracy":{ "type": "Property", "value": 0.95, "unitCode": "C62" } }, "controlledAsset": { "type": "Relationship", "object": "urn:ngsi-ld:Building:building1" } } ]'
  • 6. Provisioning an NGSI-LD Service Group /iot/services endpoint defines common elements across groups of devices ▪ entity_type, attributes and static_attributes correspond to a data model found within the @context file ▪ attributes and static_attributes may have associated metadata. ▪ types should be defined as: • Property • Relationship • A native JSON type • A GeoJSON type 5 curl -s -o /dev/null -X POST 'http://iot-agent:4041/iot/services' -H 'Content-Type: application/json' -H 'fiware-service: openiot' -d '{ "services": [ { "apikey": "321701236", "cbroker": "http://orion:1026", "entity_type": "Device", "resource": "/iot/d", "protocol": "PDI-IoTA-UltraLight", "transport": "HTTP", "timezone": "Europe/Berlin", "attributes": [ { "object_id": "t", "name":"temperature", "type": "Float", "metadata": {"unitCode": {"type": "Property","value": "CEL"}} } ], "static_attributes": [ {"name": "description", "type":"Property", "value": "Thermometer"}, {"name": "category", "type":"Property", "value": ["sensor"]}, {"name": "controlledProperty", "type": "Property", "value": "temperature"}, {"name": "supportedProtocol", "type": "Property", "value": ["ul20"]} ] } ] }'
  • 7. Provisioning NGSI-LD device /iot/devices endpoint defines additional data for an individual device ▪ attributes and static_attributes can also be defined at the device level - the standard rules about types apply ▪ Use link on a static_attribute to update a linked Entity 6 curl -s -o /dev/null -X POST 'http://iot-agent:4041/iot/devices' -H 'Content-Type: application/json' -H 'fiware-service: openiot' -H 'fiware-servicepath: /' -d '{ "devices": [ { "device_id": "txhme001xxe", "entity_name": "urn:ngsi-ld:Device:temperature001", "entity_type": "Device", "static_attributes": [ { "name": "controlledAsset", "type": "Relationship", "value": "urn:ngsi-ld:Building:001", "link": { "attributes": ["temperature"], "name": "providedBy", "type": "Building" } } ] } ]
  • 8. GPS Measure: “GPS X has moved to location x,y” With location payloads such as: ▪ As Ultralight String gps|13.3501,52.5143 ▪ As Ultralight Multiple attributes lng|13.3501|lat|52.5143 ▪ JSON as string value: {"gps": "13.3501,52.5143"} ▪ JSON as array value: {"gps": [13.3501, 52.5143]} ▪ JSON as GeoJSON: { "gps": { "type": "Point", "coordinates": [13.3501, 52.5143] } } ▪ etc... 7 Context Broker receives an NGSI-LD upsert curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' -H 'Content-Type: application/ld+json' -d '[ { "@context": "http://example.com/context.json-ld", "id": "urn:ngsi-ld:Device:gps1", "type": "Device" "location": { "type": "GeoProperty", "value": :{ "type": "Point", "coordinates": [13.3501, 52.5143] }, “observedAt": "2015-08-05T07:35:01.468Z" }, "controlledAsset": { "type": "Relationship", "object": "urn:ngsi-ld:Tractor:tractor1" } } ]'
  • 9. Provisioning GPS Devices GPS Provisioning from a single input ▪ Use location as the name of a geolocation attribute ▪ Set type=GeoProperty or any GeoJSON type ▪ Map an attribute object_id to NGSI-LD attribute name Aliasing Latitude and Longitude as separate inputs ▪ Use location as the name of a geolocation attribute ▪ Set type=GeoProperty or any GeoJSON type ▪ Use expression aliasing to map multiple inputs to a String ▪ Remember GeoJSON uses Lng/Lan format ▪ Will only fire if both latitude and longitude are present in the payload All GeoProperty input values are automatically converted into GeoJSON in the NGSI-LD upsert 8 IoT Agent Device Provisioning { "object_id": "gps", "name":"location", "type": "geo:point" } { "name": "location", "type": "geo:json", "expression": "${@lng}, ${@lat}" }
  • 10. NGSI-LD Actuations ▪ NGSI-LD actuation code is currently based on the existing NGSI-v2 IoT Agent paradigm. ▪ Uses registrations and request forwarding ▪ Alternatively uses subscriptions and notification payloads ▪ Both mechanisms supported by IoT Agents. Internally syntax may change based on the decisions of the ETSI committee, but since the listening mechanism is internal to the IoT Agent library it will be updated once the proposed interface is finalized. 9
  • 11. Command provisioning - via actuation registration: “I am responsible for Attribute X” IoT Agent Device Provisioning 10 Context Broker receives a Registration curl -L -X POST 'http://localhost:4041/iot/devices' -H 'fiware-service: openiot' -H 'Content-Type: application/json' --data-raw '{ "devices": [ { "device_id": "water001", "protocol": "PDI-IoTA-UltraLight", "transport": "HTTP", "endpoint": "http://device:3001/iot/water001", "entity_name": "urn:ngsi-ld:Device:water001", "entity_type": "Device", "commands": [ { "name": "on", "type": "command" }, { "name": "off", "type": "command" } ] } ] }' curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/csourceRegistrations' -H 'NGSILD-Tenant: openiot' -H 'Content-Type: application/ld+json' -d '{ "@context": "http://context.json-ld", "endpoint": "http://iotagent.com", "information": [ { "entities": [ { "id": "urn:ngsi-ld:Device:water001", "type": "Device" } ], "properties": [ "on", "off" ] } ], "type": "ContextSourceRegistration" } '
  • 12. Bidirectional attribute provisioning - actuation via subscription: “Tell me when Attribute X changes” 11 Context Broker sends a Subscription curl -L -X POST 'http://localhost:4041/iot/devices' -H 'fiware-service: openiot' -H 'fiware-servicepath: /' -H 'Content-Type: application/json' --data-raw '{ "devices": [ { "device_id": "bell002", "entity_name": "urn:ngsi-ld:Bell:002", "entity_type": "Bell", "protocol": "PDI-IoTA-UltraLight", "transport": "HTTP", "endpoint": "http://device:3001/iot/bell002", "attributes": [ { "name":"ring", "type":"Text", "expression": "${@ring}", "reverse": [ { "object_id":"r", "type": "Text", "expression": "${@ring}" } ] } ] } ] }' { "id": "urn:ngsi-ld:Notification:5fd0fa684eb81930c97005f3", "type": "Notification", "subscriptionId": "urn:ngsi-ld:Subscription:12345", "notifiedAt": "2020-12-09T16:25:12.193Z", "data": [ { "id": "urn:ngsi-ld:Bell:002", "type": "Bell", "filling": { "type": "Property", "value": “ “, } } ] }
  • 13. Extending to legacy Systems via Upsert 12 Multiple options exist to architect this: ▪ Amend legacy processing component to use NGSI directly as well as legacy protocol ▪ Upload a file as CSV via an Agent? https://www.youtube.com/watch?v=HuEwI8wJKFU ▪ Create a separate chron-job to query legacy system and upsert as NGSI? Also consider using a database as an intermediary. https://www.youtube.com/watch?v=_uLZDGFPlRA function upsertToMongoDB(building) { return new Promise((resolve, reject) => { mongoDB .upsert( building.id, building.name, building.address, building.verified) .then(() => { return resolve(); }) .catch((error) => { return reject(error); }); }); } function duplicateBuildings(req, res) { async function copyEntityData(building) { await upsertToMongoDB(building); } req.body.data.forEach(copyEntityData); res.status(204).send(); }
  • 14. Extending to legacy Systems via Registration “Tell me about X”, “I want to update X” 13 curl -L -X GET 'http://my-legacy-system/ngsi-ld/v1/entities/urn:ngsi-ld :Building:store001?attrs=tweets' -H 'Link: <https://my-context/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' -H 'Content-Type: application/ld+json' curl -L -X PATCH 'http://my-legacy-system/ngsi-ld/v1/entities/urn:ngsi-ld :Building:store001/attrs/tweets' -H 'Link: <https://my-context/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' -H 'Content-Type: application/json' --data-raw '{ "type": "Property", "value": [ "This must be Thursday", "I never could get the hang of Thursdays." ] } ' router.get('/ngsi-ld/v1/entities/:id', NGSIProxy.getAsNgsiLD ); router.patch( '/ngsi-ld/v1/entities/:id/attrs', NGSIProxy.updateEntity ); function getAsNgsiLD(req, res) { const response = doSomething(req); if (req.headers.accept === 'application/json') { res.set('Content-Type', 'application/json'); delete response['@context']; } else { res.set('Content-Type', 'application/ld+json'); } res.send(response); }
  • 15. Extending to legacy Systems via Subscription “Inform me about X so I can do something” 14 { "id": "urn:ngsi-ld:Notification:5fd0fa684eb81930c97005f3", "type": "Notification", "subscriptionId": "urn:ngsi-ld:Subscription:12345", "notifiedAt": "2020-12-09T16:25:12.193Z", "data": [ { "id": "urn:ngsi-ld:Bell:002", "type": "Bell", "filling": { "type": "Property", "value": “ “, } } ] } router.post('/subscription/:type', (req, res) => { _.forEach(req.body.data, (item) => { doSomething(req, item); }); res.status(204).send(); });
  • 16. Useful links JSON-LD ▪ Website: https://json-ld.org/ ▪ Linked Data Video: https://www.youtube.com/watch?v=vioCbTo3C-4 ▪ JSON-LD Video: https://www.youtube.com/watch?v=4x_xzT5eF5Q NGSI-LD ▪ ETSI Specification: https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.03.01_60/gs_cim009v010301p.pdf ▪ NGSI-LD Video: https://www.youtube.com/watch?v=rZ13IyLpAtA ▪ Tutorials: https://ngsi-ld-tutorials.readthedocs.io/ Smart Data Models ▪ Website: http://smartdatamodels.org/ ▪ Smart Cities Data Models Video: https://www.youtube.com/watch?v=dfMo0HnaIUQ 15
  • 17. Thank you! i4Trust has received funding from the European Union’s Horizon 2020 research and innovation programme under the Grant Agreement no 951975.