If you use the soon to be released 5.0.0 of RDFLib (i.e. head of git
master) and you need a Graph and not just a query, you can do:

import rdflib
from rdflib.plugins.stores.sparqlstore import SPARQLStore

import requests
r = requests.post( ... whatever ...)
jar = r.cookies

store = SPARQLStore('http://localhost:8000', cookies=jar)
g = rdflib.Graph(store)

Any query performed by this graph will now use your cookies.

- Gunnar
On Wed, 31 Oct 2018 at 17:23, <[email protected]> wrote:
>
> Hi all,
>
> I'd like to use SPARQLWrapper to query an endpoint that requires 
> authorization.  Sadly, the authorization is form based, so I need to fetch an 
> initial cookie, post username/password and then hold on to that cookie for 
> every subsequent query.  I don't see an easy way to do this.  Is there an 
> example floating around that might be of help to me?
>
> Thanks,
> Adam
>
> --
> http://github.com/RDFLib
> ---
> You received this message because you are subscribed to the Google Groups 
> "rdflib-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rdflib-dev/25f8f5e4-8884-4368-b0d9-e55f926826fc%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
http://gromgull.net

-- 
http://github.com/RDFLib
--- 
You received this message because you are subscribed to the Google Groups 
"rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rdflib-dev/CAGm1OD%3DjmvXGqeHN%3DrZpkWDfqpBk1J27W4VnubNLAOxgy%2B96sw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to