Skip to content

Commit 9f92754

Browse files
committed
Describe how to handle a remote context that is not a valid IRI (not absolute) when it can't be resolved against _base URL_, because it is also not a valid IRI.
Update `expand()` to pass the _original base URL_ from the current _active context_ when creating a new _active context_ using _expandContext_. Fixes #373.
1 parent cca90b1 commit 9f92754

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,10 @@ <h3>Algorithm</h3>
12361236
<li id="alg-context-string">If <var>context</var> is a <a>string</a>,
12371237
<ol>
12381238
<li>Initialize <var>context</var> to the result of resolving <var>context</var> against
1239-
<var>base URL</var>.
1239+
<var>base URL</var>. If <var>base URL</var> is not a valid <a>IRI</a>,
1240+
then <var>context</var> MUST be a valid <a>IRI</a>, otherwise
1241+
a <a data-link-for="JsonLdErrorCode">loading document failed</a> error
1242+
has been detected and processing is aborted.
12401243
<div class="note">
12411244
<var>base URL</var> is often not the same as {{JsonLdOptions/base}}
12421245
or the <a>base IRI</a> of the <var>active context</var>.
@@ -5754,9 +5757,9 @@ <h3>Algorithm</h3>
57545757
<li>If the {{JsonLdOptions/expandContext}} option in <a data-lt="jsonldprocessor-expand-options">options</a> is set,
57555758
update the <var>active context</var> using the <a href="#context-processing-algorithm">Context Processing algorithm</a>,
57565759
passing the {{JsonLdOptions/expandContext}} as <var>local context</var>
5757-
and {{JsonLdOptions/expandContext}} as <var>base URL</var>.
5760+
and the <a>original base URL</a> from <var>active context</var> as <var>base URL</var>.
57585761
If {{JsonLdOptions/expandContext}} is a <a class="changed">map</a> having an <code>@context</code> <a>entry</a>,
5759-
pass that <a data-lt="entry">entry's</a> value instead.</li>
5762+
pass that <a data-lt="entry">entry's</a> value instead for <var>local context</var>.</li>
57605763
<li>If <var>remote document</var> has a {{RemoteDocument/contextUrl}},
57615764
update the <var>active context</var> using the <a href="#context-processing-algorithm">Context Processing algorithm</a>,
57625765
passing the {{RemoteDocument/contextUrl}} as <var>local context</var>,

0 commit comments

Comments
 (0)