Reply to my own, account I had to overwrite the updat method of SPARQLConnector to explicitly set utf-8 in the header. Is this really the only solution?
def update(
self,
query,
default_graph: Optional[str] = None,
named_graph: Optional[str] = None,
):
if not self.update_endpoint:
raise SPARQLConnectorException("Query endpoint not set!")
params = {}
if default_graph is not None:
params["using-graph-uri"] = default_graph
if named_graph is not None:
params["using-named-graph-uri"] = named_graph
headers = {
"Accept": _response_mime_types[self.returnFormat],
"Content-Type": "application/sparql-update; charset=UTF-8",
}
args = dict(self.kwargs) # other QSAs
args.setdefault("params", {})
args["params"].update(params)
args.setdefault("headers", {})
args["headers"].update(headers)
qsa = "?" + urlencode(args["params"])
res = urlopen(
Request(
self.update_endpoint + qsa, data=query.encode(), headers=args["headers"]
)
)