Re: canonical representation

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.

It would be great if the JSON-LD and RDFJS group could work together on
that topic and to specify common definition. Please join the discussion
here on the mailing list or on the gitter room [4].

Best,
bergi

[1] https://github.com/rdfjs/representation-task-force/wiki
[2] https://lists.w3.org/Archives/Public/public-rdfjs/2016Jan/0004.html
[3] http://json-ld.github.io/normalization/spec/
[4] https://gitter.im/rdfjs/public

Am 04.01.2016 um 09:48 schrieb Ruben Verborgh:
> Dear all,
> 
> As part of the specification for JavaScript RDF library interoperability,
> we aim to create a method or property for a "canonical representation"
> of triples/quads and their components. We would like your input for this.
> 
> For example, consider the triple (Turtle notation):
> 
>     PREFIX schema: <http://schema.org/>
>     <http://example.org/Concept> schema:url "http://example.org/Concept".
> 
> A JavaScript library will represent this in memory in some way.
> With the current proposal, the following will be possible:
> 
>     console.log(triple.subject.value)      // "http://example.org/Concept"
>     console.log(triple.subject.termType)   // "iri"
>     console.log(triple.predicate.value)    // "http://schema.org/url"
>     console.log(triple.predicate.termType) // "iri"
>     console.log(triple.object.value)       // "http://example.org/Concept"
>     console.log(triple.object.termType)    // "literal"
> 
> Note in particular that subject.value and object.value are the same strings,
> even though subject and object are different entities.
> Also note that it taks two property accesses to fully capture an entity
> (even more in case of a literal, which might have a datatype or language).
> 
> Therefore, we want to introduce a property or method
> that returns a string which uniquely represents an entity / triple / quad.
> There must be a 1-to-1 correspondence between
> such a representation and an entity / triple / quad.
> 
> A (fictitious) example of how this could work:
>     console.log(triple.subject.getCanonicalRepresentation()) // "<http://example.org/Concept>"
>     console.log(triple.object.getCanonicalRepresentation()) // "^http://example.org/Concept^"
> Note how the representation is different for IRIs and literals,
> even if they have the same value.
> Note also that this representation is _not_ Turtle or N-Triples,
> since these formats can only express full triples.
> Moreover, our library aims to support variables,
> which are not available in these formats.
> 
> What we are looking for is:
> – a name for this method or property
>    – current suggestions include .toCanonical() and .toNT()
> – values this method or property should return
>     – e.g., "IRIs are surrounded by angular brackets"
> 
> We appreciate your take on this.
> 
> Best regards and my best wishes for 2016,
> 
> Ruben
> 

Received on Monday, 11 January 2016 21:23:35 UTC