SensorThings API

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
OGC SensorThings API - Part 1 Sensing
Status OGC Standard Implementation Specification
Year started 2015
Latest version 1.0
Editors Steve Liang (SensorUp), Chih-Yuan Huang (National Central University), Tania Tania Khalafbeigi (SensorUp)
Base standards JSON, OGC/ISO 19156:2011 O&M
Domain Open Geospatial Consortium, Internet of Things
Abbreviation OGC STA
Website OGC SensorThings API Standard GitHub Page

SensorThings API[1] is an Open Geospatial Consortium (OGC) standard providing an open and unified framework to interconnect IoT sensing devices, data, and applications over the Web. It is an open standard addressing the syntactic interoperability and semantic interoperability of the Internet of Things. It complements the existing IoT networking protocols such CoAP, MQTT, HTTP, 6LowPAN. While the above-mentioned IoT networking protocols are addressing the ability for different IoT systems to exchange information, OGC SensorThings API is addressing the ability for different IoT systems to use and understand the exchanged information. As an OGC standard, SensorThings API also allows easy integration into existing Spatial Data Infrastructures or Geographic Information Systems.

OGC SensorThings API was released for public comment on June 18, 2015.[2] The OGC Technical Committee (TC) approves start of electronic vote on December 3, 2015, and the SensorThings API passed the TC vote on February 1, 2016.

Design

SensorThings API is designed specifically for resource-constrained IoT devices and the Web developer community. It follows REST principles, the JSON encoding, and the OASIS OData protocol and URL conventions. Also, it has an MQTT extension allowing users/devices to publish and subscribe updates from devices, and can use CoAP in addition to HTTP.

File:SensorThings API data model.svg
SensorThings API data model

The foundation of the SensorThings API is its data model that is based on the ISO 19156 (ISO/OGC Observations and Measurements), that defines a conceptual model for observations, and for features involved in sampling when making observations. In the context of the SensorThings, the features are modelled as Things, Sensors (i.e., Procedures in O&M), and Feature of Interests. As a result, the SensorThings API provides an interoperable Observation-focus view, that is particularly useful to reconcile the differences between heterogeneous sensing systems (e.g., in-situ sensors and remote sensors).

An IoT device or system is modelled as a Thing. A Thing has a Location with one or more Datastreams. Each Datastream observes one ObservedProperty with one Sensor and has many Observations collected by the Sensor. Each Observation observes one particular FeatureOfInterest. The O&M based model allows SensorThings to accommodate heterogeneous IoT devices and the data collected by the devices.[3]

SensorThings API provides two main functionalities, each handled by a profile. The two profiles are the Sensing profile and the Tasking profile. The Sensing profile provides a standard way to manage and retrieve observations and metadata from heterogeneous IoT sensor systems, and the Sensing profile functions are similar to the OGC Sensor Observation Service. The Tasking profile provides a standard way for parameterizing - also called tasking - of task-able IoT devices, such as sensors or actuators. The Tasking profile functions are similar to the OGC Sensor Planning Service. The Sensing profile is designed based on the ISO/OGC Observations and Measurements (O&M) model, and allows IoT devices and applications to CREATE, READ, UPDATE, and DELETE (i.e., HTTP POST, GET, PATCH, and DELETE) IoT data and metadata in a SensorThings service.

Entities (Resources)

SensorThings API defines the following resources. As SensorThings is a RESTful web service, each entity can be CREATE, READ, UPDATE, and DELETE with standard HTTP verbs (POST, GET, PATCH, and DELETE):[4][5]

  • Thing: An object of the physical world (physical things) or the information world (virtual things) that is capable of being identified and integrated into communication networks.[6]
  • Locations: Locates the Thing or the Things it associated with.
  • HistoricalLocations: Set provides the current (i.e., last known) and previous locations of the Thing with their time.
  • Datastream: A collection of Observations and the Observations in a Datastream measure the same ObservedProperty and are produced by the same Sensor.
  • ObservedProperty : Specifies the phenomenon of an Observation.
  • Sensor : An instrument that observes a property or phenomenon with the goal of producing an estimate of the value of the property.
  • Observation: Act of measuring or otherwise determining the value of a property.[7]
  • FeatureOfInterest: An Observation results in a value being assigned to a phenomenon.The phenomenon is a property of a feature, the latter being the FeatureOfInterest of the Observation.[7]

Example Payload

http://example.org/v1.0/Datastream(id)/Observations

{
  "@iot.count": 2,
  "value": [
    {
      "@iot.id": 1,
      "@iot.selfLink": "http://example.org/v1.0/Observations(1)",
      "phenomenonTime": "2016-01-01T05:00:00.000Z",
      "result": "-9",
      "resultTime": null,
      "Datastream@iot.navigationLink": "http://example.org/v1.0/Observations(1)/Datastream",
      "FeatureOfInterest@iot.navigationLink": "http://example.org/v1.0/Observations(1)/FeatureOfInterest"
    },
    {
      "@iot.id": 2,
      "@iot.selfLink": "http://example.org/v1.0/Observations(2)",
      "phenomenonTime": "2016-01-01T04:00:00.000Z",
      "result": "-10",
      "resultTime": null,
      "Datastream@iot.navigationLink": "http://example.org/v1.0/Observations(2)/Datastream",
      "FeatureOfInterest@iot.navigationLink": "http://example.org/v1.0/Observations(2)/FeatureOfInterest"
    }
  ]
}

Data Array Extensions

In order to reduce the data size transmitted over the network, SensorThings API data array extension allows users to request for multiple Observation entities and format the entities in the dataArray format. When a SensorThings service returns a dataArray response, the service groups Observation entities by Datastream or MultiDatastream, which means the Observation entities that link to the same Datastream or the same MultiDatastream are aggregated in one dataArray.

Example request for data array

http://example.org/v1.0/Observations?$resultFormat=dataArray

Example data array response

{
  "value": [
    {
      "Datastream@iot.navigationLink": "http://example.org/v1.0/Datastreams(1)",
      "components": [
        "id",
        "phenomenonTime",
        "resultTime",
        "result"
      ],
      "dataArray@iot.count": 3,
      "dataArray": [
        [
          1,
          "2005-08-05T12:21:13Z",
          "2005-08-05T12:21:13Z",
          20
        ],
        [
          2,
          "2005-08-05T12:22:08Z",
          "2005-08-05T12:21:13Z",
          30
        ],
        [
          3,
          "2005-08-05T12:22:54Z",
          "2005-08-05T12:21:13Z",
          0
        ]
      ]
    }
  ]
}

Evaluation

Interoperability between OpenIoT and SensorThings "We believe that the implementation of the SensorThing API will be a major improvement for the OpenIoT middleware. It will give OpenIoT a standardized and truly easy to use interface to sensor values.This will complement the rich semantic reasoning services with a simple resource based interface. And the consistent data model mapping gives both a common context to describe the internet of things".[8]

Efficiency of SensorThings API A comprehensive evaluation of the SensorThings API is published in Jazayeri, Mohammad Ali, Steve HL Liang, and Chih-Yuan Huang. "Implementation and Evaluation of Four Interoperable Open Standards for the Internet of Things." Sensors 15.9 (2015): 24343-24373.

Quotes

SensorThings API was demonstrated in a pilot project[9] sponsored by the Department of Homeland Security Science and Technology. Dr. Reginald Brothers, the Undersecretary of the Homeland Security Science and Technology, was "impressed with the ‘state of the practical’ where these various industry sensors can be integrated today using open standards that remove the stovepipe limitations of one-off technologies.[10] "

OGC SensorThings API Standard Specification

Open Source SensorThings API Implementations

In March 2016 SensorUp and the GeoSensorWeb Lab at the University of Calgary submitted an open source software project proposal to the Eclipse Foundation and has been approved. The project is called Whiskers.[11] Whiskers will be an OGC SensorThings API framework. It will have a Javascript client and a light-weight server for IoT gateway devices (e.g., Raspberry Pi or BeagleBone). Whiskers aim to foster a healthy and open IoT ecosystem, as opposed to one dominated by proprietary information silos. Whiskers aims to make SensorThings development easy for the large and growing world of IoT developers.

Comparison between OGC SensorThings API and OGC Sensor Observation Services

SensorThings API provides functions similar to the OGC Sensor Observation Service, an OGC specification approved in 2005. Both standard specifications are under the OGC Sensor Web Enablement standard suite. The following table summarizes the technical difference between the two specifications.[12]

OGC SensorThings API OGC Sensor Observation Service (SOS)
Encoding JSON XML
Architecture Style Resource Oriented Architecture Service Oriented Architecture
Binding REST SOAP
Inserting new sensors or observations HTTP POST (e.g., CRUD) using SOS specific interfaces, e.g., RegisterSensor(), InsertObservation()
Deleting existing sensors HTTP DELETE using SOS specific interfaces, i.e., DeleteSensor()
Pagination $top, $skip, $nextLink Not Supported
Pub/Sub Support MQTT and SensorThings MQTT Extension Not Supported
Updating properties of existing sensors or observations HTTP PATCH and JSON PATCH Not Supported
Deleting observations HTTP DELETE Not Supported
Linked data support JSON-LD Not Supported
Return only the properties selected by the client $select Not Supported
Return multiple O&M entities (e.g., FeatureOfInterest and Observation) in one request/response $expand Not Supported

Links

  1. SensorThings API - GitHub
  2. Presentation: Sensor up your connected applications with OGC SensorThings API (FOSS4G)
  3. Chapter: Mapping the OGC SensorThings API onto the OpenIoT Middleware
  4. Tutorial in YouTube: Getting Started Series #1 and SensorThings Tutorial Series #2
  5. Application: SensorThings Playground allows interested people and organizations to experiment with a SensorThings system via a friendly, step-by-step process.

References

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. 4.0 4.1 Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. 7.0 7.1 Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.