sparqlconnector sends correct accept header in case of construct query#3324
sparqlconnector sends correct accept header in case of construct query#3324smeckler wants to merge 6 commits intoRDFLib:mainfrom
Conversation
WhiteGobo
left a comment
There was a problem hiding this comment.
I suggest also adding a test like test/test_store/test_store_sparqlstore_query.test_query_construct_format, where you check, that turtle is in request.headers['Accept'].
| rdf_mimetype_map = [mime for mlist in FORMAT_MIMETYPE_MAP.values() for mime in mlist] | ||
|
|
||
| # use the matched returnType if it matches one of the rdf mime types | ||
| if self.returnFormat in FORMAT_MIMETYPE_MAP: |
There was a problem hiding this comment.
As far as i remember we have different parsers available for Construct-queries and Select-queries. So i would rather see use of a variable self.returnFormatConstruct than reuse self.returnFormat. Of course, you would have to add it to __init__ too.
|
Because of the failing testrun, you can take a look into developers guide poetry run mypy
poetry run black .Apart from that, this looks fine, to me at least. Sorry for my misunderstanding in your issue description. |
|
@smeckler Is this PR backwards compatible with existing v7 releases? If so, we should rebase onto |
resolves #3332
Summary of changes
For SPARQL construct queries, send mime types for RDF instead of for SPARQL results in the header of the HTTP request.
Some SPARQL servers (in my case Anzo) respond with a 400 'Bad Request' response if the Accept header does not describe RDF for construct or describe queries.
sparqlconnector.py
plugin.py
Checklist
the same change.
update:
7600 passed, 592 skipped, 331 xfailed, 36 xpassed, 36012 warnings in 139.91s (0:02:19)