RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.15k stars 555 forks source link

SPARQLConnector.update() does set content type #919

Closed jpmccu closed 3 years ago

jpmccu commented 5 years ago

According to the spec, when posting text/plain data (which is what most web servers interpret a missing content-type as) to a SPARQL endpoint, you need to pass the update as a form-encoded dictionary. However, the current SPARQLConnector.update() function passes it as the data body, which would be fine if the content type were set to application/sparql-update. It's probably easier to set the content type correctly, but the current state will fail on SPARQL endpoints (like Blazegraph) that interpret this strictly.

robcast commented 3 years ago

Thanks for spotting this @jimmccusker! I just ran into the same problem with some obscure error messages when I tried to use RDFLib 5.0.0 with Blazegraph (worked fine with 4.2.2).

...looks like it's been fixed in da99d4e. Now if there would be a new release... :-)