Search code examples
proxysparqljenafusekifederated-queries

Make jena and fuseki proxy aware for federated queries


Our application is built on top of Jena and Fuseki. The application uses federated SPARQL queries accessing SPARQL endpoints in the public domain.

Some networks which the application is intended for only allow HTTP requests via a HTTP proxy as part of their network policy.

How may fuseki be configured so that, when it makes HTTP requests as part of a SERVICE block in a SPARQL sub-query, it uses the correct http_proxy?

On Linux, I have tried using a local environment variable

export http_proxy=http://myproxy.notadomain

in the shell which runs the fuseki-server process but Fuseki does not appear to respect this environment variable.

I cannot find information in the Fuseki documentation about how this is handled.

I would like a way to run fuseki-server directly as a Linux process with the proxy configured, either in a configuration file, or as a run time parameter.

All advice gratefully received.


Solution

  • Fuseki is a Java application. What I usually do is to export a JAVA_OPTIONS variable with all my customizations, for example:

    export JAVA_OPTIONS="-Xmx10g -Dhttp.proxyHost=proxy.example.org -Dhttp.proxyPort=8080 -Dfile.encoding=UTF-8 -Dlog4j.configuration=file:./log4j.properties"