Skip to content

Commit 67d96d1

Browse files
committed
Update Term Rank algorithm to add parantheses to bind terms together to remove ambiguity.
Add issue marker in compact algorithm for @list compaction, as the wording is incorrect (IMO).
1 parent 3aeab9c commit 67d96d1

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

spec/latest/json-ld-api/index.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,20 +1476,20 @@ <h3>Term Rank Algorithm</h3>
14761476
<ol class="algorithm">
14771477
<li>If <em>value</em> has a <code>@value</code> property:
14781478
<ol class="algorithm">
1479-
<li>If <em>value</em> has a <code>@type</code> property matching a
1479+
<li>If <em>value</em> has a <code>@type</code> property: if that type matches a
14801480
<code>@type</code> coercion for <em>term</em>, <tref>term rank</tref>
14811481
is <code>3</code>, otherwise if <em>term</em> has no <code>@type</code>
14821482
coercion and no <code>@language</code>, <tref>term rank</tref> is
14831483
<code>1</code>, otherwise <code>0</code>.</li>
1484-
<li>Otherwise, if <code>@value</code> is not a <tref>string</tref>, if <em>term</em> has
1484+
<li>Otherwise, if <code>@value</code> is not a <tref>string</tref>: if <em>term</em> has
14851485
no <code>@type</code> or <code>@language</code> it is <code>2</code>, otherwise <code>1</code>.</li>
1486-
<li>Otherwise, if <em>value</em> has no <code>@language</code> property, if <em>term</em> has
1487-
<code>@language</code> <tref>null</tref>, or <em>term</em> has no <code>@type</code> or
1488-
<code>@language</code> and the <tref>active context</tref> has no <code>@language</code>,
1486+
<li>Otherwise, if <em>value</em> has no <code>@language</code> property: if <em>term</em> has
1487+
<code>@language</code> <tref>null</tref> or ((<em>term</em> has no <code>@type</code> or
1488+
<code>@language</code>) and the <tref>active context</tref> has no <code>@language</code>),
14891489
<tref>term rank</tref> is <code>3</code>, otherwise <code>0</code>.</li>
14901490
<li>Otherwise, if <em>value</em> has a <code>@language</code> property matching a
1491-
<code>@language</code> definition for <em>term</em> (or
1492-
<em>term</em> has no <code>@type</code> or <code>@language</code> definition and
1491+
<code>@language</code> definition for <em>term</em> or
1492+
((<em>term</em> has no <code>@type</code> or <code>@language</code> definition) and
14931493
<code>@language</code> in the <tref>active context</tref> matches the
14941494
<em>value</em> <code>@language</code>), <tref>term rank</tref> is
14951495
<code>3</code>, otherwise if <em>term</em> has no <code>@type</code>
@@ -1803,7 +1803,13 @@ <h3>Compaction Algorithm</h3>
18031803
that the result is an array with all <tref>null</tref> values removed. If there already exists a value for
18041804
<tref>active property</tref> in <em>element</em> and the full IRI of <em>property</em> is also coerced to
18051805
<code>@list</code>, return an error. Otherwise store the resulting array as value of <tref>active property</tref>
1806-
if empty or <em>property</em> otherwise.</li>
1806+
if empty or <em>property</em> otherwise.
1807+
<div class="issue">
1808+
This language is incorrect, since the current element contains only <code>@list</code>. It seems that
1809+
the intention is for when there is no term match, and we fall back on the full IRI, it's an
1810+
error if the full IRI term was defined with a list coercion.
1811+
</div>
1812+
</li>
18071813
<li>Otherwise, construct <em>output</em> as a new <tref>JSON object</tref> used for returning the result
18081814
of compacting <em>element</em>. For each <em>property</em> and <em>value</em> in <em>element:</em>
18091815
<ol class="algorithm">

0 commit comments

Comments
 (0)