Difference between revisions of "Sensor's network"
(→Topics (MQTT, structure)) |
(→Observations and observation types) |
||
Line 7: | Line 7: | ||
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 <code>name</code> and <code>description</code> that you can find in any object, you will find: | 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 <code>name</code> and <code>description</code> 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 : 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 [[#Topics|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 <code>/amtech</code> as a topic but you can also express something more specific like <code>/us/nevada/las_vegas/hotel_x/main_parking/parking_lot_1/movement_sensor</code> 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. | ; producer : A String used to specify the producer of this observation. |
Revision as of 09:52, 3 March 2016
Contents
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.
- 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 topic related to observers
Observation instances in simulator
Topics
Structure, MQTT reassembling