You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use SPARQLWrapper version 1.8.5-152-g2a6e2d3 with GraphDB 10.2.2 SPARQL endpoint.
Here is my my-example-insert.py script:
from SPARQLWrapper import SPARQLWrapper, POST
sparql = SPARQLWrapper("http://172.17.0.3:7200/repositories/test")
sparql.setMethod(POST)
sparql.setQuery("""
WITH <http://example.graph>
INSERT
{ <http://dbpedia.org/resource/Asturias> rdfs:label "Asturies"@ast }
""")
results = sparql.query()
print(results.response.read())
The script output:
$ python3 my-example-insert.py
Traceback (most recent call last):
File "/workdir/test-sparql/SPARQLWrapper/Wrapper.py", line 926, in _query
response = urlopener(request)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 525, in open
response = meth(req, response)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response
response = self.parent.error(
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 563, in error
return self._call_chain(*args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workdir/test-sparql/example-delete.py", line 13, in <module>
results = sparql.query()
^^^^^^^^^^^^^^
File "/workdir/test-sparql/SPARQLWrapper/Wrapper.py", line 960, in query
return QueryResult(self._query())
^^^^^^^^^^^^^
File "/workdir/test-sparql/SPARQLWrapper/Wrapper.py", line 930, in _query
raise QueryBadFormed(e.read())
SPARQLWrapper.SPARQLExceptions.QueryBadFormed: QueryBadFormed: A bad request has been sent to the endpoint: probably the SPARQL query is badly formed.
Response:
b'Missing parameter: query'
I have the same problem with the DELETE request.
The text was updated successfully, but these errors were encountered:
I use SPARQLWrapper version 1.8.5-152-g2a6e2d3 with GraphDB 10.2.2 SPARQL endpoint.
Here is my
my-example-insert.py
script:The script output:
I have the same problem with the
DELETE
request.The text was updated successfully, but these errors were encountered: