afs commented on issue #3461:
URL: https://github.com/apache/jena/issues/3461#issuecomment-3368902511

   There are two different uses of "canoicalization" here:
   
   1. Canonical N-Quads output - this is about the layout of the characters and 
is in 
[rdf12/rdf-n-quads/c14n](https://github.com/w3c/rdf-tests/tree/main/rdf/rdf12/rdf-n-quads/c14n).
 The order of quads in the file is not defined but Jena's N-Quads writer 
actually writes an `Iterator<Quad>` (or easily by adding`RDFStream`).
   2. Canonical dataset - which is the RDFC-1.0 algorithm - which is a 
consistent labelling of blank nodes. [4. 
Canonicalization](https://www.w3.org/TR/rdf-canon/#canonicalization) and [5. 
Serialization](https://www.w3.org/TR/rdf-canon/#serialization).
   
   In (2), in serialization, `rdf-canon` sorts the n-quads and outputs them in 
order, in the canonical N-Quads form, preserving the blank node labelling from 
RDFC-1.0. The detailed form of RDFTerms is done by a `NodeFormatterNT` in 
`WriterStreamRDFPlain`.
   
   There are choices in how to write RDF terms. e.g. lowercase language tags, 
ECHAR vs UCHAR. This is (1) [3. A Canonical form of 
N-Quads](https://www.w3.org/TR/rdf12-n-quads/#canonical-quads) and it should be 
exactly the same as [A. A Canonical form of 
N-Quads](https://www.w3.org/TR/rdf-canon/#dfn-canonical-n-quads) because the 
text was copied over before making some presentation changes. There are other 
uses for canonical n-quads so having it available on it's own is valuable.
   
   It may be easier to write a new N-Quads writer rather than try to use 
inheritance and modularity of the existing one use the existing one because the 
algorithm of writing N-quads is very small. The common part is only a few lines.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to