SensorThings API

{{Infobox technology standard

| title = OGC SensorThings API - Part 1 Sensing

| status = OGC Standard Implementation Specification

| year_started = 2015

| version = 1.0

| editors = Steve Liang (SensorUp), Chih-Yuan Huang ([http://www.ncu.edu.tw National Central University]), Tania Khalafbeigi (SensorUp)

| base_standards = JSON, OGC/ISO 19156:2011 O&M

| abbreviation = OGC STA

| domain = Open Geospatial Consortium, Internet of Things

| website = [https://github.com/opengeospatial/sensorthings OGC SensorThings API Standard GitHub Page]

}}

{{Infobox technology standard

| title = OGC SensorThings API - Part 2 Tasking Core

| status = OGC Standard Implementation Specification

| year_started = 2018

| version = 1.0

| editors = Steve Liang (SensorUp), Tania Khalafbeigi (SensorUp)

| base_standards = [http://www.opengeospatial.org/standards/sps OGC SPS]

| abbreviation = OGC STA

| domain = Open Geospatial Consortium, Internet of Things

| website = [https://github.com/opengeospatial/sensorthings OGC SensorThings API Standard GitHub Page]

}}

{{Infobox technology standard

| title = OGC SensorThings API - Part 2 Tasking Core Discussion Paper

| status = OGC Discussion Paper

| year_started = 2018

| version = 1.0

| editors = Steve Liang (SensorUp), Tania Khalafbeigi (SensorUp), Kan Luo(University of Calgary)

| base_standards = [http://www.opengeospatial.org/standards/sensorthings OGC SensorThings]

| abbreviation = OGC STA

| domain = Open Geospatial Consortium, Internet of Things

| website = [https://portal.opengeospatial.org/files/?artifact_id=79179 OGC SensorThings API Tasking Core Discussion Paper download page]

}}

SensorThings API{{Cite web|url=http://www.opengeospatial.org/standards/sensorthings|title=OGC SensorThings API|website=Open Geospatial Consortium|access-date=2018-02-20}} 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 has two parts: (1) Part I - Sensing and (2) Part II - Tasking. OGC SensorThings API Part I - Sensing was released for public comment on June 18, 2015.{{Cite web|title = OGC seeks public comment on SensorThings API standard for Internet of Things {{!}} OGC|url = http://www.opengeospatial.org/pressroom/pressreleases/2238|website = www.opengeospatial.org|access-date = 2016-01-26}} The OGC Technical Committee (TC) 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 [http://docs.opengeospatial.org/is/15-078r6/15-078r6.html official OGC standard specification] was published online on July 26, 2016. In 2019 the SensorThings API was also published as a United Nation's ITU-T Technical Specification.{{Cite web|url=https://www.itu.int/pub/T-FG-DPM-2019-3.2|title=Technical Specification D3.2 - SensorThings API - Sensing|website=www.itu.int|access-date=2019-07-17}}

OGC SensorThings API Part II - Tasking Core was released for public comment on February 20, 2018,{{Cite web|url=http://www.opengeospatial.org/pressroom/pressreleases/2739|title=OGC seeks public comment on 'SensorThings API Part 2 – Tasking Core' Candidate Standard for use in the Internet of Things {{!}} OGC|website=www.opengeospatial.org|language=en|access-date=2018-02-21}} and it passed the TC vote on June 1, 2018. The [http://docs.opengeospatial.org/is/17-079r1/17-079r1.html official OGC standard specification] for the SensorThings API Part II - Tasking Core was published online on January 8, 2019.

In order to offer a better developer experience, [https://portal.opengeospatial.org/files/?artifact_id=79179 the SensorThings API Part II - Tasking Core Discussion Paper] 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.

File:SensorThings API data model.svg

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 an arbitrary number of Locations (including 0 Locations) and an arbitrary number of Datastreams (including 0 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.{{Cite web|title = API Reference|url = http://www.sensorup.com/docs/?json#introduction|website = www.sensorup.com|access-date = 2016-01-26|archive-date = 2016-02-03|archive-url = https://web.archive.org/web/20160203145736/http://www.sensorup.com/docs/?json#introduction|url-status = dead}}

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 [http://www.opengeospatial.org/standards/sps Sensor Planning Service]. The Sensing part 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 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 (POST, GET, PATCH, and DELETE):{{Cite book|url=http://docs.opengeospatial.org/is/15-078r6/15-078r6.html|title=OGC® SensorThings API Part 1: Sensing|editor-last=Liang|editor-first=Steve|editor-last2=Huang|editor-first2=Chih-Yuan|editor-last3=Khalafbeigi|editor-first3=Tania|date=2016-07-26}}{{Cite web|title = SensorThings Data Model|url = https://ogc-iot.github.io/ogc-iot-api/datamodel.html|website = ogc-iot.github.io|access-date = 2016-01-26}}

  • 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.{{Cite web|title = Y.2060 : Overview of the Internet of things|url = https://www.itu.int/rec/T-REC-Y.2060-201206-I|website = www.itu.int|access-date = 2016-01-26|last = tsbmail}}
  • 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.{{Cite web|title = ISO 19156:2011 - Geographic information -- Observations and measurements|url = http://www.iso.org/iso/catalogue_detail.htm?csnumber=32574|website = www.iso.org|access-date = 2016-01-26}}
  • 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:{{Cite book|url=http://docs.opengeospatial.org/is/17-079r1/17-079r1.html|title=OGC® SensorThings API Part 2: Tasking Core|editor-last=Liang|editor-first=Steve|editor-last2=Khalafbeigi|editor-first2=Tania|date=2019-01-08}}

  • 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.{{Cite web|url=http://www.opengeospatial.org/standards/sensorml|title=Sensor Model Language (SensorML) {{!}} OGC|website=www.opengeospatial.org|language=en|access-date=2018-02-21}}

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".{{Cite book|title = Mapping the OGC SensorThings API onto the OpenIoT Middleware|publisher = Springer International Publishing|date = 2015-01-01|isbn = 9783319165455|pages = 62–70|series = Lecture Notes in Computer Science|doi = 10.1007/978-3-319-16546-2_6|language = en|first1 = Hylke van der|last1 = Schaaf|first2 = Reinhard|last2 = Herzog|editor-first = Ivana Podnar|editor-last = Žarko|editor-first2 = Krešimir|editor-last2 = Pripužić|editor-first3 = Martin|editor-last3 = Serrano}}

Efficiency of SensorThings API

A comprehensive evaluation of the SensorThings API is published in [http://www.mdpi.com/1424-8220/15/9/24343 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{{Cite web|title = OGC announces successful completion of Incident Management Information Sharing IoT Pilot|url = http://www.opengeospatial.org/pressroom/pressreleases/2394}} 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.{{Cite web|title = S&T's Internet of Things Pilot Demonstrates 'State of the Practical'|url = https://www.dhs.gov/science-and-technology/blog/2016/01/25/st-internet-things-pilot-demonstrates-state-practical|access-date = 2016-02-14|date = 2016-01-25}} "

OGC SensorThings API standard specification

  • [http://docs.opengeospatial.org/is/15-078r6/15-078r6.html OGC® SensorThings API Part 1: Sensing]
  • Internal reference number of this OGC®  document: 15-078r6
  • Submission Date: 2015-06-18
  • Publication Date: 2016-07-26
  • Editor: Steve Liang (University of Calgary/SensorUp)
  • Co-Editors: Chih-Yuan Huang (National Central University) / Tania Khalafbeigi (University of Calgary/SensorUp)
  • [http://docs.opengeospatial.org/is/17-079r1/17-079r1.html OGC® SensorThings API Part 2: Tasking Core]
  • Internal reference number of this OGC®  document: 17-079r1
  • Submission Date: 2017-10-13
  • Publication Date: 2019-01-08
  • Editor: Steve Liang (University of Calgary/SensorUp)
  • Co-Editors: Tania Khalafbeigi (University of Calgary/SensorUp)
  • Developer API Documentation
  • [http://developers.sensorup.com/docs/#sensorthingsAPISensing Part I - Sensing]
  • [http://developers.sensorup.com/docs/#sensorthingsAPITasking Part II - Tasking]
  • [http://scratchpad.sensorup.com SensorThings API Sandbox] {{Webarchive|url=https://web.archive.org/web/20160916222838/https://scratchpad.sensorup.com/ |date=2016-09-16 }}
  • [http://cite.opengeospatial.org/te2/about/sta10/1.0/site/ SensorThings Compliance Test Suite]

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 [https://github.com/eclipse/whiskers Whiskers].{{Cite web|title = Whisker, an Eclipse project proposal|url = https://projects.eclipse.org/proposals/whiskers|access-date = 2016-03-24|date = 2016-03-11}} Whiskers is 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.

= GOST =

GOST{{Cite web|url=https://github.com/gost/home|title=Geodan/gost|website=GitHub|access-date=2016-06-30}} 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 (June 2016) 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 (e.g. Windows, Linux, Mac OS and Raspberry Pi). By default sensor data is stored in a PostgreSQL database.

= FROST =

FROST-Server{{Cite web|url=https://github.com/FraunhoferIOSB/FROST-Server|title=FraunhoferIOSB/FROST-Server|website=GitHub|access-date=2018-07-04}} 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{{Cite web|url=https://github.com/FraunhoferIOSB/FROST-Client|title=FraunhoferIOSB/FROST-Client|website=GitHub|access-date=2018-07-04}} is a Java client library for communicating with a SensorThings API compatible server.

= SensorThings HcDT Charting SDK =

SensorThings HcDT{{Cite web|url=http://www.sensorup.com/sensorthings-high-chart-and-data-table-hcdt/|title=SensorThings Highchart and DataTable (HcDT) {{!}} SensorUp|website=www.sensorup.com|access-date=2016-08-31|archive-date=2016-08-20|archive-url=https://web.archive.org/web/20160820104430/http://www.sensorup.com/sensorthings-high-chart-and-data-table-hcdt/|url-status=dead}} is a JavaScript charting library for the OGC SensorThings API. It is based on the open source{{clarify|date=December 2019}} Highcharts library and [https://datatables.net/ DataTables]. 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 =

Mozilla developed a node implementation of the OGC SensorThings API.{{Cite web|url=https://github.com/mozilla-sensorweb/sensorthings|title=mozilla-sensorweb/sensorthings|website=GitHub|language=en|access-date=2017-03-05}}

= 52°North STA =

52N SensorThingsAPI{{Citation|title=52North/sensorweb-server-sta|date=2020-11-17|url=https://github.com/52North/sensorweb-server-sta|publisher=52°North Initiative for Geospatial Open Source Software GmbH|access-date=2020-11-24}} is an open source implementation of the OGC SensorThings API. Its core features are the interoperability with the [https://github.com/52North/SOS/ 52N SOS] implementing the OGC Sensor Observation Service, customizable database mappings and several convenience extensions. It can be deployed as a Docker container, inside an Apache Tomcat or as a standalone application.

Example applications

= [https://www.dhs.gov/science-and-technology Department of Homeland Security S&T] Shaken Fury Operational Experiment =

In 2019 the Shaken Fury operational experiment{{Cite web|url=https://www.dhs.gov/science-and-technology/news/2019/06/10/news-release-st-industry-responders-partner-evaluate-tech|title=News Release: S&T, Industry, Responders Partner to Evaluate Tech|date=2019-06-10|website=Department of Homeland Security|language=en|access-date=2019-07-17}} for the DHS Next Generation First Responder program depicts a scenario of an earthquake causing partial structural collapse and HAZMAT leak at a stadium. OGC SensorThings API is used as the standard interface{{Cite web|url=https://www.dhs.gov/science-and-technology/ngfr/handbook|title=NGFR Integration Handbook|date=2018-02-06|website=Department of Homeland Security|language=en|access-date=2019-07-17}} that interconnects multiple sensors and offers an IoT enabled real-time situational awareness.

= Smart Citizens for Smart Cities YYC - crowd-sourced air quality sensing =

On Oct 8th 2016,{{Cite news|url=http://metronews.ca/news/calgary/2016/09/27/calgary-sensor-pilot-helps-you-plan-a-run-best-air-quality.html|title=Calgary sensor pilot helps you plan a run with the best air quality {{!}} Metro News|newspaper=metronews.ca|access-date=2016-11-04|archive-date=2016-11-04|archive-url=https://web.archive.org/web/20161104203929/http://metronews.ca/news/calgary/2016/09/27/calgary-sensor-pilot-helps-you-plan-a-run-best-air-quality.html|url-status=dead}} a group of volunteers (smart citizens) in Calgary gathered together, assembled their own sensors, installed at their houses, and formed a crowd-sourced air quality sensor network. All data are publicly available via OGC SensorThings API.{{Cite web|url=http://calgary-air.sensorup.com/|title=Air Quality in Calgary|website=calgary-air.sensorup.com|access-date=2016-11-04}} This citizen sensing efforts increased the number of Calgary's air quality sensors from 3 to more than 50.

= Smart Emission Project in Nijmegen, NL =

Smart emission{{Cite web|url=http://data.smartemission.nl/|title=Smart Emission|last=contributors|first=Just van den Broecke - Geonovum original: Mark Otto, Jacob Thornton, and Bootstrap|website=data.smartemission.nl|access-date=2016-11-04}} is an air quality monitoring project in the city of Nijmegen, NL. The project deployed multiple air quality sensors throughout the city. Data are published with open standards, including OGC SensorThings API. Part of the project is an open source ETL engine to load the project sensor data into an OGC SensorThings API.{{Cite web|url=https://github.com/Geonovum/smartemission/tree/master/etl|title=Geonovum/smartemission|website=GitHub|access-date=2016-11-04}}

= SensorThings Dashboard =

This [https://github.com/SensorThings-Dashboard/SensorThings-Dashboard dashboard] provides easy-to-use client-side visualisation of Internet-of-Things sensor data from OGC SensorThings API compatible servers. Various types of widgets can be arranged and configured on the dashboard. It is a web application and can be embedded into any website. A live demo is available on the [https://sensorthings-dashboard.github.io/ project page].

https://github.com/SensorThings-Dashboard/SensorThings-Dashboard

= GOST Dashboard v2 =

[https://github.com/gost/dashboard-v2 GOST Dashboard v2] is an open source library of custom HTML elements (web components) supporting SensorThings API. These elements facilitate the development of HTML applications integrating functionality and data from SensorThings API compatible services. The components are developed with [https://www.predix-ui.com Predix-UI] and [https://www.polymer-project.org/ Polymer].

= AFarCloud project OGC Connector =

The connector enables interoperability between OGC-compliant data sources and the semantic middleware{{cite book |last1=Kepka |first1=Michal |last2=Černý |first2=Lukáš |last3=Brada |first3=Premek |title=Proceedings of the 18th Conference on Embedded Networked Sensor Systems |chapter=An open system for monitoring environmental phenomena: Poster abstract |date=November 2020 |pages=659–660 |doi=10.1145/3384419.3430443 |publisher=ACM|isbn=9781450375900 |s2cid=227154703 }} developed in the Horizon 2020 ECSEL [https://cordis.europa.eu/project/id/783221 project AFarCloud]. It is a modular Java application with Docker-based deployment, implemented according to the 15-078r6 OGC SensorThings API 1.0 Implementation Standard.

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.{{Cite web|title = Comparison of SensorThings API and Sensor Observation Service|url = http://www.sensorup.com/index.php/2016/03/01/comparison-of-sensorthings-api-and-sensor-observation-service/|access-date = 2016-02-29|archive-date = 2016-03-06|archive-url = https://web.archive.org/web/20160306065338/http://www.sensorup.com/index.php/2016/03/01/comparison-of-sensorthings-api-and-sensor-observation-service/|url-status = dead}}

class="wikitable"
OGC SensorThings APIOGC Sensor Observation Service (SOS)
EncodingJSONXML
Architecture StyleResource Oriented ArchitectureService Oriented Architecture
BindingRESTSOAP
Inserting new sensors or observationsHTTP POST (e.g., CRUD)using SOS specific interfaces, e.g., RegisterSensor(), InsertObservation()
Deleting existing sensorsHTTP DELETEusing SOS specific interfaces, i.e., DeleteSensor()
Pagination$top, $skip, $nextLinkNot Supported
Pub/Sub SupportMQTT and SensorThings MQTT ExtensionNot Supported
Updating properties of existing sensors or observationsHTTP PATCH and JSON PATCHNot Supported
Deleting observationsHTTP DELETENot Supported
Linked data supportJSON-LDNot Supported
Return only the properties selected by the client$selectNot Supported
Return multiple O&M entities (e.g., FeatureOfInterest and Observation) in one request/response$expandNot Supported

References