#!/bin/bash if [ $# -eq 0 ] ; then echo "Usage: $0 file-query.sparql" exit 1 fi input_sparql_query_file=$1 output_json_queryresult_file=${input_sparql_query_file%.*}.json sparql_query=`cat "$input_sparql_query_file"` port=${FUSEKI3_PORT:-8383} # The following line helps with runing a she-bang line of: # '#!/usr/bin/env ruby' # when the current script has been run from Perl under Cygwin # export PATH=/usr/bin:$PATH s-query --service http://localhost:$port/fuseki3/greenstone/query \ "$sparql_query" > "$output_json_queryresult_file"