From 8f491e309fb50f15204db7c81e06dec3cc7993fb Mon Sep 17 00:00:00 2001 From: Tpt Date: Thu, 22 Nov 2018 11:47:36 +0100 Subject: [PATCH] Adds BSBM benchmark scripts --- bench/bsbm-plot.py | 26 ++++++++++++++++++++++++++ bench/bsbm_blazegraph.sh | 16 ++++++++++++++++ bench/bsbm_graphdb.sh | 19 +++++++++++++++++++ bench/bsbm_rudf.sh | 15 +++++++++++++++ bench/bsbm_virtuoso.sh | 17 +++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100644 bench/bsbm-plot.py create mode 100755 bench/bsbm_blazegraph.sh create mode 100755 bench/bsbm_graphdb.sh create mode 100755 bench/bsbm_rudf.sh create mode 100755 bench/bsbm_virtuoso.sh diff --git a/bench/bsbm-plot.py b/bench/bsbm-plot.py new file mode 100644 index 00000000..a3527144 --- /dev/null +++ b/bench/bsbm-plot.py @@ -0,0 +1,26 @@ +import xml.etree.ElementTree as ET +import matplotlib.pyplot as plt +from collections import defaultdict +from glob import glob + + +def plot_y_per_x_per_plot(data, xlabel, ylabel, file): + for label, xys in data.items(): + plt.plot(list(xys.keys()), list(xys.values()), '.', label=label) + plt.legend() + plt.xlabel(xlabel) + plt.ylabel(ylabel) + # plt.yscale('log') + plt.savefig(file) + plt.show() + + +aqet = defaultdict(dict) +for file in glob('bsbm.explore.*.xml'): + run = file.replace('bsbm.explore.', '').replace('.xml', '') + for query in ET.parse(file).getroot().find('queries').findall('query'): + val = float(query.find('aqet').text) + if val > 0: + aqet[run][int(query.attrib['nr'])] = val + +plot_y_per_x_per_plot(aqet, 'query id', 'aqet', 'bsbm.explore.png') diff --git a/bench/bsbm_blazegraph.sh b/bench/bsbm_blazegraph.sh new file mode 100755 index 00000000..2b0a8835 --- /dev/null +++ b/bench/bsbm_blazegraph.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +DATASET_SIZE=100000 +cd bsbmtools-0.2 +./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" +wget https://github.com/blazegraph/database/releases/download/BLAZEGRAPH_RELEASE_2_1_5/blazegraph.jar +/usr/lib/jvm/java-8-openjdk-amd64/bin/java -server -jar blazegraph.jar & +sleep 10 +curl -f -X POST -H 'Content-Type:text/plain' --data-binary "@explore-${DATASET_SIZE}.nt" http://localhost:9999/blazegraph/sparql +./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.blazegraph.${DATASET_SIZE}.2.1.5.xml" http://localhost:9999/blazegraph/sparql +./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.blazegraph.${DATASET_SIZE}.2.1.5.xml" http://localhost:9999/blazegraph/sparql +kill $! +rm blazegraph.jar +rm blazegraph.jnl +rm "explore-${DATASET_SIZE}.nt" +rm -r td_data diff --git a/bench/bsbm_graphdb.sh b/bench/bsbm_graphdb.sh new file mode 100755 index 00000000..0e1c8eef --- /dev/null +++ b/bench/bsbm_graphdb.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +DATASET_SIZE=100000 +cd bsbmtools-0.2 +./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" +export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +../graphdb-free-8.11.0/bin/graphdb -s -Dgraphdb.logger.root.level=WARN & +sleep 10 +curl -f -X POST http://localhost:7200/rest/repositories -H 'Content-Type:application/json' -d ' +{"id":"test","params":{"ruleset":{"label":"Ruleset","name":"ruleset","value":"empty"},"title":{"label":"Repository title","name":"title","value":"GraphDB Free repository"},"checkForInconsistencies":{"label":"Check for inconsistencies","name":"checkForInconsistencies","value":"false"},"disableSameAs":{"label":"Disable owl:sameAs","name":"disableSameAs","value":"true"},"baseURL":{"label":"Base URL","name":"baseURL","value":"http://example.org/owlim#"},"repositoryType":{"label":"Repository type","name":"repositoryType","value":"file-repository"},"id":{"label":"Repository ID","name":"id","value":"repo-test"},"storageFolder":{"label":"Storage folder","name":"storageFolder","value":"storage"}},"title":"Test","type":"free"} +' +curl -f -X PUT -H 'Content-Type:application/n-triples' --data-binary "@explore-${DATASET_SIZE}.nt" http://localhost:7200/repositories/test/statements +./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.graphdb.${DATASET_SIZE}.8.11.0.xml" http://localhost:7200/repositories/test +./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.graphdb.${DATASET_SIZE}.8.11.0.xml" http://localhost:7200/repositories/test +kill $! +sleep 5 +rm -r ../graphdb-free-8.11.0/data +rm "explore-${DATASET_SIZE}.nt" +rm -r td_data diff --git a/bench/bsbm_rudf.sh b/bench/bsbm_rudf.sh new file mode 100755 index 00000000..583078a2 --- /dev/null +++ b/bench/bsbm_rudf.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +DATASET_SIZE=100000 +cd bsbmtools-0.2 +./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" +cargo build --release --manifest-path="../../server/Cargo.toml" +./../../target/release/rudf_server --file rudf_data & +sleep 5 +curl -f -X POST -H 'Content-Type:application/n-triples' --data-binary "@explore-${DATASET_SIZE}.nt" http://localhost:7878/ +./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.rudf.${DATASET_SIZE}.$(date +'%Y-%m-%d').xml" http://localhost:7878/query +./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.rudf.${DATASET_SIZE}.$(date +'%Y-%m-%d').xml" http://localhost:7878/query +kill $! +rm -r rudf_data +rm "explore-${DATASET_SIZE}.nt" +rm -r td_data \ No newline at end of file diff --git a/bench/bsbm_virtuoso.sh b/bench/bsbm_virtuoso.sh new file mode 100755 index 00000000..4e64cf48 --- /dev/null +++ b/bench/bsbm_virtuoso.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +DATASET_SIZE=100000 +cd bsbmtools-0.2 +./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" +cp ../virtuoso-opensource/database/virtuoso.ini.sample virtuoso.ini +mkdir ../database +../virtuoso-opensource/bin/virtuoso-t -f & +sleep 30 +curl -f --digest --user dba:dba -H 'Content-Type:application/n-triples' --data-binary "@explore-${DATASET_SIZE}.nt" 'http://localhost:8890/sparql-graph-crud-auth?graph-uri=urn:graph:test' +curl -f -H 'Content-Type:application/sparql-query' --data "SELECT (COUNT(*) AS ?c) WHERE { ?s ?p ?o }" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' +./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.virtuoso.${DATASET_SIZE}.7.2.5.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' +./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.virtuoso.${DATASET_SIZE}.7.2.5.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' +kill $! +rm -r ../database +rm "explore-${DATASET_SIZE}.nt" +rm -r td_data