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.

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

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.

Please note that the Turtle version of the ontology can be always obtained by doing content negotiation as explained in Appendix D of the Thing Description Recommendation. You can include Accept: text/turtle in the request to obtain the Turtle version of this ontology.

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]].

Axiomatization

Classes

AdditionalExpectedResponse

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

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

ExpectedResponse

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

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

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 ofhctl:additionalReturns
hctl:forContentCoding
hctl:forContentType
hctl:forSubProtocol
hctl:hasOperationType
hctl:hasTarget
hctl:returns
td:hasSecurityConfiguration
In the range oftd:hasForm

Object Properties

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 includeshctl:Form
Range includeshctl:AdditionalExpectedResponse

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 includeshctl:AdditionalExpectedResponse

hasOperationType

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

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

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 includeshctl:Form
Range includeshctl:ExpectedResponse

Datatype Properties

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 includeshctl:Form
Range includesschema:Text

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 includeshctl:Form
Range includesschema:Text

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 includeshctl:Form
Range includesschema:Text

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 3.1.4.1, and is serialized as a URI.
Domain includeshctl:Link

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 includeshctl:Link

hasRelationType

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

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

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 includeshctl:Link

hasTarget

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

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

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 includeshctl:Link
Range includesschema:Text

isSuccess

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

Signals if the additional response should not be considered an error.
Domain includeshctl:AdditionalExpectedResponse
Range includesschema:Boolean

Annotation Properties

No AnnotationProperty found in the ontology.

Alignments

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

Usage Examples

JSON Representation of Links & Forms

Same terms as specified by JSON hyper-schema and the TD model.

OCF example (equivalent to an OpenAPI definition). HTTP in RDF vocabulary.

Reified Links

Either as RDF statements or as reified statements. Primarily for WoT compatibility but also e.g. to include validity metadata.