Re: canonical representation

> On Jan 11, 2016, at 6:10 PM, Dave Longley <dlongley@digitalbazaar.com> wrote:
> 
> On 01/11/2016 04:23 PM, bergi wrote:
>> Hi all,
>> 
>> one of the issues we currently discuss in the RDFJS Representation 
>> Task Force [1] is a canonical representation for triples/quads and 
>> their components. I proposed to use the N-Triples representation [2] 
>> if there is a definition (the specification contains also a
>> interface for variables). One of the reasons for me is the RDF
>> Dataset Normalization [3]. It would be nice, if we could reuse the
>> canonical method for this use case. But the normalization
>> specification doesn't define the serialization. The N-Triples format
>> would allow to escape literals in different ways. Therefore a unique
>> way to escape literals must be defined.
> 
> That the specification doesn't define the serialization is just a
> temporary failing of the spec. The serialization is N-Quads as
> output by the four interoperable implementations:

Note that the spec defines a “normalized dataset”, which is a restriction on an RDF dataset where all blank nodes are labeled with stable identifiers. There should also be a canonical serialization format defined, which will/should be canonical N-Quads. (Note, that N-Quads doesn’t define this, but N-Triples defines “Canonical N-Triples” [1], which we can use for an internal definition).

> JavaScript: https://github.com/digitalbazaar/jsonld.js
> Python: https://github.com/digitalbazaar/pyld
> PHP: https://github.com/digitalbazaar/php-json-ld
> Ruby: https://github.com/ruby-rdf/rdf-normalize
> 
> If the spec doesn't already have an issue indicating that we need to
> clearly document the serialization, we need to add one (and/or doc the
> serialization).
> 
> 
> -- 
> Dave Longley
> CTO
> Digital Bazaar, Inc.
> 


Gregg

[1] http://www.w3.org/TR/n-triples/#canonical-ntriples

Received on Tuesday, 12 January 2016 02:54:08 UTC