On Wed 25 Apr 2007, Earle Martin <openguides(a)downlode.org> wrote:
Your recent change to using templates for the output
theoretically
makes it very easy for us to implement.
We don't even need templates for JSON output; there's a Perl module
(called JSON, unsurprisingly) that turns a Perl object directly into JSON.
Some examples of our output in different formats using
Dave Beckett's
excellent "triplr" triple-converter:
http://triplr.org/json;pretty/http://london.openguides.org/index.cgi?id=Roy…
Hm, that's not really what I meant by JSON output. That's RDF output
wearing different clothes. What I was thinking of was something along
these lines:
{
"name" : "Red Lion and Sun, N6 4BE",
"uri" :
"http://london.randomness.org.uk/wiki.cgi?id=Red_Lion_And_Sun,_N6_4BE;format=json"
"wgs84_lat" : 51.572545,
"wgs84_long" : -0.148517,
"locales" : [ "Highgate", "N6" ],
"categories" : [ "Pubs", "Pub Food", "Beer
Gardens" ],
}
Something that can trivially be turned back into an object without the
need to parse RDF and work out what all the triples represent.
Or even:
{
"name" : "Red Lion and Sun, N6 4BE",
"uri" :
"http://london.randomness.org.uk/wiki.cgi?id=Red_Lion_And_Sun,_N6_4BE;format=json"
"wgs84_lat" : 51.572545,
"wgs84_long" : -0.148517,
"locales" : [ "Highgate", "N6" ],
"categories" : [ "Pubs", "Pub Food", "Beer
Gardens" ],
"nearby" : [
{
"distance" : 153,
"uri" :
"http://london.randomness.org.uk/wiki.cgi?id=Wrestlers,_N6_4AA;format=json"
},
{
"distance" : 311,
"uri" :
"http://london.randomness.org.uk/wiki.cgi?id=Flask,_N6_6BU;format=json"
},
{
"distance" : 589,
"uri" :
"http://london.randomness.org.uk/wiki.cgi?id=Highgate_Station;format=json"
}
]
}
Kake