Skip to content

Commit 36d5a44

Browse files
committed
Use an _original base URL_ member of an _active context_ to record the original documentUrl containing the top-most context. This is initialized in expand() and when a _local context_ is null.
1 parent 616b482 commit 36d5a44

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

index.html

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ <h2>RDF Serialization/Deserialization</h2>
10701070
<li>the active <a>term definitions</a> which specify how
10711071
keys and values have to be interpreted (<a>array</a> of <a>term definitions</a>),</li>
10721072
<li>the current <a>base IRI</a> (<a>IRI</a>),</li>
1073+
<li class="changed">the <dfn>original base URL</dfn> (<a>IRI</a>),</li>
10731074
<li>an optional <a>vocabulary mapping</a> (<a>IRI</a>),</li>
10741075
<li>an optional <a>default language</a> (<a>string</a>),</li>
10751076
<li class="changed">an optional <a>default base direction</a> (`"ltr"` or `"rtl"`),</li>
@@ -1154,6 +1155,15 @@ <h3>Overview</h3>
11541155
it may be rolled back when a new <a>node object</a> is entered.
11551156
By default, all contexts are propagated, other than <a>type-scoped contexts</a>.</p>
11561157

1158+
<p class="changed">
1159+
When an <a>active context</a> is initialized, the value
1160+
of the <a>original base URL</a>
1161+
is initialized from the original {{RemoteDocument/documentUrl}}
1162+
of the document containing the initial <a>context</a>.
1163+
This is necessary when resetting the <a>active context</a>
1164+
by setting it to `null`
1165+
to retain the original default <a>base IRI</a>.</p>
1166+
11571167
<p>Then, for every other <a>entry</a> in <a>local context</a>, we update
11581168
the <a>term definition</a> in <var>result</var>. Since
11591169
<a>term definitions</a> in a <a>local context</a>
@@ -1211,15 +1221,13 @@ <h3>Algorithm</h3>
12111221
contains any <a>protected</a> <a>term definitions</a>,
12121222
an <a data-link-for="JsonLdErrorCode">invalid context nullification</a>
12131223
has been detected and processing is aborted.</li>
1214-
<li>Otherwise, initialize <var>result</var> as a
1215-
newly-initialized <var>active context</var>,
1224+
<li>Initialize <var>result</var> as a
1225+
newly-initialized <a>active context</a>,
12161226
<span class="changed">setting <a>previous context</a> in <var>result</var>
1217-
to the previous value of <var>result</var> if <var>propagate</var> is <code>false</code></span>
1218-
and <a>base IRI</a> to the value of the {{JsonLdOptions/base}} option
1219-
of the <a href="#the-application-programming-interface" class="sectionRef"></a>,
1220-
if provided, otherwise to <var>base URL</var>.
1221-
Continue with the next <var>context</var>.
1222-
</li>
1227+
to the previous value of <var>result</var> if <var>propagate</var> is <code>false</code>
1228+
and both <a>base IRI</a> and <a>original base URL</a> to the value of
1229+
<a>original base URL</a> in <var>active context</var></span>.</li>
1230+
<li>Continue with the next <var>context</var>.</li>
12231231
</ol>
12241232
</li>
12251233
<li id="alg-context-string">If <var>context</var> is a <a>string</a>,
@@ -5750,7 +5758,7 @@ <h3>Algorithm</h3>
57505758
If {{RemoteDocument/document}} cannot be transformed to the <a>internal representation</a>,
57515759
reject <var>promise</var> passing a <a data-link-for="JsonLdErrorCode">loading document failed</a> error.</li>
57525760
<li>Initialize a new empty <var>active context</var>.
5753-
The <a>base IRI</a> of the <var>active context</var> is set to the {{RemoteDocument/documentUrl}}
5761+
The <a>base IRI</a> and <a>original base URL</a> of the <var>active context</var> is set to the {{RemoteDocument/documentUrl}}
57545762
from <var>remote document</var>, if available;
57555763
otherwise to <code>null</code>.
57565764
If set, the {{JsonLdOptions/base}} option from <a data-lt="jsonldprocessor-expand-options">options</a> overrides the <a>base IRI</a>.</li>

0 commit comments

Comments
 (0)