Difference between revisions of "Observation enrichment"

From AMTech WikiDocs
Jump to: navigation, search
(Placeholder substitution)
(Blanked the page)
 
(6 intermediate revisions by 2 users not shown)
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.
 
  
=== 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:
 
 
* <code>topic</code>
 
* <code>producer</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 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 <code>location</code> field of an observation. Based on the [[WKT]] that is given in the <code>location</code> 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 <code>topic</code>, <code>producer</code> or <code>targetthings</code> fields of the original observation JSON.
 
 
* <code>#{country}</code> or <code>#{country_code}</code>
 
* <code>#{state}</code> or </code>#{province}</code>
 
* <code>#{postcode}</code> or <code>#{postal code}</code> or <code>#{zip code}</code>
 
* <code>#{city}</code> or <code>#{town}</code>
 
* <code>#{suburb}</code> or <code>#{residential}</code> or <code>#{city_district}</code> or <code>#{municipality}</code> or <code>#{neighbourhood}</code>
 
 
=== Proximity updates ===
 
 
A proximity update is executed when an observation arrives to the system containing information about proximity in its <code>targetthings</code> 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 <code>proximityarea</code> of the thing <code>/amtech/things/entities/smartphone/main_phone_1</code> is updated with the given <code>proximityarea</code> in the observation.
 

Latest revision as of 10:53, 15 May 2016