From d062a5869e01d58606e77e20386b319024df396e Mon Sep 17 00:00:00 2001 From: Olaf Hartig Date: Wed, 13 Sep 2023 08:53:45 +0200 Subject: [PATCH 01/15] adds an appendix for the additional datatypes and moves the sections about rdf:HTML and rdf:XMLLiteral into this appendix, as per https://github.com/w3c/rdf-concepts/issues/14#issuecomment-1715834979 --- spec/index.html | 187 +++++++++++++++++++++++++----------------------- 1 file changed, 99 insertions(+), 88 deletions(-) diff --git a/spec/index.html b/spec/index.html index 9e14ed7..3c563bc 100644 --- a/spec/index.html +++ b/spec/index.html @@ -1199,7 +1199,7 @@

Datatype IRIs

MUST refer to the RDF-compatible XSD type named xsd:xxx for every XSD type listed in section 5.1.

-

The following three datatype IRIs are defined in this section:

+

The following three datatype IRIs are defined in Appendix :

Two JSON values are considered equal - if they are the same if they are the same string, + if they are the same string, number, boolean, or - null, + null; if they are both arrays with entries - which are pairwise equal, - or if they are both a map with equal map entries. + which are pairwise equal; + or if they are both maps with equal map entries.
The lexical-to-value mapping
From 39cdf497f0fe9c03fcdaea49e2f3f9b3bf0b9448 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 20 Sep 2023 14:27:34 -0700 Subject: [PATCH 12/15] Generally revert the definition of the rdf:JSON value space to that defined by JSON-LD 1.1. Note: this could be simplified by simply saying that the value space is an RDF string representing the lexical value using the JSON Canonicalization Scheme --- spec/index.html | 74 ++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/spec/index.html b/spec/index.html index 2c853f9..4cc9388 100644 --- a/spec/index.html +++ b/spec/index.html @@ -1467,44 +1467,53 @@

The rdf:JSON Datatype

The value space
- is a single JSON value in the form of an array, - map, - string, - number, - boolean, or - null. + is the set of all RDF strings that conform to the + JSON Grammar as described in + Section 2 JSON Grammar of + [[RFC8259]], and furthermore comply with the following constraints:
    -
  • Array entries may be - any of the above JSON values.
  • -
  • Map keys are strings with - values, which may be any of the above - JSON values.
  • +
  • They MUST NOT contain any unnecessary whitespace.
  • +
  • Keys in objects MUST be ordered lexicographically.
  • +
  • Native Numeric values MUST be serialized according to + Section 7.1.12.1 + of [[ECMASCRIPT]].
  • +
  • Strings MUST be serialized with Unicode code points from U+0000 + through U+001F using lower case hexadecimal Unicode notation + (`\uhhhh`) except for the set of predefined JSON control characters — + `U+0008`, `U+0009`, `U+000A`, `U+000C`, and `U+000D` — which SHOULD be + serialized as `\b`, `\t`, `\n`, `\f`, and `\r`, respectively. All + other Unicode characters SHOULD be serialized "as is", except + `U+005C` (`\`) and `U+0022` (`"`), which SHOULD be serialized as + `\\` and `\"`, respectively.
- - Two JSON values are considered equal - if they are the same string, - number, - boolean, or - null; - if they are both arrays with entries - which are pairwise equal; - or if they are both maps with equal map entries. +
The JSON Canonicalization Scheme (JCS) [[RFC8785]] + is an emerging standard for JSON canonicalization. This rdf:JSON specification + will likely be updated to require such a canonical representation. + Users are cautioned against depending on the lexical representation of + literals with the rdf:JSON datatype as RDF literals, + as the specifics of serialization may change in a future revision of + this document.
+ Despite being defined as a set of strings, this value space is + considered distinct from the value space of xsd:string, + in order to avoid side effects with existing specifications.
- +
The lexical-to-value mapping
- maps every element of the lexical space to the result of parsing it into a - JSON value - consistent with the [[ECMASCRIPT]] representation created by using the JSON.parse - function as defined in Section 24.5 The JSON Object - of [[ECMASCRIPT]]. + maps every element of the lexical space to the result of +
    +
  1. parsing it into an internal representation consistent with the + [[ECMASCRIPT]] representation created by using the JSON.parse + function as defined in Section 24.5 The JSON Object + of [[ECMASCRIPT]],
  2. +
  3. then serializing it into the JSON format [[RFC8259]] in compliance + with the constraints of the value space described above.
  4. +
The canonical mapping
-
maps a JSON value - to an RDF string conforming to the JSON Grammar - using the mechanism described in [[[RFC8785]] [[RFC8785]]. -
+
maps any element of the value space to the identical string in the + lexical space.
@@ -1747,10 +1756,7 @@

Changes between RDF 1.1 and RDF 1.2

datatypes to this appendix.
  • Added the rdf:JSON datatype, the definition of which is adopted from Section 10.2 The `rdf:JSON` Datatype - in [[?JSON-LD11]]. - Note that the value space defined here - updates the value space of the - `rdf:JSON` datatype defined in [[[JSON-LD11]]] [[JSON-LD11]]
  • + in [[?JSON-LD11]].
  • Clarify Unicode terminology, using Unicode code points, and restriction to the XML Char production. From 2861559c66345f5fd5292643f317051139a5e2a4 Mon Sep 17 00:00:00 2001 From: Olaf Hartig Date: Thu, 21 Sep 2023 08:51:25 +0200 Subject: [PATCH 13/15] A few small edits that improve how things are phrased. Co-authored-by: Ted Thibodeau Jr --- spec/index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/index.html b/spec/index.html index 4cc9388..0571471 100644 --- a/spec/index.html +++ b/spec/index.html @@ -1199,7 +1199,8 @@

    Datatype IRIs

    MUST refer to the RDF-compatible XSD type named xsd:xxx for every XSD type listed in section 5.1.

    -

    The following three datatype IRIs are defined in Appendix :

    +

    The datatypes identified by the three IRIs below are defined in + Appendix :

    • The IRI http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral @@ -1257,11 +1258,11 @@

      Fragment Identifiers

      This section discusses the handling of fragment identifiers in representations that encode RDF graphs.

      -

      In RDF-bearing representations of a primary resource, +

      In RDF-bearing representations of a primary resource, e.g., <https://example.com/foo>, - the secondary resource identified by a fragment identifier, bar, + the secondary resource identified by a fragment identifier, e.g., bar, is the resource denoted by the - full IRI <https://example.com/foo#bar> in the RDF graph. + full IRI in the RDF graph, which would be <https://example.com/foo#bar> in this case. Since IRIs in RDF graphs can denote anything, this can be something external to the representation, or even external to the web.

      @@ -1276,7 +1277,7 @@

      Fragment Identifiers

      with these constraints. For example, in an HTML+RDFa document [[HTML-RDFA]], a fragment identifier such as chapter1 may identify a document section via the semantics of HTML's @name or @id - attributes. The IRI <#chapter1> should + attributes. Such an IRI, e.g., <#chapter1>, should then be taken to denote that same section in any RDFa-encoded triples within the same document. Similarly, fragment identifiers should be used consistently in resources @@ -1322,7 +1323,7 @@

      Generalized RDF Triples, Graphs, and Datasets

      generalized RDF triples, graphs, or datasets needs to be aware that these notions are non-standard extensions of RDF, and their use may cause interoperability problems. - There is no requirement on the part of any RDF tool to + There is no requirement for any RDF tool to accept, process, or produce anything beyond standard RDF triples, graphs, and datasets.

      From 2d9a0bd434d531790d227eb0a87135f0c7e52847 Mon Sep 17 00:00:00 2001 From: Dominik Tomaszuk Date: Thu, 21 Sep 2023 14:27:50 +0200 Subject: [PATCH 14/15] remove orphan RFC4627 RFC4627 -> RFC8259 --- spec/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.html b/spec/index.html index 0571471..295c69d 100644 --- a/spec/index.html +++ b/spec/index.html @@ -1462,14 +1462,14 @@

      The rdf:JSON Datatype

      The lexical space
      is the set of all RDF strings that conform to the - JSON Grammar as described in + JSON Grammar as described in Section 2 JSON Grammar of [[RFC8259]].
      The value space
      is the set of all RDF strings that conform to the - JSON Grammar as described in + JSON Grammar as described in Section 2 JSON Grammar of [[RFC8259]], and furthermore comply with the following constraints:
        From 40c1c016c849c853d37b37ec5ba4a5978fb1a8ef Mon Sep 17 00:00:00 2001 From: Olaf Hartig Date: Thu, 21 Sep 2023 20:38:19 +0200 Subject: [PATCH 15/15] More minor edits Co-authored-by: Ted Thibodeau Jr --- spec/index.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/spec/index.html b/spec/index.html index 295c69d..cf0f3e0 100644 --- a/spec/index.html +++ b/spec/index.html @@ -1086,9 +1086,8 @@

        The XML Schema Built-in Datatypes

        listed in the following table are the RDF-compatible XSD types. Their use is RECOMMENDED.

        -

        Readers might note that the `xsd:hexBinary` and `xsd:base64Binary` - datatypes are the only safe datatypes for transferring binary - information.

        +

        Readers might note that the only safe datatypes for transferring + binary information are `xsd:hexBinary` and `xsd:base64Binary`.

        @@ -1224,7 +1223,7 @@

        Datatype IRIs

        Semantic extensions of RDF might choose to recognize other datatype IRIs - and require them to refer to a fixed datatype. + and require each of them to refer to a fixed datatype. See [[[RDF12-SEMANTICS]]] [[RDF12-SEMANTICS]] for more information on semantic extensions.

        @@ -1311,7 +1310,7 @@

        Generalized RDF Triples, Graphs, and Datasets

        Generalized RDF triples, graphs, and datasets differ - from normative RDF triples, + from standard normative RDF triples, graphs, and datasets only by allowing IRIs, @@ -1324,8 +1323,8 @@

        Generalized RDF Triples, Graphs, and Datasets

        aware that these notions are non-standard extensions of RDF, and their use may cause interoperability problems. There is no requirement for any RDF tool to - accept, process, or produce anything beyond standard RDF - triples, graphs, and datasets.

        + accept, process, or produce anything beyond standard + normative RDF triples, graphs, and datasets.

        A list of the RDF-compatible XSD types, with short descriptions