forked from w3c/wot-thing-description
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtd-validation.ttl
2249 lines (2189 loc) · 109 KB
/
td-validation.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 td:title ;
skos:definition """Provides a human-readable title (e.g., display
a text for UI representation) based on a default
language."""^^rdf:HTML ;
sh:nodeKind sh:Literal ;
sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ;
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> [[RFC6068]],
<code>tel</code> [[RFC3966]],
<code>https</code> [[RFC9112]])."""^^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: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. <a>Thing level</a> forms are used to describe endpoints for a group of interaction affordances."""^^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:datatype xsd:string ;
sh:minCount 1 ;
sh:order 15 ;
] ;
sh:property [
sh:path td:definesSecurityScheme ;
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 ;
] ;
sh:property [
sh:path td:hasUriTemplateSchema ;
skos:definition """Define URI template variables according to [[RFC6570]] as collection
based on DataSchema declarations. The <a>Thing level</a> <code>uriVariables</code> can be used in <a>Thing level</a>
<code>forms</code> or in Interaction Affordances.
The individual variables DataSchema cannot be an ObjectSchema or an ArraySchema since each variable needs
to be serialized to a string inside the <code>href</code> upon the execution of the operation.
If the same variable is both declared in <a>Thing level</a> <code>uriVariables</code> and in Interaction Affordance level,
the Interaction Affordance level variable takes precedence."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:order 18 ;
] ;
skos:scopeNote """<p>
For <code>@context</code> the following rules are defined for <a>Thing Description</a> instances:
</p>
<ul>
<li>
<span class="rfc2119-assertion" id=
"td-context-ns-thing-mandatory">
The <code>@context</code>
name-value pair MUST contain the anyURI
<code>https://www.w3.org/2022/wot/td/v1.1</code>
in order to identify the document as a TD 1.1 which would allow <a>Consumers</a> to use the newly introduced terms.
</span>
</li>
<li>
<span class="rfc2119-assertion" id=
"td-context-ns-td10-namespace">
When there are possibly TD 1.0 consumers the anyURI
<code>https://www.w3.org/2019/wot/td/v1</code>
MUST be the first entry and the <code>https://www.w3.org/2022/wot/td/v1.1</code> MUST be the second entry.</span>
</li>
<li>
<span class="rfc2119-assertion" id=
"td-context-ns-td10-namespacev10">
TD 1.1 consumers MUST accept TDs satisfying the W3C WoT Thing Description 1.0 [[wot-thing-description10]] specification.
</span>
</li>
<li>
<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/2022/wot/td/v1.1</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 RECOMMENDED 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>
</li>
<li>
<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> MAY
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>
</li>
<li>
<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> SHOULD 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>
</li>
</ul>
<p>To determine the base direction of all
human-readable text in <a>Thing Description</a>
and <a>Thing Model</a> instances this specification
recommends to follow the [[STRING-META]] guideline about
<a href="https://www.w3.org/TR/string-meta/#string_specific_direction">string-specific directional information</a>
when no built-in mechanism for associating base direction metadata
is available.
</p>
<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.
<span class="rfc2119-assertion" id="td-processor-bidi-isolation">
<a href="#dfn-td-processor" class="internalDFN"
data-link-type="dfn">TD Processors</a> SHOULD take care to use bidi isolation when
presenting strings to users, particularly when embedding
in surrounding text (e.g., for Web user interface)</span>.
Mixed direction text can occur in any language, even when the
language is properly identified.</p>
<p><span class="rfc2119-assertion" id="td-producer-mixed-direction">
TD <a>producers</a> SHOULD attempt to provide mixed direction
strings in a way that can be displayed successfully by a
naive user agent. </span>
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-map" class="internalDFN" data-link-type=
"dfn">Maps</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, it MUST contain <code>op</code> member with 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>, MUST be one of the following <em>operation
types</em>: <code>readallproperties</code>,
<code>writeallproperties</code>,
<code>readmultipleproperties</code>,
<code>writemultipleproperties</code>, <code>observeallproperties</code>,
<code>unobserveallproperties</code>, <code>queryallactions</code>,
<code>subscribeallevents</code>, or
<code>unsubscribeallevents</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 the property 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. The array cannot be empty."""^^rdf:HTML ;
sh:minCount 1 ;
sh:node :FormShape ;
sh:order 5 ;
] ;
sh:property [
sh:path td:hasUriTemplateSchema ;
skos:definition """Define URI template variables according to [[RFC6570]] as collection
based on DataSchema declarations. The individual variables DataSchema cannot be an ObjectSchema or an ArraySchema since each variable needs
to be serialized to a string inside the <code>href</code> upon the execution of the operation.
If the same variable is both declared in <a>Thing level</a> <code>uriVariables</code>and in Interaction Affordance level,
the Interaction Affordance level variable takes precedence."""^^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/or 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:defaultValue false ;
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> MUST 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><p class="note">
The observation mechanism depends on the underlying protocol or sub-protocol. Having said that, it is not
guaranteed that the current <a>Property</a> value will be provided once the subscription is initiated. Hence, it may be
necessary to read the current <a>Property</a> value before/after the subscription to get a first value.
</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 ;
] ;
sh:property [
sh:path td:isSynchronous ;
skos:definition """Indicates whether the action is synchronous (=true) or not.
A synchronous action means that the response of action contains all the information
about the result of the action and no further querying about the status of the action
is needed. Lack of this keyword means that no claim on the synchronicity of the
action can be made."""^^rdf:HTML ;
sh:datatype xsd:boolean ;
sh:maxCount 1 ;
sh:order 5 ;
] ;
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 MUST
either be <code>invokeaction</code>, <code>queryaction</code>,
<code>cancelaction</code> or an
<a href="#dfn-array" class="internalDFN" data-link-type="dfn">Array</a>
containing a combination of these terms.
</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:hasNotificationResponseSchema ;
skos:definition """Defines the data schema of the Event response messages sent by the consumer in a response to a data message."""^^rdf:HTML ;
sh:node :DataSchemaShape ;
sh:maxCount 1 ;
sh:order 3 ;
] ;
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 4 ;
] ;
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>
MUST 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>
<p>
EventAffordances are similar to observable PropertyAffordances in the sense that the Thing itself informs interested Consumers about state changes.
However, a main difference of EventAffordances is that not every change of the associated resource needs to trigger an event message to be emitted, e.g. a critical threshold for a numeric value.
Furthermore, EventAffordances allow for more complex subscribing and unsubscribing mechanisms via the definition of <code>subscription</code>, <code>dataResponse</code>, and <code>cancellation</code> DataSchema definitions.
Not all protocols might support these more advanced mechanisms, however, which is why in some scenarios, events may be very similar to observable PropertyAffordances.
In these cases, the choice between a Property and a Event for modelling the Affordance should be made based on the semantics of the underlying resource; for example, if the state of the affordance is also supposed to be read or written by a Consumer, then a Property is most likely the appropriate choice.
</p>
"""^^rdf:HTML .
:MultiLanguageShape a sh:NodeShape ;
sh:targetClass td:MultiLanguage ;
skos:definition """<p>A <a>Map</a> providing a set of human-readable texts in different languages identified by language tags described in [[BCP47]]. See <a href="#titles-descriptions-serialization-json"></a> for example usages of this container in a Thing Description instance.</p>
<p><span class="rfc2119-assertion" id="td-multilanguage-language-tag">Each name of the <code>MultiLanguage</code> <a>Map</a> MUST be a language tag as defined in [[!BCP47]].</span>
<span class="rfc2119-assertion" id="td-multilanguage-value"> Each value of the <code>MultiLanguage</code> <a>Map</a> MUST be of type <code>string</code>. </span>
"""^^rdf:HTML ;
sh:closed false ;
sh:order 18 .
: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.
"""^^rdf:HTML ;
sh:nodeKind sh:Literal ;
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.
"""^^rdf:HTML ;
sh:nodeKind sh:Literal ;
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:datatype xsd:anyURI ;
sh:nodeKind sh:Literal ;
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:nodeKind sh:Literal ;
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:nodeKind sh:Literal ;
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:queryAction
td:cancelAction
td:subscribeEvent
td:unsubscribeEvent
td:readAllProperties
td:writeAllProperties
td:readMultipleProperties
td:writeMultipleProperties
td:observeAllProperties
td:unobserveAllProperties
td:subscribeAllEvents
td:unsubscribeAllEvents
td:queryAllActions
);
sh:nodeKind sh:IRI ;
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:nodeKind sh:Literal ;
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:nodeKind sh:Literal ;
sh:datatype xsd:string ;
#sh:node :SecuritySchemeShape ;
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:nodeKind sh:Literal ;
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-architecture11" title=
"Web of Things (WoT) Architecture 1.1">wot-architecture11</a></cite>].
Future versions of the standard may extend this list but
<span class="rfc2119-assertion" id=
"well-known-operation-types-only">operations types
MUST be restricted to the values in the
table below.</span></p>
<div id="table-operation-types">
<table class="def numbered">
<caption>Well-known operation types</caption>
<thead>
<tr>
<th>Operation Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>readproperty</td>
<td>Identifies the read operation on
Property Affordances to retrieve the
corresponding data.</td>
</tr>
<tr>
<td>writeproperty</td>
<td>Identifies the write operation on
Property Affordances to update the
corresponding data.</td>
</tr>
<tr>
<td>observeproperty</td>
<td>Identifies the observe operation on
Property Affordances to be notified with
the new data when the Property is
updated.</td>
</tr>
<tr>
<td>unobserveproperty</td>
<td>Identifies the unobserve
operation on Property Affordances to stop
the corresponding notifications.</td>
</tr>
<tr>
<td>invokeaction</td>
<td>Identifies the invoke operation on
Action Affordances to perform the
corresponding action.</td>
</tr>
<tr>
<td>queryaction</td>
<td>Identifies the querying operation on
Action Affordances to get the status of the
corresponding action.</td>
</tr>
<tr>
<td>cancelaction</td>
<td>Identifies the cancel operation on
Action Affordances to cancel the ongoing
corresponding action.</td>
</tr>
<tr>
<td>subscribeevent</td>
<td>Identifies the subscribe operation
on Event Affordances to be notified by
the Thing when the event occurs.</td>
</tr>
<tr>
<td>unsubscribeevent</td>
<td>Identifies the unsubscribe
operation on Event Affordances to stop
the corresponding notifications.</td>
</tr>
<tr>
<td>readallproperties</td>
<td>Identifies the readallproperties
operation on a Thing to retrieve the
data of all Properties in a single interaction.</td>
</tr>
<tr>
<td>writeallproperties</td>
<td>Identifies the writeallproperties
operation on a Thing to update the
data of all writable Properties in a single interaction.</td>
</tr>
<tr>
<td>readmultipleproperties</td>
<td>Identifies the readmultipleproperties
operation on a Thing to retrieve the
data of selected Properties in a single interaction.</td>
</tr>
<tr>
<td>writemultipleproperties</td>
<td>Identifies the writemultipleproperties
operation on a Thing to update the
data of selected writable Properties in a single interaction.</td>
</tr>
<tr>
<td>observeallproperties</td>
<td>Identifies the observeallproperties operation on
Properties to be notified with new data when any Property is
updated.</td>
</tr>
<tr>
<td>unobserveallproperties</td>
<td>Identifies the unobserveallproperties operation on
Properties to stop notifications from all Properties in a
single interaction.</td>
</tr>
<tr>
<td>queryallactions</td>
<td>Identifies the queryallactions operation on a Thing to get the status of
all Actions in a single interaction.</td>
</tr>
<tr>
<td>subscribeallevents</td>
<td>Identifies the subscribeallevents operation on Events to subscribe
to notifications from all Events in a single interaction.</td>
</tr>
<tr>
<td>unsubscribeallevents</td>
<td>Identifies the unsubscribeallevents operation on Events to unsubscribe
from notifications from all Events in a single interaction.</td>
</tr>
</tbody>
</table>
</div>
<p>
A <a>Thing Description</a> of a WoT <a>producer</a> 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 <a>producer</a>.
</p>
<section id="sec-op-data-schema-mapping" class="informative">
<h4>Mapping op Values to Data Schemas</h4>
<p>
Protocols that can be used with TDs follow request-response or eventing mechanisms.
The Data Schema of an affordance generally correlates with the <code>op</code> keywords used in <code>forms</code>.
The table below informatively summarizes the available data schema related terms with the <code>op</code> keywords.
</p>
<ul>
<li>Consumer to Thing applies for messages sent by the Consumer to the Thing, such as the value for writing a property.</li>
<li>Thing to Consumer applies for messages sent by the Thing to the Consumer, such as the value of a property value as the result of reading a property.</li>
<li>In case that there is no correlation with the data schema and the operation, it implies that no payload is required for executing the operation or no
payload is expected as a result of the operation.</li>
</ul>
<table class="def numbered">
<caption>Mapping op Values to Data Schemas</caption>
<thead>
<tr>
<th>Operation Type</th>
<th>Consumer to Thing DataSchema Correlation</th>
<th>Thing to Consumer DataSchema Correlation</th>
</tr>
</thead>
<tbody>
<tr>
<td>readproperty</td>
<td>No correlation.</td>
<td>All fields in the Property Affordance without <code>"writeOnly":true</code>.</td>
</tr>
<tr>
<td>writeproperty</td>
<td>All fields in the Property Affordance without <code>"readOnly":true</code>.</td>
<td>No correlation. <code>additionalResponses</code> can be used in the form level.</td>
</tr>
<tr>
<td>observeproperty</td>
<td>No correlation.</td>
<td>All fields in the Property Affordance without <code>"writeOnly":true</code>.</td>
</tr>
<tr>
<td>unobserveproperty</td>
<td>No correlation.</td>
<td>No correlation.</td>
</tr>
<tr>
<td>invokeaction</td>
<td>Value of the <code>input</code> key.</td>
<td>Value of the <code>output</code> key.</td>
</tr>
<tr>
<td>queryaction</td>
<td>No correlation.</td>
<td>No correlation. <code>additionalResponses</code> can be used in the form level.</td>
</tr>
<tr>
<td>cancelaction</td>
<td>No correlation.</td>
<td>No correlation. <code>additionalResponses</code> can be used in the form level.</td>
</tr>
<tr>
<td>subscribeevent</td>
<td>Value of the <code>subscription</code> key with all fields without <code>"readOnly":true</code></td>
<td>Value of the <code>subscription</code> key with all fields without <code>"writeOnly":true</code></td>
</tr>
<tr>
<td>unsubscribeevent</td>
<td>Value of the <code>subscription</code> key with all fields without <code>"readOnly":true</code></td>
<td>Value of the <code>subscription</code> key with all fields without <code>"writeOnly":true</code></td>
</tr>
</tbody>
</table>
<p class="note" title="writeproperty and observeproperty relationship">
Writing to a property does not necessarily mean that a new value will be sent to the Consumer observing the property.
It depends on the protocol and implementation.
</p>
<p class="note" title="Further Data Schemas mappings">
Further specification of how to map operations to data schemas, as well as mapping meta operations such as <code>readallproperties</code>
can be found in the respective protocol specification of the [[WOT-BINDING-TEMPLATES]].
</p>
</section>
<section id="sec-response-usage">
<h4>Response-related Terms Usage</h4>
<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
MUST 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