Skip to content

Commit 2577df6

Browse files
committed
Use rdf:JSON instead of jsonld:JSON.
1 parent 63cbf70 commit 2577df6

24 files changed

+69
-52
lines changed

index.html

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,6 @@ <h2>RDF Serialization/Deserialization</h2>
894894
<th>IRI</th>
895895
</tr></thead>
896896
<tbody>
897-
<tr>
898-
<td>jsonld</td>
899-
<td>http://www.w3.org/ns/json-ld#</td>
900-
</tr>
901897
<tr>
902898
<td>rdf</td>
903899
<td>http://www.w3.org/1999/02/22-rdf-syntax-ns#</td>
@@ -4260,12 +4256,17 @@ <h3>Algorithm</h3>
42604256
<li class="changed">If <var>item</var> has a <code>@language</code>
42614257
<a>member</a> which is not <a>well-formed</a>, return <code>null</code>.</li>
42624258
<li class="changed">If <var>datatype</var> is <code>@json</code>,
4263-
convert <var>value</var> to the <a>canonical lexical form</a> as defined in [[JCS]]
4259+
convert <var>value</var> to the <a>canonical lexical form</a>
42644260
using the result of transforming the <a>internal representation</a> of <var>value</var>
4265-
to JSON and set <var>datatype</var> to <code>jsonld:JSON</code>.
4266-
<div class="issue atrisk">JCS is still in draft form, and normatively requiring
4267-
JSON canonicalization may be removed in a future draft, or
4268-
a JSON-LD specific canonicalization form may be defined.</div></li>
4261+
to JSON and set <var>datatype</var> to <code>rdf:JSON</code>.
4262+
<div class="issue atrisk">The JSON Canonicalization Scheme [[?JCS]]
4263+
is an emerging standard for JSON canonicalization
4264+
not yet ready to be referenced.
4265+
When a JSON canonicalization standard becomes available,
4266+
this specification will likely be updated to require such a canonical representation.
4267+
Users are cautioned from depending on the
4268+
<a>JSON literal</a> lexical representation as an <a>RDF literal</a>,
4269+
as the specifics of serialization may change in a future revison of this document.</div></li>
42694270
<li>If <var>value</var> is <code>true</code> or
42704271
<code>false</code>, set <var>value</var> to the <a>string</a>
42714272
<code>true</code> or <code>false</code> which is the
@@ -4583,7 +4584,7 @@ <h3>Overview</h3>
45834584
<a>value objects</a> whereas <a>IRIs</a> and
45844585
<a>blank node identifiers</a> are
45854586
transformed to <a>node objects</a>.
4586-
<span class="changed">Literals with datatype <code>jsonld:JSON</code>
4587+
<span class="changed">Literals with datatype <code>rdf:JSON</code>
45874588
are transformed into a value object using the internal representation
45884589
based on the lexical-to-value mapping defined in
45894590
<a data-cite="JSON-LD11#dfn-json-datatype" class="externalDfn">JSON datatype</a> in [[JSON-LD11]],
@@ -4679,10 +4680,9 @@ <h2>Data Round Tripping</h2>
46794680
or not (the result of a modulo&#8209;1 operation), the boolean values
46804681
<code>true</code> and <code>false</code> are coerced to <code>xsd:boolean</code>,
46814682
and <a>strings</a> are coerced to <code>xsd:string</code>.
4682-
The <span class="changed">JSON, </span>numeric, or boolean values themselves are converted to
4683+
The <span class="changed">JSON</span>, numeric, or boolean values themselves are converted to
46834684
<dfn>canonical lexical form</dfn>, i.e., a deterministic string
4684-
representation as defined in [[XMLSCHEMA11-2]]
4685-
<span class="changed">and [[JCS]]</span>.
4685+
representation as defined in [[XMLSCHEMA11-2]].</p>
46864686

46874687
<p>The <a>canonical lexical form</a> of an <em>integer</em>, i.e., a
46884688
<a>number</a> with no non-zero fractional part or a <a>number</a>
@@ -4735,11 +4735,33 @@ <h2>Data Round Tripping</h2>
47354735
<code>true</code> and <code>false</code>.</p>
47364736

47374737
<p class="changed">The <a>canonical lexical form</a> of the <a>JSON literal</a>
4738-
values are defined in [[JCS]]. The internal representation
4739-
of value objects having @type @json are converted to JSON
4740-
and canonicalized to reduce unnecessary whitespace,
4741-
order object members, and use a standard representation
4742-
for strings and numbers.</p>
4738+
values are non-normative, as a normative recommendation for
4739+
JSON canonicalization is not yet defined. Implementations
4740+
SHOULD use the following guidelines when creating the lexical
4741+
representation of a <a>JSON literal</a>:</p>
4742+
<ul class="changed">
4743+
<li>Serialize JSON using no unnecessary whitespace,</li>
4744+
<li>Keys in objects SHOULD be ordered lexicographically,</li>
4745+
<li>Native Boolean and Numeric values SHOULD be serialized as described elsewhere in this section
4746+
for <a href="#deserialize-json-ld-to-rdf-algorithm">deserializing JSON-LD to RDF</a>,</li>
4747+
<li>Strings SHOULD be serialized with Unicode codepoints from <code>U+0000</code> through <code>U+001F</code>
4748+
using lowercase hexaddecimal Unicode notation (<code>\uhhhh</code>) unless in the set
4749+
of predefined JSON control characters <code>U+0008</code>, <code>U+0009</code>,
4750+
<code>U+000A</code>, <code>U+000C</code> or <code>U+000D</code>
4751+
which SHOULD be serialized as <code>\b</code>, <code>\t</code>, <code>\n</code>, <code>\f</code> and <code>\r</code> respectively.
4752+
All other Unicode characters SHOULD be serialized "as is", other than
4753+
<code>U+005C</code> (<code>\</code>) and <code>U+0022</code> (<code>"</code>)
4754+
which SHOULD be serialized as <code>\\</code> and <code>\"</code> respectively.</li>
4755+
</ul>
4756+
4757+
<p class="issue atrisk changed">The JSON Canonicalization Scheme [[?JCS]]
4758+
is an emerging standard for JSON canonicalization
4759+
not yet ready to be referenced.
4760+
When a JSON canonicalization standard becomes available,
4761+
this specification will likely be updated to require such a canonical representation.
4762+
Users are cautioned from depending on the
4763+
<a>JSON literal</a> lexical representation as an <a>RDF literal</a>,
4764+
as the specifics of serialization may change in a future revison of this document.</div>
47434765

47444766
<aside class="example changed" data-ignore
47454767
title="Canonicalized JSON literal">
@@ -4775,15 +4797,11 @@ <h2>Data Round Tripping</h2>
47754797
<!--
47764798
@prefix ex: <http://example.org/vocab#> .
47774799
@prefix jsonld: <http://www.w3.org/ns/json-ld#> .
4778-
[ex:c14n ****"""[56,{"1":[],"10":null,"d":true}]"""^^jsonld:JSON****] .
4800+
[ex:c14n ****"""[56,{"1":[],"10":null,"d":true}]"""^^rdf:JSON****] .
47794801
-->
47804802
</pre>
47814803
</aside>
47824804

4783-
<p class="issue atrisk">JCS is still in draft form, and normatively requiring
4784-
JSON canonicalization may be removed in a future draft, or
4785-
a JSON-LD specific canonicalization form may be defined.</p>
4786-
47874805
<p>When JSON-native <a>numbers</a> are deserialized
47884806
to RDF, lossless data round-tripping cannot be guaranteed, as rounding
47894807
errors might occur. When

tests/fromRdf-manifest.jsonld

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,55 +199,55 @@
199199
"@id": "#tjs01",
200200
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
201201
"name": "JSON literal (boolean true)",
202-
"purpose": "Tests creating property with rdf:type jsonld:JSON to a JSON literal (boolean true).",
202+
"purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (boolean true).",
203203
"input": "fromRdf/js01-in.nq",
204204
"expect": "fromRdf/js01-out.jsonld",
205205
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
206206
}, {
207207
"@id": "#tjs02",
208208
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
209209
"name": "JSON literal (boolean false)",
210-
"purpose": "Tests creating property with rdf:type jsonld:JSON to a JSON literal (boolean false).",
210+
"purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (boolean false).",
211211
"input": "fromRdf/js02-in.nq",
212212
"expect": "fromRdf/js02-out.jsonld",
213213
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
214214
}, {
215215
"@id": "#tjs03",
216216
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
217217
"name": "JSON literal (double)",
218-
"purpose": "Tests creating property with rdf:type jsonld:JSON to a JSON literal (double).",
218+
"purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (double).",
219219
"input": "fromRdf/js03-in.nq",
220220
"expect": "fromRdf/js03-out.jsonld",
221221
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
222222
}, {
223223
"@id": "#tjs04",
224224
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
225225
"name": "JSON literal (double-zero)",
226-
"purpose": "Tests creating property with rdf:type jsonld:JSON to a JSON literal (double-zero).",
226+
"purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (double-zero).",
227227
"input": "fromRdf/js04-in.nq",
228228
"expect": "fromRdf/js04-out.jsonld",
229229
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
230230
}, {
231231
"@id": "#tjs05",
232232
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
233233
"name": "JSON literal (integer)",
234-
"purpose": "Tests creating property with rdf:type jsonld:JSON to a JSON literal (integer).",
234+
"purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (integer).",
235235
"input": "fromRdf/js05-in.nq",
236236
"expect": "fromRdf/js05-out.jsonld",
237237
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
238238
}, {
239239
"@id": "#tjs06",
240240
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
241241
"name": "JSON literal (object)",
242-
"purpose": "Tests creating property with rdf:type jsonld:JSON to a JSON literal (object).",
242+
"purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (object).",
243243
"input": "fromRdf/js06-in.nq",
244244
"expect": "fromRdf/js06-out.jsonld",
245245
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}
246246
}, {
247247
"@id": "#tjs07",
248248
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
249249
"name": "JSON literal (array)",
250-
"purpose": "Tests creating property with rdf:type jsonld:JSON to a JSON literal (array).",
250+
"purpose": "Tests creating property with rdf:type rdf:JSON to a JSON literal (array).",
251251
"input": "fromRdf/js07-in.nq",
252252
"expect": "fromRdf/js07-out.jsonld",
253253
"option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"}

tests/fromRdf/js01-in.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<http://example.org/vocab#id> <http://example.org/vocab#bool> "true"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
<http://example.org/vocab#id> <http://example.org/vocab#bool> "true"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/fromRdf/js02-in.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<http://example.org/vocab#id> <http://example.org/vocab#bool> "false"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
<http://example.org/vocab#id> <http://example.org/vocab#bool> "false"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/fromRdf/js03-in.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<http://example.org/vocab#id> <http://example.org/vocab#double> "1.23"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
<http://example.org/vocab#id> <http://example.org/vocab#double> "1.23"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/fromRdf/js04-in.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<http://example.org/vocab#id> <http://example.org/vocab#double> "0"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
<http://example.org/vocab#id> <http://example.org/vocab#double> "0"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/fromRdf/js05-in.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<http://example.org/vocab#id> <http://example.org/vocab#integer> "123"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
<http://example.org/vocab#id> <http://example.org/vocab#integer> "123"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/fromRdf/js06-in.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<http://example.org/vocab#id> <http://example.org/vocab#object> "{\"foo\":\"bar\"}"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
<http://example.org/vocab#id> <http://example.org/vocab#object> "{\"foo\":\"bar\"}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/fromRdf/js07-in.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<http://example.org/vocab#id> <http://example.org/vocab#array> "[{\"foo\":\"bar\"}]"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
<http://example.org/vocab#id> <http://example.org/vocab#array> "[{\"foo\":\"bar\"}]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js01-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#bool> "true"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#bool> "true"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js02-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#bool> "false"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#bool> "false"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js03-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#double> "1.23"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#double> "1.23E0"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js04-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#double> "0"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#double> "0"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js05-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#integer> "123"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#integer> "123"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js06-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#object> "{\"foo\":\"bar\"}"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#object> "{\"foo\":\"bar\"}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js07-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#array> "[{\"foo\":\"bar\"}]"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#array> "[{\"foo\":\"bar\"}]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js08-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#c14n> "[56,{\"1\":[],\"10\":null,\"d\":true}]"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#c14n> "[56,{\"1\":[],\"10\":null,\"d\":true}]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js09-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#c14n> "{\"peach\":\"This sorting order\",\"péché\":\"is wrong according to French\",\"pêche\":\"but canonicalization MUST\",\"sin\":\"ignore locale\"}"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#c14n> "{\"peach\":\"This sorting order\",\"péché\":\"is wrong according to French\",\"pêche\":\"but canonicalization MUST\",\"sin\":\"ignore locale\"}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js10-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#c14n> "{\"\":\"empty\",\"1\":{\" \":56,\"f\":{\"F\":5,\"f\":\"hi\"}},\"10\":{},\"111\":[{\"E\":\"no\",\"e\":\"yes\"}],\"A\":{},\"a\":{}}"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#c14n> "{\"\":\"empty\",\"1\":{\" \":56,\"f\":{\"F\":5,\"f\":\"hi\"}},\"10\":{},\"111\":[{\"E\":\"no\",\"e\":\"yes\"}],\"A\":{},\"a\":{}}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js11-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#c14n> "{\"Unnormalized Unicode\":\"Å\"}"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#c14n> "{\"Unnormalized Unicode\":\"Å\"}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js12-in.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"e": {"@id": "http://example.org/vocab#c14n", "@type": "@json"}
55
},
66
"e": {
7-
"numbers": [333333333.33333329, 1E30, 4.50, 2e-3, 0.000000000000000000000000001],
7+
"numbers": [333333333.333333, 1E20, 4.50, 2e-3, 0.000000000000000000000000001],
88
"string": "\u20ac$\u000F\u000aA'\u0042\u0022\u005c\\\"\/",
99
"literals": [null, true, false]
1010
}

tests/toRdf/js12-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#c14n> "{\"literals\":[null,true,false],\"numbers\":[333333333.3333333,1e+30,4.5,0.002,1e-27],\"string\":\"€$\\u000f\\nA'B\\\"\\\\\\\\\\\"/\"}"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#c14n> "{\"literals\":[null,true,false],\"numbers\":[3.33333333333333E8,100000000000000000000,4.5E0,2.0E-3,1.0E-27],\"string\":\"€$\\u000f\\nA'B\\\"\\\\\\\\\\\"/\"}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/toRdf/js13-in.jsonld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"\u0080": "Control\u007f",
1212
"\ud83d\ude02": "Smiley",
1313
"\u00f6": "Latin Small Letter O With Diaeresis",
14-
"\ufb33": "Hebrew Letter Dalet With Dagesh",
1514
"</script>": "Browser Challenge"
1615
}
1716
}

tests/toRdf/js13-out.nq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_:b0 <http://example.org/vocab#c14n> "{\"\\n\":\"Newline\",\"\\r\":\"Carriage Return\",\"1\":\"One\",\"</script>\":\"Browser Challenge\",\"€\":\"Control\",\"ö\":\"Latin Small Letter O With Diaeresis\",\"€\":\"Euro Sign\",\"😂\":\"Smiley\",\"דּ\":\"Hebrew Letter Dalet With Dagesh\"}"^^<http://www.w3.org/ns/json-ld#JSON> .
1+
_:b0 <http://example.org/vocab#c14n> "{\"\\n\":\"Newline\",\"\\r\":\"Carriage Return\",\"1\":\"One\",\"</script>\":\"Browser Challenge\",\"€\":\"Control\",\"ö\":\"Latin Small Letter O With Diaeresis\",\"€\":\"Euro Sign\",\"😂\":\"Smiley\"}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

0 commit comments

Comments
 (0)