SPARQL proxy endpoint#898
Draft
dennisvang wants to merge 16 commits into
Draft
Conversation
RestTemplate is deprecated, so we're using RestClient for new functionality. Existing functionality using RestTemplate should be updated in a separate PR, see #897
The idea is to pass on requests as unauthenticated requests to the triple store's SPARQL endpoint.
Here we use RestClient.exchange() to obtain the actual response object, with body as bytes to ensure it remains unchanged. Note that RestClient.retrieve() could work, but that would raise an error if the RestClient receives a status >=400, so the controller would return a status 500 server error.
this is a better fit for the restclient headers() method api
this is a more idiomatic spring web mvc approach, although we still need to use the underlying request object to get the ip
due to the @RequestHeader approach, it is now cleaner to use the lambda
the url parameters are added separately, instead of using a map containing all of them, because this creates more useful swagger docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced the custom read-only SPARQL endpoint by a proxy endpoint that forwards the request directly to the backend triple store's SPARQL endpoint, which should offer full SPARQL protocol support.
Note
This only works for external triple stores, not for the
in-memoryornative(file-system) options.fixes #896
TODO:
sparqlPostcontroller method