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

On Wednesday, December 11, 2013 11:22 AM, Ruben Verborgh wrote:
> > Exactly, I would really like that we can use common way to deal with
> various RDF constructs in javascript runtime. Statement, IRI, BNode and
> Literal sound like good candidates to start with :)
> 
> If we go for a statement-based representation, we are abandoning the
> JSON-LD route. Which is okay if that’s what we want.
> If the goal is to exchange data between systems that use triples
> internally, it probably is what we want.

It depends on how you use JSON-LD. It's true that the predicate is the name of a member in that case and not the value but it still looks pretty much like a statement.

> Here is the representation format I use:
> 
> { subject: 'http://dbpedia.org/resource/Daft_Punk’,
>   predicate: 'http://www.w3.org/2000/01/rdf-schema#label',
>   object: '"Daft Punk"@en' }

Here's how you could do it with JSON-LD (weirdly formatted to show the similarity)

{ "@id": "http://dbpedia.org/resource/Daft_Punk",
  "http://www.w3.org/2000/01/rdf-schema#label": {
    "@value": "Daft Punk", "@language": "@en"
  }
}

The advantage is that you can write such a structure directly in a file to exchange it with other systems because the format is standardized. The disadvantage is lower performance and slightly more difficult access to the triple components.

I think the question really boils down to what exactly do you want to achieve with such a intermediate representation!?


--
Markus Lanthaler
@markuslanthaler

Received on Wednesday, 11 December 2013 12:39:13 UTC