Lucky SPARQL

A proposed mini-convention for giving SPARQL endpoints an "I'm Feeling
Lucky" option and hence supporting things like WebFinger.

Take a query like:

SELECT DISTINCT ?blog WHERE {
   ?person foaf:name "James Snell" .
   ?person foaf:weblog ?blog .
}
LIMIT 1

If I'm asking something like that, then what I'm probably trying to
achieve is to get to James' blog. But if use that on an endpoint, what
I'll get back is a bunch of XML (or JSON), from which I'll have to
parse out the URI, then fire off another GET. So what about having the
endpoint server support an additional parameter, something like:

http://example.org/sparql?query=SELECT+DISTINCT+... &action=redirect

which would tell the server to pull out the URI in the results, and return:

HTTP/1.1 302 Found
Location: http://chmod777self.blogspot.com

- thus taking me straight to my actual target.

I've had James Snell's proposal [1] for simplifying WebFinger [2]
simmering away in the back of my mind. I'm unconvinced by the
architectural style of what he suggests (Gopher?), but he does get
bonus points for creativity. (See also James' response on that [3]).
In the query above I've used foaf:name which is likely to give
ambiguous results. But if it was foaf:mbox_sha1sum instead, you've got
a mechanism for WebFinger with James' optimization. Ok, the request
URI is a bit cumbersome, but templating a short version for special
cases like WebFinger would be easy enough.

(Blogged at [4] and fired off to all the social nets, but then it
occurred to me that most of the potential implementers will be around
here :)

Cheers,
Danny.

[1] http://chmod777self.blogspot.com/2012/03/thoughts-on-webfinger.html
[2] http://www.ietf.org/id/draft-jones-appsawg-webfinger-01.txt
[3] https://plus.google.com/112609322932428633493/posts/WvedRayrYEn
[4] http://dannyayers.com/2012/03/29/Lucky-SPARQL

-- 
http://dannyayers.com

http://webbeep.it  - text to tones and back again

Received on Thursday, 29 March 2012 12:19:17 UTC