RDF has advantages for integration of data, but in the end it is much more convenient to work with simple record structures and many developers prefer simple serialization formats such as CSV, JSON, and INI-Files. Here I don't want to discuss about the reason, but about how do best map RDF to this formats. I don't refer to serialization forms like RDF/JSON but to simple, domain specific, ad-hoc data structures. For instance I'd want a JSON structure like the following (please don't argue whether this structure is good or bad, it is just given as requirement):

{
  "orgs": [
    { "uri": "http://example.org/", "name": "Example Organisation" },
    { "uri": "http://example.com/", "name": "Another Organisation" },
  ],
  "people": [
    { "name": "Alice", "age": 32 }, { "name": "Bob", "age": 24 }
  ]
}

Or I just want a CSV list of people with name, homepage, and age, etc. The general answer would be "SPARQL with some additional post-processing", but I want to manage mappings in a simple, readable form. The best I could find was using a scripting language and a simple API to access RDF like this pseudo-Perl script:

my %result = (
  orgs   => [ map { return { uri => $_->uri, name => $_->getprop('foaf:name') } }    
                  $rdf->get( undef, 'a', 'faof:Organization' ) ],
  people => [ map { return { name => $_->getprop('foaf:name'), 
                             age => $_->getprop('foaf:age') } }
                  $rdf->get( undef, 'a', 'faof:Person' ) ]
);
return toJSON(\%result);

However I do not want to stick to a specific Turing-complete scripting language. Before inventing my own RDF-Mapping language I'd like to know whether there already are good solutions. Maybe the mapping could even be stored in form of RDF, so I could write it down in Turtle?

asked 27 Jul '11, 06:32

Jakob's gravatar image

Jakob
1.9k211
accept rate: 10%


Some relevant tidbits:

link

answered 27 Jul '11, 08:04

cygri's gravatar image

cygri ♦
9.0k412
accept rate: 34%

JSON-LD is a serious contender to become a standard to serialize RDF into JSON. Related to other text formats such as CSV or INI, I personally use template-based approach.

link

answered 27 Jul '11, 12:19

fellahst's gravatar image

fellahst
3.3k29
accept rate: 9%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×23
×20
×15
×6

Asked: 27 Jul '11, 06:32

Seen: 1,870 times

Last updated: 28 Jul '11, 03:28