You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/latest/json-ld-syntax/index.html
+16-5Lines changed: 16 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -694,7 +694,7 @@ <h2>IRIs</h2>
694
694
<code>@id</code> or <code>@type</code>.</li>
695
695
<li>An <tref>IRI</tref> is generated for the <tref>string</tref> value of any key for which there
696
696
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>
698
698
</ol>
699
699
</section>
700
700
@@ -1097,9 +1097,18 @@ <h2>Type Coercion</h2>
1097
1097
1098
1098
<p>Type coercion is specified within an <tref>expanded term definition</tref>
1099
1099
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 <treftitle="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 <treftitle="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
+
<treftitle="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>.
1103
1112
1104
1113
<p><treftitle="term">Terms</tref> or <treftitle="compact_iri">compact IRIs</tref> used as the value of a
1105
1114
<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>
2889
2898
or the <tref>active context</tref>, or an <tref>array</tref> composed of any of the previous allowed values except
2890
2899
<tref>null</tref>.</p>
2891
2900
<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
+
<treftitle="keyword">keywords</tref><code>@id</code> or <code>@vocab</code>.</p>
2893
2904
<p>If the <tref>expanded term definition</tref> contains the <code>@language</code><tref>keyword</tref>,
2894
2905
its value MUST have the lexical form described in [[!BCP47]] or be <tref>null</tref>.</p>
2895
2906
<p>If the <tref>expanded term definition</tref> contains the <code>@container</code><tref>keyword</tref>,
0 commit comments