forked from w3c/wot-thing-description
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhctl.template.html
299 lines (271 loc) · 11.2 KB
/
hctl.template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Web of Things (WoT) Hypermedia Controls Ontology</title>
<script src='https://www.w3.org/Tools/respec/respec-w3c' class='remove'></script>
<script class='remove'>
var respecConfig = {
specStatus: "ED",
latestVersion: null,
// publishDate: "2023-12-05",
group: "wg/wot",
editors: [{
name: "Victor Charpenay"
}, {
name: "Matthias Kovatsch"
}],
edDraftURI: "https://www.w3.org/2019/wot/hypermedia",
shortName: "wot-hctl-ontology",
localBiblio: {
"hydra": {
href: "https://www.hydra-cg.com/spec/latest/core/",
title: "Hydra Core Vocabulary",
publisher: "Hydra W3C Community Group",
authors: [
"Markus Lanthaler"
]
},
"rest" : {
title : "REST: Architectural Styles and the Design of Network-based Software Architectures",
author : "Roy Thomas Fielding",
status : "PhD thesis",
publisher : "University of California, Irvine",
date : "2000"
},
"coral" : {
href : "https://tools.ietf.org/html/draft-hartke-t2trg-coral",
title : "The Constrained RESTful Application Language (CoRAL)",
authors : [ "Klaus Hartke" ],
publisher : "IETF",
status : "Internet-Draft",
date : " March 2019"
}
},
otherLinks: [{
key: "Ontology in RDF",
data: [
{
value: "Web of Things (WoT) Hypermedia Controls Ontology in RDF",
href: "hctl.ttl",
}
]
}
]
};
</script>
</head>
<body>
<section id='abstract'>
<p>
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.
</p>
<p>
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.
</p>
</section>
<section id='sotd'>
<p>
Validation of the document by the Working Group is expected by the end of June 2019.
</p>
</section>
<section>
<h2>Introduction</h2>
<p>
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 <em>links</em> and acted upon by submitting
<em>forms</em> to servers.
</p>
<p>
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]].
</p>
<p>
Links and forms are generically referred to as <em>hypermedia controls</em>. 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.
</p>
<p>
Please note that the Turtle version of the ontology can be always obtained by doing content negotiation as explained in <a href="https://www.w3.org/TR/2023/REC-wot-thing-description11-20231205/#json-ld-ctx-usage">Appendix D of the Thing Description Recommendation</a>.
You can include <code>Accept: text/turtle</code> in the request to obtain the Turtle version of this ontology.
</p>
</section>
<section id="conformance"></section>
<section id="terminology">
<h2>Terminology</h2>
<p>The fundamental WoT terminology such as
<dfn class="lint-ignore">Thing</dfn>,
<dfn class="lint-ignore">Consumer</dfn>,
<dfn class="lint-ignore">Thing Description</dfn> (<dfn class="lint-ignore">TD</dfn>),
<dfn class="lint-ignore">Interaction Model</dfn>,
<dfn class="lint-ignore">Interaction Affordance</dfn>,
<dfn class="lint-ignore">Property</dfn>,
<dfn class="lint-ignore">Action</dfn>,
<dfn class="lint-ignore">Event</dfn>,
<dfn class="lint-ignore">Protocol Binding</dfn>,
<dfn class="lint-ignore">Servient</dfn>,
etc. is defined in <a href="https://www.w3.org/TR/wot-architecture/#terminology">Section 3</a>
of the WoT Architecture specification [[WOT-ARCHITECTURE]].
</p>
<p>
The Thing Description terminology such as
<dfn class="lint-ignore">TD Information Model</dfn>,
<dfn class="lint-ignore">TD Document</dfn>,
<dfn class="lint-ignore">Term</dfn> (<dfn class="lint-ignore">Vocabulary Term</dfn>),
etc. is defined in <a href="https://www.w3.org/TR/wot-thing-description/#terminology">Section 3</a>
of the WoT Thing Description specification [[WOT-THING-DESCRIPTION]].
</p>
</section>
<!-- axioms rendered from RDF definitions -->
%s
<section>
<h2>Alignments</h2>
<section>
<h3>Hydra</h3>
<p>
The following table gives alignment between the hypermedia controls
ontology and <a href="http://www.w3.org/ns/hydra/core#">Hydra</a>,
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.
</p>
<table class="def">
<tbody>
<tr>
<td><code>hctl:Link</code></td>
<td><code>hydra:Link</code></td>
</tr>
<tr>
<td><code>hctl:Form</code></td>
<td><code>hydra:Operation</code></td>
</tr>
</tbody>
</table>
</section>
</section>
<section>
<h2>Usage Examples</h2>
<section>
<h3>JSON Representation of Links & Forms</h3>
<p>
Same terms as specified by JSON hyper-schema and the TD model.
</p>
<aside class="example" title="JSON-LD context for hypermedia controls">
<pre>
{
"@context": {
"@vocab": "https://www.w3.org/2019/wot/hypermedia#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"href": { "@id": "hasTarget" },
"rel": { "@id": "hasRelationType", "@type": "@vocab" },
"anchor": { "@id": "hasAnchor", "@type": "@id" },
"type": { "@id": "hintsAtMediaType" },
"op": { "@id": "rdf:type"; "@type": "@vocab" },
"contentType": { "@id": "forContentType" },
"contentCoding": { "@id": "forContentCoding" },
"subprotocol": { "@id": "forSubProtocol" },
"response": { "@id": "returns" },
"readproperty": { "@id": "ReadPropertyOperation" },
"writeproperty": { "@id": "WritePropertyOperation" },
"observeproperty": { "@id": "ObservePropertyOperation" },
"unobserveproperty": { "@id": "UnobservePropertyOperation" },
"readmultipleproperties": { "@id": "ReadMultiplePropertiesOperation" },
"writemultipleproperties": { "@id": "WriteMultiplePropertiesOperation" },
"readallproperties": { "@id": "ReadAllPropertiesOperation" },
"writeallproperties": { "@id": "WriteAllPropertiesOperation" },
"invokeaction": { "@id": "InvokeActionOperation" },
"subscribeevent": { "@id": "SubscribeEventOperation" },
"unsubscribeevent": { "@id": "UnsubscribeEventOperation" }
}
}
</pre>
</aside>
<p>
OCF example (equivalent to an OpenAPI definition). HTTP in RDF vocabulary.
</p>
<aside class="example" title="Links and forms for an OCF temperature sensor">
<pre>
{
"@context": [
...,
{
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"htv": "http://www.w3.org/2011/http#"
}
],
"@graph": [
{
"href": "https://openconnectivityfoundation.github.io/IoTDataModels/TemperatureResURI.swagger.json",
"rel": "rdfs:seeAlso"
},
{
"href": "/TemperatureResURI",
"op": "readproperty",
"htv:methodName": "GET",
"response": [
{ "htv:statusCodeNumber": 200 },
{ "htv:statusCodeNumber": 403 }
]
},
{
"href": "/TemperatureResURI",
"op": "writeproperty",
"htv:methodName": "POST",
"response": [
{ "htv:statusCodeNumber": 200 },
{ "htv:statusCodeNumber": 403 }
]
}
]
}
</pre>
</aside>
</section>
<section>
<h3>Reified Links</h3>
<aside class="example" title="Reified link">
<pre class="split-example">
{
"@context": { "about": "http://schema.org/about" },
"@id": "https://en.wikipedia.org/wiki/Web_of_Things",
"about": "http://www.wikidata.org/entity/Q2814098"
}
</pre>
<pre class="split-example">
{
"@context": [
...,
{ "about": "http://schema.org/about" }
],
"links": [
{
"anchor": "https://en.wikipedia.org/wiki/Web_of_Things",
"rel": "about",
"href": "http://www.wikidata.org/entity/Q2814098"
}
]
}
</pre>
</aside>
<p>
Either as RDF statements or as reified statements. Primarily for WoT compatibility but also e.g. to include validity metadata.
</p>
</section>
</section>
</body>
</html>