I have been having this weird issue, I am trying to insert into a virtuoso graph using SPARQLWrapper library in python.
I am able to insert a triple via the browser based endpoint at localhost:8890\sparql
, but when I try the same query via my python SparqlWrapper it throws the below error:
SPARQLWrapper.SPARQLExceptions.QueryBadFormed: QueryBadFormed: a bad request has been sent to the endpoint, probably the sparql query is bad formed.
I feel there is something wrong at configuration end, but failed to identify the same.
PREFIX dbpedia: <http://dbpedia.org/resource/> Insert Data { GRAPH <test> { <http://dbpedia.org/resource/life> <http://umbel.org/umbel/rc/Artist> '2' . } }
Traceback (most recent call last):
File "test.py", line 33, in <module>
sys.exit(process.run("1"))
File "test.py", line 27, in run
result = self.sparql.query().convert()
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SPARQLWrapper/Wrapper.py", line 390, in query
return QueryResult(self._query())
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SPARQLWrapper/Wrapper.py", line 363, in _query
raise QueryBadFormed()
SPARQLWrapper.SPARQLExceptions.QueryBadFormed: QueryBadFormed: a bad request has been sent to the endpoint, probably the sparql query is bad formed.