A Look Inside the Think Tank...

JRON - From JSON to RDF by Sandro Hawke

Created on and categorized as Technical.
Written by Thomas Steiner.

JRON - From JSON to RDF by Sandro Hawke

@mamund pointed to @sandhawke's proposition to convert RDF to JSON. Read his piece From JSON to RDF in Six Easy Steps with JRON first. Below, co-posting my comment I made there also on my blog:

Hi Sandro,

Interesting concept! I quite like it and I'm currently struggling with a relatively similar issue of embedding RDF in XML (Media RSS more specifically). Couple of remarks: you mix foaf_name and foaf.name in your examples, you probably meant to write '_' consistently, but in the end the choice is random. I tried to model the very simple concept below, taken from one of your presentations:

In Notation 3 (I abused FOAF for the concept of nickname of a state here):

@prefix foaf: <http://xmlns.com/foaf/spec/> .

<http://dbpedia.org/resource/Massachusetts> foaf:nick "Bay State" .


I tried to convert this to JRON:

{
"dbpedia-owl_AdministrativeRegion" : "http://dbpedia.org/resource/Massachusetts",
"foaf_nick" : "Bay State",
"__prefixes": {
"foaf_" : "http://xmlns.com/foaf/0.1/",
"dbpedia-owl_" : "http://dbpedia.org/resource/"
}
}


I think it is necessary to assign <http://dbpedia.org/resource/Massachusetts> a type (dbpedia-owl:AdministrativeRegion), as I believe with JRON it is not possible to express the simple concept in Notation 3 syntax above, or in RDF/XML syntax below:

<?xml version="1.0"?>
<rdf:Description
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/spec/"
rdf:about="http://dbpedia.org/resource/Massachusetts">
<foaf:nick>Bay State</foaf:nick>
</rdf:Description>


Probably I'm just missing something obvious, though. Anyway, assuming my additional typed interpretation of JRON was correct, then hopefully I applied your xml:lang JRON transformation correctly?! See below:

{
"dbpedia-owl_AdministrativeRegion" : "http://dbpedia.org/resource/Massachusetts",
"foaf_nick" : [
{
"__text" : "Bay State",
"__lang" : "en"
},
{
"__text" : "?tat de la Baie",
"__lang" : "fr"
}
] ,
"__prefixes": {
"foaf_" : "http://xmlns.com/foaf/0.1/",
"dbpedia-owl_" : "http://dbpedia.org/resource/"
}
}


Is there a better way to express any of this in JRON? Looking forward to your response. Thanks!

Cheers,
Tom