From aeafe6b55e0a1f33682bd5b1cf48d755fd513452 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Mon, 4 Dec 2023 13:32:36 +0100 Subject: [PATCH 01/24] Update ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 7a431023c..c589ec9c9 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -42,7 +42,7 @@ Each entity type needs an url and an unique field to be persisted into the featu NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` and `service path`, to provide multiple tables access. -Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. +Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. This means that a feature named `type` in the Feature Table cannot be filled in by the sink. If Feature Table needs to persist the value of entity type it has to be in a feature different than `type`. All this parameters, can be customized using Cygnus mapping capabilities. From ad1a657cc8063d7a93fb239d76df5d4a899db13b Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Mon, 4 Dec 2023 13:48:45 +0100 Subject: [PATCH 02/24] Add note to case-sensitivity issue --- .../ngsi_arcgis_featuretable_sink.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index c589ec9c9..90228c54e 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -160,6 +160,11 @@ Connections to `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url` and `cygnus-ng [Top](#top) +#### About case-sensitivity + +**[FIXME #2320](https://github.com/telefonicaid/fiware-cygnus/issues/2320)**. Currently Arcgis sink is case sensitive with the attributes to persist in the Feature Table although arcgis is not case sensitive. This behaviour requires the use of name-mappings to match the case letters of the attribute definition in the Feature Table. + +[Top](#top) ## Programmers guide ### `NGSIArcgisFeatureTableSink` class From 665328ac432451342271fbca46072035781c8060 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 5 Dec 2023 12:27:33 +0100 Subject: [PATCH 03/24] Update ngsi_arcgis_featuretable_sink.md --- .../ngsi_arcgis_featuretable_sink.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 90228c54e..a3930329a 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -11,6 +11,8 @@ Content: * [Configuration](#section2.1) * [Important notes](#section2.2) * [About batching](#section2.2.1) + * [About case-sensitivity](#section2.2.2) + * [About Arcgis data types](#section2.2.3) * [Programmers guide](#section3) * [`NGSIArcgisFeatureTableSink` class](#section3.1) * [Authentication and authorization](#section3.2) @@ -160,12 +162,21 @@ Connections to `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url` and `cygnus-ng [Top](#top) -#### About case-sensitivity +#### About case-sensitivity **[FIXME #2320](https://github.com/telefonicaid/fiware-cygnus/issues/2320)**. Currently Arcgis sink is case sensitive with the attributes to persist in the Feature Table although arcgis is not case sensitive. This behaviour requires the use of name-mappings to match the case letters of the attribute definition in the Feature Table. [Top](#top) +#### About Arcgis data types + +- **esriFieldTypeDate** + +From https://doc.arcgis.com/en/data-pipelines/latest/process/output-feature-layer.htm +> ... Date fields are stored in feature layers using the format milliseconds from epoch and the coordinated universal time (UTC) time zone. The values will be displayed differently depending on where you are viewing the data. For example, querying the feature service REST end point will return values in milliseconds from epoch, such as 1667411518878.... + +So, to persist a `esriFieldTypeDate` field in the Feature Layer, cygnus has to receive an attribute "Number" from the CB with the milliseconds from epoch. + ## Programmers guide ### `NGSIArcgisFeatureTableSink` class As any other NGSI-like sink, `NGSIArcgisFeatureTableSink` extends the base `NGSISink`. The methods that are extended are: From e928d8241019fb59072e8b94f8a3bb53f359f4e0 Mon Sep 17 00:00:00 2001 From: Manuel Carracedo Date: Tue, 5 Dec 2023 13:02:57 +0100 Subject: [PATCH 04/24] Update ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index a3930329a..349f95de2 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -135,7 +135,6 @@ A configuration example could be: cygnus-ngsi.sinks.arcgis-sink.type = com.telefonica.iot.cygnus.sinks.NGSIArcgisFeatureTableSink cygnus-ngsi.sinks.arcgis-sink.channel = arcgis-channel cygnus-ngsi.sinks.arcgis-sink.enable_name_mappings = true - cygnus-ngsi.sinks.arcgis-sink.enable_name_mappings = false cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url = https://arcgis.com/UsuarioArcgis/arcgis/rest/services cygnus-ngsi.sinks.arcgis-sink.arcgis_username = myuser cygnus-ngsi.sinks.arcgis-sink.arcgis_password = mypassword From 720a898788b6ab4d0e2a280af7de986be3f33a59 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 5 Dec 2023 14:22:15 +0100 Subject: [PATCH 05/24] Update ngsi_arcgis_featuretable_sink.md --- .../ngsi_arcgis_featuretable_sink.md | 124 +++++++++++++++++- 1 file changed, 118 insertions(+), 6 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 349f95de2..2aec53bd5 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -42,29 +42,75 @@ Argis feature tables must be provisioned before sending entities. #### ArcGis databases naming conventions Each entity type needs an url and an unique field to be persisted into the feature table. -NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` and `service path`, to provide multiple tables access. +NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` and `service path`, to provide multiple tables access. The final url is compounds by `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url`+`fiware-service`+`fiware-servicepath`. Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. This means that a feature named `type` in the Feature Table cannot be filled in by the sink. If Feature Table needs to persist the value of entity type it has to be in a feature different than `type`. -All this parameters, can be customized using Cygnus mapping capabilities. +All this parameters, can be customized using Cygnus mapping capabilities or Context Broker custom notifications. + +##### Using Cygnus Let's see an example: -##### Agent.conf file: +###### Agent.conf file: agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services -##### Entity data: +###### Entity data: service = vehicles service-path = /4wheels entity-type = car -##### result +###### result Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/4wheels Table's unique field: car [Top](#top) +#### Using Context Broker custom notifications + +If a service path has different entitiy types, following the previous example `car` and `van`, they will need to persist in different Feature Layers, to avoid the limitation of one Feature table by a "fiware-servicepath", it can be used [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) in which we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters. + +###### Entity data: + + service = vehicles + service-path = /4wheels + entity-type = van + +For example, if the Feature table for "van" is `https://arcgis.com/{hash}/arcgis/rest/services/vehicles/van`, the custom notif could be: +``` +"httpCustom":{ + "url": "http://iot-cygnus:/notify", + "headers": { + "fiware-service": "vehicles", + "fiware-servicepath": "/van" + } +} +``` + +Using this functionality a different "fiware-servicepath" can be assigned to every entity type. + +Moveover, to modify the unique field value of `type` attribute it can be used the [ngsi patching functionality](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#ngsi-payload-patching): + +``` +"httpCustom":{ + "url": "http://iot-cygnus:/notify", + "ngsi": { + "type": "car" + }, + "headers": { + "fiware-service": "vehicles", + "fiware-servicepath": "/van" + } +} +``` + +###### result + + Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/van + Table's unique field: car + +[Top](#top) ### Example #### `NGSIEvent` @@ -90,7 +136,7 @@ Assuming the following `NGSIEvent` is created from a notified NGSI context data attrValue=112.9 }, { - attrName=oil_level, + attrName=oilLevel, attrType=float, attrValue=74.6 } @@ -165,6 +211,72 @@ Connections to `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url` and `cygnus-ng **[FIXME #2320](https://github.com/telefonicaid/fiware-cygnus/issues/2320)**. Currently Arcgis sink is case sensitive with the attributes to persist in the Feature Table although arcgis is not case sensitive. This behaviour requires the use of name-mappings to match the case letters of the attribute definition in the Feature Table. +For instance, if we have the following Feature Layer definition for the "car" entity type: +``` +Fields: + + objectid ( type: esriFieldTypeOID, alias: objectid, editable: false, nullable: false, defaultValue: null, modelName: objectid ) + car ( type: esriFieldTypeString, alias: id, editable: true, nullable: true, length: 255, defaultValue: null, modelName: id ) + speed ( type: esriFieldTypeDouble, alias: speed, editable: true, nullable: true, defaultValue: null, modelName: speed ) + oillevel ( type: esriFieldTypeDouble, alias: oillevel, editable: true, nullable: true, defaultValue: null, modelName: oillevel ) +``` + +And the model definition of the `car` is: + +``` +{ + "id": "car1", + "type": "car", + "location": { + "type": "geo:json", + "value": { + "coordinates": [ + -0.350062, + 40.054448 + ], + "type": "Point" + } + }, + "speed": { + "type": "Number", + "value": 112.9 + }, + "oilLevel": { + "type": "Number", + "value": 74.6 + } +} +``` + +The name mappings required to persist the attributes is: + +``` +{ + "serviceMappings": [{ + "originalService": "vehicle", + "servicePathMappings": [{ + "originalServicePath": "/car", + "entityMappings": [{ + "originalEntityType": "car", + "originalEntityId": "^.*", + "attributeMappings": [{ + "originalAttributeName": "oilLevel", + "newAttributeName": "oillevel", + "originalAttributeType": "^.*" + }, + ... + ] + } + ] + } + ] + } + ] +} +``` + +Note that `speed` attribute is not required in the name mappings file as it match, including case-sensitivity, with the field in the Feature Layer. + [Top](#top) #### About Arcgis data types From 5b59455dcbd30f24b91f3f9beb247c17bee6fe02 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 5 Dec 2023 14:24:41 +0100 Subject: [PATCH 06/24] Update ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 2aec53bd5..c1170c867 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -69,7 +69,7 @@ Let's see an example: #### Using Context Broker custom notifications -If a service path has different entitiy types, following the previous example `car` and `van`, they will need to persist in different Feature Layers, to avoid the limitation of one Feature table by a "fiware-servicepath", it can be used [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) in which we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters. +If a service path has different entitiy types, following the previous example `car` and `van`, they will need to persist in different Feature Layers, to avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, it can be used [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) in which we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters. ###### Entity data: From d598188e62438b8e07cb830df198e346f7d59370 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Mon, 11 Dec 2023 17:01:37 +0100 Subject: [PATCH 07/24] Update doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fermín Galán Márquez --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index c1170c867..c253b6e88 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -69,7 +69,7 @@ Let's see an example: #### Using Context Broker custom notifications -If a service path has different entitiy types, following the previous example `car` and `van`, they will need to persist in different Feature Layers, to avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, it can be used [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) in which we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters. +If a service path has different entity types, following the previous example `car` and `van`, they have to be persisted in different Feature Layers. To avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) can be used, so we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters for each entity type. ###### Entity data: From 942632f21b88a8d89a95b01be6acbeaae1ba1c9a Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Mon, 11 Dec 2023 17:02:57 +0100 Subject: [PATCH 08/24] Update doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fermín Galán Márquez --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index c253b6e88..e68fec0e5 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -42,7 +42,7 @@ Argis feature tables must be provisioned before sending entities. #### ArcGis databases naming conventions Each entity type needs an url and an unique field to be persisted into the feature table. -NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` and `service path`, to provide multiple tables access. The final url is compounds by `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url`+`fiware-service`+`fiware-servicepath`. +NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` and `service path`, to provide multiple tables access. The final url is composed of `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url`+`fiware-service`+`fiware-servicepath`. Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. This means that a feature named `type` in the Feature Table cannot be filled in by the sink. If Feature Table needs to persist the value of entity type it has to be in a feature different than `type`. From d384ca41200e2f94cd89fc1edaa6b7a0b97fb5dc Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Mon, 11 Dec 2023 17:05:26 +0100 Subject: [PATCH 09/24] Fix typo --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index e68fec0e5..534ed85db 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -44,7 +44,7 @@ Each entity type needs an url and an unique field to be persisted into the featu NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` and `service path`, to provide multiple tables access. The final url is composed of `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url`+`fiware-service`+`fiware-servicepath`. -Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. This means that a feature named `type` in the Feature Table cannot be filled in by the sink. If Feature Table needs to persist the value of entity type it has to be in a feature different than `type`. +Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. This means that a feature named `type` in the Feature Table cannot be filled in by the sink. If Feature Table needs to persist the value of entity type it has to be in a field different than `type`. All this parameters, can be customized using Cygnus mapping capabilities or Context Broker custom notifications. From deb80da960593b8e59aed2dbddfb0cc167f0edf4 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Mon, 11 Dec 2023 17:15:14 +0100 Subject: [PATCH 10/24] Fix title level --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 534ed85db..9cc3a72d5 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -67,7 +67,7 @@ Let's see an example: [Top](#top) -#### Using Context Broker custom notifications +##### Using Context Broker custom notifications If a service path has different entity types, following the previous example `car` and `van`, they have to be persisted in different Feature Layers. To avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) can be used, so we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters for each entity type. From dc8c25a61448772fdbc365b64c7fe31c30b1c780 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Mon, 11 Dec 2023 19:01:39 +0100 Subject: [PATCH 11/24] Update ngsi_arcgis_featuretable_sink.md --- .../ngsi_arcgis_featuretable_sink.md | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 9cc3a72d5..814f094e8 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -88,21 +88,49 @@ For example, if the Feature table for "van" is `https://arcgis.com/{hash}/arcgis } ``` -Using this functionality a different "fiware-servicepath" can be assigned to every entity type. +Using this functionality a different "fiware-servicepath" can be assigned to every entity type. -Moveover, to modify the unique field value of `type` attribute it can be used the [ngsi patching functionality](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#ngsi-payload-patching): +Note that the previous example is incomplete because does not change the type`s value, so to avoid using the name mappings to modify the unique field value of `type` attribute, it is required the use of [ngsi patching functionality](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#ngsi-payload-patching). + +An example of the whole subscription: ``` -"httpCustom":{ - "url": "http://iot-cygnus:/notify", - "ngsi": { - "type": "car" - }, - "headers": { - "fiware-service": "vehicles", - "fiware-servicepath": "/van" + { + "description": "Subs arcgis", + "status": "active", + "subject": { + "entities": [ + { + "idPattern": ".*", + "type": "van" + } + ], + "condition": { + "attrs": [ + "speed", + "oilLevel" + ] + } + }, + "notification": { + "attrs": [ + "speed", + "oilLevel" + ], + "onlyChangedAttrs": false, + "attrsFormat": "normalized", + "httpCustom": { + "url": "http://iot-cygnus:/notify", + "ngsi": { + "type": "car" + }, + "headers": { + "fiware-service": "vehicles", + "fiware-servicepath": "/van" + } + } + } } -} ``` ###### result From 73986f5bb9d3eb728c81394da73f7cdc3c7e0b95 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 08:19:53 +0100 Subject: [PATCH 12/24] Update ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 814f094e8..d8f33ff58 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -69,7 +69,7 @@ Let's see an example: ##### Using Context Broker custom notifications -If a service path has different entity types, following the previous example `car` and `van`, they have to be persisted in different Feature Layers. To avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) can be used, so we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters for each entity type. +If a service-path has different entity types, for example `car` and `van`, and they have to be persisted in different feature table, it cannot be done. To avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) can be used, so we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters for each entity type. ###### Entity data: From 0698764e35f2f512b244124af4a1a855ddce7e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Tue, 12 Dec 2023 08:24:02 +0100 Subject: [PATCH 13/24] Update doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index d8f33ff58..866358848 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -46,7 +46,7 @@ NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` an Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. This means that a feature named `type` in the Feature Table cannot be filled in by the sink. If Feature Table needs to persist the value of entity type it has to be in a field different than `type`. -All this parameters, can be customized using Cygnus mapping capabilities or Context Broker custom notifications. +All this parameters, can be customized using Context Broker custom notifications (preferred) or Cygnus mapping capabilities (should be avoided except in justified cases). ##### Using Cygnus From 68e06b547140593e5b7c0c178a99040cf9aa6da6 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 08:38:25 +0100 Subject: [PATCH 14/24] Reorder name mappings vs custom notifs subsections --- .../ngsi_arcgis_featuretable_sink.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 866358848..734d687f0 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -48,26 +48,7 @@ Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existan All this parameters, can be customized using Context Broker custom notifications (preferred) or Cygnus mapping capabilities (should be avoided except in justified cases). -##### Using Cygnus - -Let's see an example: - -###### Agent.conf file: - - agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services -###### Entity data: - - service = vehicles - service-path = /4wheels - entity-type = car -###### result - - Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/4wheels - Table's unique field: car - -[Top](#top) - -##### Using Context Broker custom notifications +##### Using Context Broker custom notifications (preferred) If a service-path has different entity types, for example `car` and `van`, and they have to be persisted in different feature table, it cannot be done. To avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) can be used, so we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters for each entity type. @@ -140,6 +121,25 @@ An example of the whole subscription: [Top](#top) +##### Using Cygnus name mappings + +Let's see an example: + +###### Agent.conf file: + + agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services +###### Entity data: + + service = vehicles + service-path = /4wheels + entity-type = car +###### result + + Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/4wheels + Table's unique field: car + +[Top](#top) + ### Example #### `NGSIEvent` Assuming the following `NGSIEvent` is created from a notified NGSI context data (the code below is an object representation, not any real data format): From 6c8e1f4d20e4622aa01c74d117b1702e92ae926d Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 08:39:03 +0100 Subject: [PATCH 15/24] Fix typo --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 734d687f0..6069fbe12 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -71,7 +71,7 @@ For example, if the Feature table for "van" is `https://arcgis.com/{hash}/arcgis Using this functionality a different "fiware-servicepath" can be assigned to every entity type. -Note that the previous example is incomplete because does not change the type`s value, so to avoid using the name mappings to modify the unique field value of `type` attribute, it is required the use of [ngsi patching functionality](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#ngsi-payload-patching). +Note that the previous example is incomplete because does not change the type's value, so to avoid using the name mappings to modify the unique field value of `type` attribute, it is required the use of [ngsi patching functionality](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#ngsi-payload-patching). An example of the whole subscription: From 68b19c5ff7b0a5c41b1eb8f1e3617cdec3727cf6 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:08:06 +0100 Subject: [PATCH 16/24] expand custom notif and name mappings documentation --- .../ngsi_arcgis_featuretable_sink.md | 99 ++++++++++++------- 1 file changed, 61 insertions(+), 38 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 6069fbe12..21db9f207 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -48,32 +48,29 @@ Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existan All this parameters, can be customized using Context Broker custom notifications (preferred) or Cygnus mapping capabilities (should be avoided except in justified cases). -##### Using Context Broker custom notifications (preferred) +Assuming that the feature table's url: `https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars` and feature table definition is: +``` +Fields: -If a service-path has different entity types, for example `car` and `van`, and they have to be persisted in different feature table, it cannot be done. To avoid the limitation of one "fiware-servicepath" can only persist in a unique feature table, [CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) can be used, so we can map a different value for `fiware-service` and `fiware-servicepath` headers parameters for each entity type. + objectid ( type: esriFieldTypeOID, alias: objectid, editable: false, nullable: false, defaultValue: null, modelName: objectid ) + licensePlate ( type: esriFieldTypeString, alias: licensePlate, editable: true, nullable: true, length: 255, defaultValue: null, modelName: licensePlate ) + speed ( type: esriFieldTypeDouble, alias: speed, editable: true, nullable: true, defaultValue: null, modelName: speed ) + oillevel ( type: esriFieldTypeDouble, alias: oillevel, editable: true, nullable: true, defaultValue: null, modelName: oillevel ) +``` -###### Entity data: +Let's see both configuration options: - service = vehicles - service-path = /4wheels - entity-type = van +##### Using Context Broker custom notifications (preferred) -For example, if the Feature table for "van" is `https://arcgis.com/{hash}/arcgis/rest/services/vehicles/van`, the custom notif could be: -``` -"httpCustom":{ - "url": "http://iot-cygnus:/notify", - "headers": { - "fiware-service": "vehicles", - "fiware-servicepath": "/van" - } -} -``` +["CB custom notifications"](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) is the preferred option because of its simplicity and not having to manage configuration (name-mappings) files in the server. -Using this functionality a different "fiware-servicepath" can be assigned to every entity type. +###### Entity data in CB: -Note that the previous example is incomplete because does not change the type's value, so to avoid using the name mappings to modify the unique field value of `type` attribute, it is required the use of [ngsi patching functionality](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#ngsi-payload-patching). + service = vehicles + service-path = /4wheels + entity-type = Car -An example of the whole subscription: +If the Feature table for type "Car" is `https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars`, the subscription with custom notif would be: ``` { @@ -83,7 +80,7 @@ An example of the whole subscription: "entities": [ { "idPattern": ".*", - "type": "van" + "type": "Car" } ], "condition": { @@ -103,21 +100,23 @@ An example of the whole subscription: "httpCustom": { "url": "http://iot-cygnus:/notify", "ngsi": { - "type": "car" + "type": "licensePlate" }, "headers": { "fiware-service": "vehicles", - "fiware-servicepath": "/van" + "fiware-servicepath": "/cars" } } } } ``` +Note that to avoid using the name mappings to modify the unique field value of `type` attribute, it is required the use of [ngsi patching functionality](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#ngsi-payload-patching). + ###### result - Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/van - Table's unique field: car + Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/car + Table's unique field: licensePlate [Top](#top) @@ -132,11 +131,34 @@ Let's see an example: service = vehicles service-path = /4wheels - entity-type = car + entity-type = Car + +The name mappings configuration would be: + +``` +{ + "serviceMappings": [{ + "originalService": "vehicle", + "servicePathMappings": [{ + "originalServicePath": "/4wheels", + "newServicePath": "/cars", + "entityMappings": [{ + "originalEntityType": "Car", + "newEntityType": "licensePlate", + "originalEntityId": "^.*" + } + ] + } + ] + } + ] +} +``` + ###### result - Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/4wheels - Table's unique field: car + Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars + Table's unique field: licensePlate [Top](#top) @@ -156,7 +178,7 @@ Assuming the following `NGSIEvent` is created from a notified NGSI context data }, body={ entityId=car1, - entityType=car, + entityType=Car, attributes=[ { attrName=speed, @@ -177,7 +199,7 @@ Resultant service url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/4wheels Feature table unique field: - Unique field name: car + Unique field name: Car Unique field value: car1 [Top](#top) @@ -219,7 +241,6 @@ A configuration example could be: ### Important notes - #### About batching As explained in the [programmers guide](#section3), `NGSIArcgisFeatureTableSink` extends `NGSISink`, which provides a built-in mechanism for collecting events from the internal Flume channel. This mechanism allows extending classes have only to deal with the persistence details of such a batch of events in the final backend. @@ -237,24 +258,24 @@ Connections to `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url` and `cygnus-ng #### About case-sensitivity -**[FIXME #2320](https://github.com/telefonicaid/fiware-cygnus/issues/2320)**. Currently Arcgis sink is case sensitive with the attributes to persist in the Feature Table although arcgis is not case sensitive. This behaviour requires the use of name-mappings to match the case letters of the attribute definition in the Feature Table. +**[FIXME #2320](https://github.com/telefonicaid/fiware-cygnus/issues/2320)**. Currently Arcgis sink is case sensitive with the attributes to persist in the Feature Table although arcgis is not case sensitive. This behaviour requires the use of name-mappings to match the case letters of the attribute's definition in the Feature Table. -For instance, if we have the following Feature Layer definition for the "car" entity type: +For instance, if we have the following Feature Layer definition for the "Car" entity type: ``` Fields: objectid ( type: esriFieldTypeOID, alias: objectid, editable: false, nullable: false, defaultValue: null, modelName: objectid ) - car ( type: esriFieldTypeString, alias: id, editable: true, nullable: true, length: 255, defaultValue: null, modelName: id ) + licensePlate ( type: esriFieldTypeString, alias: licensePlate, editable: true, nullable: true, length: 255, defaultValue: null, modelName: licensePlate ) speed ( type: esriFieldTypeDouble, alias: speed, editable: true, nullable: true, defaultValue: null, modelName: speed ) oillevel ( type: esriFieldTypeDouble, alias: oillevel, editable: true, nullable: true, defaultValue: null, modelName: oillevel ) ``` -And the model definition of the `car` is: +And the model definition of the `Car` is: ``` { "id": "car1", - "type": "car", + "type": "Car", "location": { "type": "geo:json", "value": { @@ -283,10 +304,12 @@ The name mappings required to persist the attributes is: "serviceMappings": [{ "originalService": "vehicle", "servicePathMappings": [{ - "originalServicePath": "/car", + "originalServicePath": "/4wheels", + "newServicePath": "/cars", "entityMappings": [{ - "originalEntityType": "car", - "originalEntityId": "^.*", + "originalEntityType": "Car", + "newEntityType": "licensePlate", + "originalEntityId": "^.*" "attributeMappings": [{ "originalAttributeName": "oilLevel", "newAttributeName": "oillevel", From 022143c13fbb938c7a94e510fc73537043de6ff5 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:15:33 +0100 Subject: [PATCH 17/24] Remove example section Remove example section as it is included in the previous section --- .../ngsi_arcgis_featuretable_sink.md | 48 +------------------ 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 21db9f207..6959f7410 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -5,8 +5,6 @@ Content: * [Mapping NGSI events to `NGSIEvent` objects](#section1.1) * [Mapping `NGSIEvent`s to Arcgis](#section1.2) * [ArcGis layers naming conventions](#section1.2.1) - * [Example](#section1.3) - * [`NGSIEvent`](#section1.3.1) * [Administration guide](#section2) * [Configuration](#section2.1) * [Important notes](#section2.2) @@ -34,8 +32,8 @@ This is done at the cygnus-ngsi Http listeners (in Flume jergon, sources) thanks [Top](#top) ### Mapping `NGSIEvent`s to ArcGis -ArcGis stores data in it's own databases using it's own data organization, you can checkout this info Reading Feature Table details at Argis server, Such organization is exploited by `NGSIArcgisFeatureTableSink` each time a `NGSIEvent` is going to be persisted. -Argis feature tables must be provisioned before sending entities. +ArcGis stores data in it's own databases using it's own data organization, you can checkout this info Reading Feature Table details at Arcgis server, Such organization is exploited by `NGSIArcgisFeatureTableSink` each time a `NGSIEvent` is going to be persisted. +Arcgis feature tables must be provisioned before sending entities. [Top](#top) @@ -162,48 +160,6 @@ The name mappings configuration would be: [Top](#top) -### Example -#### `NGSIEvent` -Assuming the following `NGSIEvent` is created from a notified NGSI context data (the code below is an object representation, not any real data format): - - ngsi-event={ - headers={ - content-type=application/json, - timestamp=1429535775, - transactionId=1429535775-308-0000000000, - correlationId=1429535775-308-0000000000, - fiware-service=vehicles, - fiware-servicepath=/4wheels, - - }, - body={ - entityId=car1, - entityType=Car, - attributes=[ - { - attrName=speed, - attrType=float, - attrValue=112.9 - }, - { - attrName=oilLevel, - attrType=float, - attrValue=74.6 - } - ] - } - } - -Resultant service url: - - https://arcgis.com/{hash}/arcgis/rest/services/vehicles/4wheels -Feature table unique field: - - Unique field name: Car - Unique field value: car1 - -[Top](#top) - ## Administration guide ### Configuration `NGSIArcgisFeatureTableSink` is configured through the following parameters: From 72ba258f488b815cbb976cfce462b9962fa38ef8 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:22:54 +0100 Subject: [PATCH 18/24] Update ngsi_arcgis_featuretable_sink.md --- .../ngsi_arcgis_featuretable_sink.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 6959f7410..a6d989350 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -125,6 +125,7 @@ Let's see an example: ###### Agent.conf file: agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services + agent.arcgis-sink.enable_name_mappings = true ###### Entity data: service = vehicles @@ -136,7 +137,7 @@ The name mappings configuration would be: ``` { "serviceMappings": [{ - "originalService": "vehicle", + "originalService": "vehicles", "servicePathMappings": [{ "originalServicePath": "/4wheels", "newServicePath": "/cars", @@ -258,7 +259,7 @@ The name mappings required to persist the attributes is: ``` { "serviceMappings": [{ - "originalService": "vehicle", + "originalService": "vehicles", "servicePathMappings": [{ "originalServicePath": "/4wheels", "newServicePath": "/cars", From d35e31223694e73eb1a22e99066393721c7cfa7d Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:24:19 +0100 Subject: [PATCH 19/24] Update ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index a6d989350..a60d7eceb 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -44,7 +44,7 @@ NGSIArcgisFeatureTableSink composes each table's url with entitie's `service` an Unique field is provided to allow `NGSIArcgisFeatureTableSink` to update existant entities. NGSI `entity type` will be used as unique field name. This means that a feature named `type` in the Feature Table cannot be filled in by the sink. If Feature Table needs to persist the value of entity type it has to be in a field different than `type`. -All this parameters, can be customized using Context Broker custom notifications (preferred) or Cygnus mapping capabilities (should be avoided except in justified cases). +All this parameters, can be customized using Context Broker custom notifications (preferred) or Cygnus mapping capabilities. Assuming that the feature table's url: `https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars` and feature table definition is: ``` From 5ac3e9ea9a8946048fe498627d416019f938e308 Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:28:58 +0100 Subject: [PATCH 20/24] Update ngsi_arcgis_featuretable_sink.md --- .../ngsi_arcgis_featuretable_sink.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index a60d7eceb..2030eca9e 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -53,7 +53,7 @@ Fields: objectid ( type: esriFieldTypeOID, alias: objectid, editable: false, nullable: false, defaultValue: null, modelName: objectid ) licensePlate ( type: esriFieldTypeString, alias: licensePlate, editable: true, nullable: true, length: 255, defaultValue: null, modelName: licensePlate ) speed ( type: esriFieldTypeDouble, alias: speed, editable: true, nullable: true, defaultValue: null, modelName: speed ) - oillevel ( type: esriFieldTypeDouble, alias: oillevel, editable: true, nullable: true, defaultValue: null, modelName: oillevel ) + oilLevel ( type: esriFieldTypeDouble, alias: oilLevel, editable: true, nullable: true, defaultValue: null, modelName: oilLevel ) ``` Let's see both configuration options: @@ -217,7 +217,7 @@ Connections to `cygnus-ngsi.sinks.arcgis-sink.arcgis_service_url` and `cygnus-ng **[FIXME #2320](https://github.com/telefonicaid/fiware-cygnus/issues/2320)**. Currently Arcgis sink is case sensitive with the attributes to persist in the Feature Table although arcgis is not case sensitive. This behaviour requires the use of name-mappings to match the case letters of the attribute's definition in the Feature Table. -For instance, if we have the following Feature Layer definition for the "Car" entity type: +For instance, if we have the following feature table definition for the "Car" entity type: ``` Fields: @@ -227,6 +227,8 @@ Fields: oillevel ( type: esriFieldTypeDouble, alias: oillevel, editable: true, nullable: true, defaultValue: null, modelName: oillevel ) ``` +Note that field `oillevel` is completely in lower case. + And the model definition of the `Car` is: ``` @@ -253,6 +255,7 @@ And the model definition of the `Car` is: } } ``` +With attribute `oilLevel` in camelCase format. The name mappings required to persist the attributes is: From 2d2c9a4d5eaff930fcef4742b6f41a6fdd3302da Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:35:23 +0100 Subject: [PATCH 21/24] Update ngsi_arcgis_featuretable_sink.md --- .../ngsi_arcgis_featuretable_sink.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 2030eca9e..6685dc8e8 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -56,6 +56,8 @@ Fields: oilLevel ( type: esriFieldTypeDouble, alias: oilLevel, editable: true, nullable: true, defaultValue: null, modelName: oilLevel ) ``` +Where `licensePlate` is the unique field to store the entityId value from the Context Broker. + Let's see both configuration options: ##### Using Context Broker custom notifications (preferred) @@ -125,7 +127,7 @@ Let's see an example: ###### Agent.conf file: agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services - agent.arcgis-sink.enable_name_mappings = true + agent.arcgis-sink.enable_name_mappings = true ###### Entity data: service = vehicles From 056af560eb11372ef10c3ca5ea02473957a6a75b Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:36:48 +0100 Subject: [PATCH 22/24] Update ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 6685dc8e8..463087830 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -122,8 +122,6 @@ Note that to avoid using the name mappings to modify the unique field value of ` ##### Using Cygnus name mappings -Let's see an example: - ###### Agent.conf file: agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services From 80647a4dc4699b19ab4201c77d773016288aa88e Mon Sep 17 00:00:00 2001 From: Daniel Villalba Date: Tue, 12 Dec 2023 10:40:23 +0100 Subject: [PATCH 23/24] Update ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index 463087830..f12b0e52b 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -115,7 +115,7 @@ Note that to avoid using the name mappings to modify the unique field value of ` ###### result - Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/car + Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars Table's unique field: licensePlate [Top](#top) From ef0e38427ef3317cdaea7bd3200b8b5425b2ce64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 13 Dec 2023 09:11:55 +0100 Subject: [PATCH 24/24] Update doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md --- .../flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md index f12b0e52b..ba457594a 100644 --- a/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md +++ b/doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_arcgis_featuretable_sink.md @@ -62,7 +62,7 @@ Let's see both configuration options: ##### Using Context Broker custom notifications (preferred) -["CB custom notifications"](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) is the preferred option because of its simplicity and not having to manage configuration (name-mappings) files in the server. +[CB custom notifications](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#custom-notifications) is the preferred option because of its simplicity and not having to manage configuration (name-mappings) files in the server. ###### Entity data in CB: