/
🌍

OGC SensorThings API-Address the IoT interoperability challenge on the Web

https://github.com/opengeospatial/sensorthings
staogcgisiotinteroperabilityweb
On this page

Highlights

  • The OGC SensorThings API is designed to address the IoT interoperability challenge on the Web.

  • The OGC SensorThings API has also become an official ITU-T standard (ITU-T Y.4473), and an official INSPIRE download service good practice.

  • Part 1: Sensing(2016): Management and reception of observations or measurements made by IoT sensors

  • SensorThings API Part 1: Sensing 1.1(2021) (PDF version)

  • Part 2: Tasking Core(2019): Tell the sensor/actuator what to do

  • Part 3: Rules Engine: TBD

  • Part 4: Tasking Extensions: TBD

Units for Measurement from QUDT

  • Develope SensorThings API 2.0 Part1-Sensing

    • Propose a new task for the STA 2.0-Sensing

      • Incorporate the learned lessons, feature requests, and latest technology trends
      • Pub-sub first, run independently of RESTful request-response pattern
      • OGC Observations and Measurements (O&M) V3.0, which is the underlying data mode of the STA
      • Harmonization of STA and OGC API: follow OGC API pattern
      • Considering OData v4, MQTT v5, Security, and JSON-LD
      • Evaluate each Change Request Proposals (CRPs)
    • Develop new and maintain discussion papers and best practices of STA

      • promote the standard and demonstrate the best practices of using STA in a more specific domain
      • Best Practice of the OGC SensorThings API - Methane Emissions
    • Review draft Engineering Reports from the OGC innovatin Programme related to STA

Implementating and certified servers are also listed on OGC website:

Sandbox Services

| Owner | access | version | Endpoint URL | Fraunhofer IOSB | CRUD | 1.1 | ogc-demo.k8s.i...fraunhofer.de | SensorUp | CRUD | 1.0 | scratchpad.sensorup.com/O....0

Some client implementations exist:

Introduction

OGC SensorThings API provides an open and unified way to interconnect Internet of Things (IoT) devices over the Web as well as interfaces to interact with and analyze their observations. SensorThings API Part 1: Sensing 1.0 (PDF version) was released in 2016 and allowed management and reception of observations or measurements made by IoT sensors. SensorThings API Part 2: Tasking Core 1.0 (PDF version) provides a mechanism to tell the sensor/actuator what to do.

Frequent Asked Questions

Is SensorThings API part of the OGC Sensor Web Enablement standards?

The answer is YES. This might be the #1 question get asked. SensorThings API is part of the OGC Sensor Web Enablement standards. Hey, SensorThings API was called SWE for IoT! For example, SensorThings API's data model is based on OGC/ISO Observations and Measurements (OGC/ISO 19156:2011), so that it can easily interoperate with OGC Sensor Observation Services (SOS). The main difference is that SensorThings is RESTful, uses the efficient JSON encoding, adopts the OASIS OData URL pattern and query options, and supports the ISO MQTT messaging protocol.

What is the OGC SensorThings API?

The OGC SensorThings API is an OGC standard providing an open and unified framework to interconnect IoT devices, data, and applications over the Web. It is non-proprietary, platform-independent, and perpetual royalty-free. The OGC SensorThings API significantly simplifies and accelerates the development of IoT applications. Application developers can connect to various IoT devices and create innovative applications without worrying the daunting heterogeneous protocols of the different IoT devices. The OGC SensorThings API can also be embedded within various IoT hardware and software platforms, so that the various IoT devices can effortlessly connect with the OGC standard-compliant servers around the world. In summary, the OGC SensorThings API is transforming the numerous disjointed IoT systems into a fully connected platform where complex tasks can be synchronized and performed.

Why do we develop the OGC SensorThings API?

In today's world, most sensors have proprietary software interfaces defined by their manufacturers and used selectively. New APIs are requested and developed on an as needed basis. This situation causes significant burden not only on developers who develop applications with new sensors, but also on providers of gateways, portals or services where observations are used. The OGC SensorThings API defines standardized interfaces for sensors in the Web of Things (WoT) and Internet of Things (IoT), two terms that are frequently used interchangeably. These standardized interfaces will permit the proliferation of new high value services with lower overhead of development and wider reach, and will also lower the cost for sensor and gateway providers.

What is the status of the OGC SensorThings API?

OGC SensorThings API is an official OGC standard specification. The OGC SensorThings API was approved by OGC Techncial Committee in February 2016.

Is the OGC SensorThings API a new standard?

Yes and No. The answer can be yes, because it is a new standard designed specifically for IoT devices and applications. The answer can also be no, because the OGC SensorThings API is developed based on the existing OGC Sensor Web Enablement (SWE) standards. The OGC SWE standards enable all types of sensors and actuators discoverable, accessible and re-usable via the Web. These standards have been widely implemented around the world. SWE standards, however, are as complex as necessary to support tasks such as controlling Earth imaging satellites and archiving national libraries of geological observation data, and thus are, too "heavyweight" for the resource-constrained IoT applications. The OGC SensorThings API can be considered as a lightweight SWE profile suited particularly for IoT applications. As a result, the OGC SensorThings API is a new and efficient API based on the proven and widely implemented SWE standard framework.

Get all Datastreams

sh
https://toronto-bike-snapshot.sensorup.com/v1.0/Datastreams?$count=false&$expand=Thing/Locations,ObservedProperty,Observations($top=2000),Observations/FeatureOfInterest&$top=1

Get all observations of Datastreams named with the given name

sh
http://edmonton-aq-sta.sensorup.com/v1.0/Datastreams?$expand=Thing,Sensor,ObservedProperty,Observations,Observations%2FFeatureOfInterest&$filter=substringof('PM2.5',name)

Get all observations between the specific datetime of Datastreams named with the given name

sh
http://edmonton-aq-sta.sensorup.com/v1.0/Datastreams?$expand=Thing,Sensor,ObservedProperty,Observations,Observations%2FFeatureOfInterest&$filter=substringof('PM2.5',name) and Observations/phenomenonTime ge 2017-01-01T00:00:00.000Z and Observations/phenomenonTime le 2018-03-01T00:00:00.000Z

Get specific Datastream hourly data

sh
http://edmonton-aq-sta.sensorup.com/v1.0/Datastreams(124139)/Observations?$aggregate=mean_hour:America/Edmonton

Resources

-Frost-Client: a Java-based client library for the SensorThingsAPI and aims to simplify development of SensorThings enabled client applications.

-Sensorthings API Python Client: a client library to facilitate interaction with a FROST SensorThingsAPI Server

json
[
{“n”:”urn:dev:ops:561133-ElectricMeter-CL17999”,”u”:”kWh”,”t”:1.5513408e+09,”v”:65141}
]

This specification defines a format for representing simple sensor measurements and device parameters in Sensor Measurement Lists (SenML). A simple sensor, such as a temperature sensor, could use one of these media types in protocols such as HTTP or the Constrained Application Protocol (CoAP) to transport the measurements of the sensor or to be configured.

How to Cite OGC SensorThings API

Liang, Steve H.L., Chih-Yuan Huang, and Tania Khalafbeigi. "OGC SensorThings API Part I:Sensing" OGC® Implementation Standard (2016)

JSON-LD

JSON-LD is a lightweight Linked Data format. It is easy for humans to read and write. It is based on the already successful JSON format and provides a way to help JSON data interoperate at Web-scale. JSON-LD is an ideal data format for programming environments, REST Web services, and unstructured databases such as Apache CouchDB and MongoDB.

json
{
"@context": "https://json-ld.org/contexts/person.jsonld",
"@id": "http://dbpedia.org/resource/John_Lennon",
"name": "John Lennon",
"born": "1940-10-09",
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}

MQTT

Currently the STA MQTT extension only allows for:

• subscriptions on modifications, • the creation of new Observations

This means that the MQTT extension does not allow for request/response type data retrieval.

MQTT5 has formalised the way to do request/response data exchange over MQTT, so this makes it possible to apply the complete SensorThingsAPI rest interface to MQTT as well, instead of just HTTP.

TODO

  • [] Review existing tools
  • [] Setup a dev plan
Edit this page
logo
Code-related notes and snippets