SensorThings API


SensorThings API is an Open Geospatial Consortium 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 has two parts: Part I - Sensing and Part II - Tasking. OGC SensorThings API Part I - Sensing was released for public comment on June 18, 2015. The OGC Technical Committee approves start of electronic vote on December 3, 2015, and the SensorThings API Part I - Sensing passed the TC vote on February 1, 2016. The was published online on July 26, 2016. In 2019 the SensorThings API was also published as a United Nation's ITU-T Technical Specification.
OGC SensorThings API Part II - Tasking Core was released for public comment on February 20, 2018, and it passed the TC vote on June 1, 2018. The for the SensorThings API Part II - Tasking Core was published online on January 8, 2019.
In order to offer a better developer experience, was published online on December 18, 2018. The Tasking Core Discussion paper provides 15 JSON examples showing how SensorThings API Part II - Tasking Core can be used.

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.
The foundation of the SensorThings API is its data model that is based on the ISO 19156, 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, 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.
An IoT device or system is modelled as a Thing. A Thing has an arbitrary number of Locations and an arbitrary number of 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.
SensorThings API provides two main functionalities, each handled by a part. The two profiles are the Sensing part and the Tasking part. The Sensing part provides a standard way to manage and retrieve observations and metadata from heterogeneous IoT sensor systems, and the Sensing part functions are similar to the OGC Sensor Observation Service. The Tasking part provides a standard way for parameterizing - also called tasking - of task-able IoT devices, such as sensors or actuators. The Tasking part functions are similar to the OGC . The Sensing part is designed based on the ISO/OGC Observations and Measurements model, and allows IoT devices and applications to CREATE, READ, UPDATE, and DELETE IoT data and metadata in a SensorThings service.

Entities (resources)

SensorThings API Part I - Sensing defines the following resources. As SensorThings is a RESTful web service, each entity can be CREATE, READ, UPDATE, and DELETE with standard HTTP verbs :
  • Thing: An object of the physical world or the information world that is capable of being identified and integrated into communication networks.
  • Locations: Locates the Thing or the Things it associated with.
  • HistoricalLocations: Set provides the current 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.
  • 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.
In addition to the above sensing resources, SensorThings API Part II - Tasking Core defines the following resources:
  • TaskingCapabilities: Specifies the task-able parameters of an actuator.
  • Tasks: A collection of Tasks that has been created.
  • Actuator : A type of transducer that converts a signal to some real-world action or phenomenon.

    Example payload

http://example.org/v1.0/Datastream/Observations

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


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".
Efficiency of SensorThings API
A comprehensive evaluation of the SensorThings API is published in .

Quotes

SensorThings API was demonstrated in a pilot project sponsored by the Department of Homeland Security Science and Technology Directorate. 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. "

OGC SensorThings API standard specification

  • '
  • * Internal reference number of this OGC® document: 15-078r6
  • * Submission Date: 2015-06-18
  • * Publication Date: 2016-07-26
  • * Editor: Steve Liang
  • * Co-Editors: Chih-Yuan Huang / Tania Khalafbeigi
  • '
  • * Internal reference number of this OGC® document: 17-079r1
  • * Submission Date: 2017-10-13
  • * Publication Date: 2019-01-08
  • * Editor: Steve Liang
  • * Co-Editors: Tania Khalafbeigi
  • Developer API Documentation
  • * '
  • * '
  • ''''''

    Free and open source SensorThings API implementations

Whiskers

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 is an OGC SensorThings API framework. It will have a JavaScript client and a light-weight server for IoT gateway devices. 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.

GOST

GOST is an open source implementation of the SensorThings API in the Go programming language initiated by Geodan. It contains easily deployable server software and a JavaScript client. Currently it is in development but a first version can already be downloaded and deployed. The software can be installed on any device supporting Docker or Go. By default sensor data is stored in a PostgreSQL database.

FROST

FROST-Server is an Open Source server implementation of the OGC SensorThings API. FROST-Server implements the entire specification, including all extensions. It is written in Java and can run in Tomcat or Wildfly and is available as a Docker image. Among its many features is the ability to use String or UUID based entity IDs.
FROST-Client is a Java client library for communicating with a SensorThings API compatible server.

SensorThings HcDT Charting SDK

SensorThings HcDT is a JavaScript charting library for the OGC SensorThings API. It is based on the open source Highcharts library and . It is a front-end charting library enable developers to connect to datastreams from any OGC SensorThings API service, and display the sensor observations in charts, tables, or dashboard widgets for web applications.

Mozilla STA

developed a node implementation of the OGC SensorThings API.