Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

URL-encoded POST // Encountered "update" at line 1, column 1 #70

Closed
Inexpugnable opened this issue Oct 7, 2020 · 1 comment
Closed

Comments

@Inexpugnable
Copy link

Inexpugnable commented Oct 7, 2020

Issue raised when using Corese-server (version 4.1.4a) and SPARQLWrapper (python library) with insert queries (not tested with other SPARQL 1.1 Update queries).

SPARQLWrapper will detect that Corese-server uses the "URL-encoded" protocol (https://www.w3.org/TR/sparql11-protocol/#update-operation) and will therefore use an "update" parameter not supported by Corese-server.

Line of codes probably involved in SPARQLWrapper (https://github.com/RDFLib/sparqlwrapper/blob/master/SPARQLWrapper/Wrapper.py):

request = urllib.request.Request(uri)
request.add_header("Content-Type", "application/x-www-form-urlencoded")
request.data = self._getRequestEncodedParameters(("update", self.queryString)).encode('ascii')

One way to workaround the problem with SPARQLWrapper is to use the parameter 'postdirectly' (setRequestMethod('postdirectly')) https://sparqlwrapper.readthedocs.io/en/latest/SPARQLWrapper.Wrapper.html#SPARQLWrapper.Wrapper.POSTDIRECTLY

@MaillPierre
Copy link
Member

Tested during resolution of #191

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants