diff --git a/docs/usermanual.md b/docs/usermanual.md index d1754772..f7d602e2 100644 --- a/docs/usermanual.md +++ b/docs/usermanual.md @@ -116,10 +116,47 @@ tools available online like [this one](https://string-functions.com/string-hex.a It is possible report as a measure a NGSI-v2 or NGSI-LD payload when related device/group is configured with `payloadType` `ngsiv2` or `ngsild`. In these cases payload is ingested as measure where entity attributes are measure -attributes and `id` and `type` are ignored, since `id` and `type` from device/group configuration provisioned are used, -as well as `actionType`. +attributes. -Examples of these `ngsiv2` payloads are the following ones: +Note that the entity ID and type in the measure are also include as attributes `measure_id` and `measure_type` as described +[here](https://github.dev/telefonicaid/iotagent-node-lib/doc/api.md#special-measures-and-attributes-names) (both using +attribute type `Text`). The ID and type of the entity updated at Context Broker is taken from device/group configuration or provision, + +However, it is possible to use the same entity ID that the original one by using `entityNameExp` +at [device group provision](https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#config-group-datamodel), this way: + +``` +"entityNameExp": "measure_id" +``` + +The `actionType` used in the update sent to Context Broker is taken from the measure in the case that measure corresponds to +a NGSI-v2 batch update. In other cases (i.e. NGSI-LD or NGSI-v2 non-batch update), the `actionType` is the default one (`append`). + +For instance, given an incoming **measure** as the follwing one: + +```json +{ + "id": "MyEntityId1", + "type": "MyEntityType1", + "attr1": { "type": "Text", "value": "MyAttr1Value"} +} +``` + +It would persist an entity into the Context Broker like the following one: + +```json +{ + "id":"MyProvisionID", + "type":"MyProvisionType", + "attr1": { "type": "Text", "value": "MyAttr1Value"}, + "measure_id": {"type": "Text","value": "MyEntityId1"}, + "measure_type":{"type": "Text","value": "MyEntityType1"} +} +``` + +The IoTA is able to ingest different types of `NGSI-V2` and `NGSI-LD` payloads like the following ones: + +**NGSI-V2** (1) NGSI-v2 batch update format: @@ -171,7 +208,7 @@ Examples of these `ngsiv2` payloads are the following ones: } ``` -Example of these `ngsild` payloads are the following ones: +**NGSI-LD** (1) NGSI-LD entities array format: