tl;dr : how to give SPARQL endpoints an "I'm Feeling Lucky" option and hence support 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.
WebFingering
I've had James Snell's proposal for simplifying WebFinger 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). 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.
PS. A better name might be "Optimistic SPARQL" (and probably return a 404 if the query doesn't return a suitable pattern).