WIPIVERSE All articles

Thing Description

The Thing Description (TD), also known as the W3C Web of Things (WoT) Thing Description, is a royalty-free, open information model with a JSON-based representation format standardized by the World Wide Web Consortium (W3C) for the Internet of Things (IoT). It provides a unified, machine-readable way to describe the capabilities, interfaces, metadata, protocol usage, and security requirements of an IoT device or service (referred to as a "Thing").

Overview

The Thing Description is a central building block of the W3C Web of Things (WoT) architecture. It serves as the entry point for interacting with a Thing, analogous to how index.html functions as the entry point of a website. A TD instance enables interoperability across diverse IoT platforms by abstracting device-specific protocols and data formats behind a standardized description.

The W3C published the Thing Description 1.0 as a W3C Recommendation on April 9, 2020. Version 1.1 was published as a W3C Recommendation on December 5, 2023.

Technical Specifications

Attribute Details
Filename extensions .jsontd, .td.json, .td.jsonld
Internet media type application/td+json
Developed by W3C
Initial release April 9, 2020
Type of format JSON-LD
Standard W3C Web of Things

Core Components

A TD instance consists of five main components:

  1. Textual metadata about the Thing itself (e.g., title, description, version, identifier)
  2. Interaction Affordances indicating how the Thing can be used
  3. Data schemas for the data exchanged with the Thing
  4. Security definitions describing the security mechanisms required for interactions
  5. Web links expressing formal or informal relations to other Things or documents

Interaction Affordances

The WoT Interaction Model defines three types of Interaction Affordances:

Property

Exposes the state of an IoT device. This state can be retrieved (read) and optionally updated (write). Properties can also be made observable, pushing new state values after changes occur.

Action

Allows invocation of a function on an IoT device that manipulates state (e.g., toggling a lamp on or off) or triggers a process (e.g., dimming a lamp over time). Actions may have input and output data schemas.

Event

Describes an event source that asynchronously pushes event data to subscribers (e.g., overheating alerts). Events support subscription, data, and cancellation data schemas.

Standard Technologies

The Thing Description reuses established Internet and Web standards:

  • Serialization: JSON format aligned with JSON-LD 1.1, enabling context extension and semantic enrichment
  • Security: Metadata framework supporting schemes such as OAuth2, Basic Authentication, Digest Access Authentication, API Keys, Pre-Shared Keys, and Bearer Tokens
  • Linking: Uses Web Linking (RFC 8288) for referencing related Things or documents
  • Data Schema: Based on a subset of JSON Schema for modeling exchanged data
  • Protocol Bindings: URI-based protocol identification supporting HTTP, CoAP, MQTT, Modbus, OPC UA, and others
  • Media Types: Content type assignment for payload encoding (JSON, CBOR, XML, EXI, etc.)

Example

The following is a simplified Thing Description for an internet-connected lamp using the HTTP protocol:

{
    "@context": "https://www.w3.org/2022/wot/td/v1.1",
    "id": "urn:dev:ops:32473-WoTLamp-1234",
    "title": "MyLampThing",
    "securityDefinitions": {
        "basic_sc": {"scheme": "basic", "in": "header"}
    },
    "security": ["basic_sc"],
    "properties": {
        "status": {
            "type": "string",
            "forms": [{
                "href": "https://mylamp.example.com/status",
                "htv:methodName": "GET"
            }]
        }
    },
    "actions": {
        "toggle": {
            "forms": [{
                "href": "https://mylamp.example.com/toggle",
                "htv:methodName": "POST"
            }]
        }
    },
    "events": {
        "overheating": {
            "data": {"type": "string"},
            "forms": [{
                "href": "https://mylamp.example.com/oh",
                "htv:methodName": "GET",
                "subprotocol": "longpoll"
            }]
        }
    }
}

Thing Model

The Thing Description specification also introduces the Thing Model (TM), which serves as a template or class definition for Thing Description instances. Thing Models describe interaction affordances and common metadata without instance-specific information such as concrete IP addresses or serial numbers. Thing Models support versioning, extension, import via tm:ref, composition via tm:submodel, and optional interaction affordances via tm:optional. Thing Models are identified by the media type application/tm+json.

Implementations

Notable tools and libraries implementing the Thing Description standard include:

  • Eclipse edi{TD}or: A tool for designing Thing Descriptions and Thing Models
  • TD Playground: Validation tool for Thing Description instances
  • Eclipse node-wot: W3C WoT implementation in Node.js
  • wot-py: W3C WoT implementation in Python
  • SANE: W3C WoT implementation in Java

Security and Privacy

The specification includes security considerations such as TD interception and tampering mitigation, context interception risks, script injection prevention, JSON parsing guidelines, and JSON-LD expansion safeguards. Privacy considerations cover context fetching, immutable identifiers, fingerprinting, and personally identifiable information inferencing.

See Also

  • Web of Things
  • Digital Twin
  • OpenAPI Specification
  • JSON-LD
Browse

More topics to explore

    Browse all articles