/
remote-doc-manifest.jsonld
191 lines (191 loc) · 8.05 KB
/
remote-doc-manifest.jsonld
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
{
"@context": ["context.jsonld", {"@base": "remote-doc-manifest"}],
"@id": "",
"@type": "mf:Manifest",
"name": "Remote document",
"description": "These tests implement the requirements for JSON-LD [Remote Document and Context Retrieval](https://www.w3.org/TR/json-ld11-api/#remote-document-and-context-retrieval).",
"baseIri": "https://w3c.github.io/json-ld-api/tests/",
"sequence": [
{
"@id": "#t0001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "load JSON-LD document",
"purpose": "Document loader loads a JSON-LD document.",
"input": "remote-doc/0001-in.jsonld",
"expect": "remote-doc/0001-out.jsonld"
}, {
"@id": "#t0002",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "load JSON document",
"purpose": "Document loader loads a JSON document.",
"input": "remote-doc/0002-in.json",
"expect": "remote-doc/0002-out.jsonld"
}, {
"@id": "#t0003",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "load JSON document with extension-type",
"purpose": "Document loader loads a JSON document having an extension mime-subtype.",
"option": {
"contentType": "application/jldTest+json"
},
"input": "remote-doc/0003-in.jldt",
"expect": "remote-doc/0003-out.jsonld"
}, {
"@id": "#t0004",
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
"name": "loading an unknown type raises loading document failed",
"purpose": "Loading a document with a non-JSON mime type raises loading document failed",
"option": {
"contentType": "application/jldTest"
},
"input": "remote-doc/0004-in.jldte",
"expectErrorCode": "loading document failed"
}, {
"@id": "#t0005",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Load JSON-LD through 301 redirect",
"purpose": "Loading a document with a redirect should use the redirected URL as document base",
"option": {
"redirectTo": "remote-doc/0001-in.jsonld",
"httpStatus": 301
},
"input": "remote-doc/0005-in.jsonld",
"expect": "remote-doc/0001-out.jsonld"
}, {
"@id": "#t0006",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Load JSON-LD through 303 redirect",
"purpose": "Loading a document with a redirect should use the redirected URL as document base",
"option": {
"redirectTo": "remote-doc/0001-in.jsonld",
"httpStatus": 303
},
"input": "remote-doc/0006-in.jsonld",
"expect": "remote-doc/0001-out.jsonld"
}, {
"@id": "#t0007",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Load JSON-LD through 307 redirect",
"purpose": "Loading a document with a redirect should use the redirected URL as document base",
"option": {
"redirectTo": "remote-doc/0001-in.jsonld",
"httpStatus": 307
},
"input": "remote-doc/0007-in.jsonld",
"expect": "remote-doc/0001-out.jsonld"
}, {
"@id": "#t0008",
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
"name": "Non-existant file (404)",
"purpose": "Loading a non-existant file raises loading document failed error",
"input": "remote-doc/missing-in.jsonld",
"expectErrorCode": "loading document failed"
}, {
"@id": "#t0009",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "load JSON-LD document with link",
"purpose": "If a context is specified in a link header, it is not used for JSON-LD.",
"option": {
"httpLink": "<0009-context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\""
},
"input": "remote-doc/0009-in.jsonld",
"expect": "remote-doc/0009-out.jsonld"
}, {
"@id": "#t0010",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "load JSON document with link",
"purpose": "If a context is specified in a link header, it is used for JSON.",
"option": {
"httpLink": "<0010-context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\""
},
"input": "remote-doc/0010-in.json",
"expect": "remote-doc/0010-out.jsonld"
}, {
"@id": "#t0011",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "load JSON document with extension-type with link",
"purpose": "If a context is specified in a link header, it is used for a JSON extension type.",
"input": "remote-doc/0011-in.jldt",
"option": {
"contentType": "application/jldTest+json",
"httpLink": "<0011-context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\""
},
"expect": "remote-doc/0011-out.jsonld"
}, {
"@id": "#t0012",
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
"name": "Multiple context link headers",
"purpose": "Loading a file when multiple link headers are returned is an error",
"option": {
"httpLink": [
"<0012-context1.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"",
"<0012-context2.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\""
]
},
"input": "remote-doc/0012-in.json",
"expectErrorCode": "multiple context link headers"
}, {
"@id": "#t0013",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "load JSON document with link to HTML document",
"purpose": "If a context is specified in a link header, it is used for JSON, extracting from HTML.",
"option": {
"httpLink": "<0013-context.html>; rel=\"http://www.w3.org/ns/json-ld#context\""
},
"input": "remote-doc/0013-in.json",
"expect": "remote-doc/0013-out.jsonld"
}, {
"@id": "#tla01",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Redirects if type is text/html",
"purpose": "Load an alternate link if type is not ld+json and rel=alternate.",
"option": {
"httpLink": "<la01-alternate.jsonld>; rel=\"alternate\"; type=\"application/ld+json\""
},
"input": "remote-doc/la01-in.html",
"expect": "remote-doc/la01-out.jsonld"
}, {
"@id": "#tla02",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Does not redirect if type is application/ld+json",
"purpose": "Load an alternate link if type is not ld+json and rel=alternate.",
"option": {
"httpLink": "<la02-alternate.jsonld>; rel=\"alternate\"; type=\"application/ld+json\"",
"processorFeature": "HTML Script Extraction"
},
"input": "remote-doc/la02-in.jsonld",
"expect": "remote-doc/la02-out.jsonld"
}, {
"@id": "#tla03",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Does not redirect if link type is not application/ld+json",
"purpose": "Load an alternate link if type is not ld+json and rel=alternate.",
"option": {
"httpLink": "<la03-alternate.json>; rel=\"alternate\"; type=\"application/json\""
},
"input": "remote-doc/la03-in.json",
"expect": "remote-doc/la03-out.jsonld"
}, {
"@id": "#tla04",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Does not redirect if type is application/json",
"purpose": "Load an alternate link if type is not ld+json and rel=alternate.",
"option": {
"httpLink": "<la04-alternate.jsonld>; rel=\"alternate\"; type=\"application/ld+json\""
},
"input": "remote-doc/la04-in.json",
"expect": "remote-doc/la04-out.jsonld"
}, {
"@id": "#tla05",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Base is that of the alternate URL",
"purpose": "Load an alternate link if type is not ld+json and rel=alternate.",
"option": {
"httpLink": "<la05-alternate.jsonld>; rel=\"alternate\"; type=\"application/ld+json\"",
"processorFeature": "HTML Script Extraction"
},
"input": "remote-doc/la05-in.html",
"expect": "remote-doc/la05-out.jsonld"
}
]
}