Skip to content

Commit b169d8a

Browse files
committed
Add a section on keywords to the grammar, and slight improvement to type values.
1 parent 3502c17 commit b169d8a

File tree

1 file changed

+174
-4
lines changed

1 file changed

+174
-4
lines changed

index.html

Lines changed: 174 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ <h2>Syntax Tokens and Keywords</h2>
542542
<dt class="changed"><code>@nest</code></dt><dd class="changed">Collects a set of <a>nested properties</a> within
543543
a <a>node object</a>.</dd>
544544
<dt class="changed"><code>@none</code></dt><dd class="changed">Used as an index value
545-
in an <a>id map</a>, <a>language map</a>, <a>type map</a>, or elsewhere where a dictionary is
545+
in an <a>index map</a>, <a>id map</a>, <a>language map</a>, <a>type map</a>, or elsewhere where a dictionary is
546546
used to index into other values.</dd>
547547
<dt class="changed"><code>@prefix</code></dt><dd class="changed">
548548
With the value <a>true</a>, allows this <a>term</a> to be used to construct a <a>compact IRI</a>
@@ -2668,7 +2668,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
26682668
<p>Since keywords cannot be redefined, they can also not be aliased to
26692669
other keywords.</p>
26702670

2671-
<p class="note">Aliased keywords may not be used within a <a>context</a>, itself.</p>
2671+
<p class="note">Aliased keywords MUST NOT be used within a <a>context</a>, itself.</p>
26722672
</section>
26732673

26742674
<section class="informative"><h2>IRI Expansion within a Context</h2>
@@ -3114,7 +3114,7 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
31143114
</pre>
31153115
</aside>
31163116

3117-
<p>The <em>modified</em> key's value above is automatically type coerced to a
3117+
<p>The <em>modified</em> key's value above is automatically type interpreted as a
31183118
<em>dateTime</em> value because of the information specified in the
31193119
<code>@context</code>. The example tabs show how a <a>JSON-LD processor</a> will interpret the data.</p>
31203120

@@ -3191,7 +3191,8 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
31913191

31923192
<p class="note">The <code>@type</code> <a>keyword</a> is also used to associate a type
31933193
with a <a>node</a>. The concept of a <a>node type</a> and
3194-
a <a>value type</a> are different.</p>
3194+
a <a>value type</a> are different.
3195+
For more on adding types to <a>nodes</a>, see <a class="sectionRef" href="#specifying-the-type"></a>.</p>
31953196

31963197
<p>A <dfn>node type</dfn> specifies the type of thing
31973198
that is being described, like a person, place, event, or web page. A
@@ -9242,6 +9243,175 @@ <h2>Context Definitions</h2>
92429243
<p>See <a class="sectionRef" href="#the-context"></a> for further discussion on contexts.</p>
92439244
</section>
92449245

9246+
<section class="normative changed">
9247+
<h2>Keywords</h2>
9248+
<p>JSON-LD <a>keywords</a> are described in <a class="sectionRef" href="#syntax-tokens-and-keywords"></a>,
9249+
this section describes where each <a>keyword</a> may appear within different JSON-LD structures.</p>
9250+
9251+
<dl data-sort>
9252+
<dt><code>@base</code></dt><dd>
9253+
The <code>@base</code> keyword MUST NOT be aliased, and MAY be used as a key in a <a>context definition</a>.
9254+
Its value MUST be an <a>absolute IRI</a>, a <a>relative IRI</a>, or <a>null</a>.
9255+
</dd>
9256+
<dt><code>@container</code></dt><dd>
9257+
The <code>@container</code> keyword MUST NOT be aliased, and MAY be used as a key in an <a>expanded term definition</a>.
9258+
Its value MUST be either
9259+
<code>@list</code>,
9260+
<code>@set</code>,
9261+
<code>@language</code>,
9262+
<code>@index</code>,
9263+
<span><code>@id</code></span>,
9264+
<span><code>@graph</code></span>,
9265+
<span><code>@type</code></span>, or be
9266+
<a>null</a>,
9267+
or an <a>array</a> containing exactly any one of those keywords, or a
9268+
combination of <code>@set</code> and any of <code>@index</code>,
9269+
<code>@id</code>, <code>@graph</code>, <code>@type</code>,
9270+
<code>@language</code> in any order.
9271+
The value may also be an array
9272+
containing <code>@graph</code> along with either <code>@id</code> or
9273+
<code>@index</code> and also optionally including <code>@set</code>.</span>
9274+
</dd>
9275+
<dt><code>@context</code></dt><dd>
9276+
The <code>@context</code> keyword MUST NOT be aliased, and MAY be used as a key in the following objects:</p>
9277+
<ul data-sort>
9278+
<li><a>node objects</a> (see <a class="sectionRef" href="#node-objects"></a>),</li>
9279+
<li><a>value objects</a> (see <a class="sectionRef" href="#value-objects"></a>),</li>
9280+
<li><a>graph objects</a> (see <a class="sectionRef" href="#graph-objects"></a>),</li>
9281+
<li><a>list objects</a> (see <a class="sectionRef" href="#lists-and-sets"></a>),</li>
9282+
<li><a>set objects</a> (see <a class="sectionRef" href="#lists-and-sets"></a>),</li>
9283+
<li><a>nested properties</a> (see <a class="sectionRef" href="#property-nesting"></a>), and</li>
9284+
<li><a>expanded term definitions</a> (see <a class="sectionRef" href="#context-definitions"></a>).</li>
9285+
</ul>
9286+
The value of <code>@context</code> MUST be
9287+
<a>null</a>,
9288+
an <a>absolute IRI</a>,
9289+
a <a>relative IRI</a>,
9290+
a <a>context definition</a>, or
9291+
an <a>array</a> composed of any of these.
9292+
</dd>
9293+
<dt><code>@id</code></dt><dd>
9294+
The <code>@id</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a> or a <a>graph object</a>.
9295+
The unaliased <code>@id</code> MAY be used as a key in an <a>expanded term definition</a>,
9296+
or as the value of the <code>@container</code> key within an <a>expanded term definition</a>.
9297+
The value of the <code>@id</code> key MUST be an <a>absolute IRI</a>, a <a>relative IRI</a>,
9298+
or a <a>compact IRI</a> (including <a>blank node identifiers</a>).
9299+
See <a class="sectionRef" href="#node-identifiers"></a>,
9300+
<a class="sectionRef" href="#compact-iris"></a>, and
9301+
<a class="sectionRef" href="#identifying-blank-nodes"></a> for further discussion on
9302+
<code>@id</code> values.
9303+
</dd>
9304+
<dt><code>@index</code></dt><dd>
9305+
The <code>@index</code> keyword MAY be aliased and MAY be used as a key in a
9306+
<a>node object</a>, <a>value object</a>, <a>graph object</a>, <a>set object</a>, or <a>list object</a>.
9307+
The unaliased <code>@index</code> MAY be used as the value of the <code>@container</code> key within an <a>expanded term definition</a>.
9308+
Its value MUST be a <a>string</a>.
9309+
See <a class="sectionRef" href="#index-maps"></a> for a further discussion.
9310+
</dd>
9311+
<dt><code>@language</code></dt><dd>
9312+
The <code>@language</code> keyword MAY be aliased and MAY be used as a key in a <a>value object</a>.
9313+
The unaliased <code>@language</code> MAY be used as a key in a <a>context definition</a>,
9314+
or as the value of the <code>@container</code> key within an <a>expanded term definition</a>.
9315+
Its value MUST be a <a>string</a> with the <a data-cite="BCP47#section-2.1.1">lexical form</a> described in [[BCP47]] or be <a>null</a>..
9316+
See <a class="sectionRef" href="#index-maps"></a> for a further discussion.
9317+
</dd>
9318+
<dt><code>@list</code></dt><dd>
9319+
The <code>@list</code> keyword MAY be aliased and MUST be used as a key in a <a>list object</a>.
9320+
The unaliased <code>@list</code> MAY be used as the value of the <code>@container</code> key within an <a>expanded term definition</a>.
9321+
Its value MUST be one of the following:
9322+
<ul>
9323+
<li><a>string</a>,</li>
9324+
<li><a>number</a>,</li>
9325+
<li><a>true</a>,</li>
9326+
<li><a>false</a>,</li>
9327+
<li><a>null</a>,</li>
9328+
<li><a>node object</a>,</li>
9329+
<li><a>value object</a>, or</li>
9330+
<li>an <a>array</a> of zero or more of the above possibilities</li>
9331+
</ul>
9332+
9333+
<p>See <a class="sectionRef" href="#sets-and-lists"></a> for further discussion on sets and lists.</p>
9334+
</dd>
9335+
<dt><code>@nest</code></dt><dd>
9336+
The <code>@nest</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a>.
9337+
The unaliased <code>@nest</code> MAY be used as the value of a <a>simple term definition</a>,
9338+
or as a key in an <a>expanded term definition</a>.
9339+
When used in a <a>node object</a>, its value must be a <a>dictionary</a>.
9340+
When used in an <a>expanded term definition</a>, its value MUST be a term expanding to <code>@nest</code>.
9341+
Its value MUST be a <a>string</a>.
9342+
See <a class="sectionRef" href="#property-nesting"></a> for a further discussion.
9343+
</dd>
9344+
<dt><code>@none</code></dt><dd>
9345+
The <code>@none</code> keyword MAY be aliased and MAY beused as a key in an
9346+
<a>index map</a>, <a>id map</a>, <a>language map</a>, <a>type map</a>.
9347+
See <a class="sectionRef" href="#data-indexing"></a>,
9348+
<a class="sectionRef" href="#language-indexing"></a>,
9349+
<a class="sectionRef" href="#node-identifier-indexing"></a>,
9350+
<a class="sectionRef" href="#node-type-indexing"></a>,
9351+
<a class="sectionRef" href="#named-graph-indexing"></a>, or
9352+
<a class="sectionRef" href="#named-graph-data-indexing"></a>
9353+
for a further discussion.</dd>
9354+
<dt><code>@prefix</code></dt><dd>
9355+
The <code>@prefix</code> keyword MUST NOT be aliased, and MAY be used as a key in an <a>expanded term definition</a>.
9356+
Its value MUST be <code>true</code> or <code>false</code>.
9357+
See <a class="sectionRef" href="#compact-iris"></a>
9358+
and <a class="sectionRef" href="#context-definitions"></a>
9359+
for a further discussion.
9360+
</dd>
9361+
<dt><code>@reverse</code></dt><dd>
9362+
The <code>@reverse</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a>.
9363+
The unaliased <code>@reverse</code> MAY be used as a key in an <a>expanded term definition</a>.
9364+
The value of the <code>@reverse</code> key MUST be an <a>absolute IRI</a>, a <a>relative IRI</a>,
9365+
or a <a>compact IRI</a> (including <a>blank node identifiers</a>).
9366+
See <a class="sectionRef" href="#reverse-properties"></a> and
9367+
<a class="sectionRef" href="#context-definitions"></a> for further discussion.
9368+
</dd>
9369+
<dt><code>@set</code></dt><dd>
9370+
The <code>@set</code> keyword MAY be aliased and MUST be used as a key in a <a>set object</a>.
9371+
The unaliased <code>@set</code> MAY be used as the value of the <code>@container</code> key within an <a>expanded term definition</a>.
9372+
Its value MUST be one of the following:
9373+
<ul>
9374+
<li><a>string</a>,</li>
9375+
<li><a>number</a>,</li>
9376+
<li><a>true</a>,</li>
9377+
<li><a>false</a>,</li>
9378+
<li><a>null</a>,</li>
9379+
<li><a>node object</a>,</li>
9380+
<li><a>value object</a>, or</li>
9381+
<li>an <a>array</a> of zero or more of the above possibilities</li>
9382+
</ul>
9383+
9384+
<p>See <a class="sectionRef" href="#sets-and-lists"></a> for further discussion on sets and lists.</p>
9385+
</dd>
9386+
<dt><code>@type</code></dt><dd>
9387+
The <code>@type</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a> or a <a>value object</a>.
9388+
The unaliased <code>@type</code> MAY be used as a key in an <a>expanded term definition</a>,
9389+
or as the value of the <code>@container</code> key within an <a>expanded term definition</a>.
9390+
The value of the <code>@type</code> key MUST be a <a>term</a>, <a>absolute IRI</a>, a <a>relative IRI</a>,
9391+
or a <a>compact IRI</a> (including <a>blank node identifiers</a>).
9392+
Within an expanded term definition, its value may also be either <code>@id</code> or <code>@vocab</code>.
9393+
This keyword is described further in <a class="sectionRef" href="#specifying-the-type"></a>
9394+
and <a class="sectionRef" href="#typed-values"></a>.
9395+
</dd>
9396+
<dt><code>@value</code></dt><dd>
9397+
The <code>@value</code> keyword MAY be aliased and MUST be used as a key in a <a>value object</a>.
9398+
Its value key MUST be either a <a>string</a>, a <a>number</a>, <a>true</a>, <a>false</a> or <a>null</a>.
9399+
This keyword is described further in <a class="sectionRef" href="#value-objects"></a>.
9400+
</dd>
9401+
<dt><code>@version</code></dt><dd>
9402+
The <code>@version</code> keyword MUST NOT be aliased and MAY be used as a key in a <a>context definition</a>.
9403+
Its value MUST be a <a>number</a> with the value <code>1.1</code>.
9404+
This keyword is described further in <a class="sectionRef" href="#context-definitions"></a>.
9405+
</dd>
9406+
<dt><code>@vocab</code></dt><dd>
9407+
The <code>@vocab</code> keyword MUST NOT be aliased and MAY be used as a key in a <a>context definition</a>
9408+
or as the value of <code>@type</code> in an <a>expanded term definition</a>.
9409+
Its value MUST be a <a>absolute IRI</a>, a <a>compact IRI</a>, a <a>blank node identifier</a>, an empty <a>string</a> (""), a <a>term</a>, or <a>null</a>.
9410+
This keyword is described further in <a class="sectionRef" href="#context-definitions"></a>,
9411+
and <a class="sectionRef" href="#default-vocabulary"></a>.
9412+
</dd>
9413+
</dl>
9414+
</section>
92459415
</section>
92469416

92479417
<section class="normative">

0 commit comments

Comments
 (0)