SlideShare a Scribd company logo
NGSIv2 Overview for Developers
That Already Know NGSIv1
Fermín Galán Márquez
Technological Expert. Orion Context Broker Development Lead
fermin.galanmarquez@telefonica.com
Outline
• Introduction to NGSIv2
• RESTful-ness
• URL & payload simplification
• Native JSON datatypes
• Text-based attribute value set/get
• Geolocation capabilities
• Datetime support
• Filtering
• Subscription improvements
• Batch operations
• Working with IDs
• Pagination
• Next things to come
2
Two “flavors” of NGSI API
• NGSIv1 (the one you already know )
– Original NGSI RESTful binding of OMA-NGSI
– Implemented in 2013
– Uses the /v1 prefix in resource URL
• NGSIv2
– A revamped, simplified binding of OMA-NGSI
• Simple things must be easy
• Complex things should be possible
• Agile, implementation-driven approach
• Make it as developer-friendly as possible (RESTful, JSON, …)
– Enhanced functionality compared to NGSIv1 (e.g. filtering)
– Stable, ready for production, version already available
• Current NGSIv2 version is Release Candidate 2016.10 http://telefonicaid.github.io/fiware-
orion/api/v2/stable
• New features coming (see last part of this presentation)
– Uses the /v2 prefix in resource URL
• Introduction to NGSIv2
– https://docs.google.com/presentation/d/1_fv9dB5joCsOCHlb4Ld6A-
QmeIYhDzHgFHUWreGmvKU/edit#slide=id.g53c31d7074fd7bc7_0
3
The NGSI model is kept as it is in NGSIv2
Attributes
• Name
• Type
• Value
Entity
• EntityId
• EntityType
1 n
“has”
Metadata
• Name
• Type
• Value1 n
“has”
4
NGSIv2 status (AKA the “NGSIv2 disclaimer”)
• NGSIv2 is in “release candidate” status
– By "release candidate" we mean that the specification is quite stable,
but changes may occur with regard to new release candidates or the
final version. In particular, changes may be of two types:
• Extensions to the functionality currently specified by this
document. Note that in this case there isn't any risk of breaking
backward compatibility on existing software implementations.
• Slight modifications in the functionality currently specified by this
document, as a consequence of ongoing discussions. Backward
compatibility will be taken into account in this case, trying to
minimize the impact on existing software implementations. In
particular, only completely justified changes impacting backward
compatibility will be allowed and "matter of taste" changes will not
be allowed.
5
So… when should I use NGSIv1 or NGSIv2?
• In general, it is always preferable to use NGSIv2
• However, you would need to use NGSIv1 if
– You need register/discovery operations (context management
availability functionality)
• Not yet implemented in NGSIv2 (in roadmap)
– Zero tolerance to changes in software interacting with Orion
• Even if you use NGSIv1, you can still use NGSIv2
functionality and requests
– See “Considerations on NGSIv1 and NGSIv2 coexistence”
section in the Orion manual
6
RESTful-ness
• In NGSIv1
– Originally based on OMA-NGSI standard operations, not really
RESTful
• The URL doesn’t identify a resource, but an operation type
• The verb is always POST
• Actually, NGSIv1 is closer to HTTP-based RPC than to RESTful
– An extended set of operations (convenience operations) were
added in a later stage but with “legacy” from standard
operations that make it hard to apply full RESTful principles
• E.g. dual response code
• NGSIv2 has been designed from scratch with RESTful
principles in mind
– Batch operations (similar to standard operations in NGSIv1)
are also provided, but without impacting the RESTful
operations in the API
7
RESTful-ness
8
200 OK
...
{
"contextElement" : {
"type" : "",
"isPattern" : "false",
"id" : "Car1"
},
"statusCode" : {
"code" : "404",
"reasonPhrase" : "No context element found",
"details" : "Entity id: /Car1/"
}
}
GET /v1/contextEntities/Car1
404 Not Found
...
{
"error": "NotFound",
"description": "The requested entity has not
been found. Check type and id“
}
GET /v2/entities/Car1
NGSIv1
NGSIv2
both status codes have to be taken into account by
the client in order to detect error conditions,
which increases complexity
only HTTP response code,
following RESTful principles -
simpler to process
Example: get Car1 entity
URL & payload simplification
• In NGSIv1 the strict alignment with OMA NGSI involves
complexity and ineffectiveness
– Message payloads include a lot of structural overhead elements not
actually needed
– Response payload in methods that don’t really need a payload from a
semantic point of view (e.g. update operation)
– Unnecessarily long structural elements in URLs
• NGSIv2 simplifies URLs and payload, leading to a much
more lean and less verbose API
9
URL & payload simplification
10
POST /v1/contextEntities
...
{
"id": "Car1",
"type": "Car",
"attributes": [
{
"name": "colour",
"type": "Text",
"value": "red"
}
]
}
200 OK
Location: /v2/entities?type=Car
POST /v2/entities
…
{
"id": "Car1",
"type": "Car",
"colour": {
"value": "red",
"type": "Text",
}
}
NGSIv1
NGSIv2
Most of the NGSIv1 response payload is
useless: clients only need to know the
status code. In NGSIv2 the response has
no payload at all
shorter URLs in
NGSIv2
200 OK
...
{
"contextResponses": [
{
"attributes": [
{
"name": "colour",
"type": "float",
"value": ""
}
],
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
],
"id": "Car1",
"isPattern": "false",
"type": “Car"
}
structural
overhead
Example: create Car1
entity (type Car) with
attribute colour set to
“Red”
URL & payload simplification
11
GET /v1/contextEntities/type/Car/id/Car1/attributes/colour GET /v2/entities/Car1/attrs/colour?type=Car
NGSIv1 NGSIv2
redundant (already part of the request URL)
200 OK
...
{
"attributes": [
{
"name": "colour",
"type": "Text",
"value": " red"
}
],
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
mostly useless
200 OK
...
{
"value": "red",
"type": "Text",
"metadata": {}
}
shorter URL in
NGSIv2
structural
overhead
Example: get attribute
colour at Car1 entity
(type Car)
URL & payload simplification
• Moreover, NGSIv2 provides simplified data representations
– keyValues: exclude attribute type and metadata
– values: only attribute values (attrs is used to order the values in the
resulting vector)
– unique: like values which in addition removes duplicate values
• Not only for retrieval operations, also for creation/update
operations
– Default attribute types are used in that case
12
GET /v2/entities/Car1/attrs?options=keyValues
200 OK
...
{
"model": "Ford",
"colour": "red",
"temp": 22
}
GET /v2/entities/Car1/attrs?options=values&attrs=model,colour,temp
200 OK
...
["Ford", "red", 22]
Example: get attribute
colour at Car1 entity (type
Car)
Native JSON datatypes
• In NGSIv1
– All attribute values are string based to align with XML encoding
• At the end, XML support was removed (in Orion 1.0.0), but it left
an awful legacy 
– Although creation/update operations can use numbers, bool,
etc. at the end they are transformed to strings and stored in
that way internally
– Retrieve operation always provides string encoded values (*)
• NGSIv2 fully supports all the types described in the JSON
specification (string, number, boolean, object, array and
null)
13
(*) Exception: entities created/updated with NGSIv2 (which support native types) and retrieved
with NGSIv1 will render without stringification.
Native JSON datatypes
1414
POST /v1/contextEntities
...
{
"id": "Car1",
"type": "Car",
"attributes": [
{
"name": "speed",
"type": "Number",
"value": 98
}
]
}
POST /v2/entities?options=keyValues
…
{
"id": "Car1",
"type": "Car",
"speed": 98,
"isActive": true
}
NGSIv1
NGSIv2
created as
number but
retrieved as
string… weird!
GET /v1/contextEntities/Car1/attributes/speed
...
{
"attributes": [
{
"name": "speed",
"type": "Number",
"value": "98"
}
],
"statusCode": { … }
}
GET /v2/entities/Car1/attrs?options=keyValues
…
{
"speed": 98,
"isActive": true
}
coherent result
Example: create Car1
entity (type Car) with
attribute speed set to 98
Text-based attribute value set/get
• In NGSIv1
– There is no similar functionality
• NGSIv2 offers set/get attribute access directly without
anything else than the attribute value itself in the
request/response payload
– In the set operation, attribute type and metadata are kept as they are
15
PUT /v2/entities/Car1/attrs/speed/value
Content-Type: text/plain
…
86
GET /v2/entities/Car1/attrs/speed/value
200 OK
Content-Type: text/plain
…
86200 OK
…
Example: set speed attribute
value at Car1 entity
Example: get speed attribute
value at Car1 entity
Geolocation capabilities
• In NGSIv1
– Entity location must be a point
– Queries are based on an area specification (circle or polygon, inner or
outer area)
– Query as part of queryContext payload scope
• In NGSIv2
– In addition to point, entity location can be a line, box, polygon or
arbitrary GeoJSON
– Queries are based on a spatial relationship and a geometry
• Spatial relationships: near (max and min distance), coveredBy, intersect,
equal and disjoint
• Geometries: point, line, box, polygon
– Query as part of URL (more user-friendly than payload-based
approach)
16
Geolocation capabilities
17
NGSIv1
NGSIv2
Much easier and more compact in NGSIv2
POST /v1/queryContext
…
{
"entities": [
{
"type": "City",
"isPattern": "true",
"id": ".*"
}
],
"restriction": {
"scopes": [
{
"type" : "FIWARE::Location",
"value" : {
"circle": {
"centerLatitude": "40.418889",
"centerLongitude": "-3.691944",
"radius": "13500"
}
}
}
]
}
}
GET /v2/entities?
idPattern=.*&
type=City&
georel=near;maxDistance:13500&
geometry=point&
coords=40.418889,-3.691944
Example: retrieve all entities of type
“City” (no matter the id) whose
distance to Madrid city center (GPS
coordinates 40.418889,-3691944) is
less than 13.5 km
Geolocation capabilities
18
Point location
(the only one supported by NGSIv1)
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:json",
"value": {
"type": "Polygon",
"coordinates": [ [ [2, 1], [4, 3], [5, -1], [2, 1] ] ]
} } }
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:polygon",
"value": [ "2, 2", "8, 7", "-1, 4", "2, 2"]
}
}
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:box",
"value": [ "2, 2", "8, 7" ]
}
}
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:point",
"value": "40.41,-3.69"
}
}
POST /v2/entities
{
"id": "E",
"type": "T",
"location": {
"type": "geo:line",
"value": [ "2, 2", "8, 7" ]
}
}
Line location (e.g. a street) Box location (e.g. a squared building)
Polygon location (e.g. a city district) GeoJSON geometry (full flexibility)
Datetime support
• In NGSIv1
– There is no support for attributes meaning dates, they
are treated as conventional strings
• NGSIv2 implements date support
– Based on ISO ISO8601 format, including partial
representations and timezones
• See https://fiware-
orion.readthedocs.io/en/master/user/ngsiv2_implementati
on_notes/index.html#datetime-support for syntax details
– Use reserved attribute type DateTime to express a date
– Date-based filters are supported
19
Datetime support
• Attribute value arithmetic filters can be used with dates as if they
were numbers
• Entity dateModified and dateCreated special attributes, to get
entity creation and last modification timestamps
– They are shown in query responses using
attrs=dateModified,dateCreated
• Entity dateModified and dateCreated special metadata, to get
attribute creation and last modification timestamps
– They are shown in query responses using
metadata=dateModified,dateCreated
20
POST /v2/entities
…
{
"id": "John",
"birthDate": {
"type": "DateTime",
"value": "1979-10-14T07:21:24.238Z"
}
}
GET /v2/entities?q=birthDate<1985-01-01T00:00:00
Example: create entity John,
with birthDate attribute using
type DateTime
Filtering
• In NGSIv1
– Limited filtering functionality, much of it based on queryContext
complex scopes
– Filters are not supported in subscriptions
• In NGSIv2 the mechanism
– Is simpler (see next slide)
– Can be applied to both queries and subscriptions (described in a later
topic of this presentation)
21
POST /v1/queryContext
…
{
"restriction": {
"scopes": [
{
"type" : "FIWARE::StringFilter",
"value" : "temp<24"
…
}
This is the only interesting
part, all the rest is
structural overhead
Example: filtering entities
which temperature is less
than 24
• For the GET /v2/entities operation, retrieve all entities…
– … of a given entity type
– … whose entity id is in a list
– ... whose entity id match a regex pattern
• Example: the id starts with “Room” followed by a digit from 2 to 5
– … with an attribute that matches a given expression
• Example: attribute temp is greater than 25
• Filters can be used simultaneously (i.e. like AND condition)
22
GET /v2/entities?type=Room
GET /v2/entities?id=Room1,Room2
GET /v2/entities?idPattern=^Room[2-5]
Filtering
GET /v2/entities?q=temp>25
supported operators:
• == (or :), equal
• !=, unequal
• >, greater than
• <, less than
• >=, greater than or
equal
• <=, less than or equal
• A..B, range
• ^=, pattern (regex)
• Existence/inexistence
• For the GET /v2/entities operation, retrieve all entities…
– ... whose entity type match a regex pattern
– … with an attribute which sub-key matches a given expression
– … with an attribute metadata that matches a given expression
– … with an attribute metadata which sub-key matches a given
expression
23
GET /v2/entities?q=tirePressure.frontRight >130
attribute name attribute sub-key (for compound
attribute values only)
GET /v2/entities?mq=temperature.avg>25
GET /v2/entities?mq=tirePressure.accuracy.frontRight >90
metadata sub-key (for compound
metadata values only)
metadata name
Filtering
GET /v2/entities?typePattern=T[ABC]
• By default all attribute are included in query
responses or notifications
• The attrs field (as parameter in GET operations
and as notification sub-field in subscriptions)
can be used to specify a filtering list
• The attrs field can be also used to explicitly
include some special attributes (not included by
default)
– dateCreated: entity creation date
– dateModified: entity last modification date
• The “*” can be used as an alias of “all the
(regular) attributes”
24
Attributes filtering and special attributes
• Examples
– Include only attributes temp and lum
• In queries: GET /v2/entities?attrs=temp,lum
• In subscriptions: "attrs": [ "temp", "lum" ]
– Include dateCreated and not any other attribute
• In queries: GET /v2/entities?attrs=dateCreated
• In subscriptions: "attrs": [ "dateCreated" ]
– Include dateModified and all the other (regular)
attributes
• In queries: GET /v2/entities?attrs=dateModified,*
• In subscriptions: "attrs": [ "dateModified", "*" ]
– Include all attributes (same effect that not using attrs,
not very interesting)
• In queries: GET /v2/entities?attrs=*
• In subscriptions: "attrs": [ "*" ]
25
Attributes filtering and special attributes
• By default all attribute metadata are included in query
responses and notifications
• The metadata field (as parameter in GET operations and
as notification sub-field in subscriptions) can be used to
specify a filtering list
• The metadata field can be also used to explicitly include
some special metadata (not included by default)
– dateCreated, dateModified: attribute creation or last
modification date
– actionType: which value is the action type corresponding to
the update triggering the notification: “update”, “append” or
“delete”
– previousValue: which provides the value of the attribute
previous to processing the update that triggers the notification
• The “*” can be used as an alias of “all the (regular)
metadata”
26
Metadata filtering and special metadata
• Examples
– Include only metadata MD1 and MD2
• In queries: GET /v2/entities?metadata=MD1,MD2
• In subscriptions: "metadata": [ "MD1", "MD2" ]
– Include previousValue and not any other metadata
• In queries: GET /v2/entities?metadata=previousValue
• In subscriptions: "attrs": [ "previousValue" ]
– Include actionType and all the other (regular) metadata
• In queries: GET /v2/entities?metadata=actionType,*
• In subscriptions: "attrs": [ "actionType", "*" ]
– Include all metadatata (same effect that not using
metadata, not very interesting)
• In queries: GET /v2/entities?metadata=*
• In subscriptions: "metadata": [ "*" ]
27
Metadata filtering and special metadata
Subscription improvements
• NGSIv1 context subscription API is very limited
– There is no operation to list existing subscriptions
• If a client loses the ID of created subscriptions, there is no way to retrieve
them through the API
– No support for permanent subscriptions
• Creating absurdly long subscriptions (e.g. 100 years) is a dirty workaround
– Fix notification structure
• Difficult to integrate to arbitrary endpoints (e.g. public REST services)
– No support for filters
• NGSIv2 subscription API solves all these limitations and
introduces some additional enhancements
– Notification attributes based on “blacklist” (in addition to the
“whitelist” approach in NGSIv1)
– Ability to pause/resume subscriptions
– Extra fields: times sent, last notification and description
28
Anatomy of a NGSIv2 subscription
29
POST /v2/subscriptions
…
{
"subject": {
"entities": [
{
"id": "Room1",
"type": "Room"
}
]
},
"condition": {
"attrs": [ "temp" ]
},
"notification": {
"http": {
"url": "http://<host>:<port>/publish"
},
"attrs": [ "temp" ]
},
"expires": "2026-04-05T14:00:00.00Z",
"throttling": 5
}
201 Created
Location: /v2/subscriptions/51c0ac9ed714fb3b37d7d5a8
...
POST /v1/subscribeContext
…
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [ "temp“ ],
"reference": "http://<host>:<port>/publish",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [ "temp" ]
}
],
"throttling": "PT5S"
}
200 OK
...
{ "subscribeResponse": {
"duration": "P1M",
"subscriptionId": "51c0ac9ed714fb3b37d7d5a8",
"throttling": "PT5S"
} }
NGSIv1 NGSIv2
Simpler response
(no payload)
Simpler way of specifying
expiration and throttling
in NGSIv2
Redundant Example: subscribe to
Room1 entity, so
whenever a change
occurs in the temp
attribute a notification
including only temp is
sent
List subscriptions and special fields in NGSIv2
• List operations (not available in NGSIv1)
– GET /v2/subscriptions lists all subscriptions
– GET /v2/subscriptions/<id> retrieves information of a particular
subscription
• Whitelist vs. blacklist (in the notification field)
– Use "attrs": [ "A", "B" ] to “include A and B in the notification”
(whitelist)
– Use "exceptAttrs": [ "A", "B" ] to “include all the attributes except
A and B” (blacklist)
– Use "attrs": [ ] to include “all the attributes” (special case)
• Other informative fields (in the notification field)
– timesSent: the number of times that the subscription has been
triggered and a notification has been sent
– lastNotification: datetime corresponding to the last notification
• Other informative fields (at root level)
– description, free text descriptive text for user convenience
30
Permanent and paused subscriptions in NGSIv2
• The status attribute can be used to pause/resume
subscriptions
• In GET operations, the status field can be
– active: subscription is active (notifications will be sent)
– inactive: subscription is inactive (notifications will not be sent)
– expired: subscription is expired (notifications will not be sent)
31
PATCH /v2/subscriptions/<id>
…
{
"status": "active"
}
PATCH /v2/subscriptions/<id>
…
{
"status": "inactive"
}
To pause To resume
Notification formats in NGSIv2
• The optional attrsFormat field can be used to choose between different notification
flavors, aligned with the representation modes
• Notifications include the NGSIv2-AttrsFormat header to help the receiver identify
the format
• legacy can be used as value for attrsFormat in order to send notifications in
NGSIv1 format
– Very useful when integrating legacy notification endpoints
32
{
"subscriptionId": "12345",
"data": [
{
"id": "Room1",
"type": "Room",
"temperature": {
"value": 23,
"type": "Number",
"metadata": {}
}
}
]
}
{
"subscriptionId": "12345",
"data": [
{
"id": "Room1",
"type": "Room",
"temperature": 23
}
]
}
{
"subscriptionId": "12345",
"data": [ [ 23 ] ]
}
normalized (default) keyValues values
Outer vector represent the list of
entities, inner vector the values of
the attribute of each entity (not too
interesting in this single-entity
single-attribute example)
Custom notifications in NGSIv2
• Apart from the standard formats defined in the
previous slide, NGSIv2 allows to re-define all the
notification aspects
• httpCustom is used (instead of http) with the
following subfields
– URL query parameters
– HTTP method
– HTTP headers
– Payload (not necessarily JSON!)
• A simple macro substitution language based on ${..}
syntax can be used to “fill the gaps” with entity data (id,
type or attribute values)
33
Custom notifications in NGSIv2
34
…
"httpCustom": {
"url": "http://foo.com/entity/${id}",
"headers": {
"Content-Type": "text/plain"
},
"method": "PUT",
"qs": {
"type": "${type}"
},
"payload": "The temperature is ${temp} degrees"
}
…
PUT http://foo.com/entity/DC_S1-D41?type=Room
Content-Type: text/plain
Content-Length: 31
The temperature is 23.4 degrees
PUT /v2/entities/DC_S1-D41/attrs/temp/value?type=Room
…
23.4
Custom notification configuration
update
notification
Example: send a text
notification (i.e. not
JSON) with temperature
value, using the entity id
and type as part of the
URL
35
POST /v2/subscriptions
…
{
"subject": {
"entities": [
{
"id": "Truck11",
"type": "RoadVehicle"
},
{
"idPattern": "^Car[2-5]",
"type": "RoadVehicle"
}
],
"condition": {
"attrs": [ "speed" ],
"expression": {
"q": "speed>90",
"georel": "near;maxDistance:100000",
"geometry": "point",
"coords": "40.418889,-3.691944"
}
}
},
…
}
• Filters (described in previous
slides) can be also used in
subscriptions
– id
– type
– id pattern
– attribute values
– geographical location
Subscription filters in NGSIv2
Example: subscribe to speed changes in
entities with id Truck11 or Car2 to Car5 (both
case of type RoadVehicle) whenever speed is
greater than 90 and the vehicle distance to
Madrid city center is less than 100 km
36
POST /v2/subscriptions
…
{
"subject": {
"entities": [
{
"idPattern": ".*",
"typePattern": ".*Vehicle"
},
],
"condition": {
"attrs": [ "speed" ],
"expression": {
"q": "speed>90",
"mq": "speed.average==80..100",
"georel": "near;maxDistance:100000",
"geometry": "point",
"coords": "40.418889,-3.691944"
}
}
},
…
}
• They can be used also in
subscriptions
– type pattern
– metadata value
Subscription filters in NGSIv2
Example: subscribe to speed changes in any
entities of any type ending with Vehicle (such
as RoadVehicle, AirVehicle, etc.) whenever
speed is greater than 90 its average metadata
is between 80 and 90 and the vehicle distance
to Madrid city center is less than 100 km
Batch operations
• In NGSIv1 we have standard operations
– POST /v1/updateContext
– POST /v1/queryContext
• Similar but more user-friendly operations have
been included in NGSIv2
– POST /v2/op/update
– POST /v2/op/query
37
Batch operations
38
POST /v1/updateContext
…
{
"updateAction": "APPEND“,
"contextElements": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1",
"attributes": [
{
"name": "temp",
"type": "float",
"value": "29"
}
]
}
]
}
POST /v2/op/update
{
"actionType": "APPEND",
"entities": [
{
"type": "Room",
"id": "Room1",
"temperature":
{
"type": "Number",
"value": 29
}
}
]
}
201 Created
NGSIv1 NGSIv2
structural
overhead
200 OK
...
{
"contextResponses" : [ … ],
"statusCode" : {
"code" : "200",
"details" : "OK"
}
}
NGSIv2 response doesn’t
have any payload at all
lots of useless
stuff here
Example: create
Room1 entity (type
Room) with attribute
temp set to 29
Batch operations
39
POST /v1/queryContext
…
{
"entities": [
{
"type": "Room",
"isPattern": "true",
"id": ".*"
} ,
"attributes": [ "temp" ]
]
}
POST /v2/op/query
…
{
"entities": [
{
"idPattern": ".*",
"type": "T"
}
],
"attributes": [ "temp" ]
}
NGSIv1
NGSIv2
Requests are more or
less the same, but the
simplicity of NGSIv2
becomes evident
when comparing
responses
200 OK
...
{
"contextResponses": [
{
"contextElement": {
"attributes": [
{
"name": "temp",
"type": "Number",
"value": "25"
}
],
"id": "Room1",
"isPattern": "false",
"type": "Room"
},
"statusCode": { … }}
]
}
200 OK
...
[
{
"id": "Room1",
"type": "Room",
"temp": {
"type": "Number",
"value": 25
}
}
]
Example: get
temp attribute of
all entities with
type Room
Pagination
• In NGSIv1
– based on limit, offset and details
– Dirty workaround to fit count into NGSIv1
payloads, using an errorCode for something
that actually is not an error and forcing to
text based processing of the details field
– Fixed order: always by creation date
• In NGSIv2
– based on limit, offset and options=count
• This part doesn’t change too much
– Cleaner and easier way of returning count,
with the Fiware-Total-Count HTTP header
in the response
– Configurable ordering based on orderBy
parameter
• See details in the NGSIv2 specification
40
"errorCode": {
"code": "200",
"details": "Count: 322",
"reasonPhrase": "OK"
}
Fiware-Total-Count: 322
Working with IDs
• In NGSIv1
– Fields such as entity id, attribute name, etc. may have any value (*)
– This could cause a lot of problems as these fields use to act as IDs in
many places when propagated through notifications
• E.g. Cygnus MySQL sink may have problems when these fields are mapped
to tables names, whose allowed charset is very strict
– In addition, NGSIv1 allows ids or attribute names as "" (empty string)
which is weird and typically an error condition in the client
• NGSIv2 establishes a set of restrictions to ensure sanity in the
usage of ID fields. In particular:
– Allowed characters are those in the plain ASCII set, except the following ones:
control characters, whitespace, &, ?, / and #.
– Maximum field length is 256 characters.
– Minimum field length is 1 character.
– The rules above apply to the following six fields (identified as ID fields): entity
id, entity type, attribute name, attribute type, metadata name, metadata type
41
(*) Excluding the forbidden characters described in the Orion manual, which are general for all the fields in both
NGSIv1 and NGSIv2 APIs
Next things to come
• Up to now, all the slides have described the stable version of the
API corresponding to Release Candidate 2016.10
(http://fiware.github.io/specifications/ngsiv2/stable)
• There is also a work in progress (WIP) version, describing future
functionally (http://fiware.github.io/specifications/ngsiv2/latest)
• Warning: the future functionality of the WIP version is subject to
change and it may change before to be consolidated in a next
Release Candidate stable version
42
• Status failed means that last
attempt to notify failed
– E.g. the endpoint is not reachable
• Detailed information in the
notifications element
– timesSent: total number of
notifications attempts (both
successful and failed)
– lastSuccess: last time that
notification was successfully sent
– lastFailure: last time that
notification was tried and failed
– lastNotification: last time the
notification was sent (either success
or failure)
• Corollary: lastNotification value is the
same than either lastFailure or
lastSuccess
43
Notification status
200 OK
Content-Type: application/json
…
[{
"id": " 51c0ac9ed714fb3b37d7d5a8 ",
"expires": "2026-04-05T14:00:00.00Z",
"status": "failed",
"subject": { … },
"notification": {
"timesSent": 3,
"lastNotification": "2016-05-31T11:19:32.00Z",
"lastSuccess": "2016-05-31T10:07:32.00Z",
"lastFailure": "2016-05-31T11:19:32.00Z",
…
}
}]
Useful references
• Introduction to NGSI and Orion
– http://bit.ly/fiware-orion
• Orion Manual
– https://fiware-orion.readthedocs.io
• Orion page at FIWARE Catalogue
– http://catalogue.fiware.org/enablers/publishsubscribe-
context-broker-orion-context-broker
• NGSIv2 specs
– http://fiware.github.io/specifications/ngsiv2/stable
– http://fiware.github.io/specifications/ngsiv2/latest
• Orion support at StackOverflow
– Look for existing questions at
http://stackoverflow.com/questions/tagged/fiware-orion
– Ask your questions using the “fiware-orion” tag
• FIWARE Tour Guide Application
– https://github.com/fiware/tutorials.TourGuide-App
44
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
Batch query scope
• This is the way of including q,
mq and geo filters (typically
used as URL param of a GET
operation) in a batch query
• Like NGSIv1 scopes but much
simpler (without the restriction
structural overhead)
46
POST /v2/op/query
…
{
"entities": [
{
"idPattern": ".*",
"type": "T"
}
],
"attributes": [ "temp" ],
"scopes": [
{
"type": "FIWARE::StringQuery",
"value": "temp"
},
{
"type" : "FIWARE::Location::NGSIv2",
"value" : {
"georel": [ "near", "maxDistance:20000" ],
"geometry": "point",
"coords": [ [40.31,-3.75] ]
}
}
]
}
Example: get all entities of type T
with the attribute temp as long as
that attribute is greater than 40 and
the entity distance to coordinates
(40.31, -3.75) is less than 20 km

More Related Content

What's hot

A Hitchhikers Guide to Cloud Native API Gateways
A Hitchhikers Guide to Cloud Native API GatewaysA Hitchhikers Guide to Cloud Native API Gateways
A Hitchhikers Guide to Cloud Native API Gateways
QAware GmbH
 
A Hitchhiker's Guide to Cloud-Native API Gateways
A Hitchhiker's Guide to Cloud-Native API GatewaysA Hitchhiker's Guide to Cloud-Native API Gateways
A Hitchhiker's Guide to Cloud-Native API Gateways
QAware GmbH
 
Enterprise Software Architecture styles
Enterprise Software Architecture stylesEnterprise Software Architecture styles
Enterprise Software Architecture styles
Araf Karsh Hamid
 
Devops CI-CD pipeline with Containers
Devops CI-CD pipeline with ContainersDevops CI-CD pipeline with Containers
Devops CI-CD pipeline with Containers
NuSpace
 
Service Mesh - Why? How? What?
Service Mesh - Why? How? What?Service Mesh - Why? How? What?
Service Mesh - Why? How? What?
Orkhan Gasimov
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring Applications
Damien Dallimore
 
Microservices &amp; anypoint service mesh calgary mule soft meetup
Microservices &amp; anypoint service mesh   calgary mule soft meetupMicroservices &amp; anypoint service mesh   calgary mule soft meetup
Microservices &amp; anypoint service mesh calgary mule soft meetup
Jimmy Attia
 
How to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in RundeckHow to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in Rundeck
Rundeck
 
Transformacion e innovacion digital Meetup - Application Modernization and Mi...
Transformacion e innovacion digital Meetup - Application Modernization and Mi...Transformacion e innovacion digital Meetup - Application Modernization and Mi...
Transformacion e innovacion digital Meetup - Application Modernization and Mi...
José Román Martín Gil
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performance
Red Hat
 
INTERFACE, by apidays - Apache Cassandra now speaks developer with Stargate ...
INTERFACE, by apidays  - Apache Cassandra now speaks developer with Stargate ...INTERFACE, by apidays  - Apache Cassandra now speaks developer with Stargate ...
INTERFACE, by apidays - Apache Cassandra now speaks developer with Stargate ...
apidays
 
Blockchain Intro to Hyperledger Fabric
Blockchain Intro to Hyperledger Fabric Blockchain Intro to Hyperledger Fabric
Blockchain Intro to Hyperledger Fabric
Araf Karsh Hamid
 
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Lucas Jellema
 
CNCF Live Webinar: Kubernetes 1.23
CNCF Live Webinar: Kubernetes 1.23CNCF Live Webinar: Kubernetes 1.23
CNCF Live Webinar: Kubernetes 1.23
LibbySchulze
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
Araf Karsh Hamid
 
Successful Patterns for running platforms
Successful Patterns for running platformsSuccessful Patterns for running platforms
Successful Patterns for running platforms
Paul Czarkowski
 
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Lucas Jellema
 
MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021
Ieva Navickaite
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
Paul Czarkowski
 
Nashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load Balancer
Nashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load BalancerNashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load Balancer
Nashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load Balancer
Jitendra Bafna
 

What's hot (20)

A Hitchhikers Guide to Cloud Native API Gateways
A Hitchhikers Guide to Cloud Native API GatewaysA Hitchhikers Guide to Cloud Native API Gateways
A Hitchhikers Guide to Cloud Native API Gateways
 
A Hitchhiker's Guide to Cloud-Native API Gateways
A Hitchhiker's Guide to Cloud-Native API GatewaysA Hitchhiker's Guide to Cloud-Native API Gateways
A Hitchhiker's Guide to Cloud-Native API Gateways
 
Enterprise Software Architecture styles
Enterprise Software Architecture stylesEnterprise Software Architecture styles
Enterprise Software Architecture styles
 
Devops CI-CD pipeline with Containers
Devops CI-CD pipeline with ContainersDevops CI-CD pipeline with Containers
Devops CI-CD pipeline with Containers
 
Service Mesh - Why? How? What?
Service Mesh - Why? How? What?Service Mesh - Why? How? What?
Service Mesh - Why? How? What?
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring Applications
 
Microservices &amp; anypoint service mesh calgary mule soft meetup
Microservices &amp; anypoint service mesh   calgary mule soft meetupMicroservices &amp; anypoint service mesh   calgary mule soft meetup
Microservices &amp; anypoint service mesh calgary mule soft meetup
 
How to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in RundeckHow to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in Rundeck
 
Transformacion e innovacion digital Meetup - Application Modernization and Mi...
Transformacion e innovacion digital Meetup - Application Modernization and Mi...Transformacion e innovacion digital Meetup - Application Modernization and Mi...
Transformacion e innovacion digital Meetup - Application Modernization and Mi...
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performance
 
INTERFACE, by apidays - Apache Cassandra now speaks developer with Stargate ...
INTERFACE, by apidays  - Apache Cassandra now speaks developer with Stargate ...INTERFACE, by apidays  - Apache Cassandra now speaks developer with Stargate ...
INTERFACE, by apidays - Apache Cassandra now speaks developer with Stargate ...
 
Blockchain Intro to Hyperledger Fabric
Blockchain Intro to Hyperledger Fabric Blockchain Intro to Hyperledger Fabric
Blockchain Intro to Hyperledger Fabric
 
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
 
CNCF Live Webinar: Kubernetes 1.23
CNCF Live Webinar: Kubernetes 1.23CNCF Live Webinar: Kubernetes 1.23
CNCF Live Webinar: Kubernetes 1.23
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Successful Patterns for running platforms
Successful Patterns for running platformsSuccessful Patterns for running platforms
Successful Patterns for running platforms
 
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
 
MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
 
Nashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load Balancer
Nashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load BalancerNashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load Balancer
Nashik MuleSoft Virtual Meetup#1 - Shared and Dedicated Load Balancer
 

Viewers also liked

Welcome to the 1st FIWARE Summit
Welcome to the 1st FIWARE SummitWelcome to the 1st FIWARE Summit
Welcome to the 1st FIWARE Summit
FIWARE
 
FIWARE Accelerate
FIWARE AccelerateFIWARE Accelerate
FIWARE Accelerate
FIWARE
 
FIWARE IoT Ready Programme
FIWARE IoT Ready ProgrammeFIWARE IoT Ready Programme
FIWARE IoT Ready Programme
FIWARE
 
The FIWARE Marketplace
The FIWARE MarketplaceThe FIWARE Marketplace
The FIWARE Marketplace
FIWARE
 
FIWARE iHubs: the road ahead
FIWARE iHubs: the road aheadFIWARE iHubs: the road ahead
FIWARE iHubs: the road ahead
FIWARE
 
FIWARE Mundus Ecosystem Support Committee: The Road Ahead
FIWARE Mundus Ecosystem Support Committee: The Road AheadFIWARE Mundus Ecosystem Support Committee: The Road Ahead
FIWARE Mundus Ecosystem Support Committee: The Road Ahead
FIWARE
 
FIWARE for Smart Cities: City of Ancona - Parking Advisor
FIWARE for Smart Cities: City of Ancona - Parking AdvisorFIWARE for Smart Cities: City of Ancona - Parking Advisor
FIWARE for Smart Cities: City of Ancona - Parking Advisor
FIWARE
 
Spanish AgriFood Cooperatives
Spanish AgriFood CooperativesSpanish AgriFood Cooperatives
Spanish AgriFood Cooperatives
FIWARE
 
FIWARE Summit - conclusions
FIWARE Summit - conclusionsFIWARE Summit - conclusions
FIWARE Summit - conclusions
FIWARE
 
Frontier Cities 2 - FIWARE Goes to the Market
Frontier Cities 2 - FIWARE Goes to the MarketFrontier Cities 2 - FIWARE Goes to the Market
Frontier Cities 2 - FIWARE Goes to the Market
FIWARE
 
FIWARE Zone
FIWARE Zone FIWARE Zone
FIWARE Zone
FIWARE
 
FIWARE: the best is yet to come
FIWARE: the best is yet to comeFIWARE: the best is yet to come
FIWARE: the best is yet to come
FIWARE
 
FIWARE for Smart Industry
FIWARE for Smart IndustryFIWARE for Smart Industry
FIWARE for Smart Industry
FIWARE
 
The 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWAREThe 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWARE
FIWARE
 
FIWARE Accelerate Next Steps
FIWARE Accelerate Next StepsFIWARE Accelerate Next Steps
FIWARE Accelerate Next Steps
FIWARE
 
IMPACT Growth
IMPACT GrowthIMPACT Growth
IMPACT Growth
FIWARE
 
FIWARE Accelerator Programme
FIWARE Accelerator ProgrammeFIWARE Accelerator Programme
FIWARE Accelerator Programme
FIWARE
 
FIWARE Accelerator Programme Results - May 2015
FIWARE Accelerator Programme Results - May 2015FIWARE Accelerator Programme Results - May 2015
FIWARE Accelerator Programme Results - May 2015
FIWARE
 
Campus Party Brazil Agenda
Campus Party Brazil AgendaCampus Party Brazil Agenda
Campus Party Brazil Agenda
FIWARE
 
FIWARE & TM Forum partnership (Infographic)
FIWARE & TM Forum partnership (Infographic)FIWARE & TM Forum partnership (Infographic)
FIWARE & TM Forum partnership (Infographic)
FIWARE
 

Viewers also liked (20)

Welcome to the 1st FIWARE Summit
Welcome to the 1st FIWARE SummitWelcome to the 1st FIWARE Summit
Welcome to the 1st FIWARE Summit
 
FIWARE Accelerate
FIWARE AccelerateFIWARE Accelerate
FIWARE Accelerate
 
FIWARE IoT Ready Programme
FIWARE IoT Ready ProgrammeFIWARE IoT Ready Programme
FIWARE IoT Ready Programme
 
The FIWARE Marketplace
The FIWARE MarketplaceThe FIWARE Marketplace
The FIWARE Marketplace
 
FIWARE iHubs: the road ahead
FIWARE iHubs: the road aheadFIWARE iHubs: the road ahead
FIWARE iHubs: the road ahead
 
FIWARE Mundus Ecosystem Support Committee: The Road Ahead
FIWARE Mundus Ecosystem Support Committee: The Road AheadFIWARE Mundus Ecosystem Support Committee: The Road Ahead
FIWARE Mundus Ecosystem Support Committee: The Road Ahead
 
FIWARE for Smart Cities: City of Ancona - Parking Advisor
FIWARE for Smart Cities: City of Ancona - Parking AdvisorFIWARE for Smart Cities: City of Ancona - Parking Advisor
FIWARE for Smart Cities: City of Ancona - Parking Advisor
 
Spanish AgriFood Cooperatives
Spanish AgriFood CooperativesSpanish AgriFood Cooperatives
Spanish AgriFood Cooperatives
 
FIWARE Summit - conclusions
FIWARE Summit - conclusionsFIWARE Summit - conclusions
FIWARE Summit - conclusions
 
Frontier Cities 2 - FIWARE Goes to the Market
Frontier Cities 2 - FIWARE Goes to the MarketFrontier Cities 2 - FIWARE Goes to the Market
Frontier Cities 2 - FIWARE Goes to the Market
 
FIWARE Zone
FIWARE Zone FIWARE Zone
FIWARE Zone
 
FIWARE: the best is yet to come
FIWARE: the best is yet to comeFIWARE: the best is yet to come
FIWARE: the best is yet to come
 
FIWARE for Smart Industry
FIWARE for Smart IndustryFIWARE for Smart Industry
FIWARE for Smart Industry
 
The 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWAREThe 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWARE
 
FIWARE Accelerate Next Steps
FIWARE Accelerate Next StepsFIWARE Accelerate Next Steps
FIWARE Accelerate Next Steps
 
IMPACT Growth
IMPACT GrowthIMPACT Growth
IMPACT Growth
 
FIWARE Accelerator Programme
FIWARE Accelerator ProgrammeFIWARE Accelerator Programme
FIWARE Accelerator Programme
 
FIWARE Accelerator Programme Results - May 2015
FIWARE Accelerator Programme Results - May 2015FIWARE Accelerator Programme Results - May 2015
FIWARE Accelerator Programme Results - May 2015
 
Campus Party Brazil Agenda
Campus Party Brazil AgendaCampus Party Brazil Agenda
Campus Party Brazil Agenda
 
FIWARE & TM Forum partnership (Infographic)
FIWARE & TM Forum partnership (Infographic)FIWARE & TM Forum partnership (Infographic)
FIWARE & TM Forum partnership (Infographic)
 

Similar to NGSIv2 Overview for Developers that Already Know NGSIv1

NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1
Fermin Galan
 
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
Fermin Galan
 
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
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Fermin Galan
 
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Fermin Galan
 
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Orion Context Broker NGSIv2 Overview for Developers That Already Know NGSIv1 ...
Fermin Galan
 
NGSIv2 Overview for Developers That Already Know NGSIv1 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
Fermin Galan
 
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
Fermin Galan
 
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
Fermin Galan
 
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
Actuation, Federation and Interoperability of Context Brokers
Actuation, Federation and Interoperability of Context BrokersActuation, Federation and Interoperability of Context Brokers
Actuation, Federation and Interoperability of Context Brokers
FIWARE
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0 Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
Sumanth Chinthagunta
 

Similar to NGSIv2 Overview for Developers that Already Know NGSIv1 (20)

NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1NGSIv2 Overview for Developers That Already Know NGSIv1
NGSIv2 Overview for Developers That Already Know NGSIv1
 
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
orioncontextbroker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20...
 
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...
 
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 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 ...
 
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
 
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
ngsiv2-overview-for-developers-that-already-know-ngsiv1-20190214
 
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
NGSIv2 Overview for Developers That Already Know NGSIv1 20180928
 
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
Orion contextbroker ngs-iv2-overview-for-developers-that-already-know-ngsiv1-...
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
 
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...
 
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...
 
Actuation, Federation and Interoperability of Context Brokers
Actuation, Federation and Interoperability of Context BrokersActuation, Federation and Interoperability of Context Brokers
Actuation, Federation and Interoperability of Context Brokers
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0 Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
 

More from FIWARE

Behm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptx
FIWARE
 
Katharina Hogrebe Herne Digital Days.pdf
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdf
FIWARE
 
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
FIWARE
 
Behm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptx
FIWARE
 
Evangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptx
FIWARE
 
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
FIWARE
 
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
FIWARE
 
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
FIWARE
 
Ulrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxUlrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptx
FIWARE
 
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxAleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
FIWARE
 
Water Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfWater Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdf
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
 
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
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
 
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
FIWARE
 
WE_LoRaWAN _ IoT.pptx
WE_LoRaWAN  _ IoT.pptxWE_LoRaWAN  _ IoT.pptx
WE_LoRaWAN _ IoT.pptx
FIWARE
 
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
FIWARE
 

More from FIWARE (20)

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

Recently uploaded

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
saathvikreddy2003
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 

Recently uploaded (19)

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 

NGSIv2 Overview for Developers that Already Know NGSIv1

  • 1. NGSIv2 Overview for Developers That Already Know NGSIv1 Fermín Galán Márquez Technological Expert. Orion Context Broker Development Lead fermin.galanmarquez@telefonica.com
  • 2. Outline • Introduction to NGSIv2 • RESTful-ness • URL & payload simplification • Native JSON datatypes • Text-based attribute value set/get • Geolocation capabilities • Datetime support • Filtering • Subscription improvements • Batch operations • Working with IDs • Pagination • Next things to come 2
  • 3. Two “flavors” of NGSI API • NGSIv1 (the one you already know ) – Original NGSI RESTful binding of OMA-NGSI – Implemented in 2013 – Uses the /v1 prefix in resource URL • NGSIv2 – A revamped, simplified binding of OMA-NGSI • Simple things must be easy • Complex things should be possible • Agile, implementation-driven approach • Make it as developer-friendly as possible (RESTful, JSON, …) – Enhanced functionality compared to NGSIv1 (e.g. filtering) – Stable, ready for production, version already available • Current NGSIv2 version is Release Candidate 2016.10 http://telefonicaid.github.io/fiware- orion/api/v2/stable • New features coming (see last part of this presentation) – Uses the /v2 prefix in resource URL • Introduction to NGSIv2 – https://docs.google.com/presentation/d/1_fv9dB5joCsOCHlb4Ld6A- QmeIYhDzHgFHUWreGmvKU/edit#slide=id.g53c31d7074fd7bc7_0 3
  • 4. The NGSI model is kept as it is in NGSIv2 Attributes • Name • Type • Value Entity • EntityId • EntityType 1 n “has” Metadata • Name • Type • Value1 n “has” 4
  • 5. NGSIv2 status (AKA the “NGSIv2 disclaimer”) • NGSIv2 is in “release candidate” status – By "release candidate" we mean that the specification is quite stable, but changes may occur with regard to new release candidates or the final version. In particular, changes may be of two types: • Extensions to the functionality currently specified by this document. Note that in this case there isn't any risk of breaking backward compatibility on existing software implementations. • Slight modifications in the functionality currently specified by this document, as a consequence of ongoing discussions. Backward compatibility will be taken into account in this case, trying to minimize the impact on existing software implementations. In particular, only completely justified changes impacting backward compatibility will be allowed and "matter of taste" changes will not be allowed. 5
  • 6. So… when should I use NGSIv1 or NGSIv2? • In general, it is always preferable to use NGSIv2 • However, you would need to use NGSIv1 if – You need register/discovery operations (context management availability functionality) • Not yet implemented in NGSIv2 (in roadmap) – Zero tolerance to changes in software interacting with Orion • Even if you use NGSIv1, you can still use NGSIv2 functionality and requests – See “Considerations on NGSIv1 and NGSIv2 coexistence” section in the Orion manual 6
  • 7. RESTful-ness • In NGSIv1 – Originally based on OMA-NGSI standard operations, not really RESTful • The URL doesn’t identify a resource, but an operation type • The verb is always POST • Actually, NGSIv1 is closer to HTTP-based RPC than to RESTful – An extended set of operations (convenience operations) were added in a later stage but with “legacy” from standard operations that make it hard to apply full RESTful principles • E.g. dual response code • NGSIv2 has been designed from scratch with RESTful principles in mind – Batch operations (similar to standard operations in NGSIv1) are also provided, but without impacting the RESTful operations in the API 7
  • 8. RESTful-ness 8 200 OK ... { "contextElement" : { "type" : "", "isPattern" : "false", "id" : "Car1" }, "statusCode" : { "code" : "404", "reasonPhrase" : "No context element found", "details" : "Entity id: /Car1/" } } GET /v1/contextEntities/Car1 404 Not Found ... { "error": "NotFound", "description": "The requested entity has not been found. Check type and id“ } GET /v2/entities/Car1 NGSIv1 NGSIv2 both status codes have to be taken into account by the client in order to detect error conditions, which increases complexity only HTTP response code, following RESTful principles - simpler to process Example: get Car1 entity
  • 9. URL & payload simplification • In NGSIv1 the strict alignment with OMA NGSI involves complexity and ineffectiveness – Message payloads include a lot of structural overhead elements not actually needed – Response payload in methods that don’t really need a payload from a semantic point of view (e.g. update operation) – Unnecessarily long structural elements in URLs • NGSIv2 simplifies URLs and payload, leading to a much more lean and less verbose API 9
  • 10. URL & payload simplification 10 POST /v1/contextEntities ... { "id": "Car1", "type": "Car", "attributes": [ { "name": "colour", "type": "Text", "value": "red" } ] } 200 OK Location: /v2/entities?type=Car POST /v2/entities … { "id": "Car1", "type": "Car", "colour": { "value": "red", "type": "Text", } } NGSIv1 NGSIv2 Most of the NGSIv1 response payload is useless: clients only need to know the status code. In NGSIv2 the response has no payload at all shorter URLs in NGSIv2 200 OK ... { "contextResponses": [ { "attributes": [ { "name": "colour", "type": "float", "value": "" } ], "statusCode": { "code": "200", "reasonPhrase": "OK" } } ], "id": "Car1", "isPattern": "false", "type": “Car" } structural overhead Example: create Car1 entity (type Car) with attribute colour set to “Red”
  • 11. URL & payload simplification 11 GET /v1/contextEntities/type/Car/id/Car1/attributes/colour GET /v2/entities/Car1/attrs/colour?type=Car NGSIv1 NGSIv2 redundant (already part of the request URL) 200 OK ... { "attributes": [ { "name": "colour", "type": "Text", "value": " red" } ], "statusCode": { "code": "200", "reasonPhrase": "OK" } } mostly useless 200 OK ... { "value": "red", "type": "Text", "metadata": {} } shorter URL in NGSIv2 structural overhead Example: get attribute colour at Car1 entity (type Car)
  • 12. URL & payload simplification • Moreover, NGSIv2 provides simplified data representations – keyValues: exclude attribute type and metadata – values: only attribute values (attrs is used to order the values in the resulting vector) – unique: like values which in addition removes duplicate values • Not only for retrieval operations, also for creation/update operations – Default attribute types are used in that case 12 GET /v2/entities/Car1/attrs?options=keyValues 200 OK ... { "model": "Ford", "colour": "red", "temp": 22 } GET /v2/entities/Car1/attrs?options=values&attrs=model,colour,temp 200 OK ... ["Ford", "red", 22] Example: get attribute colour at Car1 entity (type Car)
  • 13. Native JSON datatypes • In NGSIv1 – All attribute values are string based to align with XML encoding • At the end, XML support was removed (in Orion 1.0.0), but it left an awful legacy  – Although creation/update operations can use numbers, bool, etc. at the end they are transformed to strings and stored in that way internally – Retrieve operation always provides string encoded values (*) • NGSIv2 fully supports all the types described in the JSON specification (string, number, boolean, object, array and null) 13 (*) Exception: entities created/updated with NGSIv2 (which support native types) and retrieved with NGSIv1 will render without stringification.
  • 14. Native JSON datatypes 1414 POST /v1/contextEntities ... { "id": "Car1", "type": "Car", "attributes": [ { "name": "speed", "type": "Number", "value": 98 } ] } POST /v2/entities?options=keyValues … { "id": "Car1", "type": "Car", "speed": 98, "isActive": true } NGSIv1 NGSIv2 created as number but retrieved as string… weird! GET /v1/contextEntities/Car1/attributes/speed ... { "attributes": [ { "name": "speed", "type": "Number", "value": "98" } ], "statusCode": { … } } GET /v2/entities/Car1/attrs?options=keyValues … { "speed": 98, "isActive": true } coherent result Example: create Car1 entity (type Car) with attribute speed set to 98
  • 15. Text-based attribute value set/get • In NGSIv1 – There is no similar functionality • NGSIv2 offers set/get attribute access directly without anything else than the attribute value itself in the request/response payload – In the set operation, attribute type and metadata are kept as they are 15 PUT /v2/entities/Car1/attrs/speed/value Content-Type: text/plain … 86 GET /v2/entities/Car1/attrs/speed/value 200 OK Content-Type: text/plain … 86200 OK … Example: set speed attribute value at Car1 entity Example: get speed attribute value at Car1 entity
  • 16. Geolocation capabilities • In NGSIv1 – Entity location must be a point – Queries are based on an area specification (circle or polygon, inner or outer area) – Query as part of queryContext payload scope • In NGSIv2 – In addition to point, entity location can be a line, box, polygon or arbitrary GeoJSON – Queries are based on a spatial relationship and a geometry • Spatial relationships: near (max and min distance), coveredBy, intersect, equal and disjoint • Geometries: point, line, box, polygon – Query as part of URL (more user-friendly than payload-based approach) 16
  • 17. Geolocation capabilities 17 NGSIv1 NGSIv2 Much easier and more compact in NGSIv2 POST /v1/queryContext … { "entities": [ { "type": "City", "isPattern": "true", "id": ".*" } ], "restriction": { "scopes": [ { "type" : "FIWARE::Location", "value" : { "circle": { "centerLatitude": "40.418889", "centerLongitude": "-3.691944", "radius": "13500" } } } ] } } GET /v2/entities? idPattern=.*& type=City& georel=near;maxDistance:13500& geometry=point& coords=40.418889,-3.691944 Example: retrieve all entities of type “City” (no matter the id) whose distance to Madrid city center (GPS coordinates 40.418889,-3691944) is less than 13.5 km
  • 18. Geolocation capabilities 18 Point location (the only one supported by NGSIv1) POST /v2/entities { "id": "E", "type": "T", "location": { "type": "geo:json", "value": { "type": "Polygon", "coordinates": [ [ [2, 1], [4, 3], [5, -1], [2, 1] ] ] } } } POST /v2/entities { "id": "E", "type": "T", "location": { "type": "geo:polygon", "value": [ "2, 2", "8, 7", "-1, 4", "2, 2"] } } POST /v2/entities { "id": "E", "type": "T", "location": { "type": "geo:box", "value": [ "2, 2", "8, 7" ] } } POST /v2/entities { "id": "E", "type": "T", "location": { "type": "geo:point", "value": "40.41,-3.69" } } POST /v2/entities { "id": "E", "type": "T", "location": { "type": "geo:line", "value": [ "2, 2", "8, 7" ] } } Line location (e.g. a street) Box location (e.g. a squared building) Polygon location (e.g. a city district) GeoJSON geometry (full flexibility)
  • 19. Datetime support • In NGSIv1 – There is no support for attributes meaning dates, they are treated as conventional strings • NGSIv2 implements date support – Based on ISO ISO8601 format, including partial representations and timezones • See https://fiware- orion.readthedocs.io/en/master/user/ngsiv2_implementati on_notes/index.html#datetime-support for syntax details – Use reserved attribute type DateTime to express a date – Date-based filters are supported 19
  • 20. Datetime support • Attribute value arithmetic filters can be used with dates as if they were numbers • Entity dateModified and dateCreated special attributes, to get entity creation and last modification timestamps – They are shown in query responses using attrs=dateModified,dateCreated • Entity dateModified and dateCreated special metadata, to get attribute creation and last modification timestamps – They are shown in query responses using metadata=dateModified,dateCreated 20 POST /v2/entities … { "id": "John", "birthDate": { "type": "DateTime", "value": "1979-10-14T07:21:24.238Z" } } GET /v2/entities?q=birthDate<1985-01-01T00:00:00 Example: create entity John, with birthDate attribute using type DateTime
  • 21. Filtering • In NGSIv1 – Limited filtering functionality, much of it based on queryContext complex scopes – Filters are not supported in subscriptions • In NGSIv2 the mechanism – Is simpler (see next slide) – Can be applied to both queries and subscriptions (described in a later topic of this presentation) 21 POST /v1/queryContext … { "restriction": { "scopes": [ { "type" : "FIWARE::StringFilter", "value" : "temp<24" … } This is the only interesting part, all the rest is structural overhead Example: filtering entities which temperature is less than 24
  • 22. • For the GET /v2/entities operation, retrieve all entities… – … of a given entity type – … whose entity id is in a list – ... whose entity id match a regex pattern • Example: the id starts with “Room” followed by a digit from 2 to 5 – … with an attribute that matches a given expression • Example: attribute temp is greater than 25 • Filters can be used simultaneously (i.e. like AND condition) 22 GET /v2/entities?type=Room GET /v2/entities?id=Room1,Room2 GET /v2/entities?idPattern=^Room[2-5] Filtering GET /v2/entities?q=temp>25 supported operators: • == (or :), equal • !=, unequal • >, greater than • <, less than • >=, greater than or equal • <=, less than or equal • A..B, range • ^=, pattern (regex) • Existence/inexistence
  • 23. • For the GET /v2/entities operation, retrieve all entities… – ... whose entity type match a regex pattern – … with an attribute which sub-key matches a given expression – … with an attribute metadata that matches a given expression – … with an attribute metadata which sub-key matches a given expression 23 GET /v2/entities?q=tirePressure.frontRight >130 attribute name attribute sub-key (for compound attribute values only) GET /v2/entities?mq=temperature.avg>25 GET /v2/entities?mq=tirePressure.accuracy.frontRight >90 metadata sub-key (for compound metadata values only) metadata name Filtering GET /v2/entities?typePattern=T[ABC]
  • 24. • By default all attribute are included in query responses or notifications • The attrs field (as parameter in GET operations and as notification sub-field in subscriptions) can be used to specify a filtering list • The attrs field can be also used to explicitly include some special attributes (not included by default) – dateCreated: entity creation date – dateModified: entity last modification date • The “*” can be used as an alias of “all the (regular) attributes” 24 Attributes filtering and special attributes
  • 25. • Examples – Include only attributes temp and lum • In queries: GET /v2/entities?attrs=temp,lum • In subscriptions: "attrs": [ "temp", "lum" ] – Include dateCreated and not any other attribute • In queries: GET /v2/entities?attrs=dateCreated • In subscriptions: "attrs": [ "dateCreated" ] – Include dateModified and all the other (regular) attributes • In queries: GET /v2/entities?attrs=dateModified,* • In subscriptions: "attrs": [ "dateModified", "*" ] – Include all attributes (same effect that not using attrs, not very interesting) • In queries: GET /v2/entities?attrs=* • In subscriptions: "attrs": [ "*" ] 25 Attributes filtering and special attributes
  • 26. • By default all attribute metadata are included in query responses and notifications • The metadata field (as parameter in GET operations and as notification sub-field in subscriptions) can be used to specify a filtering list • The metadata field can be also used to explicitly include some special metadata (not included by default) – dateCreated, dateModified: attribute creation or last modification date – actionType: which value is the action type corresponding to the update triggering the notification: “update”, “append” or “delete” – previousValue: which provides the value of the attribute previous to processing the update that triggers the notification • The “*” can be used as an alias of “all the (regular) metadata” 26 Metadata filtering and special metadata
  • 27. • Examples – Include only metadata MD1 and MD2 • In queries: GET /v2/entities?metadata=MD1,MD2 • In subscriptions: "metadata": [ "MD1", "MD2" ] – Include previousValue and not any other metadata • In queries: GET /v2/entities?metadata=previousValue • In subscriptions: "attrs": [ "previousValue" ] – Include actionType and all the other (regular) metadata • In queries: GET /v2/entities?metadata=actionType,* • In subscriptions: "attrs": [ "actionType", "*" ] – Include all metadatata (same effect that not using metadata, not very interesting) • In queries: GET /v2/entities?metadata=* • In subscriptions: "metadata": [ "*" ] 27 Metadata filtering and special metadata
  • 28. Subscription improvements • NGSIv1 context subscription API is very limited – There is no operation to list existing subscriptions • If a client loses the ID of created subscriptions, there is no way to retrieve them through the API – No support for permanent subscriptions • Creating absurdly long subscriptions (e.g. 100 years) is a dirty workaround – Fix notification structure • Difficult to integrate to arbitrary endpoints (e.g. public REST services) – No support for filters • NGSIv2 subscription API solves all these limitations and introduces some additional enhancements – Notification attributes based on “blacklist” (in addition to the “whitelist” approach in NGSIv1) – Ability to pause/resume subscriptions – Extra fields: times sent, last notification and description 28
  • 29. Anatomy of a NGSIv2 subscription 29 POST /v2/subscriptions … { "subject": { "entities": [ { "id": "Room1", "type": "Room" } ] }, "condition": { "attrs": [ "temp" ] }, "notification": { "http": { "url": "http://<host>:<port>/publish" }, "attrs": [ "temp" ] }, "expires": "2026-04-05T14:00:00.00Z", "throttling": 5 } 201 Created Location: /v2/subscriptions/51c0ac9ed714fb3b37d7d5a8 ... POST /v1/subscribeContext … { "entities": [ { "type": "Room", "isPattern": "false", "id": "Room1" } ], "attributes": [ "temp“ ], "reference": "http://<host>:<port>/publish", "duration": "P1M", "notifyConditions": [ { "type": "ONCHANGE", "condValues": [ "temp" ] } ], "throttling": "PT5S" } 200 OK ... { "subscribeResponse": { "duration": "P1M", "subscriptionId": "51c0ac9ed714fb3b37d7d5a8", "throttling": "PT5S" } } NGSIv1 NGSIv2 Simpler response (no payload) Simpler way of specifying expiration and throttling in NGSIv2 Redundant Example: subscribe to Room1 entity, so whenever a change occurs in the temp attribute a notification including only temp is sent
  • 30. List subscriptions and special fields in NGSIv2 • List operations (not available in NGSIv1) – GET /v2/subscriptions lists all subscriptions – GET /v2/subscriptions/<id> retrieves information of a particular subscription • Whitelist vs. blacklist (in the notification field) – Use "attrs": [ "A", "B" ] to “include A and B in the notification” (whitelist) – Use "exceptAttrs": [ "A", "B" ] to “include all the attributes except A and B” (blacklist) – Use "attrs": [ ] to include “all the attributes” (special case) • Other informative fields (in the notification field) – timesSent: the number of times that the subscription has been triggered and a notification has been sent – lastNotification: datetime corresponding to the last notification • Other informative fields (at root level) – description, free text descriptive text for user convenience 30
  • 31. Permanent and paused subscriptions in NGSIv2 • The status attribute can be used to pause/resume subscriptions • In GET operations, the status field can be – active: subscription is active (notifications will be sent) – inactive: subscription is inactive (notifications will not be sent) – expired: subscription is expired (notifications will not be sent) 31 PATCH /v2/subscriptions/<id> … { "status": "active" } PATCH /v2/subscriptions/<id> … { "status": "inactive" } To pause To resume
  • 32. Notification formats in NGSIv2 • The optional attrsFormat field can be used to choose between different notification flavors, aligned with the representation modes • Notifications include the NGSIv2-AttrsFormat header to help the receiver identify the format • legacy can be used as value for attrsFormat in order to send notifications in NGSIv1 format – Very useful when integrating legacy notification endpoints 32 { "subscriptionId": "12345", "data": [ { "id": "Room1", "type": "Room", "temperature": { "value": 23, "type": "Number", "metadata": {} } } ] } { "subscriptionId": "12345", "data": [ { "id": "Room1", "type": "Room", "temperature": 23 } ] } { "subscriptionId": "12345", "data": [ [ 23 ] ] } normalized (default) keyValues values Outer vector represent the list of entities, inner vector the values of the attribute of each entity (not too interesting in this single-entity single-attribute example)
  • 33. Custom notifications in NGSIv2 • Apart from the standard formats defined in the previous slide, NGSIv2 allows to re-define all the notification aspects • httpCustom is used (instead of http) with the following subfields – URL query parameters – HTTP method – HTTP headers – Payload (not necessarily JSON!) • A simple macro substitution language based on ${..} syntax can be used to “fill the gaps” with entity data (id, type or attribute values) 33
  • 34. Custom notifications in NGSIv2 34 … "httpCustom": { "url": "http://foo.com/entity/${id}", "headers": { "Content-Type": "text/plain" }, "method": "PUT", "qs": { "type": "${type}" }, "payload": "The temperature is ${temp} degrees" } … PUT http://foo.com/entity/DC_S1-D41?type=Room Content-Type: text/plain Content-Length: 31 The temperature is 23.4 degrees PUT /v2/entities/DC_S1-D41/attrs/temp/value?type=Room … 23.4 Custom notification configuration update notification Example: send a text notification (i.e. not JSON) with temperature value, using the entity id and type as part of the URL
  • 35. 35 POST /v2/subscriptions … { "subject": { "entities": [ { "id": "Truck11", "type": "RoadVehicle" }, { "idPattern": "^Car[2-5]", "type": "RoadVehicle" } ], "condition": { "attrs": [ "speed" ], "expression": { "q": "speed>90", "georel": "near;maxDistance:100000", "geometry": "point", "coords": "40.418889,-3.691944" } } }, … } • Filters (described in previous slides) can be also used in subscriptions – id – type – id pattern – attribute values – geographical location Subscription filters in NGSIv2 Example: subscribe to speed changes in entities with id Truck11 or Car2 to Car5 (both case of type RoadVehicle) whenever speed is greater than 90 and the vehicle distance to Madrid city center is less than 100 km
  • 36. 36 POST /v2/subscriptions … { "subject": { "entities": [ { "idPattern": ".*", "typePattern": ".*Vehicle" }, ], "condition": { "attrs": [ "speed" ], "expression": { "q": "speed>90", "mq": "speed.average==80..100", "georel": "near;maxDistance:100000", "geometry": "point", "coords": "40.418889,-3.691944" } } }, … } • They can be used also in subscriptions – type pattern – metadata value Subscription filters in NGSIv2 Example: subscribe to speed changes in any entities of any type ending with Vehicle (such as RoadVehicle, AirVehicle, etc.) whenever speed is greater than 90 its average metadata is between 80 and 90 and the vehicle distance to Madrid city center is less than 100 km
  • 37. Batch operations • In NGSIv1 we have standard operations – POST /v1/updateContext – POST /v1/queryContext • Similar but more user-friendly operations have been included in NGSIv2 – POST /v2/op/update – POST /v2/op/query 37
  • 38. Batch operations 38 POST /v1/updateContext … { "updateAction": "APPEND“, "contextElements": [ { "type": "Room", "isPattern": "false", "id": "Room1", "attributes": [ { "name": "temp", "type": "float", "value": "29" } ] } ] } POST /v2/op/update { "actionType": "APPEND", "entities": [ { "type": "Room", "id": "Room1", "temperature": { "type": "Number", "value": 29 } } ] } 201 Created NGSIv1 NGSIv2 structural overhead 200 OK ... { "contextResponses" : [ … ], "statusCode" : { "code" : "200", "details" : "OK" } } NGSIv2 response doesn’t have any payload at all lots of useless stuff here Example: create Room1 entity (type Room) with attribute temp set to 29
  • 39. Batch operations 39 POST /v1/queryContext … { "entities": [ { "type": "Room", "isPattern": "true", "id": ".*" } , "attributes": [ "temp" ] ] } POST /v2/op/query … { "entities": [ { "idPattern": ".*", "type": "T" } ], "attributes": [ "temp" ] } NGSIv1 NGSIv2 Requests are more or less the same, but the simplicity of NGSIv2 becomes evident when comparing responses 200 OK ... { "contextResponses": [ { "contextElement": { "attributes": [ { "name": "temp", "type": "Number", "value": "25" } ], "id": "Room1", "isPattern": "false", "type": "Room" }, "statusCode": { … }} ] } 200 OK ... [ { "id": "Room1", "type": "Room", "temp": { "type": "Number", "value": 25 } } ] Example: get temp attribute of all entities with type Room
  • 40. Pagination • In NGSIv1 – based on limit, offset and details – Dirty workaround to fit count into NGSIv1 payloads, using an errorCode for something that actually is not an error and forcing to text based processing of the details field – Fixed order: always by creation date • In NGSIv2 – based on limit, offset and options=count • This part doesn’t change too much – Cleaner and easier way of returning count, with the Fiware-Total-Count HTTP header in the response – Configurable ordering based on orderBy parameter • See details in the NGSIv2 specification 40 "errorCode": { "code": "200", "details": "Count: 322", "reasonPhrase": "OK" } Fiware-Total-Count: 322
  • 41. Working with IDs • In NGSIv1 – Fields such as entity id, attribute name, etc. may have any value (*) – This could cause a lot of problems as these fields use to act as IDs in many places when propagated through notifications • E.g. Cygnus MySQL sink may have problems when these fields are mapped to tables names, whose allowed charset is very strict – In addition, NGSIv1 allows ids or attribute names as "" (empty string) which is weird and typically an error condition in the client • NGSIv2 establishes a set of restrictions to ensure sanity in the usage of ID fields. In particular: – Allowed characters are those in the plain ASCII set, except the following ones: control characters, whitespace, &, ?, / and #. – Maximum field length is 256 characters. – Minimum field length is 1 character. – The rules above apply to the following six fields (identified as ID fields): entity id, entity type, attribute name, attribute type, metadata name, metadata type 41 (*) Excluding the forbidden characters described in the Orion manual, which are general for all the fields in both NGSIv1 and NGSIv2 APIs
  • 42. Next things to come • Up to now, all the slides have described the stable version of the API corresponding to Release Candidate 2016.10 (http://fiware.github.io/specifications/ngsiv2/stable) • There is also a work in progress (WIP) version, describing future functionally (http://fiware.github.io/specifications/ngsiv2/latest) • Warning: the future functionality of the WIP version is subject to change and it may change before to be consolidated in a next Release Candidate stable version 42
  • 43. • Status failed means that last attempt to notify failed – E.g. the endpoint is not reachable • Detailed information in the notifications element – timesSent: total number of notifications attempts (both successful and failed) – lastSuccess: last time that notification was successfully sent – lastFailure: last time that notification was tried and failed – lastNotification: last time the notification was sent (either success or failure) • Corollary: lastNotification value is the same than either lastFailure or lastSuccess 43 Notification status 200 OK Content-Type: application/json … [{ "id": " 51c0ac9ed714fb3b37d7d5a8 ", "expires": "2026-04-05T14:00:00.00Z", "status": "failed", "subject": { … }, "notification": { "timesSent": 3, "lastNotification": "2016-05-31T11:19:32.00Z", "lastSuccess": "2016-05-31T10:07:32.00Z", "lastFailure": "2016-05-31T11:19:32.00Z", … } }]
  • 44. Useful references • Introduction to NGSI and Orion – http://bit.ly/fiware-orion • Orion Manual – https://fiware-orion.readthedocs.io • Orion page at FIWARE Catalogue – http://catalogue.fiware.org/enablers/publishsubscribe- context-broker-orion-context-broker • NGSIv2 specs – http://fiware.github.io/specifications/ngsiv2/stable – http://fiware.github.io/specifications/ngsiv2/latest • Orion support at StackOverflow – Look for existing questions at http://stackoverflow.com/questions/tagged/fiware-orion – Ask your questions using the “fiware-orion” tag • FIWARE Tour Guide Application – https://github.com/fiware/tutorials.TourGuide-App 44
  • 46. Batch query scope • This is the way of including q, mq and geo filters (typically used as URL param of a GET operation) in a batch query • Like NGSIv1 scopes but much simpler (without the restriction structural overhead) 46 POST /v2/op/query … { "entities": [ { "idPattern": ".*", "type": "T" } ], "attributes": [ "temp" ], "scopes": [ { "type": "FIWARE::StringQuery", "value": "temp" }, { "type" : "FIWARE::Location::NGSIv2", "value" : { "georel": [ "near", "maxDistance:20000" ], "geometry": "point", "coords": [ [40.31,-3.75] ] } } ] } Example: get all entities of type T with the attribute temp as long as that attribute is greater than 40 and the entity distance to coordinates (40.31, -3.75) is less than 20 km