Difference between revisions of "Sensor's network"

From AMTech WikiDocs
Jump to: navigation, search
(Placeholders)
(Sensor network error)
Line 63: Line 63:
  
 
==Sensor network error==
 
==Sensor network error==
 +
 +
* Occurs when there is an error in the process of delivering an observation to its destination topic.
 +
* Usually occurs in the process of [[observation enrichment]]

Revision as of 10:00, 14 March 2016

Observations and observation types

Observations are the kind of objects that are used by sensors, devices, pieces of software (things in general) to notify about state change, sensor's readings, etc. Like thing's instances, or any other object in our architecture, they have a type that defines its attributes. Usually we differentiate between an observation instance and an observation type but the former is usually called just observation.

Observation types, as any other type, is a JSON-LD that defines the attributes of an observation.

To be able to create an observation you need to firstly define its type. When you create a new observation type, you will find there are a number of core attributes that are present in all observations. In addition to those like name and description that you can find in any object, you will find:

topic 
This is a String. It contains the destination path where this observation will be stored. We will explain later in this document the characteristics of a topic. Like paths in a filesystem you can specify a list of tokes separated by the character '/' to express an specific position in topic's tree. For instance, you can have /amtech as a topic but you can also express something more specific like /us/nevada/las_vegas/hotel_x/main_parking/parking_lot_1/movement_sensor as the topic of an observation generated by the movement sensor that is located in the parking lot 1 of the main parking of Hotel X in Las Vegas. A topic specification can have placeholders. Those will be explained later in this document.
producer 
A String used to specify the producer of this observation.
location 
If known, this is the location where this observation took place. It's expressed as a JSON String that contains a WKT specification. The structure of this JSON is explained in the Location's page.
ocurrence_time 
This is the date and time an observation occurred. It's specified by the producer of the observation.
detection_time 
This is the date and time an observation is detected in the system. The producer can specify it but it will always be overriden by our system.
targetthings 
This is a JSON String that specified the things that are affected in some way by this observation. This is a concept that is better explained in the Observer's page

Simulator

The simulator is a page in the Creator's UE that allows the user to send observations as if they were generated by a thing in the IoT. There you can create your own observation's instances. Once created, you can select one or more observations and hit the Send button in order to run a simulation. Observations are actually sent to the sensor's network and you can see the result by consuming then from the corresponding topic.

Topics

Structure, MQTT reassembling

Proximity enrichment

Placeholders

Enrichment placeholders can be applied to the following observation properties:

  • topic. Example:
"topic": "/#{tenantId}/#{country_code}/#{city}";
  • producer
  • targetthings. Example:
"targetthings": "[
    {
        \"thingType\": \"/amtech/linkeddata/types/composite/entity/smartphone\", 
        \"thingsId\": [\"phone#{city}\"]
    }, {
        \"thingType\": \"/amtech/linkeddata/types/composite/entity/truck\", 
        \"thingsId\": [\"truck#{country_code}\"]
    }]"

Type of placeholders:

  • Access control placeholders
    • #{tenantId}
    • #{userId}
  • Geographic place holders reverse geocoding synonyms (ordered by priority)
    • #{country} or #{country_code}
    • #{state} or #{province}
    • #{postcode} or #{postal code} or #{zip code}
    • #{city} or #{town}
    • #{suburb} or #{residential} or #{city_district} or #{municipality} or #{neighbourhood}

Target things

CRUD observation

observationresourcecrud

Sensor network error

* Occurs when there is an error in the process of delivering an observation to its destination topic.
* Usually occurs in the process of observation enrichment