Strabon
changeset 491:23a9e69cb926
added option "-i" in strabon script for including the prefixes present in file "prefixes.sparql" when SPARQL querying
author | Babis Nikolaou <charnik@di.uoa.gr> |
---|---|
date | Mon Jul 23 14:30:44 2012 +0300 (2012-07-23) |
parents | b127904ef297 |
children | 6c92f5b28e76 1cf4692447d2 |
files | scripts/strabon |
line diff
1.1 --- a/scripts/strabon Mon Jul 23 12:40:58 2012 +0300 1.2 +++ b/scripts/strabon Mon Jul 23 14:30:44 2012 +0300 1.3 @@ -60,6 +60,9 @@ 1.4 # so it must not be overidden 1.5 DEBUG_SAVE=false 1.6 1.7 +# Filename containing the prefixes to be included in SPARQL queries 1.8 +PREFIXES_FILE="${LOC}/prefixes.sparql" 1.9 + 1.10 # configuration file for the Strabon connection 1.11 STRABON_CONF="${HOME}/.strabon" 1.12 1.13 @@ -75,6 +78,8 @@ 1.14 echo " -d : don't run, just print what shall be executed" 1.15 echo " Variable for configuration file: \`DEBUG'" 1.16 echo " Values: \`true' or \`false'" 1.17 + echo " -i : include URI prefixes in the SPARQL query. Prefixes are taken from file" 1.18 + echo " \`prefixes.sparql'" 1.19 echo " -e DATABASE : the database engine to connect (one of \`postgis' (default) or \`monetdb')" 1.20 echo " Variable for configuration file: \`DATABASE'" 1.21 echo " Values: \`postgis' or \`monetdb'" 1.22 @@ -167,6 +172,11 @@ 1.23 DEBUG=true 1.24 DEBUG_SAVE=true 1.25 ;; 1.26 + -i) 1.27 + shift 1.28 + PREFIXES="$(cat ${PREFIXES_FILE}) 1.29 +" 1.30 + ;; 1.31 -e) 1.32 shift 1.33 if ! test $# -gt 1; then 1.34 @@ -479,7 +489,7 @@ 1.35 " 1.36 done 1.37 else 1.38 - STRABON_EXEC="(cd ${RUNTIME} && java -cp ./target/\*:. ${PKG}.${DATABASE}.${CLASS} ${HOST} ${PORT} ${DB} ${DBUSER} ${DBPASS} \"${QUERY}\" ${RESULT_FORMAT})" 1.39 + STRABON_EXEC="(cd ${RUNTIME} && java -cp ./target/\*:. ${PKG}.${DATABASE}.${CLASS} ${HOST} ${PORT} ${DB} ${DBUSER} ${DBPASS} \"${PREFIXES}${QUERY}\" ${RESULT_FORMAT})" 1.40 fi 1.41 1.42 # execute command or debug