@@ -12858,48 +12858,15 @@
Serializing/Deserializing RDF
12858
12858
is the set of UNICODE [[UNICODE]] strings which conform to the JSON Grammar
12859
12859
as described in
Section 2 JSON Grammar of [[RFC8259]].
12860
12860
The value space
12861
- is the union of the four primitive types (strings , numbers , booleans ,
12862
- and
null ) and two structured types (
objects and
arrays )
12863
- from [[ECMASCRIPT]].
12864
- Two JSON values A and B are considered equal if and only if the following is true:
12865
-
12866
- If A and B are both objects ,
12867
- both
A and
B have the same number of
entries ,
12868
- and each
entry in
A is equal to a corresponding
entry in
B
12869
-
12870
- the keys are equal (as defined in Section 7.2.13, step 5.a
12871
- in [[ECMASCRIPT]]), and
12872
-
the values are considered equal through
12873
- applying this comparison recursively.
12874
-
12875
- Otherwise, if A and B are both arrays ,
12876
- both A and B have the same number of elements,
12877
- and each element Ai is considered
12878
- equal to the corresponding element Bi
12879
- through applying this comparison recursively.
12880
-
Otherwise, if A and B satisfy the
12881
-
12882
- defined in
Section 7.2.16 in [[ECMASCRIPT]].
12883
-
Otherwise, A and B are not equal.
12884
-
12885
-
12886
-
The lexical-to-value mapping
12887
-
is the result of parsing the lexical representation into
12888
- an internal representation consistent with [[ECMASCRIPT]] representation
12889
- created by using the JSON.parse
function as defined in
12890
-
12891
-
The canonical mapping
12892
-
is non-normative, as a normative recommendation for
12893
- JSON canonicalization is not yet defined. Implementations
12894
- SHOULD use the following guidelines when creating the lexical
12895
- representation of a
JSON literal :
12896
-
12897
-
12898
-
Serialize JSON using no unnecessary whitespace,
12899
-
Keys in objects SHOULD be ordered lexicographically,
12900
-
Native Numeric values SHOULD be serialized according to
12861
+ is the set of UNICODE [[UNICODE]] strings which conform to the JSON Grammar
12862
+ as described in
Section 2 JSON Grammar of [[RFC8259]],
12863
+ and furthermore comply with the following constraints:
12864
+
12865
+
It MUST not contain any unnecessary whitespace,
12866
+
Keys in objects MUST be ordered lexicographically,
12867
+
Native Numeric values MUST be serialized according to
12901
12868
Section 7.1.12.1 of [[?ECMASCRIPT]],
12902
-
Strings SHOULD be serialized with Unicode codepoints from U+0000
through U+001F
12869
+
Strings MUST be serialized with Unicode codepoints from U+0000
through U+001F
12903
12870
using lower case hexadecimal Unicode notation (\uhhhh
) unless in the set
12904
12871
of predefined JSON control characters U+0008
, U+0009
,
12905
12872
U+000A
, U+000C
or U+000D
@@ -12908,7 +12875,6 @@
Serializing/Deserializing RDF
12908
12875
U+005C
(\
) and U+0022
("
)
12909
12876
which SHOULD be serialized as \\
and \"
respectively.
12910
12877
12911
-
12912
12878
The JSON Canonicalization Scheme [[?JCS]]
12913
12879
is an emerging standard for JSON canonicalization
12914
12880
not yet ready to be referenced.
@@ -12917,7 +12883,25 @@
Serializing/Deserializing RDF
12917
12883
Users are cautioned from depending on the
12918
12884
JSON literal lexical representation as an
RDF literal ,
12919
12885
as the specifics of serialization may change in a future revision of this document.
12886
+ Despite being defined as a set of strings,
12887
+ this value space is considered distinct from the value space of `xsd:string`,
12888
+ in order to avoid side effects with existing specifications.
12920
12889
12890
+
The lexical-to-value mapping
12891
+
maps any element of the lexical space to the result of
12892
+
12893
+
parsing it into
12894
+ an internal representation consistent with [[ECMASCRIPT]] representation
12895
+ created by using the JSON.parse
function as defined in
12896
+
12897
+
then serializing it in the JSON format [[RFC8259]]
12898
+ in compliance with the constraints of the value space described above.
12899
+
12900
+
12901
+
12902
+
The canonical mapping
12903
+
maps any element of the value space to the identical string in the lexical space.
12904
+
12921
12905
12922
12906
12923
12907
0 commit comments