@@ -815,7 +815,7 @@ <h3>JSON vs YAML comparison</h3>
815815 {
816816 "@context": "https://schema.org",
817817
818- "@id": "https://w3.org /yaml-ld/",
818+ "@id": "https://w3c.github.io /yaml-ld/",
819819 "@type": "WebContent",
820820 "name": "YAML-LD",
821821 "author": {
@@ -840,7 +840,7 @@ <h3>JSON vs YAML comparison</h3>
840840 <!--
841841 "@context": https://schema.org
842842
843- "@id": https://w3.org /yaml-ld/
843+ "@id": https://w3c.github.io /yaml-ld/
844844 "@type": WebContent
845845 name: YAML-LD
846846 author:
@@ -1216,67 +1216,69 @@ <h2>Scalar Value Types</h2>
12161216 < h2 > JSON literals</ h2 >
12171217
12181218 < p >
1219- A < a data-cite ="JSON-LD11#json-literals "> JSON literal</ a > is represented by a
1220- < a > value object</ a > with < code > @type</ code > < code > @json</ code >
1221- (in expanded form), and arbitrary data in its `@value`.
1222- In a YAML-LD document, the `@value` need not look like
1223- < a data-cite ="RFC8259#section-2 "> JSON text</ a > ; idiomatic YAML and JSON-like flow can
1224- yield the same literal after parsing to an
1225- < a data-cite ="JSON-LD11-API#dfn-internal-representation "> internal representation</ a >
1226- and processing as in [[JSON-LD11]].
1219+ The < code > @json</ code > keyword from JSON-LD 1.1 defines a < a data-cite ="JSON-LD11#dfn-json-literal "> JSON literal</ a > as a < a > value object</ a > with
1220+ < code > @type</ code > < code > @json</ code > and < code > @value</ code > containing JSON data. A processor treats such a value as a JSON literal, rather than
1221+ interpreting it further as JSON-LD. Consider the following example.
12271222 </ p >
12281223
12291224 < pre class ="example yaml "
12301225 data-transform ="updateExample "
12311226 data-content-type ="application/ld+yaml "
1232- title ="YAML-LD WebContent with JSON literal (idiomatic YAML under @value) ">
1227+ title ="JSON literal metadata about YAML-LD specification ">
12331228 <!--
12341229 "@context":
1235- "@version": 1.1
1236- schema: https://schema.org/
1237- profile: https://w3c.github.io/yaml-ld/vocab#processorProfile
1238- "@id": https://w3.org/yaml-ld/
1239- "@type": schema:WebContent
1240- name: YAML-LD
1241- profile:
1230+ metadata: https://example.org/vocab#metadata
1231+ "@id": https://w3c.github.io/yaml-ld/
1232+ metadata:
12421233 "@type": "@json"
12431234 "@value":
12441235 jsonLd: "1.1"
12451236 yaml: "1.2"
12461237 defaultProfile: "basic"
1247- testSuite: " https://w3c.github.io/yaml-ld/tests/"
1238+ testSuite: https://w3c.github.io/yaml-ld/tests/
12481239 -->
12491240 </ pre >
12501241
1251- < pre class ="example yaml "
1242+ < p >
1243+ Consider the expanded form.
1244+ </ p >
1245+
1246+ < pre class ="example json "
12521247 data-transform ="updateExample "
1253- data-content-type ="application/ld+yaml "
1254- title ="YAML-LD WebContent with JSON literal (flow @value) ">
1248+ data-content-type ="application/ld+json "
1249+ title ="Expanded JSON literal metadata about YAML-LD specification ">
12551250 <!--
1256- "@context":
1257- "@version": 1.1
1258- schema: https://schema.org/
1259- profile: https://w3c.github.io/yaml-ld/vocab#processorProfile
1260- "@id": https://w3.org/yaml-ld/
1261- "@type": schema:WebContent
1262- name: YAML-LD
1263- profile:
1264- "@type": "@json"
1265- "@value": {jsonLd: "1.1", yaml: "1.2", defaultProfile: "basic", testSuite: "https://w3c.github.io/yaml-ld/tests/"}
1251+ [
1252+ {
1253+ "@id": "https://w3c.github.io/yaml-ld/",
1254+ "https://example.org/vocab#metadata": [
1255+ {
1256+ "@type": "@json",
1257+ "@value": {
1258+ "jsonLd": "1.1",
1259+ "yaml": "1.2",
1260+ "defaultProfile": "basic",
1261+ "testSuite": "https://w3c.github.io/yaml-ld/tests/"
1262+ }
1263+ }
1264+ ]
1265+ }
1266+ ]
12661267 -->
12671268 </ pre >
12681269
12691270 < p >
1270- Authors may use JSON-shaped YAML flow for the literal's < code > @value</ code > when
1271- readers or tools are expected to see JSON-like text.
1271+ Although the keyword is named < code > @json</ code > , it does not require the
1272+ value of < code > @value</ code > to be written using JSON syntax in YAML-LD. As this example shows, the metadata
1273+ value object is preserved during expansion in its JSON-LD form, — as this keyword mandates.
12721274 </ p >
12731275
12741276 < p >
1275- When is converted as RDF, the JSON literal's lexical form is
1277+ When it is converted to RDF, the JSON literal's lexical form is
12761278 < a data-cite ="RFC8259#section-2 "> JSON text</ a > reconstructed from the
1277- < a data-cite ="JSON-LD11-API#dfn-internal-representation "> internal representation</ a > ;
1278- that is separate from how the literal is written in YAML.
1279+ < a data-cite ="JSON-LD11-API#dfn-internal-representation "> internal representation</ a > .
12791280 </ p >
1281+
12801282 </ section >
12811283 </ section >
12821284
@@ -1370,7 +1372,7 @@ <h2>Streams</h2>
13701372 title ="YAML-LD with several documents in one file ">
13711373 <!--
13721374 "@base": https://schema.org
1373- "@id": https://w3.org /yaml-ld/
1375+ "@id": https://w3c.github.io /yaml-ld/
13741376 "@type": WebContent
13751377 name: YAML-LD
13761378 ---
@@ -1644,7 +1646,7 @@ <h2>Specify node <code>@type</code></h2>
16441646 %TAG !xsd! http://www.w3.org/2001/XMLSchema%23
16451647 ---
16461648 "@context": https://schema.org
1647- "@id": https://w3.org /yaml-ld/
1649+ "@id": https://w3c.github.io /yaml-ld/
16481650 dateModified: !xsd:date 2023-06-26
16491651 </ pre >
16501652
0 commit comments