-
Notifications
You must be signed in to change notification settings - Fork 4
/
927.txt
142 lines (95 loc) · 5.57 KB
/
927.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
[15] [[基底URI]] からの相対的な位置関係によってあらわされる [[URI]]。 Relative URI。
[16] 太古の昔には部分 (partial) URI とも呼ばれました。
[17] 現在では相対 URI は [[scheme]] によらない一般構文が定められていますから、基底 URI と相対 URI が与えられれば機械的に[[絶対URI]] に変換できます。
[18]
類似の用語:
- [CODE(math)[[DFN[[[相対URL]]]] := 相対 URI ∧ [[URL]]]]
- [CODE(ABNF)[[DFN[[[相対URI参照]]]] := [ [[相対URI]] ]
["#" [ [[素片識別子]] ] ] ]]
[19] [[BNF]] では [CODE(ABNF)[[[relativeURI]]]] などと表されることが多いです。
* 特別な相対 URL の解決
[5] 本来の [[URL]] の仕様上は[[相対URL]]の[[解決]]は [[URL scheme]]
に依存しない演算のはずですが、実際には [[URL scheme]] ごとに独自の[[解決]]の方法が規定されていることがあります。
[3] [CODE(URI)@en[[[jar:]]]] は [CODE(URI)[[[!]]]] の扱いを特別に定めています。
[4] [CODE(URI)@en[[[smb:]]]] は[[作業グループ]]と[[鯖]]に関する [CODE(URI)[..][.. (URL)]]
の扱いを特別に定めています。
* その他 URL scheme ごとの事情
[14] [CODE(URI)@en[[[gopher:]]]] でも[[相対URL]]を使うことができ、
特別扱いもされてはいませんが、 [CODE(URI)@en[[[gopher:]]]] [[URL]]
の定義上、 [CODE(URI)[[[/]]]] は [CODE(URI)@en[[[http:]]]]
のような階層的な意味を持たないので、[[相対URL]]はあまり有用ではありません。
;; [CODE(URI)@en[[[gopher:]]]] 参照。
* 歴史
** RFC 1808
[11] [DFN[[[RFC 1808]]]] は[[相対URL]]を規定していた [[RFC]] です。
[12] [[RFC 2396]] により[[更新]] (事実上[[廃止]]) され、 [[RFC 3986]]
により[[廃止]]されました。
;; [13] [[RFC 2396]] との関係については、 [[RFC 2396]] の項を参照。
* 関連
[6] [[相対URL]]のうち、[[素片識別子]]のないものを[[部分URL]]といいます。
[8] [[Atom]] は[[リンク関係型]]として[[相対URL]]のごく一部を使うことを認めていました。
これは [[IANA]] の [[URL]] の省略形を意味していました。
[7] [[CURIE]] や[[簡潔IRI]]は[[相対URL]]と見かけは似ていますが、全く異なるものです。
[9] [[WebDAV]] では[[単純参照]]として限定的な[[相対URL]]が用いられています。
;; [10] [[単純参照]]では [CODE[.]] と [CODE[..]] が禁止されています。
* メモ
[1]
[SAMP(URI)@en[http://foo.example/a/..]]
と
[SAMP(URI)@en[http://foo.example/a/../]]
は[[基底URI]] としても[[等価]]では''ありません''。
[[相対参照]] [SAMP(URI)@en[b]] を[[解決]]すると、それぞれ
[SAMP(URI)@en[http://foo.example/a/b]]
と
[SAMP(URI)@en[http://foo.example/b]]
になります。
参考:
[CITE@en[URL resolution sanity check]]
<mid:42DCF11E.2060503@metalab.unc.edu>
(uri@w3 のスレ)
([[名無しさん]] [sage])
[2]
[CITE[ITmedia News:ニフティ、動画にコメント付けられる「ニフニフ動画」]] ([CODE[2007-06-11 22:16:55 +09:00]] 版) <http://www.itmedia.co.jp/news/articles/0706/11/news039.html>
[PRE(HTML example code)[
<noscript>
<img src="//secure-jp.imrworldwide.com/cgi-bin/m?ci=itmedia&cg=0" alt="">
</noscript>
]PRE]
[20] [CITE@en['''['''css-values''']''' Per WG resolution, define that empty urls must resolve t…]]
( ([[tabatkins]]著, [TIME[2016-06-09 06:49:56 +09:00]]))
<https://github.com/w3c/csswg-drafts/commit/e0518924c87638861e6b89cc303667b9421cf152>
[21] [CITE@en['''['''css-values''']''' Move empty URL section out of the way of normal readers.…]]
( ([[fantasai]]著, [TIME[2016-06-09 07:48:15 +09:00]]))
<https://github.com/w3c/csswg-drafts/commit/5f598ec4785ad42e018e081fcb9d50e80ae1d48f>
[22] [CITE@en[Allow URLs without fragments]]
([[annevk]]著, [TIME[2016-07-28 16:35:31 +09:00]])
<https://github.com/whatwg/url/commit/f88f96fe4922cb7223f327cb41db613e4b11207c>
[23] [CODE(math)[[DFN[[RUBYB[相対][relative]] URI [RUBYB[参照][reference]]]] := ¬[[絶対URI参照]] ∩ [[URI参照]]]]
[FIG(quote)[
[FIGCAPTION[
[24] [CITE[RDF::Helper - search.cpan.org]]
([TIME[2016-10-19 20:52:01 +09:00]])
<http://search.cpan.org/dist/RDF-Helper/lib/RDF/Helper.pm>
]FIGCAPTION]
> If specified, this option sets what the base URI will be when working with so called abbreviated URIs, like #me. If you do not specify an explicit base_uri option, then one will be created automatically for you. See http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-ID-xml-base for more information on abbreviated URIs.
]FIG]
[25] [CITE@en[Editorial: give URL syntax components their own terms]]
([[annevk]]著, [TIME[2016-11-01 00:05:41 +09:00]])
<https://github.com/whatwg/url/commit/451696e4297c4c676fae21dbc926aeafb2477e6c>
[FIG(quote)[
[FIGCAPTION[
[26] [CITE@en[Activity Streams 2.0]]
([TIME[2017-05-21 23:50:36 +09:00]])
<https://w3c.github.io/activitystreams/core/#h-urls>
]FIGCAPTION]
> Relative IRI (and URL) references should not be used within an Activity Streams 2.0 document due to the fact that many JSON parser implementations are not capable of reliably preserving the base context necessary to properly resolve relative references.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[27] [CITE[VRML97, ISO/IEC 14772-1:1997 -- 3 Definitions]]
([TIME[2014-01-31 07:20:50 +09:00]])
<https://www.web3d.org/documents/specifications/14772/V2.0/part1/glossary.html#RURL>
]FIGCAPTION]
> 3.86 RURL
> Relative Uniform Resource Locator.
]FIG]