Difference between revisions of "Observation enrichment"
(→Proximity updates) |
(→Placeholder substitution) |
||
Line 1: | Line 1: | ||
The enrichment of observations is a group of actions and/or replacements that take place over an observation in the process of delivering it ot its final destination or topic. They are placeholder substitutions, geolocation substitutions, proximity updates. | The enrichment of observations is a group of actions and/or replacements that take place over an observation in the process of delivering it ot its final destination or topic. They are placeholder substitutions, geolocation substitutions, proximity updates. | ||
− | === | + | === Placeholders substitution === |
− | A placeholder is a string with format #{placeholder_name} than can be used in certain fields of an observation where the | + | A placeholder is a string with format #{placeholder_name} than can be used in certain fields of an observation where the placeholders substitution takes place. Actually there are three fields where this kind of substitution is considered: |
* <code>topic</code> | * <code>topic</code> | ||
Line 9: | Line 9: | ||
* <code>targetthings</code> | * <code>targetthings</code> | ||
− | Some substitutions occur in the process of building the observation in applications in the edge like the [[M2MBridge]] and others occur after the observation is sent to the AMTech's platform. This is mostly geolocation substitutions which is a special kind of placeholder substitution. | + | Some substitutions occur in the process of building the observation in applications in the edge like the [[M2MBridge]] and others occur after the observation is sent to the AMTech's platform. This is mostly geolocation fields substitutions which is a special kind of placeholder substitution. |
+ | |||
+ | These are a couple of placeholders substitution that run in the M2MBridge: | ||
+ | |||
+ | * Access control placeholders | ||
+ | ** #{tenantId} | ||
+ | ** #{userId} | ||
=== Geolocation substitution === | === Geolocation substitution === |
Revision as of 09:39, 14 March 2016
The enrichment of observations is a group of actions and/or replacements that take place over an observation in the process of delivering it ot its final destination or topic. They are placeholder substitutions, geolocation substitutions, proximity updates.
Placeholders substitution
A placeholder is a string with format #{placeholder_name} than can be used in certain fields of an observation where the placeholders substitution takes place. Actually there are three fields where this kind of substitution is considered:
-
topic
-
producer
-
targetthings
Some substitutions occur in the process of building the observation in applications in the edge like the M2MBridge and others occur after the observation is sent to the AMTech's platform. This is mostly geolocation fields substitutions which is a special kind of placeholder substitution.
These are a couple of placeholders substitution that run in the M2MBridge:
- Access control placeholders
- #{tenantId}
- #{userId}
Geolocation substitution
This is about doing placeholder substitution of a group of geolocation attributes than can be determined by using the location
field of an observation. Based on the WKT that is given in the location
field, a process of reverse geolocation is run and the address is determined when possible. These fields are then replaced if they appear in the topic
, producer
or targetthings
fields of the original observation JSON.
-
#{country}
or#{country_code}
-
#{state}
or </code>#{province}</code> -
#{postcode}
or#{postal code}
or#{zip code}
-
#{city}
or#{town}
-
#{suburb}
or#{residential}
or#{city_district}
or#{municipality}
or#{neighbourhood}
Proximity updates
A proximity update is executed when an observation arrives to the system containing information about proximity in its targetthings
field. For instance:
{ ... "targetthings": "[{ \"thingType\": \"/amtech/linkeddata/types/composite/entity/smartphone\", \"thingsId\": [\"main_phone_1\"], \"proximityarea\": \"/some/uri/for/proximity/thing\" }]", ... }
Using this information, the field proximityarea
of the thing /amtech/things/entities/smartphone/main_phone_1
is updated with the given proximityarea
in the observation.