Thing Description Explained

Thing Description
Iconcaption:The logo of the latest version, Thing Description
Extension:.jsontd, .td.json, .td.jsonld
Mime:application/td+json
Developer:W3C
Type:JSON-LD
Released:April 9, 2020
Url:https://www.w3.org/TR/wot-thing-description/
Standard:W3C Web of Things
Open:Yes
Genre:Device Description

The Thing Description (TD) (or W3C WoT Thing Description (TD)) is a royalty-free, open information model with a JSON based representation format for the Internet of Things (IoT). A TD provides a unified way to describe the capabilities of an IoT device or service with its offered data model and functions, protocol usage, and further metadata. Using Thing Descriptions help reduce the complexity of integrating IoT devices and their capabilities into IoT applications.[1]

The TD originated from the Web of Things (WoT) initiative of the international standards organization of the W3C which has the intention to increase the interoperability in the IoT.[2] Since April 2020, the Thing Description[3] is a W3C recommendation (W3C WoT Thing Description 1.0).

In December 2023, the W3C published 1.1 version of the Thing Description recommendation.[4]

Principles

The major principle of the Thing Description is to provide a human-readable and machine-interpretable interface description of an IoT device/Thing. In that context, the WoT Thing Description is to the IoT what index.html is to a website: it can be considered as the entry point of a physical or virtual Thing/device.[5] Thing Description are not limited to a specific communication protocol, rather it provides a framework called a WoT Binding Template.[6] Such a Protocol Binding defines the mapping from an Interaction Affordance to concrete messages of a specific IoT protocol such as MQTT, HTTP, CoAP, Modbus or OPC UA.

The WoT Thing Description defines 3 kinds of Interaction Affordances, named Property, Action and Event:

Property

An Interaction Affordance that exposes state of an IoT device. This state can then be retrieved (read) and optionally updated (write). Devices can also choose to make Properties observable by pushing the new state after a change.

Action

An Interaction Affordance that allows to invoke a function of an IoT device, which manipulates state (e.g., toggling a lamp on or off) or triggers a process on the device (e.g., dim a lamp over time).

Event

An Interaction Affordance that describes an event source, which asynchronously pushes event data to the subscribers of the event (e.g., overheating alerts).

Components and standard technologies

In general, the Thing Description is designed to reuse and rely on established Internet and Web standards, this includes:

Thing Description examples

Below is an example TD serialized in JSON-LD format, which has one property, one action and one event. The IoT device represented by this TD uses the HTTP protocol but a TD can represent any protocol with a URI scheme, as shown in the example below.This TD represents an Internet connected lamp, which could be thought as a simple version of a Philips Hue lamp.

From this TD example, a client knows that there exists one Property affordance with the title status (lines 10-16). In addition, information is provided in lines 13-14 that this Property is readable with an HTTP GET request to the URI <nowiki>https://mylamp.example.com/status</nowiki>, and will return a string-based status value. In a similar manner, an Action affordance is specified to toggle the switch status using the POST method on the <nowiki>https://mylamp.example.com/toggle</nowiki> resource. The Event affordance enables a mechanism for asynchronous messages to be sent by a Thing. Here, a subscription to be notified upon a possible overheating event of the lamp can be obtained by using HTTP with its long polling subprotocol on <nowiki>https://mylamp.example.com/oh</nowiki>. The use of the GET or POST method is stated explicitly but can be omitted using the default assumptions stated in the TD specification. It can be seen that the HTTP methods are defined using the "htv:methodName" vocabulary terms. This vocabulary terms for HTTP are included in the TD vocabulary that is found in the "@context" value.

This example also specifies the basic security scheme, requiring a username and password for access. A security scheme is first given a name and its corresponding scheme in the securityDefinitions and then activated by specifying that name in a security section. In combination with the use of the HTTP this example demonstrates the use of Basic access authentication.

Below is the same connected lamp but using MQTT protocol and no security.

Differently from the last TD, here the forms include MQTT protocol as specified by the WoT Binding Templates. More specifically, lines 17, 25 and 34 describe what message types should be used to use the affordances. For example, instead of HTTP GET and longpoll subprotocol to observe the overheating event, a client can subscribe to this event using the MQTT protocol. Furthermore, a WoT device with MQTT protocol can be both a publisher and a subscriber. For the property and event affordances, it would publish the values, whereas for action affordances it would subscribe to the action topics that other MQTT publishers can trigger by publishing to these topics.

Implementations

Thing Description editing and validation tools

Implementations using Thing Description

See also

Notes and References

  1. Web site: Web of Things over IoT and Its Applications. 2020-12-03. InfoQ. en.
  2. Web site: Solution for IoT Interoperability – W3C Web of Things. 2020-04-13. DATAVERSITY - Data Education for Business and IT Professionals . 13 April 2020. en.
  3. Web site: Web of Things (WoT) Thing Description. Käbisch. Sebastian. Kamiya. Takuki. McCool. Michael. Charpenay. Victor. Kovatsch. Matthias. 2020-04-09. www.w3.org. bot: unknown. https://web.archive.org/web/20211024131227/https://www.w3.org/TR/wot-thing-description10/. 2021-10-24. 2020-04-17.
  4. Web site: Web of Things (WoT) Thing Description 1.1. Käbisch. Sebastian. McCool. Michael. Korkan. Ege. 2023-12-05. www.w3.org. bot: unknown. https://web.archive.org/web/20231207121223/https://www.w3.org/TR/wot-thing-description11/. 2023-12-07. 2023-01-19.
  5. Web site: Solution for IoT Interoperability - W3C Web of Things (WoT) . W3C . 9 April 2020 . W3C Press . 22 December 2020.
  6. Web site: Web of Things (WoT) Binding Templates. Koster. Michael. Korkan. Ege. 2019-01-30. www.w3.org. bot: unknown. https://web.archive.org/web/20200414181540/https://www.w3.org/TR/wot-binding-templates/. 2020-04-14. 2020-04-17.
  7. Web site: JSON-LD Syntax 1.1. Kellogg . Gregg . Champin. Pierre-Antoine. Longley. Dave. 2020-07-16.
  8. Book: Serena . Fernando . Poveda-Villalón . María . García-Castro . Raúl . Semantic Discovery in the Web of Things . 22 February 2018 . Springer . Cham, Switzerland . 10.1007/978-3-319-74433-9_2 . 978-3-319-74433-9 .
  9. Ed. . R. Shekh-Yusef . Ahrens . D. . Bremer . S. . R. . Shekh-Yusef . HTTP Digest Access Authentication . 2015 . IETF . 10.17487/RFC7616 . 11159319 . 2020-09-01.
  10. Nottingham . M. . Web Linking . IETF . September 2017. 10.17487/RFC8288 .
  11. News: Wright . Austin . Andrews . Henry . Luff . Geraint . JSON Schema Validation: A Vocabulary for Structural Validation of JSON . Ietf Datatracker . IETF.
  12. Berners-Lee . T. . Fielding . R. . Masinter . L. . Uniform Resource Identifier (URI): Generic Syntax . 2005 . IETF. 10.17487/RFC3986 . 30973664 .
  13. Freed . N. . Borenstein . N. . Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types . 1996 . IETF. 10.17487/RFC2046 . free .
  14. 1909.03296. cs.DC. Ege. Korkan. Hassib Belhaj. Hassine. WoTify: A platform to bring Web of Things to your devices. 2019-09-07. Schlott. Verena Eileen. Käbisch. Sebastian. Steinhorst. Sebastian.
  15. Web site: Java-Implementation für das Web of Things veröffentlicht. 2020-01-28. sane.city. en-us.