Skip to content

SPARQL proxy endpoint#898

Draft
dennisvang wants to merge 16 commits into
support/1.19.xfrom
feature/896-sparql-protocol
Draft

SPARQL proxy endpoint#898
dennisvang wants to merge 16 commits into
support/1.19.xfrom
feature/896-sparql-protocol

Conversation

@dennisvang
Copy link
Copy Markdown
Contributor

@dennisvang dennisvang commented May 13, 2026

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-memory or native (file-system) options.

fixes #896

TODO:

  • require authentication?
  • bump version
  • add POST methods
  • remove the "old" sparqlPost controller method
  • ensure SPARQL update requests are denied
  • check if we need to do additional input validation

dennisvang added 16 commits May 13, 2026 15:33
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant