Sign inSign up

alexishuf/fedx-lrb

By alexishuf

•Updated almost 5 years ago

SPARQL server around the FedX-3.1 shipped with the LargeRDFBench

Image
0

582

alexishuf/fedx-lrb repository overview

⁠fedx-lrb

Mavenizes Fedx-3.1 from LargeRDFBench⁠ and adds a SPARQL server implementation supporting all SPARQL result formats:

The current implementation of the server, as many triple stores (e.g., Jena Fuseki and Virtuoso at the time of this writing) is not "streamed" to supporting HTTP clients. Thus, the server buffers the whole representation of the query results in memory before issuing the Content-Length header and start sending the representation over the wire.

⁠Running the image

docker run -it --rm [-v HOST:/data] [-p 8080:8080] \ 
    alexishuf/fedx-lrb:3.1 [OPTIONS] ENDPOINTS_FILES_OR_URLS...

Not providing any command line arguments will use a default of --help to show available options. ENDPOINTS_FILES_OR_URLS must be one or more URLs of SPARQL endpoints or files reached from the container (most likely mounted in /data) containing one such URL per line (empty lines or lines starting with # are ignored).

⁠Environment variables
  • JVM_ARGS - command-line flags to be passed to java, before the -jar flag.
⁠Complete example

Start a SPARQL endpoint at http://0.0.0.0:3031/a/sparql

cd "$(mktemp -d)"
cat >data.ttl<<EOF
@prefix ex: <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
ex:Alice foaf:name "Alice"@en;
         foaf:knows ex:Bob.
EOF
fuseki-server --port 3031 --file data.ttl /a

Start a second SPARQL endpoint at http://0.0.0.0:3032/b/sparql

cd "$(mktemp -d)"
cat >data.ttl<<EOF
@prefix ex: <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
ex:Bob foaf:name "Bob"@en;
       foaf:age 22.
EOF
fuseki-server --port 3032 --file data.ttl /b 

Start FedX (replace 172.17.0.1 according to ip addr show docker0) on port 3033 using a host directory as the /data volume, using up to 3.75 GiB of 4 GiB RAM allocated to the container.

mkdir data
echo http://172.17.0.1:3032/b/sparql > data/endpoints
docker run -it --rm -p 3033:3033 -v $(pwd)/data:/data \
    -m 4g --env JVM_ARGS="-Xmx3.75g -Xms=256m" \
    alexishuf/fedx-lrb:3.1 --port 3033 -v DEBUG \
    http://172.17.0.1:3031/a/sparql /data/endpoints

Send a query:

url -vH "Accept: text/tsv" "http://localhost:3033/sparql?query=SELECT%20*%20WHERE%20%7B?s%20?p%20?o%7D%20LIMIT%2010"

⁠Build arguments

The following variables can be set with --build-arg at docker build:

  • LRB_REPO=dice-group/LargeRDFBench - GitHub repository with LargeRDFBench⁠
  • LRB_COMMIT=49d1401d70673a8054ddb2cba185e387e7a0e81c - Commit of LRB_REPO from which LargeRDFBench_Selected_Systems.7z shall be downloaded
  • MVN_ARCHIVE=https://archive.apache.org/dist/maven/maven-3 - where to download maven binaries from.
  • MVN_VERSION=3.8.1 - maven version to use

Tag summary

Content type

Image

Digest

Size

458.4 MB

Last updated

almost 5 years ago

docker pull alexishuf/fedx-lrb:3.1