[foaf-dev] GRDDL and JSON
Morten Høybye Frederiksen
morten at wasab.dk
Tue Feb 5 18:31:57 GMT 2008
Thinking out loud...
* GRDDL  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  can return results in a callback wrapper.
* Results from GSG can be turned into triples .
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
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:
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...
More information about the foaf-dev