Web of Things (WoT) Hypermedia Controls Ontology

W3C Editor's Draft

More details about this document
This version:
Latest published version:
Latest editor's draft:
Victor Charpenay
Matthias Kovatsch
Ontology in RDF
Web of Things (WoT) Hypermedia Controls Ontology in RDF


This document introduces an ontology for links and forms, the main hypermedia controls in use on the Web. This ontology offers, among others, a means to reify RDF statements interpreted as links between Web resources. It also provides a versatile exchange format for links and forms in RESTful Web applications.

Hypermedia controls are of importance in the fields of the Web of Things and the Embedded Web, in particular in the W3C Thing Description model and the IETF Constrained RESTful Application Language.

Status of This Document

This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.

Validation of the document by the Working Group is expected by the end of June 2019.

This document was published by the Web of Things Working Group as an Editor's Draft.

Publication as an Editor's Draft does not imply endorsement by W3C and its Members.

This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 03 November 2023 W3C Process Document.

1. Introduction

The concept of Representational State Transfer (REST) [rest] is at the core of most modern Web applications. The state of a Web resources, exposed via a collection of Web resources, can be browsed by clients by following links and acted upon by submitting forms to servers.

Links and forms have always be present in Web technologies, including HTML [html]. Web linking [rfc8288] is a fundamental principle of the Web architecture that can be leveraged to drive applications, e.g. when a server returns a link to a newly created resource as the result of a client's request. Conversely, forms, are request templates that servers can expose to clients for them to fill in with client-specific information and send back to servers. Forms are similar in spirit to operation desriptions as defined by the Open API Specification [openapis] or by the Hydra RDF vocabulary [hydra].

Links and forms are generically referred to as hypermedia controls. They are of increasing importance in the fields of the Web of Things and the Embedded Web, which respectively led to the standardization of the Thing Description (TD) model [wot-thing-description] and the Constrained RESTful Application Language (CoRAL) [coral]. The present hypermedia controls ontology is an attempt to formalize the concepts these two standards specify.

2. Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

3. Terminology

The fundamental WoT terminology such as Thing, Consumer, Thing Description (TD), Interaction Model, Interaction Affordance, Property, Action, Event, Protocol Binding, Servient, etc. is defined in Section 3 of the WoT Architecture specification [WOT-ARCHITECTURE].

The Thing Description terminology such as TD Information Model, TD Document, Term (Vocabulary Term), etc. is defined in Section 3 of the WoT Thing Description specification [WOT-THING-DESCRIPTION].

4. Axiomatization

4.1 Classes

4.1.1 AdditionalExpectedResponse

IRI: https://www.w3.org/2019/wot/hypermedia#AdditionalExpectedResponse

Communication metadata describing the expected response message for additional responses.
In the domain of hctl:hasAdditionalOutputSchema
In the range of hctl:additionalReturns

4.1.2 ExpectedResponse

IRI: https://www.w3.org/2019/wot/hypermedia#ExpectedResponse

Communication metadata describing the expected response message for the primary response.
In the range of hctl:returns

4.1.3 Form

IRI: https://www.w3.org/2019/wot/hypermedia#Form

A form can be viewed as a statement of "To perform an operation type operation on form context, make a request method request to submission target" where the optional form fields may further describe the required request. In Thing Descriptions, the form context is the surrounding Object, such as Properties, Actions, and Events or the Thing itself for meta-interactions.
In the domain of hctl:additionalReturns
In the range of td:hasForm

4.2 Object Properties

4.2.1 additionalReturns

IRI: https://www.w3.org/2019/wot/hypermedia#additionalReturns

This optional term can be used if additional expected responses are possible, e.g. for error reporting. Each additional response needs to be distinguished from others in some way (for example, by specifying a protocol-specific response code), and may also have its own data schema.
Domain includes hctl:Form
Range includes hctl:AdditionalExpectedResponse

4.2.2 hasAdditionalOutputSchema

IRI: https://www.w3.org/2019/wot/hypermedia#hasAdditionalOutputSchema

This optional term can be used to define a data schema for an additional response if it differs from the default output data schema. Rather than a DataSchema object, the name of a previous definition given in a schemaDefinitions map must be used.
Domain includes hctl:AdditionalExpectedResponse

4.2.3 hasOperationType

IRI: https://www.w3.org/2019/wot/hypermedia#hasOperationType

Indicates the semantic intention of performing the operation(s) described by the form.
Domain includes hctl:Form

4.2.4 returns

IRI: https://www.w3.org/2019/wot/hypermedia#returns

This optional term can be used if, e.g., the output communication metadata differ from input metadata (e.g., output contentType differ from the input contentType). The response name contains metadata that is only valid for the reponse messages.
Domain includes hctl:Form
Range includes hctl:ExpectedResponse

4.3 Datatype Properties

4.3.1 forContentCoding

IRI: https://www.w3.org/2019/wot/hypermedia#forContentCoding

Content coding values indicate an encoding transformation that has been or can be applied to a representation. Content codings are primarily used to allow a representation to be compressed or otherwise usefully transformed without losing the identity of its underlying media type and without loss of information. Examples of content coding include "gzip", "deflate", etc.
Domain includes hctl:Form
Range includes schema:Text

4.3.2 forContentType

IRI: https://www.w3.org/2019/wot/hypermedia#forContentType

Assign a content type based on a media type [IANA-MEDIA-TYPES] (e.g., 'text/plain') and potential parameters (e.g., 'charset=utf-8') for the media type.
Domain includes hctl:Form
Range includes schema:Text

4.3.3 forSubProtocol

IRI: https://www.w3.org/2019/wot/hypermedia#forSubProtocol

Indicates the exact mechanism by which an interaction will be accomplished for a given protocol when there are multiple options. For example, for HTTP and Events, it indicates which of several available mechanisms should be used for asynchronous notifications such as long polling, websub (also see https://www.w3.org/TR/websub/), or server sent events (also see https://www.w3.org/TR/eventsource/). Please note that there is no restriction on the sub-protocol selection and other mechanisms can also be announced by this subprotocol term.
Domain includes hctl:Form
Range includes schema:Text

4.3.4 hasAnchor

IRI: https://www.w3.org/2019/wot/hypermedia#hasAnchor

By default, the context, or anchor, of a link conveyed in the Link header field is the URL of the representation it is associated with, as defined in RFC7231, Section, and is serialized as a URI.
Domain includes hctl:Link

4.3.5 hasHreflang

IRI: https://www.w3.org/2019/wot/hypermedia#hasHreflang

The hreflang attribute specifies the language of a linked document. The value of this must be a valid language tag [BCP47].
Domain includes hctl:Link

4.3.6 hasRelationType

IRI: https://www.w3.org/2019/wot/hypermedia#hasRelationType

A link relation type identifies the semantics of a link.
Domain includes hctl:Link

4.3.7 hasSizes

IRI: https://www.w3.org/2019/wot/hypermedia#hasSizes

Target attribute that specifies one or more sizes for the referenced icon. Only applicable for relation type 'icon'. The value pattern follows {Height}x{Width} (e.g., "16x16", "16x16 32x32")
Domain includes hctl:Link

4.3.8 hasTarget

IRI: https://www.w3.org/2019/wot/hypermedia#hasTarget

target IRI of a link or submission target of a form.
Domain includes hctl:Form

4.3.9 hintsAtMediaType

IRI: https://www.w3.org/2019/wot/hypermedia#hintsAtMediaType

Target attribute providing a hint indicating what the media type [IANA-MEDIA-TYPES] of the result of dereferencing the link should be.
Domain includes hctl:Link
Range includes schema:Text

4.3.10 isSuccess

IRI: https://www.w3.org/2019/wot/hypermedia#isSuccess

Signals if the additional response should not be considered an error.
Domain includes hctl:AdditionalExpectedResponse
Range includes schema:Boolean

4.4 Annotation Properties

No AnnotationProperty found in the ontology.

5. Alignments

5.1 Hydra

The following table gives alignment between the hypermedia controls ontology and Hydra, an alternative vocabulary for hypermedia-driven Web APIs. Each row represents a close match between two classes. These alignments are not to be understood as formal semantic equivalences but rather as hints to Hydra users.

hctl:Link hydra:Link
hctl:Form hydra:Operation

6. Usage Examples

A. References

A.1 Normative references

Tags for Identifying Languages. A. Phillips, Ed.; M. Davis, Ed.. IETF. September 2009. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc5646
The Constrained RESTful Application Language (CoRAL). Klaus Hartke. IETF. March 2019. Internet-Draft. URL: https://tools.ietf.org/html/draft-hartke-t2trg-coral
HTML Standard. Anne van Kesteren; Domenic Denicola; Ian Hickson; Philip Jägenstedt; Simon Pieters. WHATWG. Living Standard. URL: https://html.spec.whatwg.org/multipage/
Hydra Core Vocabulary. Markus Lanthaler. Hydra W3C Community Group. URL: https://www.hydra-cg.com/spec/latest/core/
Media Types. IANA. URL: https://www.iana.org/assignments/media-types/
OpenAPI Specification. Darrell Miller; Jeremy Whitlock; Marsh Gardiner; Mike Ralphson; Ron Ratovsky; Uri Sarid; Tony Tam; Jason Harmon. OpenAPI Initiative. URL: https://www.openapis.org/
REST: Architectural Styles and the Design of Network-based Software Architectures. University of California, Irvine. 2000. PhD thesis.
Web Linking. M. Nottingham. IETF. October 2017. Proposed Standard. URL: https://httpwg.org/specs/rfc8288.html
Web of Things (WoT) Architecture. Matthias Kovatsch; Ryuichi Matsukura; Michael Lagally; Toru Kawaguchi; Kunihiko Toumura; Kazuo Kajimoto. W3C. 9 April 2020. W3C Recommendation. URL: https://www.w3.org/TR/wot-architecture/
Web of Things (WoT) Thing Description. Sebastian Käbisch; Takuki Kamiya; Michael McCool; Victor Charpenay; Matthias Kovatsch. W3C. 9 April 2020. W3C Recommendation. URL: https://www.w3.org/TR/wot-thing-description/