jue...@gmail.com
unread,Nov 20, 2018, 11:11:59 AM11/20/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rdflib-dev
Hi all,
i try to run rdflib 5.0 with the SPARQLUpdateStore against graphdb from ontotext (actually against their rdf4j RestAPI) .
Anybody knows how I could do SPARQL UPDATE queries with rdflib 5.0 against their store.
Authentication works but i get an HTTP response code of 415 with message "unrecognized mime type".
I assume it is because rdflib currently sends the data as byte string.
And it seems we would need the POST body to start with "update: INSERT ...".
Also i do not see that the Content-Type header field is set in the POST request.
Looking at the removed SPARQLWrapper library is see that SPARQL update POST queries can be encoded in two ways:
if self.requestMethod == POSTDIRECTLY:
request.add_header("Content-Type", "application/sparql-update")
request.data = self.queryString.encode('UTF-8')
else: # URL-encoded
request.add_header("Content-Type", "application/x-www-form-urlencoded")
request.data = self._getRequestEncodedParameters(("update", self.queryString)).encode('ascii')
Best
Jürgen