Skip to content

Commit 3424169

Browse files
committed
Fix definition of node objects in JSON-LD grammar
This addresses #114 and #196.
1 parent 4687456 commit 3424169

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,43 +2752,44 @@ <h3>Node Object</h3>
27522752

27532753
<ul>
27542754
<li>it does not contain the <code>@value</code>, <code>@list</code>,
2755-
or <code>@set</code> keywords, or</li>
2755+
or <code>@set</code> keywords, and</li>
27562756
<li>it does not contain the <code>@graph</code> keyword and is
27572757
the top-most <tref>JSON object</tref> in the JSON-LD document.
27582758
</ul>
27592759

27602760
<p>The <tref title="property">properties</tref> of a <tref>node</tref> in
2761-
the <tref>JSON-LD graph</tref> may be spread among different
2761+
a <tref>JSON-LD graph</tref> may be spread among different
27622762
<tref title="node object">node objects</tref> within a document. When
27632763
that happens, the keys of the different
27642764
<tref title="node object">node objects</tref> are merged to create the
27652765
properties of the resulting <tref>node</tref>.</p>
27662766

2767-
<p>A <tref>node object</tref> MUST be a <tref>JSON object</tref> that contains
2768-
one or more key-value pairs. All keys which are not <tref title="IRI">IRIs</tref>,
2767+
<p>A <tref>node object</tref> MUST be a <tref>JSON object</tref>. All keys
2768+
which are not <tref title="IRI">IRIs</tref>,
27692769
<tref title="compact IRI">compact IRIs</tref>, <tref title="term">terms</tref>
27702770
valid in the <tref>active context</tref>, or one of the following
27712771
<tref title="keyword">keywords</tref> MUST be ignored when processed:</p>
27722772

27732773
<ul>
27742774
<li><code>@context</code>,</li>
27752775
<li><code>@graph</code>,</li>
2776-
<li><code>@id</code>, or</li>
2777-
<li><code>@type</code></li>
2776+
<li><code>@id</code>,</li>
2777+
<li><code>@type</code>, or</li>
2778+
<li><code>@annotation</code></li>
27782779
</ul>
27792780

27802781
<p>If the <tref>node object</tref> contains the <code>@context</code>
27812782
key, its value MUST be one of the following:</p>
27822783
<ul>
2784+
<li><tref>null</tref>,</li>
27832785
<li>an <tref>IRI</tref>,</li>
27842786
<li>a <tref>context definition</tref>, or</li>
27852787
<li>an <tref>array</tref> composed of any number of the previous two expressions.</li>
27862788
</ul>
27872789

27882790
<p>If the <tref>node object</tref> contains the <code>@id</code> key,
2789-
its value MUST be
2790-
an <tref>IRI</tref>,
2791-
a <tref>compact IRI</tref> (including <tref title="blank node identifier">blank node identifiers</tref>), or
2791+
its value MUST be an <tref>IRI</tref>, a <tref>compact IRI</tref>
2792+
(including <tref title="blank node identifier">blank node identifiers</tref>), or
27922793
a <tref>term</tref> defined in the <tref>active context</tref> expanding
27932794
into an <tref>IRI</tref> or a <tref>blank node identifier</tref>.
27942795
See <a href="#node-identifiers"></a>, <a href="#compact-iris"></a>,
@@ -2811,17 +2812,21 @@ <h3>Node Object</h3>
28112812
If the <tref>node object</tref> contains an <code>@id</code> keyword,
28122813
its value is used as the label of a named graph.
28132814
See <a href="#named-graphs"></a> for further discussion on
2814-
<code>@graph</code> values.</p>
2815-
2816-
<p class="note">As a special case, if a <tref>JSON object</tref> contains no
2817-
keys other than <code>@graph</code> and <code>@context</code>, and the
2815+
<code>@graph</code> values. As a special case, if a <tref>JSON object</tref>
2816+
contains no keys other than <code>@graph</code> and <code>@context</code>, and the
28182817
<tref>JSON object</tref> is the root of the JSON-LD document, the
28192818
<tref>JSON object</tref> is not treated as a <tref>node object</tref>; this
28202819
is used as a way of defining <tref title="node object">node
28212820
definitions</tref> that may not form a connected graph. This allows a
28222821
<tref>context</tref> to be defined which is shared by all of the constituent
28232822
<tref title="node object">node objects</tref>.</p>
28242823

2824+
<p>If the <tref>node object</tref> contains the <code>@annotation</code> key,
2825+
its value MUST be a <tref>string</tref>. See section
2826+
<a href="#data-annotations"></a> for further discussion on <code>@annotation</code>
2827+
values.</p>
2828+
2829+
28252830
<p>Keys in a <tref>node object</tref> that are not
28262831
<tref title="keyword">keywords</tref> MUST expand to an <tref>absolute IRI</tref>
28272832
using the <tref>active context</tref>. The values associated with these keys

0 commit comments

Comments
 (0)