Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canonical mappings for datatypes #86

Closed
pfps opened this issue May 12, 2024 · 5 comments · Fixed by #97
Closed

canonical mappings for datatypes #86

pfps opened this issue May 12, 2024 · 5 comments · Fixed by #97
Labels
needs discussion Proposed for discussion in an upcoming meeting spec:enhancement Change to enhance the spec without affecting conformance (class 2) –see also spec:editorial

Comments

@pfps
Copy link
Contributor

pfps commented May 12, 2024

Two datatypes provide a canonical mapping but there are no requirements for canonical mappings.

If canonical mappings are to be retained there needs to be requirements that these mapping must satisfy.

@gkellogg gkellogg added needs discussion Proposed for discussion in an upcoming meeting spec:enhancement Change to enhance the spec without affecting conformance (class 2) –see also spec:editorial labels May 13, 2024
@gkellogg
Copy link
Member

RDFa requires using Exclusive XML Canonicalization when serializing an XML Literal. The canonical mapping for rdf:XMLLiteral is based on this language. Possibly, the language could be removed from the datatype definition, but it clearly describes something that is useful.

JSON-LD 1.1 describes canonicalization as being the mapping to the value space, which is essentially JCS before it was standardized. Canonicalization of JSON datatypes is necessary for serializing the content of JSON literals.

XSD datatypes define Canonical Lexical Representations. I believe many RDF libraries expose a way of creating a canonicalized version of a literal using these mechanisms.

IMO, removing canonicalization sections for datatypes would be confusing to the user base.

The definition from XSD seems like a good starting point for such requirements:

A canonical lexical representation is a set of literals from among the valid set of literals for a datatype such that there is a one-to-one mapping between literals in the canonical lexical representation and values in the ·value space·.

@afs
Copy link
Contributor

afs commented May 22, 2024

RDFa requiring Exclusive XML Canonicalization is different to RDF 1.1. It's a subset of values.

RDF 1.1 has RDF/XML value space of "DocumentFragment" which is a wider definition than RDF 1.0. Exclusive XML Canonicalization.

@afs
Copy link
Contributor

afs commented May 30, 2024

If canonical mappings are to be retained there needs to be requirements that these mapping must satisfy.

For rdf:JSON and rdf:XMLLiteral, I don't see a reason why rdf-concepts needs to define the canonical mapping (strictly, "a canonical mapping" - these two have choices for white space and other things).

rdf:XMLLiteral is harder because there isn't a requirement on normalization on the value space.

RDFa choosing a canonicalization can be seen as a choice being made for RDFa.

JSON-LD is free to define a canonical form as that community needs and it is good to leave it to the community as to whether e.g. RFC8785 is the right choice.

@pfps
Copy link
Contributor Author

pfps commented Jun 27, 2024

I propose removing the only remaining canonical mapping, for rdf:XMLLiteral. As there are suggested RDF datatypes for which RDF does not define a canonical mapping, it does not make sense to keep this one.

It's removal should be documented in the change section.

@gkellogg
Copy link
Member

gkellogg commented Aug 1, 2024

Closed via #97.

@gkellogg gkellogg closed this as completed Aug 1, 2024
gkellogg added a commit that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Proposed for discussion in an upcoming meeting spec:enhancement Change to enhance the spec without affecting conformance (class 2) –see also spec:editorial
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants