Re: representing deserialized RDF - N3, JSON-LD, RDFa, XML/RDF

On Dec 10, 2013, at 3:06 PM, ☮ elf Pavlik ☮ <perpetual-tripper@wwelves.org> wrote:

> Hi,
> 
> I didn't yet look into all the parsers/serializers listed at our wiki, only in some parts of jsonld.js so far. I wonder if it would make sense to use common way of representing deserialized RDF in javascript. Ruben already touched topic of "URIs and literals" and I would like to take it all the way into representing datasets with named graphs, blank nodes etc.
> 
> Also looking at excellent http://ruby-rdf.github.io makes me thinking that we could take little time in coordinating our efforts to provide more uniform toolbox. And luckily I believe we can count here on Gregg's experience on RDF.rb environment :)

Of course.

> Ruben works on N3 + Turtle, Alex on RDFa + Turtle, no one from people maintaining JSON-LD (js) in this group yet but we can still connect better. Not sure if anyone here works on XML/RDF

Do we _really_ need RDF/XML in Javascript? It would be nice to move on with the more modern variations.

> I would find it very cool if while using all those parsers/serializes we could keep common representation of deserialized dataset. Also we could support each other when it comes to working with modeling some complex topics like: http://www.w3.org/TR/rdf11-concepts/#section-generalized-rdf | http://manu.sporny.org/2013/rdf-identifiers/ etc.

In RDF.rb, we keep have a number of different classes and mixins to represent RDF information. The basic breakdown is the following structure:

* Value, with subclasses Term, Graph, List and Statement.
* Term, with subclasses Literal and Resource
* Literal, with various sub-classes for different typed literals
* Resource, with subclasses IRI and BNode

There are also a variety of mixins to give Enumerable, Queryable, Mutable and so-forth behavior.

In Javascript, I think if there was a common Statement class containing slots for subject, predicate, object and name, which could be a IRI, BNode or Literal, the various serializers and deserializers could generate or consume sets of these, which would provide one level of a common representation between the different tools.

Gregg

> Cheers!
> 
> [1] http://www.w3.org/community/rdfjs/wiki/Main_Page
> 

Received on Tuesday, 10 December 2013 23:37:34 UTC