Skip to content

Commit a6799a8

Browse files
committed
Update syntax spec to include @type: @vocab
This addresses #204.
1 parent 04fc1cf commit a6799a8

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ <h2>IRIs</h2>
694694
<code>@id</code> or <code>@type</code>.</li>
695695
<li>An <tref>IRI</tref> is generated for the <tref>string</tref> value of any key for which there
696696
are <tref>coercion</tref> rules that contain a <code>@type</code> key that is
697-
set to a value of <code>@id</code>.</li>
697+
set to a value of <code>@id</code> or <code>@vocab</code>.</li>
698698
</ol>
699699
</section>
700700

@@ -1097,9 +1097,18 @@ <h2>Type Coercion</h2>
10971097

10981098
<p>Type coercion is specified within an <tref>expanded term definition</tref>
10991099
using the <code>@type</code> key. The value of this key expands to an <tref>IRI</tref>.
1100-
Alternatively, the <tref>keyword</tref> <code>@id</code> may be used as value to indicate
1101-
that within the body of a JSON-LD document, a string value of a <tref>term</tref> coerced to
1102-
<code>@id</code> is to be interpreted as an <tref>IRI</tref>.</p>
1100+
Alternatively, the <tref title="keyword">keywords</tref> <code>@id</code> or <code>@vocab</code> may be used
1101+
as value to indicate that within the body of a JSON-LD document, a <tref>string</tref> value of a
1102+
<tref>term</tref> coerced to <code>@id</code> or <code>@vocab</code> is to be interpreted as an
1103+
<tref>IRI</tref>. The difference between <code>@id</code> and <code>@vocab</code> is how values are expanded
1104+
to <tref title="absolute IRI">absolute IRIs</tref>. <code>@vocab</code> first tries to expand the value
1105+
by interpreting it as <tref>term</tref>. If no matching <tref>term</tref> is found in the
1106+
<tref>active context</tref>, it tries to expand it as <tref>compact IRI</tref> or <tref>absolute IRI</tref>
1107+
if there's a colon in the value; otherwise, it will expand the value using the
1108+
<tref title="active context">active context's</tref> vocabulary mapping, if present, or by interpreting it
1109+
as <tref>relative IRI</tref>. Values coerced to <code>@id</code> in contrast are expanded as
1110+
<tref>compact IRI</tref> or <tref>absolute IRI</tref> if a colon is present; otherwise, they are interpreted
1111+
as <tref>relative IRI</tref>.
11031112

11041113
<p><tref title="term">Terms</tref> or <tref title="compact_iri">compact IRIs</tref> used as the value of a
11051114
<code>@type</code> key may be defined within the same context. This means that one may specify a
@@ -2889,7 +2898,9 @@ <h2>Context Definition</h2>
28892898
or the <tref>active context</tref>, or an <tref>array</tref> composed of any of the previous allowed values except
28902899
<tref>null</tref>.</p>
28912900
<p>If the <tref>expanded term definition</tref> contains the <code>@type</code> <tref>keyword</tref>,
2892-
its value MUST be an <tref>absolute IRI</tref>, a <tref>compact IRI</tref>, a <tref>term</tref> defined in the defining <tref>context definition</tref> or the <tref>active context</tref>, or the <code>@id</code> <tref>keyword</tref>.</p>
2901+
its value MUST be an <tref>absolute IRI</tref>, a <tref>compact IRI</tref>, a <tref>term</tref> defined in the
2902+
defining <tref>context definition</tref> or the <tref>active context</tref>, <tref>null</tref>, or the one of the
2903+
<tref title="keyword">keywords</tref> <code>@id</code> or <code>@vocab</code>.</p>
28932904
<p>If the <tref>expanded term definition</tref> contains the <code>@language</code> <tref>keyword</tref>,
28942905
its value MUST have the lexical form described in [[!BCP47]] or be <tref>null</tref>.</p>
28952906
<p>If the <tref>expanded term definition</tref> contains the <code>@container</code> <tref>keyword</tref>,

0 commit comments

Comments
 (0)