Skip to content
57 changes: 40 additions & 17 deletions spec/latest/json-ld-api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2547,14 +2547,12 @@ <h3>Algorithm</h3>
<li>If the <a>term definition</a> is <code>null</code>,
<a>term</a> cannot be selected during <a>compaction</a>,
so continue to the next <a>term</a>.</li>
<li>Initialize <em>container</em> to <code>@none</code>. If
<li>Initialize <em>container</em> to <code>@none</code>.
<span class="changed">
the <a>container mapping</a> in <a>term definition</a>
includes <code>@id</code>, <code>@index</code>,
<code>@language</code>, <code>@list</code>, <code>@type</code>, or
<code>@set</code> in that order</span>
set <em>container</em> to
<span class="changed">the first such value found</span>.</li>
If the <a>container mapping</a> is not empty, set <em>container</em>
to the concatenation of all values of the <a>container mapping</a>
in lexicographically order
</span>.</li>
<li>Initialize <em>iri</em> to the value of the <a>IRI mapping</a>
for the <a>term definition</a>.</li>
<li>If <em>iri</em> is not a key in <em>result</em>, add
Expand Down Expand Up @@ -2720,8 +2718,8 @@ <h3>Algorithm</h3>
a <a>term</a>, based on what is compatible with <em>value</em>.</li>
<li>If <em>value</em> is a <a class="changed">dictionary</a>,
that contains the key <code>@index</code>,
<span class="changed">and <a data-link-for="JsonLdOptions">processingMode</a> is <code>json-ld-1.0</code></span>
then append the value <code>@index</code> to <em>containers</em>.</span></li>
<span class="changed">and <em>value</em> is not a <a>graph object</a></span>
then append the values <code>@index</code> <span class="changed">and <code>@index@set</code></span> to <em>containers</em>.</span></li>
<li>If <em>reverse</em> is <code>true</code>, set <em>type/language</em>
to <code>@type</code>, <em>type/language value</em> to
<code>@reverse</code>, and append <code>@set</code> to <em>containers</em>.</li>
Expand Down Expand Up @@ -2786,31 +2784,56 @@ <h3>Algorithm</h3>
</ol>
</li>
<li class="changed">Otherwise, if <em>value</em> is a <a>graph object</a>,
prefer a mapping most appropriate for the particular value.
<ol class="algorithm">
<li>If value contains the key <code>@index</code>,
append the values <code>@graph@index</code> and <code>@graph@index@set</code>
to <em>containers</em>.</li>
<li>If the value contains the key <code>@id</code>,
append the values <code>@graph@id</code> and <code>@graph@id@set</code>
to <em>containers</em>.</li>
<li>Append the values <code>@graph</code> and <code>@graph@set</code>
to <em>containers</em>.</li>
<li>If value does not contain the key <code>@index</code>,
append the values <code>@graph@index</code> and <code>@graph@index@set</code>
to <em>containers</em>.</li>
<li>If the value does not contain the key <code>@id</code>,
append the values <code>@graph@id</code> and <code>@graph@id@set</code>
to <em>containers</em>.</li>
<li>Append the values <code>@index</code> and <code>@index@set</code>
to <em>containers</em>.</li>
</ol>
</li>
append <code>@graph</code>, <code>@id</code>, <code>@index</code> and <code>@set</code> to <em>containers</em>.</li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this line supposed to be removed due to additions above?

<li>Otherwise:
<ol class="algorithm">
<li>If <em>value</em> is a <a>value object</a>:
<ol class="algorithm">
<li class="changed">If <a data-link-for="JsonLdOptions">processingMode</a> is <code>json-ld-1.1</code>,
append <code>@language</code> and <code>@index</code> to <em>containers</em>.</li>
<li>If <em>value</em> contains the key <code>@language</code>
and does not contain the key <code>@index</code>,
then set <em>type/language value</em> to its associated
value and,
<span class="changed">if <a data-link-for="JsonLdOptions">processingMode</a> is <code>json-ld-1.0</code></span>,
append <code>@language</code> to
value and, append <code>@language</code>
<span class="changed">and <code>@language@set</code></span> to
<em>containers</em>.</li>
<li>Otherwise, if <em>value</em> contains the key
<code>@type</code>, then set <em>type/language value</em> to
its associated value and set <em>type/language</em> to
<code>@type</code>.</li>
<li class="changed">Otherwise, if <em>value</em>
does not contain the key <code>@index</code>, append <code>@language</code>
and <code>@language@set</code> to
<em>containers</em>.</li>
</ol>
</li>
<li>Otherwise, set <em>type/language</em> to <code>@type</code>
and set <em>type/language value</em> to <code>@id</code>,
<span class="changed">and if <a data-link-for="JsonLdOptions">processingMode</a></span>
is <code>json-ld-1.1</code>, append <code>@id</code>, <code>@type</code>,
and <code>@index</code> to <em>containers</em>.</li>
<span class="changed">and append <code>@id</code>, <code>@id@set</code>,
<code>@type</code>, and <code>@type@set</code></span>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ordered as @set@type? (Also, does that appear anywhere else in doc?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, lexicographically.

to <em>containers</em>.</li>
<li class="changed">
If value does not contain the key <code>@index</code>, append
<code>@index</code> and <code>@index@set</code> to <em>containers</em>.
</li>
<li>Append <code>@set</code> to <em>containers</em>.</li>
</ol>
</li>
Expand Down
2 changes: 1 addition & 1 deletion test-suite/tests/error-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
"@id": "#tp007",
"@type": ["jld:NegativeEvaluationTest", "jld:CompactTest"],
"name": "@prefix is not allowed in 1.0",
"purpose": "@prefix is not allowed in a term definitionin 1.0",
"purpose": "@prefix is not allowed in a term definition 1.0",
"option": {"processingMode": "json-ld-1.0", "specVersion": "json-ld-1.1"},
"input": "error-p007-in.jsonld",
"context": "error-p007-context.jsonld",
Expand Down