[foaf-dev] GRDDL and JSON

Morten Høybye Frederiksen morten at wasab.dk
Tue Feb 5 18:31:57 GMT 2008


Hey,

Thinking out loud...

* GRDDL [1] can extract triples from xml and html documents only.
* JSON isn't as precise as RDF because of the lack of URIs, and no
universal way to interprete results.
* No obvious way to include "interpretation" information in JSON.
* Some JSON APIs, e.g. GSG [2] can return results in a callback wrapper.
* Results from GSG can be turned into triples [3].

So, how about using the callback functionality to add GRDDL-like
functionality to e.g. the results returned from GSG?

Assuming an algorithm for turning a valid JSON callback into a URI
(that doesn't contain underscores):
* Replace three consecutive underscores with a "/" (slash)
* Then replace two consecutive underscores with a ":" (colon)
* Then replace remaining underscores with a "." (dot)

Define a base URI, e.g. "http://purl.org/net/jsongrddl/", and append
som identifier, e.g. "gsg" (assuming some sort of central registry for
identifiers).

Add a callback argument to the JSON API request, and the result could
then -- with a little initial effort -- be interpreted as triples by
any RDF library (that already supports GRDDL-like functionality) by
keying of the (prefix of) the callback:

http://socialgraph.apis.google.com/lookup?q=www.wasab.dk/morten/&fme=1&pretty=1&sgn=1&callback=http________purl_org___net___jsongrddl___gsg

Not sure which mapping to use for GSG, with the wrong results
(currently) returned by the above query, I'm not inclined to much more
than rdfs:seeAlso statements...

Crazy?

Morten

[1] http://www.w3.org/2003/g/data-view
[2] http://code.google.com/apis/socialgraph/
[3] http://chatlogs.planetrdf.com/swig/2008-02-02.html#T00-47-59


More information about the foaf-dev mailing list