/
904.txt
190 lines (145 loc) · 7.25 KB
/
904.txt
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
[7] [DFN[[RUBYB[[[異体説明]]]@en[variant description]]]]は、[[異体資源]]の特徴を説明するものです。
* 仕様書
[REFS[
- [1] [CITE@en[RFC 2295 - Transparent Content Negotiation in HTTP]] ([TIME[2014-08-31 19:36:42 +09:00]] 版) <http://tools.ietf.org/html/rfc2295#page-7>
- [2] '''[CITE@en[RFC 2295 - Transparent Content Negotiation in HTTP]] ([TIME[2014-08-31 19:36:42 +09:00]] 版) <http://tools.ietf.org/html/rfc2295#section-5>'''
- [13] [CITE@en[RFC 2296 - HTTP Remote Variant Selection Algorithm -- RVSA/1.0]] ([TIME[2014-09-15 15:43:00 +09:00]] 版) <http://tools.ietf.org/html/rfc2296#section-3.1>
]REFS]
* 意味
[5] [[異体説明]]は、[[異体資源]]の[[機械可読]]な説明です [SRC[>>1, >>2]]。
[6] [[異体説明]]は、[[異体資源]]の [[URL]] と、
[[異体]]の[[特性]]を説明する種々の[[属性]]によって構成されます [SRC[>>1]]。
* 構文
[8] [[異体説明]]は、 [[URL]]、[[原始品質]]、0個以上の[[異体属性]]を連ねて
[CODE[[[{]]]] と [CODE[[[}]]]] で括ったものです。ただし [[URL]]
は [CODE[[["]]]] で括ったものです。 [SRC[>>1]]
[9] 仕様書の時代的に構文上明記されていませんが、 [[URL]] およびそれを括る [CODE["]]
や[[原始品質]]や[[異体属性]]の前後に[[空白]]を挿入することが認められていると思われます。
[FIG(railroad)[
= [CODE[[[{]]]]
= [[OWS]]
= [CODE[[["]]]]
= [[URL]]
= [CODE[[["]]]]
= [[OWS]]
= [[原始品質]]
= *
== [[OWS]]
== [[異体属性]]
= [[OWS]]
= [CODE[[[}]]]]
]FIG]
* URL
[3] [[異体説明]]の [[URL]] は、[[異体]]を [CODE(HTTP)@en[[[GET]]]] [[要求]]によって取得できる
[[URL]] を表します [SRC[>>2]]。
[10] [[絶対URL]]でも、[[要求URL]]に対する[[相対URL]]でも構いません [SRC[>>2]]。
[11] 指定された[[異体資源]]は[[要求]]に依存して変化するものであっても構いませんが、
それ自体が[[透過内容折衝]]によって変化するものであっては[['''なりません''']] [SRC[>>2]]。
[12] 仕様上は [[RFC 2068]] を通じて [[RFC 1738]] と [[RFC 1808]] が参照されています。
[[非ASCII文字]]は認められていません。
* フォールバック
[4] [CODE(HTTP)@en[[[Alternates:]]]] [[ヘッダー]]では[[変種説明]]の他に
「フォールバック」を指定できます。フォールバックは[[属性]]や[[品質値]]がなく、
[[URL]] だけが指定されたものです。
[FIG(railroad)[
= [CODE[[[{]]]]
= [[OWS]]
= [CODE[[["]]]]
= [[URL]]
= [CODE[[["]]]]
= [CODE[[[}]]]]
]FIG]
[14] [[RVSA/1.0]] では、フォールバックは[[品質値]]が低く[[異体属性]]がない[[異体説明]]とみなされます。
* 歴史
[FIG(quote)[
[FIGCAPTION[
[15] [[RFC 2295]] 2.2 抜粋
]FIGCAPTION]
>
:variant description:
A machine-readable description of a variant resource, usually found
in a variant list. A variant description contains the variant
resource URI and various attributes which describe properties of
the variant. Variant descriptions are defined in section 5.
[[変種資源]]の機械可読な記述で、通常[[変種一覧]]に見える。
変種記述は変種資源 [[URI]] とその[[変種]]の[[特性]]を記述する種々の[[属性]]からなる。
]FIG]
[FIG(quote)[
[FIGCAPTION[
[16] RFC 2295 (HTTP 透過内容折衝) 5 Variant descriptions
]FIGCAPTION]
* 5.1 Syntax
> A variant can be described in a machine-readable way with a variant description.
変種は、変種記述によって機械可読な方法で記述できます。
>
[PRE[
variant-description =
"{" <"> [[URI]] <"> source-quality *variant-attribute"}"
source-quality = [[qvalue]]
variant-attribute = "{" "type" [[media-type]] "}"
| "{" "charset" [[charset]] "}"
| "{" "language" 1#[[language-tag]] "}"
| "{" "length" 1*[[DIGIT]] "}"
| "{" "features" feature-list "}"
| "{" "description"
[[quoted-string]] [ [[language-tag]] ] "}"
| extension-attribute
extension-attribute = "{" extension-name extension-value "}"
extension-name = [[token]]
extension-value = *( token | quoted-string | [[LWS]]
| extension-specials )
extension-specials =
<any element of [[tspecials]] except <"> and "}">
]PRE]
> The feature-list syntax is defined in section 6.4.
[CODE(ABNF)[[[feature-list]]]] 構文は6.4節で定義します。
> Examples are
-[SAMP(conneg)[ {"paper.2" 0.7 {type text/html} {language fr}} ]]
-[SAMP(conneg)[ {"paper.5" 0.9 {type text/html} {features tables}} ]]
-[SAMP(conneg)[ {"paper.1" 0.001} ]]
> The various attributes which can be present in a variant description
are covered in the subsections below. Each attribute may appear only
once in a variant description.
*5.2 URI
→[CODE(WikiPage)[[[.//URI]>>1]]] 参照
*5.3 Source-quality
→[CODE(WikiPage)[[[.//source-quality]>>1]]] 参照
*5.4 Type, charset, language, and length
> The type attribute of a variant description carries the same
information as its Content-Type response header counterpart defined
in [1], except for any charset information, which MUST be carried in
the charset attribute. For, example, the header
>
- [SAMP(MIME)[Content-Type: text/html; charset=ISO-8859-4]]
> has the counterpart attributes
>
-[SAMP(conneg)[ {type text/html} {charset ISO-8859-4} ]]
> The language and length attributes carry the same information as
their Content-* response header counterparts in [1]. The length
attribute, if present, MUST thus reflect the length of the variant
alone, and not the total size of the variant and any objects inlined
or embedded by the variant.
> Though all of these attributes are optional, it is often desirable to
include as many attributes as possible, as this will increase the
quality of the negotiation process.
> Note: A server is not required to maintain a one-to-one
correspondence between the attributes in the variant description
and the Content-* headers in the variant response. For example,
if the variant description contains a language attribute, the
response does not necessarily have to contain a Content-Language
header. If a Content-Language header is present, it does not have
to contain an exact copy of the information in the language attribute.
*5.5 Features
→[CODE(WikiPage)[[[.//feature]>>1]]] 参照
*5.6 Description
→[CODE(WikiPage)[[[.//description]>>1]]] 参照
*5.7 Extension-attribute
> The extension-attribute allows future specifications to incrementally
define dimensions of negotiation which cannot be created by using the
feature negotiation framework, and eases content negotiation
experiments. In experimental situations, servers MUST ONLY generate
extension-attributes whose names start with "x-". User agents SHOULD
ignore all extension attributes they do not recognize. Proxies MUST
NOT run a remote variant selection algorithm if an unknown extension
attribute is present in the variant list.
]FIG]