accessing sparql endpoints via http requests
Dear lisp users, I am not an experienced lisper yet, so sorry in advance if the question is not up to the standards :-)
I'm using LW on an intel mac (not leopard - for whatever difference it would make), and I've been trying to access a sparql endpoint 'manually', by creating the string-query myself and passing it via http to the endpoint.
Example:
http://DBpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&should-sponge=&query=SELECT+%3Fperson%0D%0AWHERE+%7B+%3Fperson%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2Fname%3E+%22Platon%22%40de+%7D&format=text%2Fhtml&debug=on
This query over the DBpedia endpoint works well if done with a browser, but if I try to do it with DRAKMA, I get this error:
DRAKMA 32 : 4 > (http-request “http://DBpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&should-sponge=&query=SELECT+%3Fperson%0D%0AWHERE+%7B+%3Fperson%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2Fname%3E+%22Platon%22%40de+%7D&format=text%2Fhtml&debug=on“)
Error: Unknown protocol in “<?xml version=\“1.0\“ encoding=\“ISO-8859-1\“?>“.
Instead, if tried with sS-HTTP-CLIENT, it breaks here:
S-HTTP-CLIENT 19 : 5 > (do-http-request "http://DBpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&should-sponge=&query=SELECT+%3Fperson%0D%0AWHERE+%7B+%3Fperson%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2Fname%3E+%22Platon%22%40de+%7D&format=text%2Fhtml&debug=on")
Error: In 1+ of (NIL) arguments should be of type NUMBER.
1 (continue) Return a value to use.
WHere do I get it wrong? I hope that the error is due only to my lack of knowledge and you guys and help me fixin it....
Cheers
Michele
p.s.
I know that there is TWINQL for doing sparql-stuff, but it's not well supported (in platforms other that Allegro) so I just wanted an easy solution to start with..
____________________________
Michele Pasin
Phd Student
Knowledge Media Institute
The Open University
Walton Hall
Milton Keynes
MK7 6AA
United Kingdom
Tel: 01908 858730
Email: m.pasin@open.ac.uk
< www.kmi.open.ac.uk/people/mikele >