Thing Description
   HOME

TheInfoList



OR:

The Thing Description (TD) (or
W3C The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. Founded in 1994 and led by Tim Berners-Lee, the consortium is made up of member organizations that maintain full-time staff working to ...
WoT Thing Description (TD)) is a
royalty-free Royalty-free (RF) material subject to copyright or other intellectual property rights may be used without the need to pay royalties or license fees for each use, per each copy or volume sold or some time period of use or sales. Computer standard ...
, open information model with a
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
based representation format for the
Internet of Things The Internet of things (IoT) describes physical objects (or groups of such objects) with sensors, processing ability, software and other technologies that connect and exchange data with other devices and systems over the Internet or other comm ...
(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. The TD originated from the Web of Things (WoT) initiative of the international standards organization of the
W3C The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. Founded in 1994 and led by Tim Berners-Lee, the consortium is made up of member organizations that maintain full-time staff working to ...
which has the intention to increase the interoperability in the IoT. Since April 2020, the Thing Description is a W3C recommendation (W3C WoT Thing Description 1.0). In January 2023, the W3C published a candidate recommendation for Thing Description 1.1.


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''. Thing Description are not limited to a specific communication protocol, rather it provides a framework called a WoT Binding Template. 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: * Serialization: The JSON serialization of the TD information model is aligned with the syntax of JSON-LD 1.1. JSON-LD opens the opportunity of context extension and enrich the Thing Description instances with additional (e.g., domain-specific) semantics such as from Schema.org. This also supports the extraction and the understanding of relevant information such as in discovery scenarios in IoT applications * Security: The Thing Description comes with a framework that allows to provide metadata to follow existing security scheme such as
OAuth2 OAuth (short for "Open Authorization") is an open standard for access Delegation (computer security), delegation, commonly used as a way for internet users to grant websites or applications access to their information on other websites but witho ...
or Digest Access Authentication. Due to the context extension concept of the Thing Description specific security schemes can be imported. * Linking: Things may have references to other Things or like to link to further information. For defining such kind of relations the Thing Description relies on the well know Web Linking concept. * Interactions: The offered data and/or functions of a Thing are assigned to the corresponding interaction affordance Properties, Actions, and Events. * Data Schema: For modeling the Thing's data that can be exchanged, the concept of JSON schema is embedded in the Thing Description. * Bindings: The binding templates define the specific protocol and serialization method for the properties, actions, and events of the Thing. As protocol identification and addressing method URI Identifier are used. For announcing the serialization encoding (e.g.,
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
, CBOR, XML, Efficient XML Interchange) of the payload that is specified by the data schema, Media Type assignment is applied in the Thing Description.


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 Philips Hue is a line of color-changing LED lamps and white bulbs which can be controlled wirelessly. The Philips Hue line of bulbs was the first smart bulb of its kind on the market. The lamps are currently created and manufactured by Signify ...
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 Uri may refer to: Places * Canton of Uri, a canton in Switzerland * Úri, a village and commune in Hungary * Uri, Iran, a village in East Azerbaijan Province * Uri, Jammu and Kashmir, a town in India * Uri (island), an island off Malakula Islan ...
https://mylamp.example.com/status, 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 https://mylamp.example.com/toggle 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 https://mylamp.example.com/oh. 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 In the context of an HTTP transaction, basic access authentication is a method for an HTTP user agent (e.g. a web browser) to provide a user name and password when making a request. In basic HTTP authentication, a request contains a header field i ...
. 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 * Eclipse edior: A tool for simply designing W3C Thing Descriptions and Thing Models * TD Playground: Playground for validation of Thing Description instances Implementations using Thing Description * Eclipse node-wot: An implementation of W3C WoT technologies in
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript code ou ...
* WoTify: A library of WoT implementation that support a Thing Description * wot-py: An implementation of W3C WoT technologies in Python * Node-RED node-gen: Generates nodes based on a Thing Description in
Node-RED Node-RED is a flow-based programming, flow-based development tool for visual programming language, visual programming developed originally by IBM for wiring together hardware devices, Application programming interface, APIs and online services as ...
* SANE: An implementation of W3C WoT technologies in Java


See also

* Web of Things * Digital Twin * OpenAPI Specification


References

{{W3C standards Resource Description Framework JSON Internet of things