forked from oeg-upm/wot-hive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshape.ttl
executable file
·1867 lines (1823 loc) · 90.6 KB
/
shape.ttl
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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@prefix : <http://www.w3.org/ns/td-validation#> .
@prefix td: <https://www.w3.org/2019/wot/td#> .
@prefix jsonschema: <https://www.w3.org/2019/wot/json-schema#> .
@prefix wotsec: <https://www.w3.org/2019/wot/security#> .
@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
:ThingShape a sh:NodeShape ;
sh:targetClass td:Thing ;
skos:definition """An abstraction of a physical or a virtual entity whose
metadata and interfaces are described by a WoT Thing
Description, whereas a virtual entity is the composition
of one or more Things."""^^rdf:HTML ;
sh:closed false ;
sh:order 1 ;
sh:property [
sh:path dcterms:title ;
skos:definition """Provides a human-readable title (e.g., display
a text for UI representation) based on a default
language."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:order 1 ;
] ;
sh:property _:titles ;
sh:property _:description ;
sh:property _:descriptions ;
sh:property [
sh:path td:versionInfo ;
skos:definition """Provides version information."""^^rdf:HTML ;
sh:node :VersionInfoShape ;
sh:maxCount 1 ;
sh:order 5 ;
] ;
sh:property [
sh:path dcterms:created ;
skos:definition """Provides information when the TD instance was
created."""^^rdf:HTML ;
sh:datatype xsd:dateTime ;
sh:maxCount 1 ;
sh:order 6 ;
] ;
sh:property [
sh:path dcterms:modified ;
skos:definition """Provides information when the TD instance was
last modified."""^^rdf:HTML ;
sh:datatype xsd:dateTime ;
sh:maxCount 1 ;
sh:order 7 ;
] ;
sh:property [
sh:path td:supportContact ;
skos:definition """Provides information about the TD maintainer as
URI scheme (e.g., <code>mailto</code>
[<cite><a class="bibref" data-link-type="biblio" href='#bib-rfc6068' title="The 'mailto' URI Scheme">RFC6068</a></cite>],
<code>tel</code> [<cite><a class="bibref" data-link-type="biblio" href='#bib-rfc3966' title="The tel URI for Telephone Numbers">RFC3966</a></cite>],
<code>https</code>)."""^^rdf:HTML ;
sh:datatype xsd:anyURI ;
sh:maxCount 1 ;
sh:order 8 ;
] ;
sh:property [
sh:path td:baseURI ;
skos:definition """Define the base URI that is used for all
relative URI references throughout a TD document.
In TD instances, all relative URIs are resolved
relative to the base URI using the algorithm
defined in [<cite><a class="bibref" data-link-type=
"biblio" href='#bib-rfc3986' title=
"Uniform Resource Identifier (URI): Generic Syntax">RFC3986</a></cite>].<br>
<br>
<code>base</code> does not affect the URIs used in
<code>@context</code> and the IRIs used within
Linked Data [<cite><a class="bibref"
data-link-type="biblio" href='#bib-linked-data'
title=
"Linked Data Design Issues">LINKED-DATA</a></cite>]
graphs that are relevant when semantic processing
is applied to TD instances."""^^rdf:HTML ;
sh:datatype xsd:anyURI ;
sh:maxCount 1 ;
sh:order 9 ;
] ;
sh:property [
sh:path [
sh:alternativePath (
td:hasPropertyAffordance
td:hasActionAffordance
td:hasEventAffordance
)
] ;
sh:node :InteractionAffordanceShape ;
sh:minCount 0
] ;
sh:property [
sh:path td:hasPropertyAffordance ;
skos:definition """All Property-based <a href='dfn-interaction-affordance' class="internalDFN" data-link-type="dfn">Interaction Affordances</a>
of the Thing."""^^rdf:HTML ;
sh:node :PropertyAffordanceShape ;
sh:order 10 ;
] ;
sh:property [
sh:path td:hasActionAffordance ;
skos:definition """All Action-based <a href='#dfn-interaction-affordance' class="internalDFN" data-link-type="dfn">Interaction Affordances</a>
of the Thing."""^^rdf:HTML ;
sh:node :ActionAffordanceShape ;
sh:order 11 ;
] ;
sh:property [
sh:path td:hasEventAffordance ;
skos:definition """All Event-based <a href='#dfn-interaction-affordance' class="internalDFN" data-link-type="dfn">Interaction Affordances</a>
of the Thing."""^^rdf:HTML ;
sh:node :EventAffordanceShape ;
sh:order 12 ;
] ;
sh:property [
sh:path td:hasLink ;
skos:definition """Provides Web links to arbitrary resources that
relate to the specified Thing Description."""^^rdf:HTML ;
sh:node :LinkShape ;
sh:order 13 ;
] ;
sh:property [
sh:path td:hasForm ;
skos:definition """Set of form hypermedia controls that describe how
an operation can be performed. Forms are
serializations of Protocol Bindings. In this
version of TD, all operations that can be
described at the Thing level are concerning how
to interact with the Thing's <a href='#propertyaffordance'>Properties</a> collectively
at once."""^^rdf:HTML ;
sh:node :FormShape ;
sh:order 14 ;
] ;
sh:property [
sh:path td:hasSecurityConfiguration ;
skos:definition """Set of security definition names, chosen from
those defined in <code>securityDefinitions</code>.
These must all be satisfied for access to
resources."""^^rdf:HTML ;
sh:minCount 1 ;
sh:order 15 ;
] ;
sh:property [
sh:path td:securityDefinitions ;
skos:definition """Set of named security configurations
(definitions only). Not actually applied unless
names are used in a <code>security</code>
name-value pair."""^^rdf:HTML ;
sh:minCount 1 ;
sh:node :SecuritySchemeShape ;
sh:order 16 ;
] ;
sh:property [
sh:path td:followsProfile ;
skos:definition """Indicates the WoT Profile mechanisms followed by this Thing Description and the corresponding Thing implementation."""^^rdf:HTML ;
sh:datatype xsd:anyURI ;
sh:order 17 ;
] ;
sh:property [
sh:path td:schemaDefinitions ;
skos:definition """Set of named data schemas.
To be used in a <code>schema</code>
name-value pair inside an
<code>AdditionalExpectedResponse</code> object."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:order 18 ;
] ;
skos:scopeNote """<p><span class="rfc2119-assertion" id=
"td-context-ns-thing-mandatory">The <code>@context</code>
name-value pair <em class="rfc2119" title=
"MUST">MUST</em> contain the anyURI
<code>https://www.w3.org/2019/wot/td/v1</code> either
directly when of type <code>anyURI</code> or as first
element when of type <a href="#dfn-array" class=
"internalDFN" data-link-type="dfn">Array</a>.</span>
<span class="rfc2119-assertion" id=
"td-context-ns-thing-optional">When <code>@context</code>
is an <a href="#dfn-array" class="internalDFN"
data-link-type="dfn">Array</a>, the anyURI
<code>https://www.w3.org/2019/wot/td/v1</code> <em class=
"rfc2119" title="MAY">MAY</em> be followed by elements of
type <code>anyURI</code> or type <a href="#dfn-map"
class="internalDFN" data-link-type="dfn">Map</a> in any
order, while it is <em class="rfc2119" title=
"RECOMMENDED">RECOMMENDED</em> to include only one
<a href="#dfn-map" class="internalDFN" data-link-type=
"dfn">Map</a> with all the name-value pairs in the
<code>@context</code> <a href="#dfn-array" class=
"internalDFN" data-link-type="dfn">Array</a>.</span>
<span class="rfc2119-assertion" id=
"td-context-ns-thing-map-of-namespaces"><a href=
"#dfn-map" class="internalDFN" data-link-type=
"dfn">Maps</a> contained in an <code>@context</code>
<a href="#dfn-array" class="internalDFN" data-link-type=
"dfn">Array</a> <em class="rfc2119" title="MAY">MAY</em>
contain name-value pairs, where the value is a namespace
identifier of type <code>anyURI</code> and the name a
<a href="#dfn-term" class="internalDFN" data-link-type=
"dfn">Term</a> or prefix denoting that namespace.</span>
<span class="rfc2119-assertion" id=
"td-context-default-language">One <a href="#dfn-map"
class="internalDFN" data-link-type="dfn">Map</a>
contained in an <code>@context</code> <a href=
"#dfn-array" class="internalDFN" data-link-type=
"dfn">Array</a> <em class="rfc2119" title=
"SHOULD">SHOULD</em> contain a name-value pair that
defines the default language for the Thing Description,
where the name is the <a href="#dfn-term" class=
"internalDFN" data-link-type="dfn">Term</a>
<code>@language</code> and the value is a well-formed
language tag as defined by [<cite><a class="bibref"
data-link-type="biblio" href="#bib-bcp47" title=
"Tags for Identifying Languages">BCP47</a></cite>] (e.g.,
<code>en</code>, <code>de-AT</code>, <code>gsw-CH</code>,
<code>zh-Hans</code>, <code>zh-Hant-HK</code>,
<code>sl-nedis</code>).</span></p>
<p>The computation of the base direction of all
human-readable text strings is defined by the following
set of rules:</p>
<ul>
<li><span class="rfc2119-assertion" id=
"td-context-default-language-direction-heuristic">If no
language tag is given, the base direction <em class=
"rfc2119" title="SHOULD">SHOULD</em> be inferred
through first-strong heuristics or detection algorithms
such as the CLDR Likely Subtags [<cite><a class=
"bibref" data-link-type="biblio" href="#bib-ldml"
title="Unicode Technical Standard #35: Unicode Locale Data Markup Language (LDML)">LDML</a></cite>].</span></li>
<li><span class="rfc2119-assertion" id=
"td-context-default-language-direction-inference">Outside
of <code>MultiLanguage</code> <a href="#dfn-map" class=
"internalDFN" data-link-type="dfn">Maps</a>, the base
direction <em class="rfc2119" title="MAY">MAY</em> be
inferred from the language tag of the default
language.</span></li>
<li><span class="rfc2119-assertion" id=
"td-context-ns-multilanguage-text-direction-infer">Inside
of <code>MultiLanguage</code> <a href="#dfn-map" class=
"internalDFN" data-link-type="dfn">Maps</a>, the base
direction of each value of the name-value pairs
<em class="rfc2119" title="MAY">MAY</em> be inferred
from the language tag given in the corresponding
name.</span></li>
<li><span class="rfc2119-assertion" id=
"td-context-default-language-direction-script">In cases
where a language can be written in more than one script
with different base directions, the corresponding
language tag given in <code>@language</code> or
<code>MultiLanguage</code> <a href="#dfn-map" class=
"internalDFN" data-link-type="dfn">Maps</a> <em class=
"rfc2119" title="MUST">MUST</em> include a script
subtag, so that an appropriate base direction can be
inferred.</span> An example is Azeri, which is written
LTR when Latin script is used (specified using
<code>az-Latn</code>) and RTL when Arabic script is
used (specified using <code>az-Arab</code>).</li>
</ul>
<p><a href="#dfn-td-processor" class="internalDFN"
data-link-type="dfn">TD Processors</a> should be aware of
certain special cases when processing bidirectional text.
They should take care to use bidi isolation when
presenting strings to users, particularly when embedding
in surrounding text (e.g., for Web user interface). Mixed
direction text can occur in any language, even when the
language is properly identified.</p>
<p>TD producers should attempt to provide mixed direction
strings in a way that can be displayed successfully by a
naive user agent. For example, if an RTL string begins
with an LTR run (such as a number or a brand or trade
name in Latin script), including an RLM character at the
start of the string or wrapping opposite direction runs
in bidi controls can assist in proper display.</p>
<p><em>Strings on the Web: Language and Direction
Metadata</em> [<cite><a class="bibref" data-link-type=
"biblio" href="#bib-string-meta" title=
"Strings on the Web: Language and Direction Metadata">string-meta</a></cite>]
provides some guidance and illustrates a number of
pitfalls when using bidirectional text.</p>
<p id="meta-interactions-of-thing">In addition to the
explicitly provided <a href="#dfn-interaction-affordance"
class="internalDFN" data-link-type="dfn">Interaction
Affordances</a> in the <code>properties</code>,
<code>actions</code>, and <code>events</code> <a href=
"#dfn-array" class="internalDFN" data-link-type=
"dfn">Arrays</a>, a <a href="#dfn-thing" class=
"internalDFN" data-link-type="dfn">Thing</a> can also
provide meta-interactions, which are indicated by
<code>Form</code> instances in its optional
<code>forms</code> <a href="#dfn-array" class=
"internalDFN" data-link-type="dfn">Array</a>.
<span class="rfc2119-assertion" id="td-op-for-thing">When
the <code>forms</code> <a href="#dfn-array" class=
"internalDFN" data-link-type="dfn">Array</a> of a
<a href="#dfn-thing" class="internalDFN" data-link-type=
"dfn">Thing</a> instance contains <code>Form</code>
instances, the string values assigned to the name
<code>op</code>, either directly or within an <a href=
"#dfn-array" class="internalDFN" data-link-type=
"dfn">Array</a>, <em class="rfc2119" title=
"MUST">MUST</em> be one of the following <em>operation
types</em>: <code>readallproperties</code>,
<code>writeallproperties</code>,
<code>readmultipleproperties</code>,
<code>writemultipleproperties</code>, <code>observeallproperties</code>, or
<code>unobserveallproperties</code>.</span> (See
<a href="#td-forms-readall-example">an example</a> for an
usage of <code>form</code> in a Thing instance.)</p>
<p>The data schema for each of these meta-interactions is
constructed by combining the data schemas of each
<code>PropertyAffordance</code> instance in a single
<code>ObjectSchema</code> instance, where the
<code>properties</code> <a href="#dfn-map" class=
"internalDFN" data-link-type="dfn">Map</a> of the
<code>ObjectSchema</code> instance contains each data
schema of the <code>PropertyAffordances</code> identified
by the name of the corresponding
<code>PropertyAffordances</code> instance.</p>
<p>If not specified otherwise (e.g., through a <a href=
"#dfn-context-ext" class="internalDFN" data-link-type=
"dfn">TD Context Extension</a>), the request data of the
<code>readmultipleproperties</code> operation is an
<a href="#dfn-array" class="internalDFN" data-link-type=
"dfn">Array</a> that contains the intended
<code>PropertyAffordances</code> instance names, which is
serialized to the content type specified by the
<code>Form</code> instance.</p>"""^^rdf:HTML .
:InteractionAffordanceShape a sh:NodeShape ;
sh:targetClass td:InteractionAffordance ;
skos:definition """Metadata of a Thing that shows the possible choices to
<a href="#dfn-consumer" class="internalDFN" data-link-type="dfn">Consumers</a>, thereby suggesting
how <a href="#dfn-consumer" class="internalDFN" data-link-type="dfn">Consumers</a> may interact with the
Thing. There are many types of potential affordances, but
<abbr title="World Wide Web Consortium">W3C</abbr> WoT
defines three types of Interaction Affordances:
Properties, Actions, and Events."""^^rdf:HTML ;
sh:closed false ;
sh:order 2 ;
sh:property _:title ;
sh:property _:titles ;
sh:property _:description ;
sh:property _:descriptions ;
sh:property [
sh:path td:hasForm ;
skos:definition """Set of form hypermedia controls that describe
how an operation can be performed. Forms are
serializations of Protocol Bindings."""^^rdf:HTML ;
sh:minCount 1 ;
sh:node :FormShape ;
sh:order 5 ;
] ;
sh:property [
sh:path td:hasUriTemplateSchema ;
skos:definition """Define URI query template variables as collection
based on DataSchema declarations. The individual variables DataSchema cannot be an ObjectSchema or an ArraySchema."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:order 6 ;
] .
:PropertyAffordanceShape a sh:NodeShape ;
sh:targetClass td:PropertyAffordance ;
skos:definition """An Interaction Affordance that exposes state of the
Thing. This state can then be retrieved (read) and
optionally updated (write). Things can also choose to
make Properties observable by pushing the new state after
a change."""^^rdf:HTML ;
sh:closed false ;
sh:order 3 ;
sh:property [
sh:path td:isObservable ;
skos:definition """A hint that indicates whether Servients hosting
the Thing and Intermediaries should provide a
Protocol Binding that supports the <code>observeproperty</code> and <code>unobserveproperty</code> operations
for this Property."""^^rdf:HTML ;
sh:datatype xsd:boolean ;
sh:maxCount 1 ;
] ;
skos:scopeNote """<p class="note">Property instances are also instances of
the class <a href="#dataschema" class="sec-ref">DataSchema</a>. Therefore, it can contain the
<code>type</code>, <code>unit</code>,
<code>readOnly</code> and <code>writeOnly</code>
members, among others.</p>"""^^rdf:HTML,
"""<p><code>PropertyAffordance</code> is a <a href="#dfn-subclass" class="internalDFN" data-link-type="dfn">Subclass</a> of the
<code>InteractionAffordance</code> <a href="#dfn-class" class="internalDFN" data-link-type="dfn">Class</a> and
the <code>DataSchema</code> <a href="#dfn-class" class="internalDFN" data-link-type="dfn">Class</a>.
<span class="rfc2119-assertion" id="td-op-for-property">When a Form instance is within a
<code>PropertyAffordance</code> instance, the value
assigned to <code>op</code> <em class="rfc2119" title="MUST">MUST</em> be one of <code>readproperty</code>,
<code>writeproperty</code>, <code>observeproperty</code>,
<code>unobserveproperty</code> or an <a href="#dfn-array" class="internalDFN" data-link-type="dfn">Array</a>
containing a combination of these terms.</span></p><p class="note">
It is considered to be good practice that each <code>observeproperty</code> has a corresponding
<code>unobserveproperty</code> unless the protocol supports implicit unsubscription mechanisms
(e.g., heartbeat to detect connection loss).</p>"""^^rdf:HTML .
:ActionAffordanceShape a sh:NodeShape ;
sh:targetClass td:ActionAffordance ;
skos:definition """An Interaction Affordance that allows to invoke a
function of the Thing, which manipulates state (e.g.,
toggling a lamp on or off) or triggers a process on the
Thing (e.g., dim a lamp over time)."""^^rdf:HTML ;
sh:closed false ;
sh:order 4 ;
sh:property [
sh:path td:hasInputSchema ;
skos:definition """Used to define the input data schema of the
Action."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:maxCount 1 ;
sh:order 1 ;
] ;
sh:property [
sh:path td:hasOutputSchema ;
skos:definition """Used to define the output data schema of the
Action."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:maxCount 1 ;
sh:order 2 ;
] ;
sh:property [
sh:path td:isSafe ;
skos:definition """Signals if the Action is safe (=true) or not.
Used to signal if there is no internal state (cf.
resource state) is changed when invoking an Action.
In that case responses can be cached as
example."""^^rdf:HTML ;
sh:datatype xsd:boolean ;
sh:defaultValue false ;
sh:maxCount 1 ;
sh:order 3 ;
] ;
sh:property [
sh:path td:isIdempotent ;
skos:definition """Indicates whether the Action is idempotent
(=true) or not. Informs whether the Action can be
called repeatedly with the same result, if present,
based on the same input."""^^rdf:HTML ;
sh:datatype xsd:boolean ;
sh:defaultValue false ;
sh:maxCount 1 ;
sh:order 4 ;
] ;
skos:scopeNote """<p><code>ActionAffordance</code> is a <a href="#dfn-subclass" class="internalDFN" data-link-type="dfn">Subclass</a> of the
<code>InteractionAffordance</code> <a href="#dfn-class" class="internalDFN" data-link-type="dfn">Class</a>.
<span class="rfc2119-assertion" id="td-op-for-action">When a Form instance is within an
<code>ActionAffordance</code> instance, the value
assigned to op <em class="rfc2119" title="MUST">MUST</em>
be <code>invokeaction</code>.</span></p>"""^^rdf:HTML .
:EventAffordanceShape a sh:NodeShape ;
sh:targetClass td:EventAffordance ;
skos:definition """An Interaction Affordance that describes an event
source, which asynchronously pushes event data to
<a href="#dfn-consumer" class="internalDFN" data-link-type="dfn">Consumers</a> (e.g., overheating
alerts)."""^^rdf:HTML ;
sh:closed false ;
sh:order 5 ;
sh:property [
sh:path td:hasSubscriptionSchema ;
skos:definition """Defines data that needs to be passed upon
subscription, e.g., filters or message format for
setting up Webhooks."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:maxCount 1 ;
sh:order 1 ;
] ;
sh:property [
sh:path td:hasNotificationSchema ;
skos:definition """Defines the data schema of the Event instance
messages pushed by the Thing."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:maxCount 1 ;
sh:order 2 ;
] ;
sh:property [
sh:path td:hasCancellationSchema ;
skos:definition """Defines any data that needs to be passed to
cancel a subscription, e.g., a specific message to
remove a Webhook."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:maxCount 1 ;
sh:order 3 ;
] ;
skos:scopeNote """<p><code>EventAffordance</code> is a <a href="#dfn-subclass" class="internalDFN" data-link-type="dfn">Subclass</a> of the
<code>InteractionAffordance</code> <a href="#dfn-class" class="internalDFN" data-link-type="dfn">Class</a>.
<span class="rfc2119-assertion" id="td-op-for-event">When
a Form instance is within an <code>EventAffordance</code>
instance, the value assigned to <code>op</code>
<em class="rfc2119" title="MUST">MUST</em> be either
<code>subscribeevent</code>,
<code>unsubscribeevent</code>, or both terms within an
<a href="#dfn-array" class="internalDFN" data-link-type="dfn">Array</a>.</span></p><p class="note">
It is considered to be good practice that each <code>subscribeevent</code> has a corresponding <code>unsubscribeevent</code> unless the protocol
supports implicit unsubscription mechanisms (e.g., heartbeat to detect connection loss).</p>"""^^rdf:HTML .
:VersionInfoShape a sh:NodeShape ;
sh:targetClass td:VersionInfo ;
skos:definition """Metadata of a Thing that provides version information
about the TD document. If required, additional version
information such as firmware and hardware version (term
definitions outside of the TD namespace) can be extended
via the <a href="#dfn-context-ext" class="internalDFN" data-link-type="dfn">TD Context Extension</a>
mechanism."""^^rdf:HTML ;
sh:closed false ;
sh:order 8 ;
sh:property [
sh:path td:instance ;
skos:definition """Provides a version indicator of this TD.
instance."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:order 2 ;
] ;
sh:property [
sh:path td:model ;
skos:definition """Provides a version indicator of the underlying TM.
instance."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:order 2 ;
] ;
skos:scopeNote """<p>It is recommended that the values within <code>instances</code> and <code>model</code> of
the <code>VersionInfo</code> <a href="#dfn-class" class="internalDFN" data-link-type="dfn">Class</a> follow the
semantic versioning pattern, where a sequence of three
numbers separated by a dot indicates the major version,
minor version, and patch version, respectively. See
[<cite><a class="bibref" data-link-type="biblio" href="#bib-semver" title="Semantic Versioning 2.0.0">SEMVER</a></cite>] for
details.</p>"""^^rdf:HTML .
:FormShape a sh:NodeShape ;
sh:targetClass hctl:Form ;
skos:definition """A form can be viewed as a statement of "To perform an
<b><em>operation type</em></b> operation on <b><em>form
context</em></b>, make a <b><em>request method</em></b>
request to <b><em>submission target</em></b>" where the
optional <b><em>form fields</em></b> may further describe
the required request. In Thing Descriptions, the
<b><em>form context</em></b> is the surrounding Object,
such as Properties, Actions, and Events or the Thing
itself for meta-interactions."""^^rdf:HTML ;
sh:closed false ;
sh:order 7 ;
sh:property [
sh:path hctl:hasTarget ;
skos:definition """Target IRI of a link or submission target of a
form."""^^rdf:HTML ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:nodeKind sh:IRI ;
sh:order 2 ;
] ;
sh:property [
sh:path hctl:forContentType ;
skos:definition """Assign a content type based on a media type
(e.g., <code>text/plain</code>) and potential
parameters (e.g., <code>charset=utf-8</code>) for
the media type [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc2046" title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">RFC2046</a></cite>]."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:defaultValue "application/json"^^xsd:string ;
sh:order 3 ;
] ;
sh:property [
sh:path hctl:forContentCoding ;
skos:definition """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. ."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:order 4 ;
] ;
sh:property [
sh:path hctl:returns ;
skos:definition """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 primary response
messages."""^^rdf:HTML ;
sh:node :ExpectedResponseShape ;
sh:maxCount 1 ;
sh:order 8 ;
] ;
sh:property [
sh:path hctl:additionalReturns ;
skos:definition """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 error code), and may also have its own data schema."""^^rdf:HTML ;
sh:node :AdditionalExpectedResponseShape ;
sh:order 9 ;
] ;
sh:property [
sh:path hctl:hasOperationType ;
skos:definition """Indicates the semantic intention of performing
the operation(s) described by the form. For
example, the Property interaction allows get and
set operations. The protocol binding may contain a
form for the get operation and a different form for
the set operation. The op attribute indicates which
form is for which and allows the client to select
the correct form for the operation required. op can
be assigned one or more interaction verb(s) each
representing a semantic intention of an
operation."""^^rdf:HTML ;
sh:in (
td:readProperty
td:writeProperty
td:observeProperty
td:unobserveProperty
td:invokeAction
td:subscribeEvent
td:unsubscribeEvent
td:readAllProperties
td:writeAllProperties
td:readMultipleProperties
td:writeMultipleProperties
td:observeAllProperties
td:unobserveAllProperties
);
sh:datatype xsd:string ;
sh:order 1 ;
] ;
sh:property [
sh:path hctl:forSubProtocol ;
skos:definition """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
(<code>longpoll</code>), WebSub [<cite><a class="bibref" data-link-type="biblio" href="#bib-websub" title="WebSub">websub</a></cite>]
(<code>websub</code>), Server-Sent Events
(<code>sse</code>) [<cite><a class="bibref" data-link-type="biblio" href="#bib-html" title="HTML Standard">html</a></cite>] (also known as
EventSource). Please note that there is no
restriction on the subprotocol selection and other
mechanisms can also be announced by this
subprotocol term."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
skos:example (
"longpoll"
"websub"
"sse"
) ;
sh:order 5 ;
] ;
sh:property [
sh:path td:hasSecurityConfiguration ;
skos:definition """Set of security definition names, chosen from
those defined in <code>securityDefinitions</code>.
These must all be satisfied for access to
resources."""^^rdf:HTML ;
sh:order 6 ;
] ;
sh:property [
sh:path wotsec:scopes ;
skos:definition """Set of authorization scope identifiers provided
as an array. These are provided in tokens returned
by an authorization server and associated with
forms in order to identify what resources a client
may access and how. The values associated with a
form should be chosen from those defined in an
<code>OAuth2SecurityScheme</code> active on that
form."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:order 7 ;
] ;
skos:scopeNote """<p>Possible values for the <code>contentCoding</code>
property can be found, e.g., in the <a href=
"https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding">
IANA HTTP content coding registry</a>.</p>
<p>The list of possible operation types of a form is
fixed. As of this version of the specification, it only
includes the well-known types necessary to implement the
WoT interaction model described in [<cite><a class=
"bibref" data-link-type="biblio" href=
"#bib-wot-architecture" title=
"Web of Things (WoT) Architecture">WOT-ARCHITECTURE</a></cite>].
Future versions of the standard may extend this list but
<span class="rfc2119-assertion" id=
"well-known-operation-types-only">operations types
<em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> be
arbitrarily set by servients.</span></p>
<p>The optional <code>response</code> name-value pair can
be used to provide metadata for the expected response
message.
With the core vocabulary, it only includes
content type information, but TD Context Extensions could
be applied. <span class="rfc2119-assertion" id=
"td-expectedResponse-default-contentType">If no
<code>response</code> name-value pair is provided, it
<em class="rfc2119" title="MUST">MUST</em> be assumed
that the content type of the response is equal to the
content type assigned to the Form instance.</span> Note
that <code>contentType</code> within an
<code>ExpectedResponse</code>
<a href="#dfn-class" class=
"internalDFN" data-link-type="dfn">Class</a> does not
have a <a href="#dfn-default-value" class="internalDFN"
data-link-type="dfn">Default Value</a>. For instance, if
the value of the content type of the form is
<code>application/xml</code> the assumed value of the
content type of the response will be also
<code>application/xml</code>.
In some cases additional responses might be possible.
One example of this is error responses but in some cases
there might also be additional successful responses.
In this case the <code>response</code> name-value pair
is still used for the primary response but
<code>additionalResponses</code> may also be provided,
whose value is an array of <code>AdditionalExpectedResponse</code>
objects.
Each additional response must be distinguished in some way from the primary
response, either by <code>contentType</code> or by
protocol-specific settings such as error code header values.
Each additional response may also have a data schema
which can differ from the normal output data schema for the
interaction.
</p>
<p>In some use cases, input and output data might be
represented in a different form, for instance an Action
that accepts JSON, but returns an image. In such a case,
the optional <code>response</code> name-value pair can
describe the content type of the expected response.
<span class="rfc2119-assertion" id=
"td-expectedResponse-contentType">If the content type of
the expected response differs from the content type of
the form, the <code>Form</code> instance <em class=
"rfc2119" title="MUST">MUST</em> include a name-value
pair with the name <code>response</code>.</span>
For instance, an <code>ActionAffordance</code> could only
accept <code>application/json</code> for its input data,
while it will respond with an <code>image/jpeg</code>
content type for its output data. In that case the
content types differ and the <code>response</code>
name-value pair has to be used to provide response
content type (<code>image/jpeg</code>) information to the
<a href="#dfn-consumer" class="internalDFN"
data-link-type="dfn">Consumer</a>.
Similar considerations apply to additional responses,
although in this case the <code>contentType</code> is optional
if it is the same as the input content Type (e.g. JSON).
<span class="rfc2119-assertion" id=
"td-additionalExpectedResponse-contentType">If the content type of
an additional expected response differs from the content type of
the form, the <code>Form</code> instance <em class=
"rfc2119" title="MUST">MUST</em> include an entry in the array
associated with the name <code>additionalResponses</code>
that includes a value for the name <code>contentType</code>.</span>
<span class="rfc2119-assertion" id=
"td-additionalExpectedResponse-schema">If the data schema of
an additional expected response differs from the output data schema of
the interaction, the <code>Form</code> instance <em class=
"rfc2119" title="MUST">MUST</em> include an entry in the array
associated with the name <code>additionalResponses</code> that
includes a value for the name <code>schema</code>.</span>
</p><p>
A <a>Thing Description</a> of a WoT producer may have multiple forms entries with, e.g., different
protocol and/or content types declarations that a <a>Consumer</a> could possibly support. In that case
the Consumer may choose any form entry that works (e.g., the protocol and content type is supported) for them.
When one form is chosen, it is expected that the <a>Consumer</a> will continue to use it as long as possible
for every new interaction with the WoT producer.
</p>
"""^^rdf:HTML .
:LinkShape a sh:NodeShape ;
sh:targetClass hctl:Link ;
skos:definition """A link can be viewed as a statement of the form
"<b><em>link context</em></b> has a <b><em>relation
type</em></b> resource at <b><em>link target</em></b>",
where the optional <b><em>target attributes</em></b> may
further describe the resource."""^^rdf:HTML ;
sh:closed false ;
sh:order 6 ;
sh:property [
sh:path hctl:hasTarget ;
skos:definition """Target IRI of a link or submission target of a
form."""^^rdf:HTML ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:nodeKind sh:IRI ;
sh:order 1 ;
] ;
sh:property [
sh:path hctl:hintsAtMediaType ;
skos:definition """Target attribute providing a hint indicating
what the media type [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc2046" title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">RFC2046</a></cite>]
of the result of dereferencing the link should
be."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:order 2 ;
] ;
sh:property [
sh:path hctl:hasRelationType ;
skos:definition """A link relation type identifies the semantics
of a link."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
#sh:nodeKind sh:IRI ; # TODO could be relaxed
sh:order 3 ;
] ;
sh:property [
sh:path hctl:hasAnchor ;
skos:definition """Overrides the link context (by default the
Thing itself identified by its <code>id</code>)
with the given URI or IRI."""^^rdf:HTML ;
sh:datatype xsd:anyURI ;
sh:node sh:IRI ;
sh:maxCount 1 ;
sh:order 4 ;
] ;
sh:property [
sh:path hctl:hasSizes ;
skos:definition """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\")."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:order 5 ;
] ;
skos:scopeNote """ <p>Link relations can be used to describe relations such as to other Things (e.g., a Switch Thing controls a Lamp Thing), to a specific kind of Thing Models (e.g., a Thing Description
is an instance of a specific Thing Model), or to further documentations information (e.g., device manual of a Thing). It is recommended to reuse existing and established
<a href="https://www.iana.org/assignments/link-relations">Link Relation definitions from IANA.</a>
</p>
<p>In the following a best practice relation type table is introduced that is recommended to use within WoT <a>Thing Description</a>
or <a>Thing Model</a> instances.
</p>
<table class="def">
<thead>
<tr>
<th>Value</th>
<th>Occurrence</th>
<th>Explanation</th>
<th>Source of value origin</th>
</tr>
</thead>
<tbody>
<tr >
<td>
<code>icon</code>
</td>
<td>
0..*
</td>
<td>Imports an icon associated to the <a>Thing</a> (e.g., for UI purposes).</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr >
<td>
<code>service-doc</code>
</td>
<td>
0..*
</td>
<td>Relation to a resource that provide (human-readable) documentation or descriptions.</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr >
<td>
<code>alternate</code>
</td>
<td>
0..*
</td>
<td>Point to alternative representation of the <a>Thing</a> (i.e. RDF-Turtle, human-readable HTML document, ...).</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr >
<td>
<code>type</code>
</td>
<td>
0..1
</td>
<td>Indicate that the <a>Thing</a> is an instance of the target resource such as to a <a>Thing Model</a>.</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr >
<td>
<code>tm:extends</code>
</td>
<td>
0..1
</td>
<td>Extends an existing definition of the target resource such as a <a>Thing Model</a>. Only applicable for Thing Model definitions.</td>
<td>
W3C WoT Thing Model
</td>
</tr>
<tr >
<td>
<code>manifest</code>
</td>
<td>
0..*
</td>
<td>Point to a software implementation of the TD.</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr>
<td>
<code>proxy-to</code>
</td>
<td>
0..*
</td>
<td>Target resource provide the address of a proxy.</td>
<td>
W3C WoT Security and WoT Binding Template
</td>
</tr>
<tr>
<td>
<code>collection</code>
</td>
<td>
0..1
</td>
<td>Points to a collections of <a>Things</a>.</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr>
<td>
<code>item</code>
</td>
<td>
0..*
</td>
<td>Points to a <a>Thing</a> that is member of the current <a>Thing</a> collections.</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr>
<td>
<code>predecessor-version</code>
</td>
<td>
0..1
</td>
<td>Points to a previous <a>Thing Description</a> or <a>Thing Model</a> version.</td>
<td>
<a href="https://www.iana.org/assignments/link-relations">IANA Link Relation</a>
</td>
</tr>
<tr>
<td>
<code>controlledBy</code>
</td>
<td>
0..*
</td>
<td>Refers to a <a>Thing</a> that controls the context <a>Thing</a>.</td>
<td>
W3C Thing Description
</td>
</tr>
</tbody>
</table>
"""^^rdf:HTML .
:ExpectedResponseShape a sh:NodeShape ;
sh:targetClass hctl:ExpectedResponse ;
skos:definition """Communication metadata describing the expected