aboutsummaryrefslogtreecommitdiff
path: root/run_tests.bash
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2021-01-30 10:46:23 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2021-01-30 10:48:29 +0000
commitd04e2839689c4291afb4beb9a1913bb38fac1cd1 (patch)
tree365e5ea2ef138e83ff46ecce72c716de6686e78e /run_tests.bash
parent87b180f1de0e1c30a4624e546825b77c2edf9bbe (diff)
downloadRSAComb-d04e2839689c4291afb4beb9a1913bb38fac1cd1.tar.gz
RSAComb-d04e2839689c4291afb4beb9a1913bb38fac1cd1.zip
Introduce a better system to handle command line input
Diffstat (limited to 'run_tests.bash')
-rwxr-xr-xrun_tests.bash20
1 files changed, 18 insertions, 2 deletions
diff --git a/run_tests.bash b/run_tests.bash
index 17cbf01..92e0223 100755
--- a/run_tests.bash
+++ b/run_tests.bash
@@ -32,6 +32,8 @@ print_help() {
32 echo " -q | --queries <path>:" 32 echo " -q | --queries <path>:"
33 echo " path to a folder containing SPARQL query files to be" 33 echo " path to a folder containing SPARQL query files to be"
34 echo " executed against the ontology and data." 34 echo " executed against the ontology and data."
35 echo " -j | --jar <path>:"
36 echo " path to the fat jar to be executed."
35 echo " -p | --prefix <path>:" 37 echo " -p | --prefix <path>:"
36 echo " provides a folder to prefix to the output files." 38 echo " provides a folder to prefix to the output files."
37 echo " Defaults to './results'." 39 echo " Defaults to './results'."
@@ -43,6 +45,7 @@ print_help() {
43ONTOLOGY="" 45ONTOLOGY=""
44DATA="" 46DATA=""
45QUERIES="" 47QUERIES=""
48JAR=""
46PREFIX="./results" 49PREFIX="./results"
47 50
48while [[ $# -gt 0 ]] 51while [[ $# -gt 0 ]]
@@ -72,6 +75,14 @@ do
72 print_help && \ 75 print_help && \
73 exit 2 76 exit 2
74 ;; 77 ;;
78 -j|--jar)
79 shift
80 JAR="$1"
81 [ ! -r "$JAR" ] && \
82 msg_error "Unable to read jar '$JAR'" && \
83 print_help && \
84 exit 2
85 ;;
75 -p|--prefix) 86 -p|--prefix)
76 shift 87 shift
77 PREFIX="$1" 88 PREFIX="$1"
@@ -104,12 +115,17 @@ done
104 print_help && \ 115 print_help && \
105 exit 3 116 exit 3
106 117
118[ -z "$JAR" ] && \
119 msg_error "Use -j | --jar to provide a jar file" && \
120 print_help && \
121 exit 3
107 122
108DATAS=`\ls $DATA/*` 123DATAS=`\ls $DATA/*`
109mkdir -p "$PREFIX" 124mkdir -p "$PREFIX"
110for QUERY in "$QUERIES"/*.sparql 125for QUERY in "$QUERIES"/query*.sparql
111do 126do
112 sbt "run $QUERY $ONTOLOGY $DATAS" 2>&1 | tee "$PREFIX/answers_$(basename $QUERY .sparql).txt" 127 #sbt "run $QUERY $ONTOLOGY $DATAS" 2>&1 | tee "$PREFIX/answers_$(basename $QUERY .sparql).txt"
128 java -cp ./lib/JRDFox.jar:"$JAR" uk.ac.ox.cs.rsacomb.RSAComb -q "$QUERY" "$ONTOLOGY" "$DATA"/* 2>&1 | tee "$PREFIX/answers_$(basename $QUERY .sparql).txt"
113done 129done
114 130
115OUTPUT="$PREFIX/results.csv" 131OUTPUT="$PREFIX/results.csv"