-
Notifications
You must be signed in to change notification settings - Fork 578
sparqlconnector sends correct accept header in case of construct query #3324
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
base: main
Are you sure you want to change the base?
sparqlconnector sends correct accept header in case of construct query #3324
Conversation
WhiteGobo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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)