source: gs2-extensions/apache-jena/trunk/src/src3/gs-triplestore-file-query3@ 36764

Last change on this file since 36764 was 36764, checked in by davidb, 19 months ago

FUSEKI3_PORT introduced as an environment variable that can be used to control the port the server runs on (defaults to 4040)

  • Property svn:executable set to *
File size: 543 bytes
Line 
1#!/bin/bash
2
3if [ $# -eq 0 ] ; then
4 echo "Usage: $0 file-query.sparql"
5 exit 1
6fi
7
8input_sparql_query_file=$1
9
10output_json_queryresult_file=${input_sparql_query_file%.*}.json
11
12sparql_query=`cat "$input_sparql_query_file"`
13
14port=${FUSEKI3_PORT:-4040}
15
16
17# The following line helps with runing a she-bang line of:
18# '#!/usr/bin/env ruby'
19# when the current script has been run from Perl under Cygwin
20#
21export PATH=/usr/bin:$PATH
22
23s-query --service http://localhost:$port/greenstone/query \
24 "$sparql_query" > "$output_json_queryresult_file"
Note: See TracBrowser for help on using the repository browser.