Search code examples
rdfsemanticslinked-dataturtle-rdf

converting json to turtle


I am looking for tools to convert json to turtle format.

For example:

{
    "name": "Bart Simpson",
    "age": "11"
}

to something like:

@base <http://example.com/people> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix people: <http://example.com/people.rdf> .

<http://example.com/people_1> people:name "Bart Simpson" ; 
             people:age "11" .

For me, the challenge is to identify what are the right steps to perform the conversion. It seems I need to define a vocabulary first, like the http://example.com/people.rdf. But it's unclear to me how to define the vocabulary.

Also, I am looking for tools to do this json2turtle conversion, with a given vocabulary.

I might have misunderstood the concept of linked data here. Please let me know if this question doesn't make sense.


Solution

  • With JARQL you can use SPARQL construct queries on JSON files and thus create RDF in any serialization (Turtle, RDF/XML, etc.) you would like.