-
Notifications
You must be signed in to change notification settings - Fork 63
/
td.template.html
597 lines (551 loc) · 24 KB
/
td.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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Web of Things (WoT) Thing Description (TD) 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"
, company: "Siemens AG"
, companyURL: "https://www.siemens.com/"
}, {
name: "Maxime Lefrançois"
, company: "École des Mines de Saint-Étienne"
, companyURL: "https://www.mines-stetienne.fr/"
}, {
name: "María Poveda Villalón"
, company: "Universidad Politécnica de Madrid"
, companyURL: "http://www.upm.es/"
}, {
name: "Sebastian Käbisch"
, company: "Siemens AG"
, companyURL: "http://www.siemens.com/"
}],
edDraftURI: "https://www.w3.org/2019/wot/td",
shortName: "wot-td-ontology",
otherLinks: [{
key: "Ontology in RDF",
data: [
{
value: "Web of Things (WoT) TD Ontology in RDF",
href: "td.ttl",
}
]
}
]
};
</script>
<style>
span.indent {
margin-left: 2em;
}
</style>
</head>
<body>
<section id='abstract'>
<p>
The Thing Description (TD) ontology is an RDF axiomatization of the TD information model,
one of the building blocks of the Web of Things (WoT). Besides providing an alternative
to the standard JSON representation format for TD documents, the TD ontology can also
be used to process contextual information on Things and for alignments with other
WoT-related ontologies.
</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 TD ontology is an idiomatic RDF axiomatization of the TD information model [[WOT-THING-DESCRIPTION]],
which can be used to describe WoT things and their interaction affordances. The TD ontology imports
the <a href="https://www.w3.org/2019/wot/hypermedia">hypermedia controls</a> ontology.
However, although the TD information model also includes terms for data schemas and security
configurations, the TD ontology does not force the use of the corresponding
<a href="https://www.w3.org/2019/wot/json-schema">JSON schema</a> and
<a href="https://www.w3.org/2019/wot/security">WoT security</a> vocabularies. Other schema languages
like SHACL [[shacl]] can thus be leveraged to describe WoT Things.
</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>
<p>
The TD ontology shares commonalities with other WoT-related vocabularies, in particular
with SOSA [[vocab-ssn]] and <a href="http://schema.org">schema.org</a>.
Alignments between these vocabularies are provided in a human-readable way in the following.
</p>
<section>
<h3>SOSA</h3>
<p>
All alignments with SOSA are also available here in OWL:
<a href="td-sosa.ttl">td-sosa.ttl</a>.
</p>
<p>
Alignment of <code>td:Thing</code> with SOSA:
</p>
<table class="def">
<thead>
<tr>
<th>Sub-Class</th>
<th>Super-Class</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>td:Thing</code>
</td>
<td>
<code>sosa:Sensor</code> or<br>
<code>sosa:Actuator</code> or<br>
<code>sosa:Platform</code> or<br>
<code>sosa:FeatureOfInterest</code>
</td>
</tr>
<tr>
<td>
<code>td:Thing</code> and<br>
<code>sosa:FeatureOfInterest</code>
</td>
<td>
<code>ssn:hasProperty</code> some (<br>
<span class="indent">(<code>sosa:isObservedBy</code> some <code>sosa:Sensor</code>) or</span><br>
<span class="indent">(<code>sosa:isActedOnBy</code> some <code>sosa:Actuator</code>)</span><br>
)
</td>
</tr>
<tr>
<td>
<code>td:Thing</code> and<br>
<code>sosa:Sensor</code>
</td>
<td>
<code>sosa:observes</code> some<br>
<span class="indent"><code>sosa:ObservableProperty</code></span>
</td>
</tr>
<tr>
<td>
<code>td:Thing</code> and<br>
<code>sosa:Actuator</code>
</td>
<td>
<code>sosa:actsOnProperty</code> some<br>
<span class="indent"><code>sosa:ActuatableProperty</code></span>
</td>
</tr>
<tr>
<td>
<code>td:Thing</code> and<br>
<code>sosa:Platform</code>
</td>
<td>
<code>sosa:hosts</code> some (<br>
<span class="indent">(</span><br>
<span class="indent"><span class="indent"><code>sosa:Sensor</code> and</span></span><br>
<span class="indent"></span><span class="indent"><code>sosa:observes</code> some</span></span><br>
<span class="indent"><span class="indent"></span><span class="indent"><code>sosa:ObservableProperty</code></span></span></span><br>
<span class="indent">) or (</span><br>
<span class="indent"><span class="indent"><code>sosa:Actuator</code> and</span></span><br>
<span class="indent"></span><span class="indent"><code>sosa:actsOnProperty</code> some</span></span><br>
<span class="indent"><span class="indent"><span class="indent"><code>sosa:ActuatableProperty</code></span></span></span><br>
<span class="indent">)</span><br>
)
</td>
</tr>
</tbody>
</table>
<p>Alignment of <code>td:InteractionAffordance</code> with SOSA:</p>
<table class="def">
<thead>
<tr>
<th>Sub-Class</th>
<th>Super-Class</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>td:PropertyAffordance</code> and<br>
<code>td:hasForm</code> some<br>
<span class="indent"><code>hctl:hasOperationType</code> value</span><br>
<span class="indent"><span class="indent"><code>td:readProperty</code></span></span>
</td>
<td>
<code>ssn:forProperty</code> some <code>sosa:ObservableProperty</code>
</td>
</tr>
<tr>
<td>
<code>td:PropertyAffordance</code> and<br>
<code>td:hasForm</code> some<br>
<span class="indent"><code>hctl:hasOperationType</code> value</span><br>
<span class="indent"><span class="indent"><code>td:writeProperty</code></span></span>
</td>
<td>
<code>ssn:forProperty</code> some <code>sosa:ActuatableProperty</code>
</td>
</tr>
<tr>
<td>
<code>td:ActionAffordance</code>
</td>
<td>
<code>ssn:forProperty</code> some<br>
<span class="indent"><code>sosa:ActuatableProperty</code></span>
</td>
</tr>
<tr>
<td>
<code>td:EventAffordance</code>
</td>
<td>
<code>ssn:forProperty</code> some<br>
<span class="indent"><code>sosa:ObservableProperty</code></span>
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3>Schema.org</h3>
<p>
The alignments with schema.org's actions are also available here in OWL:
<a href="td-sdo.ttl">td-sdo.ttl</a>.
</p>
<table class="def">
<thead>
<tr>
<th>Sub-Class</th>
<th>Super-Class</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>td:InteractionAffordance</code>
</td>
<td>
<code>schema:Action</code> and<br>
<code>schema:actionStatus</code> value
<span class="indent"><code>schema:PotentialActionStatus</code></span><br>
</td>
</tr>
</tbody>
</table>
<table class="def">
<thead>
<tr>
<th>Sub-Property</th>
<th>Super-Property</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>td:hasInteractionAffordance</code>
</td>
<td>
<code>schema:potentialAction</code>
</td>
</tr>
</tbody>
</table>
</section>
</section>
<section>
<h2>Usage Examples</h2>
<section>
<h3>Thing Description JSON-LD 1.1 Instance to RDF Dataset</h3>
<p>
The following example shows a TD instance from <a href="https://www.w3.org/TR/wot-thing-description/#simple-thing-description-sample">Example 1</a> Thing Description
specification [[WOT-THING-DESCRIPTION]] in JSON-LD 1.1 (JSON-LD 1.1 tab) and in a RDF dataset (RDF tab).
</p>
<aside class="example ds-selector-tabs changed" id="simple-thing-description-sample" title="Thing Description Sample">
<div class="selectors">
<button class="selected" data-selects="ex-original">JSON-LD 1.1</button>
<button data-selects="ex-rdf">RDF</button>
</div>
<pre class="ex-original selected">{
"@context": {
"https://www.w3.org/2019/wot/td/v1",
{"@base": "http://example.org/MyLampThing/"}
},
"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"}]
}
},
"actions": {
"toggle" : {
"forms": [{"href": "https://mylamp.example.com/toggle"}]
}
},
"events":{
"overheating":{
"data": {"type": "string"},
"forms": [{
"href": "https://mylamp.example.com/oh",
"subprotocol": "longpoll"
}]
}
}
}</pre>
<pre class="ex-rdf"><urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#hasActionAffordance> _:b0 .
<urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#hasEventAffordance> _:b2 .
<urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#hasPropertyAffordance> _:b5 .
<urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#hasSecurityConfiguration> <http://example.org/MyLampThing/basic_sc> .
<urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#definesSecurityScheme> _:b7 .
<urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#title> "MyLampThing" .
_:b0 <https://www.w3.org/2019/wot/td#name> "toggle" .
_:b0 <https://www.w3.org/2019/wot/td#hasForm> _:b1 .
_:b1 <https://www.w3.org/2019/wot/hypermedia#hasTarget> "https://mylamp.example.com/toggle" .
_:b2 <https://www.w3.org/2019/wot/td#name> "overheating" .
_:b2 <https://www.w3.org/2019/wot/td#hasForm> _:b3 .
_:b2 <https://www.w3.org/2019/wot/td#hasNotificationSchema> _:b4 .
_:b3 <https://www.w3.org/2019/wot/hypermedia#forSubProtocol> "longpoll" .
_:b3 <https://www.w3.org/2019/wot/hypermedia#hasTarget> "https://mylamp.example.com/oh" .
_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2019/wot/json-schema#StringSchema> .
_:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2019/wot/json-schema#StringSchema> .
_:b5 <https://www.w3.org/2019/wot/td#hasForm> "status" .
_:b5 <https://www.w3.org/2019/wot/td#hasForm> _:b6 .
_:b6 <https://www.w3.org/2019/wot/hypermedia#hasTarget> "https://mylamp.example.com/status" .
_:b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2019/wot/security#BasicSecurityScheme> .
_:b7 <https://www.w3.org/2019/wot/security#in> "header" .
_:b7 <https://www.w3.org/2019/wot/td#hasConfigurationInstance> <http://example.org/MyLampThing/basic_sc> .
</pre>
</aside>
<p>
The RDF dataset contains the corresponding Thing Description IRIs as defined in this document. This IRI mapping is provided by the Thing Description
context file <code>https://www.w3.org/2019/wot/td/v1</code>. For instance, the field <code>actions</code> is transformed to <code><https://www.w3.org/2019/wot/td#hasActionAffordance></code>.
</p>
</section>
<section>
<h3>Merging Thing Descriptions</h3>
<p>
The following example includes two TD documents in the standard TD JSON
representation format [[WOT-THING-DESCRIPTION]], identified by a unique
electronic product code [[RFC5134]].
</p>
<p>
If these two documents are being merged together with contextual information
in the form of an RDF graph that uses the same identifiers, it is possible
to retrieve form metadata of these TDs depending on the relations that
exist between Things. Here, the two Things share information on room 101
of some example building.
</p>
<aside class="example" title="Merging of two TD documents and a logical map of a building">
<pre class="split-example">
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "urn:epc:id:sgtin:900100.0003456.1234567",
"title" : "HVAC System",
"@type": "https://w3id.org/saref#HVAC",
...
"properties": {
"status": {
"type": "boolean",
"forms": [...]
}
}
}
</pre>
<pre class="split-example">
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "urn:epc:id:sgtin:900200.1234000.9876543",
"title" : "TemperatureSensor",
"@type": "https://w3id.org/saref#TemperatureSensor",
...
"properties": {
"temperature": {
"type": "number",
"forms": [...]
}
}
}
</pre>
<pre class="split-example">
{
"@context": {
"bot": "https://w3id.org/bot#",
"brick": "https://brickschema.org/schema/1.0.3/BrickFrame#"
},
"@graph": [
{
"@id": "tag:room_101",
"@type": "bot:Space",
"bot:containsElement": {
"@id": "urn:epc:id:sgtin:900200.1234000.9876543"
}
},
{
"@id": "urn:epc:id:sgtin:900100.0003456.1234567",
"brick:feeds": {
"@id": "tag:room_101"
}
}
]
}
</pre>
</aside>
</section>
<section>
<h3>Internal State of a Thing</h3>
<p>
It is possible for affordances of different kinds to have the same effect.
For instance, an affordance to a writable property may be equivalent to
an affordance to invoke an action that changes the property value.
Similarly, for every observable property, there may be an equivalent
affordance to subscribe to an event that occurs at every property value change.
</p>
<p>
WoT clients can avoid having to deal with these discrepancies by
using the generic <code>td:hasInteractionAffordance</code> predicate.
They can then decide to perform an action based solely on the operation type
of the form embedded in the affordance object.
</p>
<aside class="example" title="Alternative affordances to read/write a property value">
<pre class="split-example">
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "urn:epc:id:sgtin:900300.1234000.9876543",
"title" : "LED Lamp",
...
"properties": {
"status": {
"ssn:forProperty": { "@type": "saref:OnOffState" },
"type": "boolean",
"forms": [
{
"href": "http://example.org/status",
"op": "writeproperty"
},
{
"href": "http://example.org/status",
"op": "observeproperty"
}
]
}
}
}
</pre>
<pre class="split-example">
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"actions": {
"change": {
"ssn:forProperty": { "@type": "saref:OnOffState" },
"input": { "type": "boolean" },
"forms": [
{
"href": "http://example.org/status/change",
"op": "invokeaction"
}
]
}
}
}
</pre>
<pre class="split-example">
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"events": {
"changed": {
"ssn:forProperty": { "@type": "saref:OnOffState" },
"data": { "type": "boolean" },
"forms": [
{
"href": "http://example.org/status/changed",
"op": "subscribeevent"
}
]
}
}
}
</pre>
</aside>
</section>
<section>
<h3>Specifying Affordances by Device Classes</h3>
<p>
It is possible to use the TD ontology to extend the definition of
well-known subclasses of <code>Thing</code> by defining expected
affordances that Things of such types should present. The
following example specifies that every temperature sensor presents
an affordance to a temperature property (expressed in the SAREF
vocabulary [[smartM2M]]).
</p>
<aside class="example" title="OWL axiom for affordances provided by a temperature sensor">
<pre>
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix saref: <https://w3id.org/saref#> .
@prefix td: <https://www.w3.org/2019/wot/td#> .
@prefix ex: <http://example.org/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
saref:TemperatureSensor rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty td:hasPropertyAffordance ;
owl:someValuesFrom ex:TemperatureAffordance
] .
ex:TemperatureAffordance rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty ssn:forProperty ;
owl:someValuesFrom saref:Temperature
] .
</pre>
</aside>
</section>
</section>
</body>
</html>