Last active
March 29, 2018 20:30
-
-
Save wikier/38c0e3a4925b0bb81dd0 to your computer and use it in GitHub Desktop.
SPARQLWrapper HTTP Digest Auth example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from SPARQLWrapper import SPARQLWrapper, JSON, DIGEST | |
sparql = SPARQLWrapper("http://example.org/sparql") | |
sparql.setHTTPAuth(DIGEST) | |
sparql.setCredentials('login', 'password') | |
sparql.setQuery("...") | |
sparql.setReturnFormat(JSON) | |
results = sparql.query().convert() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't it be 'DIGEST', as https://rdflib.github.io/sparqlwrapper/doc/latest/SPARQLWrapper.Wrapper.SPARQLWrapper-class.html#setHTTPAuth, states it should be string as parameter, and unless defined elsewhere, 'BASIC' and 'DIGEST' are only valid options so far