sparqlwrapper
sparqlwrapper copied to clipboard
Raise `ValueError` when user selects incopatable formats
This code fails because RDF is not a valid response format for a SELECT query:
from SPARQLWrapper import SPARQLWrapper, RDF, JSON, XML
sparql = SPARQLWrapper('http://ja.dbpedia.org/sparql')
sparql.setQuery('select * where { ?x ?y ?z. } limit 1')
sparql.setReturnFormat(RDF)
results = sparql.query().convert()
The code should not fail but should raise a ValueError Exception and explain why.
@eggplants this is just re-issuing your Issue with better scope for resolution.
@nicholascar Hi, here as a first time contributor! I tried my hands on this issue and am submitting a PR that solves it. Request you to please review it and share your thoughts on the same! Thanks!
Pull request added #218 with the required changes as discussed.