[redland-dev] Connecting to OpenAnzo with Python

Dave Beckett dave at dajobe.org
Mon Mar 14 05:30:31 CET 2011


On 3/13/11 2:33 PM, Chris Spencer wrote:
> Has anyone tried using Redland to connect to OpenAnzo?
> 
> I believe OpenAnzo's default sparql endpoint is at
> http://localhost:8080/sparql, with the basic auth login of
> sysadmin/123, so I tried modifying Redland's example.py file like:
> 
> import RDF
> storage=RDF.Storage(storage_name="uri",
>                     name="http://localhost:8080/sparql",
>                     options_string="username='sysadmin',password='123'")
> 
> However, this fails with the HTTP 401 error, presumably because the
> username and password aren't being passed. If I visited that URL in a
> browser, and enter that login, it's accepted. Is this the correct
> usage? Does Redland support sparql endpoints with basic http
> authentication?

There are a few reasons this doesn't work today as the code currently exists.

1. Redland librdf doesn't support the SPARQL protocol but raw rasqal does,
via a different API.

2. The URI storage does not handle SPARQL protocol
I don't know if I'd reflect a sparql protocol into a storage, but it would
be possible (and relatively easy) to code.

3. There is no current way to pass in HTTP auth options to storage
Which again could be added via CURL header options but isn't possible now.

Dave


More information about the redland-dev mailing list