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

accept rate: 10%

Some relevant tidbits:

permanent link

answered 27 Jul '11, 08:04

cygri's gravatar image

cygri ♦
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.

permanent link

answered 27 Jul '11, 12:19

fellahst's gravatar image

accept rate: 11%

Your answer
toggle preview

Follow this question

By Email:

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



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

Question tags:


question asked: 27 Jul '11, 06:32

question was seen: 1,979 times

last updated: 28 Jul '11, 03:28