@@ -1213,10 +1213,20 @@ <h3>Algorithm</h3>
1213
1213
Continue with the next < var > context</ var > .
1214
1214
< div class ="note "> In [[[JSON-LD10]]], the < a > base IRI</ a > was given
1215
1215
a default value here; this is now described conditionally
1216
- in < a href ="#the-application-programming-interface " class ="sectionRef "> </ a > .</ div > </ li >
1217
- </ ol >
1216
+ in the {{JsonLdOptions/base}} option
1217
+ of the < a href ="#the-application-programming-interface " class ="sectionRef "> </ a > .
1218
+ </ div >
1219
+ </ li >
1220
+ </ ol >
1218
1221
</ li >
1219
- < li > If < var > context</ var > is a < a > string</ a > ,
1222
+ < li id ="alg-context-string "> If < var > context</ var > is a < a > string</ a > ,
1223
+ < div class ="note ">
1224
+ In order to prevent being overly prescriptive,
1225
+ this algorithm makes no statement about how internal state is kept for dereferenced context documents
1226
+ and broadly applies error handling checks.
1227
+ Provided that the output of the algorithm is unchanged,
1228
+ implementations may employ optimizations.
1229
+ </ div >
1220
1230
< ol >
1221
1231
< li > Initialize < var > context</ var > to the result of resolving < var > context</ var > against
1222
1232
the < a > base IRI</ a >
@@ -1232,7 +1242,15 @@ <h3>Algorithm</h3>
1232
1242
references are treated in the same way that unreserved
1233
1243
characters are treated in URI references, per
1234
1244
< a data-cite ="RFC3987#section-6.5 "> section 6.5</ a >
1235
- of [[RFC3987]].</ li >
1245
+ of [[RFC3987]].
1246
+ < div class ="note ">
1247
+ The < a > base IRI</ a > of the document containing the < var > local context</ var >
1248
+ is often not the same as {{JsonLdOptions/base}}
1249
+ or the < a > base IRI</ a > of the < var > active context</ var > .
1250
+ Processors are responsible for retaining the {{RemoteDocument/documentUrl}}
1251
+ for documents being processed via this algorithm for use in resolving < var > context</ var > .
1252
+ </ div >
1253
+ </ li >
1236
1254
< li > If the number of entries in the < var > remote contexts</ var > array
1237
1255
exceeds a processor defined limit, a
1238
1256
< a data-link-for ="JsonLdErrorCode "> context overflow</ a >
@@ -1241,20 +1259,25 @@ <h3>Algorithm</h3>
1241
1259
< li class ="changed "> If < var > context</ var > was previously dereferenced,
1242
1260
then the processor MUST NOT do a further dereference, and
1243
1261
< a > context</ a > is set to the
1244
- previously established < a > internal representation</ a > .</ li >
1262
+ previously established < a > internal representation</ a > .
1263
+ < div class ="note "> Only the `@context` < a > entry</ a > need be retained.</ div >
1264
+ </ li >
1245
1265
< li class ="changed "> Otherwise, dereference < var > context</ var > using
1246
1266
the < a > LoadDocumentCallback</ a > , passing < var > context</ var >
1247
1267
for < a data-link-for ="LoadDocumentCallback "> url</ a > ,
1248
1268
and < code > http://www.w3.org/ns/json-ld#context</ code > for < a data-link-for ="LoadDocumentOptions "> profile</ a >
1249
- and for < a data-link-for ="LoadDocumentOptions "> requestProfile</ a > .</ li >
1250
- < li > If < var > context</ var > cannot be dereferenced,
1251
- < span class ="changed "> or cannot be transformed into the < a > internal representation</ a > </ span > ,
1252
- a < a data-link-for ="JsonLdErrorCode "> loading remote context failed</ a >
1253
- error has been detected and processing is aborted. If the dereferenced document has no
1254
- top-level < a class ="changed "> map</ a > with an < code > @context</ code > < a > entry</ a > , an
1255
- < a data-link-for ="JsonLdErrorCode "> invalid remote context</ a >
1256
- has been detected and processing is aborted; otherwise,
1257
- set < var > context</ var > to the value of that < a > entry</ a > .</ li >
1269
+ and for < a data-link-for ="LoadDocumentOptions "> requestProfile</ a > .
1270
+ < ol >
1271
+ < li id ="alg-context-deref-error "> If < var > context</ var > cannot be dereferenced,
1272
+ < span class ="changed "> or cannot be transformed into the < a > internal representation</ a > </ span > ,
1273
+ a < a data-link-for ="JsonLdErrorCode "> loading remote context failed</ a >
1274
+ error has been detected and processing is aborted. If the dereferenced document has no
1275
+ top-level < a class ="changed "> map</ a > with an < code > @context</ code > < a > entry</ a > , an
1276
+ < a data-link-for ="JsonLdErrorCode "> invalid remote context</ a >
1277
+ has been detected and processing is aborted.</ li >
1278
+ < li > Otherwise, set < var > context</ var > to the value of that < a > entry</ a > .</ li >
1279
+ </ ol >
1280
+ </ li >
1258
1281
< li > Set < var > result</ var > to the result of recursively calling this algorithm,
1259
1282
passing < var > result</ var > for < var > active context</ var > ,
1260
1283
< var > context</ var > for < var > local context</ var > , and < span class ="changed "> a copy of</ span > < var > remote contexts</ var > .</ li >
@@ -6992,6 +7015,10 @@ <h2>Changes since Candidate Release of 12 December 2019</h2>
6992
7015
</ li >
6993
7016
< li > Other changes:
6994
7017
< ul >
7018
+ < li > Added explanitory notes to step < a href ="#alg-context-string "> 5.2</ a >
7019
+ of < a href ="#context-processing-algorithm " class ="sectionRef "> </ a > ,
7020
+ and moved the former step 5.2.5 to < a href ="#alg-context-deref-error "> 5.2.4.1</ a > .
7021
+ This is in response to < a href ="https://github.com/w3c/json-ld-api/issues/265 "> Issue 265</ a > .</ li >
6995
7022
< li > Add `application/xhtml+xml` as an allowed media type in < a href ="#process-html " class ="sectionRef "> </ a > ,
6996
7023
in the note in < a href ="#loaddocumentcallback " class ="sectionRef "> </ a > ,
6997
7024
and as a use of the {{LoadDocumentOptions/profile}} API option.
0 commit comments