Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Inexpugnable opened this issue Oct 7, 2020 · 0 comments
Open

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

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

No branches or pull requests

1 participant