From: Benjamin H. <ben...@de...> - 2011-08-24 15:18:02
|
Hello, has the SPARQLWrapper library been tested with a password protected endpoint? I need to provide a username and password for executing my SPARQL queries, and providing them as part of the URI does not seem to work. Using curl for the task succeeds (and using SPARQLWrapper for an unprotected SPARQL endpoint such as DBPedia works as well). However, using SPARQLWrapper for accessing the protected endpoint does not work. I tried constructing a SPARQLWrapper like this: sparql = SPARQLWrapper("http://user:pas...@so...:2020/joseki/sparql/read") However, I get an "getaddrinfo failed" exception from deep inside urllib2. If I do not provide the username and password, I get a "401 authentication error" exception (as expected). Here is the curl command which does the job: curl --user "user:password" -H "Accept: application/sparql-results+json" -d "query=SELECT count(distinct ?post) WHERE {{?post a <http://rdfs.org/sioc/ns#Post>} UNION {?post a <http://rdfs.org/sioc/types#BlogPost>}}" http://somehost.com:2020/joseki/sparql/read If this a feature which was never actually tested with SPARQLWrapper, how difficult would it be to add this to the library? sincerely, Benjamin Heitmann. |