11## Advanced Topics
22
3- * [ Secured access to the Context Broker] ( #secured-access-to-the-context-broker )
4- * [ GeoJSON support NGSI-LD only] ( #geojson-support-ngsi-ld-only )
5- * [ Metadata support] ( #metadata-support )
6- * [ NGSI LD data and metadata considerations] ( #ngsi-ld-data-and-metadata-considerations )
7- * [ NGSI-LD Linked Data support] ( #ngsi-ld-linked-data-support )
8- * [ Autoprovision configuration (autoprovision)] ( #autoprovision-configuration-autoprovision )
9- * [ Explicitly defined attributes (explicitAttrs)] ( #explicitly-defined-attributes-explicitattrs )
10- * [ Configuring operation to persist the data in Context Broker (appendMode)] ( #configuring-operation-to-persist-the-data-in-context-broker-appendmode )
11- * [ Data mapping plugins] ( #data-mapping-plugins )
12- * [ Development] ( #development )
13- * [ Provided plugins] ( #provided-plugins )
14- * [ Timestamp Compression plugin (compressTimestamp)] ( #timestamp-compression-plugin-compresstimestamp )
15- * [ Attribute Alias plugin (attributeAlias)] ( #attribute-alias-plugin-attributealias )
16- * [ Event plugin (addEvents)] ( #event-plugin-addevents )
17- * [ Timestamp Processing Plugin (timestampProcess)] ( #timestamp-processing-plugin-timestampprocess )
18- * [ Expression Translation plugin (expressionTransformation)] ( #expression-translation-plugin-expressiontransformation )
19- * [ Multientity plugin (multiEntity)] ( #multientity-plugin-multientity )
20- * [ Bidirectionality plugin (bidirectional)] ( #bidirectionality-plugin-bidirectional )
21- * [ Autoprovision configuration (autoprovision)] ( #autoprovision-configuration-autoprovision )
22- * [ Explicitly defined attributes (explicitAttrs)] ( #explicitly-defined-attributes-explicitattrs )
23- * [ Configuring operation to persist the data in Context Broker (appendMode)] ( #configuring-operation-to-persist-the-data-in-context-broker-appendmode )
24- * [ Old IoTAgent data migration] ( #old-iotagent-data-migration )
25-
3+ - [ Secured access to the Context Broker] ( #secured-access-to-the-context-broker )
4+ - [ NGSI-LD ` GeoProperty ` support] ( #ngsi-ld-geoproperty-support )
5+ - [ Metadata support] ( #metadata-support )
6+ - [ NGSI LD data and metadata considerations] ( #ngsi-ld-data-and-metadata-considerations )
7+ - [ NGSI-LD Linked Data support] ( #ngsi-ld-linked-data-support )
8+ - [ Autoprovision configuration (autoprovision)] ( #autoprovision-configuration-autoprovision )
9+ - [ Explicitly defined attributes (explicitAttrs)] ( #explicitly-defined-attributes-explicitattrs )
10+ - [ Configuring operation to persist the data in Context Broker (appendMode)] ( #configuring-operation-to-persist-the-data-in-context-broker-appendmode )
11+ - [ Data mapping plugins] ( #data-mapping-plugins )
12+ - [ Development] ( #development )
13+ - [ Provided plugins] ( #provided-plugins )
14+ - [ Timestamp Compression plugin (compressTimestamp)] ( #timestamp-compression-plugin-compresstimestamp )
15+ - [ Attribute Alias plugin (attributeAlias)] ( #attribute-alias-plugin-attributealias )
16+ - [ Event plugin (addEvents)] ( #event-plugin-addevents )
17+ - [ Timestamp Processing Plugin (timestampProcess)] ( #timestamp-processing-plugin-timestampprocess )
18+ - [ Expression Translation plugin (expressionTransformation)] ( #expression-translation-plugin-expressiontransformation )
19+ - [ Multientity plugin (multiEntity)] ( #multientity-plugin-multientity )
20+ - [ Bidirectionality plugin (bidirectional)] ( #bidirectionality-plugin-bidirectional )
21+ - [ Autoprovision configuration (autoprovision)] ( #autoprovision-configuration-autoprovision )
22+ - [ Explicitly defined attributes (explicitAttrs)] ( #explicitly-defined-attributes-explicitattrs )
23+ - [ Configuring operation to persist the data in Context Broker (appendMode)] ( #configuring-operation-to-persist-the-data-in-context-broker-appendmode )
24+ - [ Old IoTAgent data migration] ( #old-iotagent-data-migration )
2625
2726### Secured access to the Context Broker
2827
2928For access to instances of the Context Broker secured with a
3029[ PEP Proxy] ( https://github.com/telefonicaid/fiware-orion-pep ) , an authentication mechanism based in Keystone Trust
31- tokens is provided. A trust token is a way of Keystone to allow an user delegates a role to another user for a subservice.
32- It is a long-term token that can be issued by any user to give another user permissions
33- to impersonate him with a given role in a given project (subservice). Such impersonation itself is in turn based on a short-term
34- access token.
30+ tokens is provided. A trust token is a way of Keystone to allow an user delegates a role to another user for a
31+ subservice. It is a long-term token that can be issued by any user to give another user permissions to impersonate him
32+ with a given role in a given project (subservice). Such impersonation itself is in turn based on a short-term access
33+ token.
3534
3635For the authentication mechanisms to work, the ` authentication ` attribute in the configuration has to be fully
3736configured, and the ` authentication.enabled ` subattribute should have the value ` true ` .
@@ -73,15 +72,18 @@ Agent.
7372
7473Complete info on Keystone trust tokens could be found at:
7574
76- - [ Trusts concept] ( https://docs.openstack.org/keystone/stein/user/trusts )
77- - [ Trusts API] ( https://docs.openstack.org/keystone/stein/api_curl_examples.html#post-v3-os-trust-trusts )
75+ - [ Trusts concept] ( https://docs.openstack.org/keystone/stein/user/trusts )
76+ - [ Trusts API] ( https://docs.openstack.org/keystone/stein/api_curl_examples.html#post-v3-os-trust-trusts )
77+
78+ ### NGSI-LD ` GeoProperty ` support
7879
79- ### GeoJSON support NGSI-LD only
80+ For NGSI-LD only, the defined ` type ` of any GeoJSON attribute can be any set using any of the standard NGSI-v2 GeoJSON
81+ types - (e.g. ` geo:json ` , ` geo:point ` ). NGSI-LD formats such as ` GeoProperty ` , ` Point ` and ` LineString ` are also
82+ accepted ` type ` values. If the latitude and longitude are received as separate measures, the JEXL or legacy
83+ [ expression language] ( expressionLanguage.md ) can be used to concatenate them into GeoJSON objects an array of tuples or
84+ a string as shown
8085
81- The defined ` type ` of any GeoJSON attribute can be any set to any of the standard NGSI-v2 GeoJSON types - (e.g.
82- ` geo:json ` , ` geo:point ` ). NGSI-LD formats such as ` GeoProperty ` , ` Point ` and ` LineString ` are also accepted ` type `
83- values. If the latitude and longitude are received as separate measures, the
84- [ expression language] ( expressionLanguage.md ) can be used to concatenate them.
86+ #### Legacy - encode as String
8587
8688``` json
8789{
@@ -99,8 +101,30 @@ values. If the latitude and longitude are received as separate measures, the
99101}
100102```
101103
102- For ` attributes ` and ` static_attributes ` which need to be formatted as GeoJSON values, three separate input formats are
103- accepted. Provided the ` type ` is provisioned correctly, the ` value ` may be defined using any of the following formats:
104+ #### JEXL - encode as GeoJSON
105+
106+ ``` json
107+ {
108+ "entity_type" : " GPS" ,
109+ "resource" : " /iot/d" ,
110+ "protocol" : " PDI-IoTA-JSON" ,
111+ "expressionLanguage" : " jexl" ,
112+ ..etc
113+ "attributes" : [
114+ {
115+ "name" : " location" ,
116+ "type" : " geo:json" ,
117+ "expression" : " {coordinates: [longitude,latitude], type: 'Point'}"
118+ }
119+ ]
120+ }
121+ ```
122+
123+ JEXL can be used to create GeoJSON objects directly. The Legacy expression language does not support GeoJSON. However,
124+ there is a workaround specifically for NGSI-LD Entities which always require ` location ` to be encoded as GeoJSON. For
125+ ` attributes ` and ` static_attributes ` which need to be formatted as GeoJSON values, three separate input formats are
126+ currently accepted. Provided the ` type ` is provisioned correctly, the ` value ` may be defined using any of the following
127+ formats:
104128
105129- a comma delimited string
106130
@@ -269,26 +293,28 @@ updated as shown:
269293
270294### Autoprovision configuration (autoprovision)
271295
272- By default, when a measure arrives to the IoTAgent, if the ` device_id ` does not match with an existing one, then, the IoTA
273- creates a new device and a new entity according to the group config. Defining the field ` autoprovision ` to ` false `
274- when provisioning the device group, the IoTA to reject the measure at the southbound, allowing only to persist the
275- data to devices that are already provisioned. It makes no sense to use this field in device provisioning since it is
276- intended to avoid provisioning devices (and for it to be effective, it would have to be provisional).
296+ By default, when a measure arrives to the IoTAgent, if the ` device_id ` does not match with an existing one, then, the
297+ IoTA creates a new device and a new entity according to the group config. Defining the field ` autoprovision ` to ` false `
298+ when provisioning the device group, the IoTA to reject the measure at the southbound, allowing only to persist the data
299+ to devices that are already provisioned. It makes no sense to use this field in device provisioning since it is intended
300+ to avoid provisioning devices (and for it to be effective, it would have to be provisional).
277301
278302### Explicitly defined attributes (explicitAttrs)
279303
280- If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is stored
281- in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure element. By adding the
282- field ` explicitAttrs ` with ` true ` value to device or group provision, the IoTAgent rejects the measure elements that are not defined
283- in the mappings of device or group provision, persisting only the one defined in the mappings of the provision. If ` explicitAttrs `
284- is provided both at device and group level, the device level takes precedence.
304+ If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is
305+ stored in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure
306+ element. By adding the field ` explicitAttrs ` with ` true ` value to device or group provision, the IoTAgent rejects the
307+ measure elements that are not defined in the mappings of device or group provision, persisting only the one defined in
308+ the mappings of the provision. If ` explicitAttrs ` is provided both at device and group level, the device level takes
309+ precedence.
285310
286311### Configuring operation to persist the data in Context Broker (appendMode)
287312
288- This is a flag that can be enabled by activating the parameter ` appendMode ` in the configuration file or by using the ` IOTA_APPEND_MODE `
289- environment variable (more info [ here] ( https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md ) ).
290- If this flag is activated, the update requests to the Context Broker will be performed always with APPEND type, instead of the
291- default UPDATE. This have implications in the use of attributes with Context Providers, so this flag should be used with care.
313+ This is a flag that can be enabled by activating the parameter ` appendMode ` in the configuration file or by using the
314+ ` IOTA_APPEND_MODE ` environment variable (more info
315+ [ here] ( https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md ) ). If this flag is
316+ activated, the update requests to the Context Broker will be performed always with APPEND type, instead of the default
317+ UPDATE. This have implications in the use of attributes with Context Providers, so this flag should be used with care.
292318
293319### Data mapping plugins
294320
@@ -373,8 +399,8 @@ events in the IoT Agent with the configured type name will be marked as events.
373399
374400##### Timestamp Processing Plugin (timestampProcess)
375401
376- This plugin processes the entity attributes looking for a ` TimeInstant ` attribute. If one is found, for NGSIv2,
377- the plugin adds a ` TimeInstant ` attribute as metadata for every other attribute in the same request. With NGSI-LD, the
402+ This plugin processes the entity attributes looking for a ` TimeInstant ` attribute. If one is found, for NGSIv2, the
403+ plugin adds a ` TimeInstant ` attribute as metadata for every other attribute in the same request. With NGSI-LD, the
378404Standard ` observedAt ` property-of-a-property is used instead.
379405
380406##### Expression Translation plugin (expressionTransformation)
@@ -438,7 +464,8 @@ When a device is provisioned with bidirectional attributes, the IoTAgent subscri
438464change notification for that attribute arrives to the IoTA, it applies the transformation defined in the device
439465provisioning payload to the notification, and calls the underlying notification handler with the transformed entity.
440466
441- The following ` attributes ` section shows an example of the plugin configuration (using IOTA_AUTOCAST=false to avoid translation from geo: point to geo: json )
467+ The following ` attributes ` section shows an example of the plugin configuration (using IOTA_AUTOCAST=false to avoid
468+ translation from geo: point to geo: json )
442469
443470``` json
444471 "attributes" : [
0 commit comments