Re: RDF 1.1 JSON Serialisation (RDF/JSON)

On Tue, 2011-08-23 at 09:55 +0100, Graham Klyne wrote:
> Re: http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-json/index.html
> 
> I'm probably wasting my time saying this, but I personally think that defining a 
> JSON format for RDF triples is missing the point of using JSON at all - it still 
> looks nothing like the kind of JSON a non-RDF developer might produce.
> 
> I think the effort would be better directed to defining a common RDF-carrying 
> JSON syntax that is closer to what applications might actually use.  An example 
> of the sort of thing I mean is JRON: 
> http://decentralyze.com/2010/06/04/from-json-to-rdf-in-six-easy-steps-with-jron/, which 
> I have used quite successfully to migrate an application using non-RDF JSON to 
> using something that can also be interpreted as RDF.
> 
> "Sometimes, if you stand in the right place and squint, JSON and RDF line up 
> perfectly."  But the view of RDF triples isn't that place.

Maybe I'm far enough away that jron and the editor's draft look a lot
alike.

----------------
>From jron step 1:
{ "__repr": "2010-03-06",
  "__type": "http://www.w3.org/2001/XMLSchema#date" }

As in RDF/JSON:
{ "value": "2010-03-06",
  "type" : "literal" ,
  "datatype": "http://www.w3.org/2001/XMLSchema#date" }
----------------
>From jron step 2:
{ "__text": "chat",
  "__lang": "fr" }

As in RDF/JSON:
{ "value": "chat",
  "lang": "fr" ,
  "type" : "literal" }
------------------
>From jron step 3:
{ "foaf_name": "Sandro Hawke",
     "foaf_knows: { "__node_id": "n102" },
     "__node_id": "n334" }
...
   { "foaf_name": "Eric Prud'hommeaux",
     "foaf_knows: { "__node_id": "n334" },
     "__node_id": "n102" }

As in RDF/JSON:
{ "_:n334" : {
    "foaf_name": [ {"value" : "Sandro Hawke", "type" : "literal"} ],
    "foaf_knows": [ {"value" : "_:n102" , "type" : "bnode" } ]
  },
...
 "_:n102" : {
   "foaf_name": [ { "value" : "Eric Prud'hommeaux" , "type" : "literal" } ],
   "foaf_knows: [ { "value" : "_:n334" , "type" : "bnode" } ]
  }
}
------------------
>From jron step 4:
{ "foaf_name": "Sandro Hawke",
       "__iri": "http://www.w3.org/People/Sandro/data#Sandro_Hawke"
     }

As in RDF/JSON:
{ "_:n334" : {
  "foaf_name": [ {"value" : "Sandro Hawke", "type": "literal"} ],
  "http://xmlns.com/foaf/0.1/page" : [ { 
    "value" : "http://www.w3.org/People/Sandro/data#Sandro_Hawke",
    "type" : "uri" } ]
  }
}
------------------
Jron step 5 specifies a prefix mechanism which presumably will be added to RDF/JSON (?)

-------------------
>From jron step 6:
{ "foaf.name": "Sandro Hawke",
     "foaf.knows: { "__values": [
                     { "foaf.name": "Eric Prud'hommeaux" },
                     { "foaf.name": "Dan Brickley" },
                     { "foaf.name": "Matt Womer" }
                  ]}
   }

As in RDF/JSON:
{ "_:n334" : {
  "foaf_name": [ {"value" : "Sandro Hawke", "type" : "literal"} ],
  "foaf.knows: [
                 { "value" : "_:eric" , "type" : "bnode" },
                 { "value" : "_:dan" , "type" : "bnode" },
                 { "value" : "_:matt" , "type" : "bnode" }
               ]
  },
  "_:eric" : { "foaf.name" : [ {"value" : "Eric Prud'hommeaux","type" : "literal" } ] },
  "_:dan" : { "foaf.name" : [ { "value" : "Dan Brickley", "type" : "literal" } ] } ,
  "_:matt" : { "foaf.name" : [ { "value" : "Matt Womer", "type" : "literal" } ] }
}
--------------------

OK, so jron step 6 falls flat in RDF/JSON, and step 5 is not designed (yet?).

RDF/JSON is a bit wordier than jron, but they seem to line up on the
main points.  I don't know why triple structures aren't admitted in
value arrays--I can see some advantage to flattening the graph to a set
of subject keys in a root object, but no advantage to prohibiting
nested syntactic structures that could be processed recursively.

I don't use much json myself, but am looking forward to a standard json
notation for RDF.  This looks like a good start.

Regards,
--Paul

Received on Wednesday, 24 August 2011 04:03:33 UTC