-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
3736 lines (3587 loc) · 168 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en-US">
<head>
<link rel="stylesheet" href="testing/atrisk.css">
<meta charset="utf-8" />
<title>Web of Things (WoT) Profiles</title>
<script class="remove" src="https://www.w3.org/Tools/respec/respec-w3c"></script>
<script class="remove">
var respecConfig = {
lint: {
"no-headingless-sections": false,
},
specStatus: "ED",
maxTocLevel: 6,
processVersion: 2019,
shortName: "wot-profile",
copyrightStart: 2020,
group: "wg/wot",
wgPublicList: "public-wot-wg",
edDraftURI: "https://w3c.github.io/wot-profile/",
githubAPI: "https://api.github.com/repos/w3c/wot-profile",
issueBase: "https://www.github.com/w3c/wot-profile/issues",
previousPublishDate: "2020-11-24",
previousMaturity: "FPWD",
editors: [{
name: "Michael Lagally",
w3cid: "47166",
company: "Oracle Corp.",
companyURL: "https://www.oracle.com/"
},
{
name: "Ben Francis",
w3cid: "51527",
company: "Invited Expert"
},
{
name: "Michael McCool",
w3cid: "93137",
company: "Intel Corp.",
companyURL: "https://www.intel.com/"
},
{
name: "Ryuichi Matsukura",
w3cid: "64284",
company: "Fujitsu Ltd.",
companyURL: "https://www.fujitsu.com/"
},
{
name: "Sebastian Kaebisch",
w3cid: "43064",
company: "Siemens AG",
companyURL: "https://www.siemens.com/"
},
{
name: "Tomoaki Mizushima",
w3cid: "98915",
company: "Internet Research Institute, Inc.",
companyURL: "https://www.iri.co.jp/"
}],
otherLinks: [
{
key: "Contributors",
data: [{
value: "In the GitHub repository",
href: "https://github.com/w3c/wot-profile/graphs/contributors"
}]
}, {
key: "Repository",
data: [{
value: "We are on GitHub",
href: "https://github.com/w3c/wot-profile/"
}, {
value: "File a bug",
href: "https://github.com/w3c/wot-profile/issues"
}, {
value: "Contribute",
href: "https://github.com/w3c/wot-profile/pulls"
}]
}],
localBiblio: {
"JSON-SCHEMA": {
title: "JSON Schema Validation: A Vocabulary for Structural Validation of JSON",
href: "https://tools.ietf.org/html/draft-handrews-json-schema-validation-01",
authors: ["Austin Wright", "Henry Andrews", "Geraint Luff"],
status: "Internet-Draft",
date: "19 March 2018",
publisher: "IETF"
},
"ISO-6709": {
title: "ISO-6709:2008 : Standard representation of geographic point location by coordinates",
href: "https://www.iso.org/standard/39242.html",
status: "Published",
date: "2008-07",
publisher: "ISO"
},
"H2020-CREATE-IoT": {
title: "H2020 – CREATE-IoT Project - Recommendations for commonalities and interoperability profiles of IoT platforms",
href: "https://european-iot-pilots.eu/wp-content/uploads/2018/11/D06_02_WP06_H2020_CREATE-IoT_Final.pdf",
status: "Published",
date: "2018-11",
publisher: "IoT European Large-Scale Pilots Programme"
}
}
};
</script>
<style>
.rfc2119-assertion {
background-color: rgb(230, 230, 230)
}
</style>
</head>
<body>
<section id="abstract">
<p>
This specification defines a <a href="#profiling-mechanism">Profiling
Mechanism</a> and a set of <a href="#dfn-profile">Profiles</a>
which enable <a href="#out-of-the-box-interoperability">out-of-the-box
interoperability</a> between
<a href="#dfn-thing">Web Things</a> and their
<a href="#dfn-consumer">Consumers</a> on the
<a href="https://www.w3.org/wot">Web of Things</a>.
</p>
<p>
Being out-of-the-box interoperable means that any Consumer which conforms
with a given Profile can interact with any Thing which conforms with the
same profile, without additional customization.
</p>
<p>
A Profile is a technical specification which provides a set of assertions
to which conformant Consumers and Things must conform.
</p>
<p>
The Profiling Mechanism provides a means to denote that a given Thing
conforms to one or more Profiles, by referring to the identifiers of those
Profiles in the <code>profile</code> member of its
<a href="#dfn-thing-description">Thing Description</a>.
</p>
<p>
The specification defines three profiles:
<ul>
<li>The <em>normative</em> <a href="#http-basic-profile">HTTP Basic
Profile</a> defines a protocol binding for reading and writing
properties and invoking, querying and cancelling actions using the
HTTP protocol.
</li>
<li>
The <em>informative</em> <a href=#sec-http-sse-profile>HTTP SSE
Profile</a> defines a protocol binding for observing properties and
subscribing to and unsubscring from events using Server-Sent Events.
</li>
<li>
The <em>informative</em> <a href="#sec-http-webhook-profile">HTTP
Webhook Profile</a> defines a protocol binding for subscribing to and
unsubscribing from events using Webhooks.
</li>
</ul>
</p>
<p>
The Profiles defined in this specification share a set of
<a href="#common-constraints">Common Constraints</a> to which
implementations of those Profiles must also conform. This includes
constraints on units, date formats, security mechanisms,
discovery mechanisms, link relations, errors and default language.
</p>
<p>
Future versions of this specification, or extension specifications, may
define additional Profiles.
</p>
</section>
<section id='sotd'></section>
<section id="introduction">
<h1>Introduction</h1>
<!-- Motivation -->
<section id="motivation">
<h2>Motivation</h2>
<p>
The <a href="https://www.w3.org/WoT/">Web of Things</a> (WoT) seeks to
counter the fragmentation of the
<a href="https://en.wikipedia.org/wiki/Internet_of_things">Internet of
Things</a> (IoT) by using and extending existing, standardized
web technologies.
</p>
<p>
The W3C WoT Thing Description [[wot-thing-description11]] specification
defines an information model and JSON-based representation format for
describing the capabilities of connected devices and the interfaces with
which to communicate with them. Thing Descriptions are designed to be
protocol-agnostic and flexible enough to describe a wide range of
existing ("brownfield") IoT devices.
</p>
<p>
In order to provide this level of flexibility the Thing Description
specification includes a number of extension points including protocol
bindings, payload bindings, security mechanisms, link relations and
semantic contexts. As long as all of the capabilities of a device can
be described using a Thing Description and a <a href="#dfn-consumer">
Consumer</a> implements all of the extensions used, the Consumer should
be able to interoperate with that device. However, the result of this
extensible architecture is that any given Consumer can only interoperate
with a subset of possible <a href="#dfn-thing">Web Things</a>.
</p>
<p>
This specification is designed to complement the Thing Description
[[wot-thing-description11]] specification, by enabling ad-hoc
interoperability through the use of "profiles". A profile
prescribes a finite set of extensions and defaults that a Thing can
be constrained to in order to guarantee
<a href="#out-of-the-box-interoperability">out-of-the-box
interoperability</a> with any Consumer which implements that profile.
</p>
<p>
Profiles are designed specifically for new ("greenfield") implementations
where developers have the freedom to conform to a prescriptive protocol
binding and set of common constraints, in order to benefit from
this additional level of interoperability.
</p>
<p class="note">
Of the Profiles defined in this specification, only the
<a href="#http-basic-profile">HTTP Basic Profile</a> is currently
normative. It is planned that future versions of this specification will
normatively define the <a href=#sec-http-sse-profile>HTTP SSE Profile</a>
and <a href="#sec-http-webhook-profile">HTTP Webhook Profile</a>, but
in this version of the specification they are only informative.
</p>
<p>
Future versions of this specification, or extension specifications, may
define additional Profiles.
</p>
</section>
<!-- Use Cases -->
<section id="use-cases-and-requirements">
<h2>Use Cases and Requirements</h2>
<p>
The Web of Things Interest Group collected use cases for
the Web of Things from stakeholders representing various different
industries. This includes both vertical domain-specific use cases and
horizontal use cases which apply to multiple application domains
[[wot-usecases]].
</p>
<p>
Several of the
<a href="https://www.w3.org/TR/wot-usecases/#sec-vertical-ucs">domain-specific
use cases</a> refer to the need for easy integration of
devices from multiple vendors. This is especially important for
<a href="https://www.w3.org/TR/wot-usecases/#multi-vendor">cross-domain
use cases</a> which require "multi-vendor system
integration" and "out-of-the-box interoperability".
</p>
<p>
A set of
<a href="https://github.com/w3c/wot-profile/blob/main/REQUIREMENTS.md">requirements</a>
for Profiles were derived from these use cases.
</p>
</section>
<section id="out-of-the-box-interoperability">
<h2>Out-of-the-Box Interoperability</h2>
<p>
At a high level, out-of-the-box interoperability means that a <a href="#dfn-consumer">Consumer</a> is guaranteed to be able to
use every capability of a <a href="#dfn-thing">Thing</a>, without Thing-specific customization.
</p>
<p>
The full definition of out-of-the-box interoperability used in this
specification includes multiple layers.
The following classification adopts terminology from the
"H2020 – CREATE-IoT Project - Recommendations for commonalities and
interoperability profiles of IoT platforms" [[?H2020-CREATE-IoT]]
report.
The definitions below have been adapted to reflect the scope of the WoT profile.
</p>
<h3 id="out-of-the-box-interoperability-technical-interop">Technical Interoperability</h3>
<p><em>Technical Interoperability</em> is usually associated with communication protocols and the
infrastructure needed for those protocols to operate. This implies agreeing on a common protocol
(e.g. HTTP / TCP/IP) and providing additional clarifications, where required.
</p>
<h3 id="out-of-the-box-interoperability-syntactic-interop">Syntactic Interoperability</h3>
<p><em>Syntactic Interoperability</em> is usually associated with data formats and encodings along with
techniques for compressing them. Examples for these formats and encodings in the WoT are JSON,
XML, JSON-LD, UTF-8 payloads.
</p>
<h3 id="out-of-the-box-interoperability-semantic-interop">Semantic Interoperability</h3>
<p>
<em>Semantic Interoperability</em> is associated with a common understanding of the behavior of communication
partners.
In the profile context, it includes a common interpretation of (synchronous and asynchronous) action semantics,
a common event model, how to set/get multiple properties, writable properties,
a common error model and error messages.
</p>
<p>
Domain specific ontologies, e.g. semantic interop of automotive and medical devices exceed the scope of the
this specification.
</p>
<h3 id="out-of-the-box-interoperability-organisational-interop">Organisational Interoperability</h3>
<p>
<em>Organisational Interoperability</em> in the profile context implies that any Consumer
which conforms with a given profile can interact with any Thing which conforms
with the same profile, without additional customization.
</p>
<p>
Organisational Interoperability also requires commonly agreed approaches to security,
trust and privacy, i.e. a consumer is provided access to Things only when these
common terms and conditions are applied.
</p>
<p>
Devices created by various engineers, vendors and SDOs that satisfy the requirements
of the profile specification can be integrated with compliant consumers without additional customization.
This works across infrastructures, regions and cultures.
</p>
</section>
</section>
<section id="conformance">
<p>
A device or consumer implementation complies with this specification if it follows
the normative statements in the present document.
<!--p>
A JSON Schema [[?JSON-SCHEMA]] to validate the compliance of a Thing Description
with the HTTP Basic Profile is provided in Appendix <a href="#basic-profile-json-schema"></a>.
</p-->
</section>
<section id="terminology">
<h2 id="x3-terminology">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">WoT Thing Description</dfn>,
<dfn class="lint-ignore">Partial TD</dfn>,
<dfn class="lint-ignore">Thing Model</dfn> (<dfn class="lint-ignore">TM</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>,
<dfn class="lint-ignore">Vocabulary</dfn>,
<dfn class="lint-ignore">Term</dfn>,
<dfn id="dfn-vocab-term" class="lint-ignore">Vocabulary Term</dfn>,
<dfn class="lint-ignore">WoT Interface</dfn>, and
<dfn class="lint-ignore">WoT Runtime</dfn>
are defined in <a href="https://www.w3.org/TR/wot-architecture/#terminology">Section 3</a>
of the WoT Architecture specification [[?WOT-ARCHITECTURE]].
<p>
For convenience of the reader, we use the terms <em>keyword</em>
and <em>field</em> for the linguistic notion <em>vocabulary term</em>
as defined in the <em>Thing Description</em> Specification.
</p>
<p>
We use the terms <em>device</em> and <em>thing</em> in an
interchangeable manner.
</p>
<h4 id="additional-definitions-">Additional Definitions</h4>
<dl>
<dt>
<dfn class="export">Profile</dfn>
</dt>
<dd>A technical specification which provides a set of assertions such that
any <a href="#dfn-consumer">Consumer</a> which conforms with the those
assertions is <a href="#out-of-the-box-interoperability">out-of-the-box
interoperable</a> with any <a href="#dfn-thing">Thing</a> which also
conforms with those assertions.
</dd>
</dl>
</section>
<!-- Profiling mechanism -->
<section id="profiling-mechanism">
<h2>Profiling Mechanism</h2>
<p>
<span class="rfc2119-assertion" id="profiling-mechanism-1">
In order to conform with a profile, a
<a href="https://www.w3.org/TR/wot-architecture/#dfn-thing">Web Thing</a>
MUST conform with all the normative statements in the profile's
specification.
</span>
</p>
<p>
<span class="rfc2119-assertion" id="profiling-mechanism-2">
In order to denote that a given
<a href="https://www.w3.org/TR/wot-architecture/#dfn-thing">Web Thing</a>
conforms to one or more profiles, its Thing Description MUST include a
<a href="https://w3c.github.io/wot-thing-description/#thing">
<code>profile</code></a> member [[wot-thing-description11]].
</span>
<span class="rfc2119-assertion" id="profiling-mechanism-3">
The value of the <code>profile</code> member MUST be set to either a
valid URI [[RFC3986]] identifying a single profile, or an array of valid
URIs identifying multiple profiles.
</span>
</p>
<p>
<span class="rfc2119-assertion" id="profiling-mechanism-4">
In order to use a <code>profile</code> member in a Thing Description,
the <code>@context</code> member MUST contain the anyURI
<code>https://www.w3.org/2022/wot/td/v1.1</code> in order to denote that
the document is using version 1.1 of the Thing Description
specification. [[wot-thing-description11]].
</span>
<span class="rfc2119-assertion" id="profiling-mechanism-5">
All Things and Consumers conforming to a profile MUST satisfy the assertions specified in the [[wot-thing-description11]],
except for the assertion <code>td-context-ns-td10-namespacev10</code> with text <code>TD 1.1 consumers MUST accept
TDs satisfying the W3C WoT Thing Description 1.0 [wot-thing-description] specification.</code>
</span>
</p>
<pre class="example">
{
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"id": "urn:dev:ops:32473-WoTLamp-1234",
"profile": "https://www.w3.org/2022/wot/profile/http-basic/v1",
"title": "My Lamp",
"description": "A web connected lamp",
...
}
</pre>
<pre class="example">
{
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"id": "urn:dev:ops:32473-WoTLamp-1234",
"profile": [
"https://www.w3.org/2022/wot/profile/http-basic/v1",
"https://www.w3.org/2022/wot/profile/http-sse/v1"
],
"title": "My Lamp",
"description": "A web connected lamp",
...
}
</pre>
<p class="note">
Conforming to a Profile does not prevent a Web Thing from describing
additional capabilities and protocol bindings in their Thing Description
beyond those described in the Profile, as long as they conform with all of
the normative assertions of the Profile.
</p>
</section>
<!-- Common -->
<section id="common-constraints">
<h1>Common Constraints</h1>
<p>
The following sections are applicable for all of the HTTP profiles defined by this document.
</p>
<!-- Identifiers TODO -->
<!-- Accessibility -->
<section id="common-constraints-accessibilityy">
<h2 id="accessibility">Accessibility</h2>
<p>Authors of <a>Thing Descriptions</a> must ensure that the things described by them are accessible to
users with disabilities.
</p>
<p><span class="rfc2119-assertion" id="common-constraints-a11y-1">
It is REQUIRED to provide a <code>title</code> that can be automatically rendered in a non-visual way
(e.g. using a screen reader)
for things that may be used in deployments with users with disabilities.</span>
</p>
<p><span class="rfc2119-assertion" id="common-constraints-a11y-2">
It is highly RECOMMENDED to provide a <code>description</code> that can be automatically rendered in a non-visual way
(e.g. using a screen reader)
for things that may be used in deployments with users with disabilities.</span>
</p>
<section class="ednote">
This is just a baseline set of requirements, which needs additional input from the APA group.
It needs to be clarified which TD elements are used by people with disabilities and to which these constraints are applied.
</section>
</section>
<!-- Units -->
<section id="sdec-common-constraints-units">
<h2 id="units">Units</h2>
<p>Authors of <a>Thing Descriptions</a> should be aware that units
that are common in their geographic region are not globally applicable
and may lead to misinterpretation with drastic consequences.
</p>
<p><span class="rfc2119-assertion" id="common-constraints-units">
It is highly RECOMMENDED to provide a <code>unit</code>,
if a value has a physical quantity.</span>
</p>
<p><span class="rfc2119-assertion" id="common-constraints-units-metric">
It is highly RECOMMENDED to use the metric system (SI units)
for devices that are used in global deployments.</span>
</p>
</section>
<!-- Date Format -->
<section id="common-constraints-date-format">
<h2 id="date-format">Date Format</h2>
<p>
<span class="rfc2119-assertion" id="common-constraints-date-format-1">
All date and time values MUST use the <code>date-time</code> format
defined in [[RFC3339]].</span>
</p>
<pre class="example">
<code>2022-09-21T23:20:50.52Z</code>
</pre>
<p class="note">
In order to reduce ambiguity, RFC 3339 only permits an hour with a value
between 00 and 23 (not 24), and time zones expressed as a numerical
offset relative to UTC. The suffix "Z" when applied to a time denotes a
UTC offset of 00:00.
</p>
</section>
<!-- Security -->
<section id="common-constraints-security">
<h2>Security</h2>
<div class="rfc2119-assertion" id="common-constraints-security-1">
<p>
Below is a list of <a
href="https://w3c.github.io/wot-thing-description/#sec-security-vocabulary-definition">
security schemes</a> [[wot-thing-description11]] which conformant Web
Things MAY use:
</p>
<ul>
<li>
<a href="https://w3c.github.io/wot-thing-description/#nosecurityscheme">
<code>NoSecurityScheme</code>
</a>
</li>
<li>
<a href="https://w3c.github.io/wot-thing-description/#basicsecurityscheme">
<code>BasicSecurityScheme</code>
</a>
</li>
<li>
<a href="https://w3c.github.io/wot-thing-description/#oauth2securityscheme">
<code>OAuth2SecurityScheme</code> with the <code>code</code> or <code>client</code> flow.
</a>
</li>
</ul>
</div>
<p><span class="rfc2119-assertion" id="common-constraints-security-2">
Conformant Consumers MUST support at least all of these security schemes.</span>
</p>
<p><span class="rfc2119-assertion" id="common-constraints-security-3">
A Thing MAY implement multiple security schemes.</span>
</p>
<p><span class="rfc2119-assertion" id="common-constraints-security-4">
A Thing MUST support at least one of the above security schemes.</span>
</p>
<p><span class="rfc2119-assertion" id="common-constraints-security-basic-in">
For the <code>BasicSecurityScheme</code> the "in" field MUST be either omitted
or be given its default value of "header" as defined in [[wot-thing-description11].</span>
<span class="rfc2119-assertion" id="common-constraints-security-basic-name">
For the <code>BasicSecurityScheme</code> the "name" field MUST be provided using
the value "Authorization" if a "proxy" endpoint is not given.</span>
<span class="rfc2119-assertion" id="common-constraints-security-basic-proxy">
For the <code>BasicSecurityScheme</code> the "name" field MUST be provided using
the value "Proxy-Authorization" if a"proxy" endpoint is given.</span>
</p>
<p><span class="rfc2119-assertion" id="common-constraints-security-6">
Conformant Consumers MUST support security bootstrapping for all
implemented security schemes, as defined in
<a href="https://w3c.github.io/wot-discovery/#exploration-secboot">Security Bootstrapping</a>
in the WoT Discovery [[wot-discovery]] specification.
</span></p>
<p><span class="rfc2119-assertion" id="common-constraints-security-7">
Conformant Things which require authentication in order to retrieve
their Thing Description MUST implement security bootstrapping, as
defined in
<a href="https://w3c.github.io/wot-discovery/#exploration-secboot">Security Bootstrapping</a>
in the WoT Discovery [[wot-discovery]] specification.
</span></p>
</section>
<!-- Discovery -->
<section id="common-constraints-discovery">
<h2>Discovery</h2>
<p class="rfc2119-assertion" id="common-constraints-discovery-1">
A Web Thing's Thing Description [[wot-thing-description11]] MUST be
retrievable from a
<a href="https://w3c.github.io/wot-architecture/#dfn-wot-thing-description-server">
Thing Description Server</a> [[wot-architecture11]] using an HTTP
[[HTTP11]] URL provided by a
<a href="https://w3c.github.io/wot-discovery/#introduction-mech">
Direct Introduction Mechanism</a> [[wot-discovery]].
</p>
</section>
<!-- Links -->
<section id="common-constraints-links">
<h2>Links</h2>
<p>Hypermedia links in the HTTP Profiles are significantly constrained to ensure a common interpretation
and interoperability between things and consumers.</p>
<p>
<span class="rfc2119-assertion" id="common-constraints-links-1">The following keywords are defined for links in the
HTTP profiles and MAY be present in profile-compliant TDs with the constraints defined by this section.</span>
<p>
<span class="rfc2119-assertion" id="common-constraints-links-2">Other keywords for links MAY
be present in a TD, however their interpretation is undefined
in the context of the HTTP profiles</span>
<span class="rfc2119-assertion" id="common-constraints-links-3">These other link types MAY
be ignored by all profile-compliant consumers.</span>
</p>
<section class=note>
<p>
These links enable consumers to interpret linked content that is provided by the link target in an unambiguous way.
This interpretation is a "best effort" mechanism, that depends on the capabilities of the consumer.
A consumer with a browser could render HTML content, a consumer with a PDF engine can display PDF content,
a consumer with a dot-matrix display only can display icons.
</p>
<p>For consumers that can render images or documents this implies to display appropriate documentation
to a human reader.</p>
<p>Consumers that are capable of working with nested things and thing model structures are able
to navigate between things and thing models in a well defined way.</p>
</section>
<!-- TD 5.3.4.1 -->
<table class="def">
<thead>
<tr>
<th>Keyword</th>
<th>Type</th>
<th>Constraint</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>href</code></td>
<td>IRI of the link target</td>
<td>mandatory,<code>anyURI</code></td>
</tr>
<tr>
<td><code>type</code></td>
<td>media type [RFC2046] of the link target</td>
<td>mandatory, the supported set of media types is defined in
<a href="#sec-link-relation-types">Media Types for Link Targets</a> below.
</td>
</tr>
<tr>
<td><code>rel</code></td>
<td>link relation type <a href="https://www.iana.org/assignments/link-relations/link-relations.xhtml">IANA
Link Relations</a></td>
<td>mandatory, the supported subset of relation types is described in
<a href="#sec-link-relation-types">Link Relation Types</a> below.
</td>
</tr>
<tr>
<td><code>sizes</code></td>
<td>string with icon dimensions</td>
<td>mandatory for <code>icon</code> link targets, forbidden otherwise.</td>
</tr>
<tr>
<td><code>hreflang</code></td>
<td><code>array of string</code> with valid language tags according to [BCP47]</td>
<td>optional.</td>
</tr>
</tbody>
</table>
<section id="sec-link-relation-types">
<h3>Link Relation Types</h3>
<table class="def">
<thead>
<tr>
<th>Relation Type</th>
<th>Constraint</th>
<th>Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>icon</code></td>
<td>supported media types: <code>image/png</code>, <code>image/jpeg</code>. </td>
</tr>
<tr>
<td><code>type</code></td>
<td>link target MUST be a profile-compliant <a>Thing Model</a></td>
<td>No other types are defined in the Profile.</td>
</tr>
<tr>
<td><code>service-doc</code></td>
<td>human readable documentation, supported formats are Unicode Text, markdown, HTML and PDF.</td>
<td></td>
</tr>
<tr>
<td><code>collection</code></td>
<td>link target is a collection of things or thing models.</td>
<td></td>
</tr>
<tr>
<td><code>item</code></td>
<td>link target is a collection member of the thing or thing model.</td>
<td></td>
</tr>
<tr>
<td><code>alternate</code></td>
<td>link target is an alternative representation of the Thing.</td>
<td></td>
</tr>
</tbody>
</table>
</section>
<section id="sec-link-media-types">
<h3>Media Types for Link Targets</h3>
<span class="rfc2119-assertion" id="common-constraints-links-media-types-1">The following media types from <a
href="https://www.iana.org/assignments/media-types/media-types.xhtml">IANA</a>
MAY be used as the link targets of profile compliant TDs with the constraints in this section.</span>
<span class="rfc2119-assertion" id="common-constraints-links-media-types-2">Other media types MAY
be present in a TD, however their heir interpretation is undefined
in the context of the HTTP profiles and they MAY be ignored by all profile-compliant consumers.</span>
<table class="def">
<thead>
<tr>
<th>Type</th>
<th>Constraint</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>text/plain</code></td>
<td>charset=UTF-8</td>
</tr>
<tr>
<td><code>text/html</code></td>
<td></td>
</tr>
<tr>
<td><code>text/markdown</code></td>
<td>charset=UTF-8</td>
</tr>
<tr>
<td><code>text/pdf</code></td>
<td></td>
</tr>
<td><code>application/json</code></td>
<td></td>
</tr>
<tr>
<td><code>application/ld+json</code></td>
<td></td>
</tr>
<tr>
<td><code> application/octet-stream</code></td>
<td></td>
</tr>
<tr>
<td><code>image/jpeg</code></td>
<td></td>
</tr>
<tr>
<td><code>image/png</code></td>
<td></td>
</tr>
</tbody>
</table>
</section>
<p>
<span class="rfc2119-assertion" id="common-constraints-links-media-types-4">
If a Consumer encounters a link with "rel": "icon" and "type": "image/*" and it is capable of rendering images in
the
provided format, then it SHOULD interpret the link as an icon for the Thing and display it to the user.
</span>
</p>
<p>
<span class="rfc2119-assertion" id="common-constraints-links-media-types-5">
If a Consumer encounters a link with "rel": "alternate" and "type": "text/html" and it is capable of rendering an
HTML
page and accepting user input, then it SHOULD interpret the link as a user interface for the Thing and provide a
means
for the user to follow that link and view and interact with the HTML page.
</span>
</p>
<p>
<span class="rfc2119-assertion" id="common-constraints-links-media-types-6">
If a Consumer encounters a link with "rel": "service-doc" and "type": "text/plain", "type": "text/html" or "type":
"text/pdf", and is capable of rendering documents in the provided format, then it SHOULD interpret the link as a
user
manual for the Thing and provide a means for the user to follow that link and read the user manual.
</span>
</p>
<p>
<span class="rfc2119-assertion" id="common-constraints-links-media-types-7">
If a Consumer encounters a link with "rel": "item" and "type": "application/td+json" and is capable of rendering a
hierarchical tree of Things, then it should interpret the link as an indication that the target is a sub-Thing of
the
current Thing and render this in a meaningful way to the user.
</span>
</p>
<p>
<span class="rfc2119-assertion" id="common-constraints-links-media-types-8">
If a Consumer encounters a link with "rel": "collection" and "type": "application/td+json" and is capable of
rendering a
hierarchical tree of Things, then it should interpret the link as an indication that the target describes a Thing
(e.g.
a group, system of Things or Thing Directory) which contains the current Thing and render this in a meaningful way
to
the user.
</span>
</p>
</section>
<!-- Errors -->
<section id="common-constraints-errors">
<h3 id="error-responses">Errors</h3>
<p>
<span class="rfc2119-assertion" id="common-constraints-errors-1">
If any of the operations defined in the protocol bindings of HTTP
profiles are unsuccessful then the Web Thing MUST send an HTTP
response with an HTTP error code which describes the reason for the
failure.</span>
</p>
<div class="rfc2119-assertion" id="common-constraints-errors-2">
<p>
It is RECOMMENDED that error
responses use one of the following HTTP error codes:
</p>
<ul>
<li><code>400 Bad Request</code></li>
<li><code>401 Unauthorized</code></li>
<li><code>403 Forbidden</code></li>
<li><code>404 Not Found</code></li>
<li><code>500 Internal Server Error</code></li>
<li><code>503 Service Unavailable</code></li>
</ul>
</div>
<p>
<span class="rfc2119-assertion" id="common-constraints-errors-3">
A Web Thing MAY respond with 3xx status codes for the purposes of
redirection, caching or authentication.</span>
<span class="rfc2119-assertion" id="common-constraints-errors-4">
A Web Thing MUST NOT respond with a <code>300 Multiple Choices</code>
status code.</span>
</p>
<p>
<span class="rfc2119-assertion" id="common-constraints-errors-5">
Web Things MAY respond with other valid HTTP error codes
(e.g. <code>418 I'm a teapot</code>).</span>
<span class="rfc2119-assertion" id="common-constraints-errors-6">
Consumers MAY interpret other valid HTTP error codes as a generic <code>4xx</code> or <code>5xx</code>
error with no special defined behaviour.</span>
</p>
<p>
<span class="rfc2119-assertion" id="common-constraints-errors-7">
If an HTTP error response contains a body, the content of that body
MUST conform with the Problem Details format [[RFC7807]].</span>
</p>
</section>
<!-- Default Language -->
<section id="sec-default-language">
<h2>Default Language</h2>
<p><span class="rfc2119-assertion" id="common-constraints-default-language">
One Map contained in an <code>@context Array</code> MUST contain a name-value pair
that defines the default language for the Thing Description,
where the name is the Term <code>@language</code> and the value
is a well-formed language tag as defined by [BCP47]
(e.g., en, de-AT, gsw-CH, zh-Hans, zh-Hant-HK, sl-nedis).</span>
</span>
</section>
</section>
<!-- HTTP Basic Profile -->
<section id="http-basic-profile">
<h2>HTTP Basic Profile</h2>
<p>This section defines the HTTP Basic Profile, which includes a
<a href="#http-basic-profile-protocol-binding">Protocol Binding</a>
for reading and writing properties and invoking, querying and cancelling
actions.
</p>
<p>This profile may be used in conjunction with the
<a href="#sec-http-sse-profile">HTTP SSE Profile</a> or the
<a href="#sec-http-webhook-profile">HTTP Webhook Profile</a> in order to provide
operations for observing properties and listening for events.
</p>
<p>
<span class="rfc2119-assertion" id="http-basic-profile-1">
In order to conform with the HTTP Basic Profile, Web Things and
Consumers MUST also conform with all of the assertions in the
<a href="#common-constraints">Common Constraints</a>
section.
</span>
</p>
<!-- Identifier -->
<section id="http-basic-profile-identifier">
<h2>Identifier</h2>
<p><span class="rfc2119-assertion" id="http-basic-profile-identifier-1">
In order to denote that a given
<a href="https://www.w3.org/TR/wot-architecture/#dfn-thing">Web Thing</a>
conforms to the HTTP Basic Profile, its Thing Description MUST have a
<a href="https://w3c.github.io/wot-thing-description/#thing">
<code>profile</code></a> member [[wot-thing-description11]] with a value
of <code>https://www.w3.org/2022/wot/profile/http-basic/v1</code>.</span>
</p>
</section>
<!-- Protocol Binding -->
<section id="http-basic-profile-protocol-binding">
<h3>Protocol Binding</h3>
<p>
This section defines a protocol binding which describes how a
<a href="https://www.w3.org/TR/wot-architecture/#dfn-consumer">Consumer</a>
communicates with a
<a href="https://www.w3.org/TR/wot-architecture/#dfn-thing">Web Thing</a>
[[wot-architecture11]] using JSON [[JSON]] payloads over
the HTTP [[HTTP11]] protocol.
</p>
<p>
<span class="rfc2119-assertion" id="profile-5-2-thing-protocol-binding-1">
A Consumer or Web Thing conforming to the HTTP Basic Profile
MUST implement this protocol binding.
</span>
</p>
<p>
The examples provided throughout this section describe how a Consumer
would communicate with a Web Thing which produces the following Thing
Description:
</p>
<pre class="example">
{
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"id": "https://mywebthingserver.com/things/lamp",
"profile": "https://www.w3.org/2022/wot/profile/http-basic/v1",
"base": "https://mywebthingserver.com/things/lamp/",
"title": "My Lamp",
"description": "A web connected lamp",
"securityDefinitions": {
"oauth2": {
"scheme": "oauth2",
"flow": "code",
"authorization": "https://mywebthingserver.com/oauth/authorize",
"token": "https://mywebthingserver.com/oauth/token"
}
},
"security": "oauth2",
"properties": {
"on": {
"type": "boolean",
"title": "On/Off",
"description": "Whether the lamp is turned on",
"forms": [{"href": "properties/on"}]
},
"level" : {
"type": "integer",
"title": "Brightness",
"description": "The level of light from 0-100",
"unit": "percent",
"minimum" : 0,
"maximum" : 100,
"forms": [{"href": "properties/level"}]
}
},
"actions": {
"fade": {
"title": "Fade",
"description": "Fade the lamp to a given level",
"synchronous": false,
"input": {
"type": "object",
"properties": {
"level": {
"title": "Brightness",
"type": "integer",
"minimum": 0,
"maximum": 100,
"unit": "percent"
},
"duration": {
"title": "Duration",
"type": "integer",
"minimum": 0,
"unit": "milliseconds"
}
}
},