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 |
|
---|
3 | if [ $# -eq 0 ] ; then
|
---|
4 | echo "Usage: $0 file-query.sparql"
|
---|
5 | exit 1
|
---|
6 | fi
|
---|
7 |
|
---|
8 | input_sparql_query_file=$1
|
---|
9 |
|
---|
10 | output_json_queryresult_file=${input_sparql_query_file%.*}.json
|
---|
11 |
|
---|
12 | sparql_query=`cat "$input_sparql_query_file"`
|
---|
13 |
|
---|
14 | port=${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 | #
|
---|
21 | export PATH=/usr/bin:$PATH
|
---|
22 |
|
---|
23 | s-query --service http://localhost:$port/greenstone/query \
|
---|
24 | "$sparql_query" > "$output_json_queryresult_file"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.