Last change
on this file since 35080 was 35080, checked in by davidb, 3 years ago |
Like gs-triplestore-query3, but takes its query from a file specified as a command-line argument
|
-
Property svn:executable
set to
*
|
File size:
514 bytes
|
Rev | Line | |
---|
[35080] | 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 |
|
---|
| 15 | # The following line helps with runing a she-bang line of:
|
---|
| 16 | # '#!/usr/bin/env ruby'
|
---|
| 17 | # when the current script has been run from Perl under Cygwin
|
---|
| 18 | #
|
---|
| 19 | export PATH=/usr/bin:$PATH
|
---|
| 20 |
|
---|
| 21 | s-query --service http://localhost:4040/greenstone/query \
|
---|
| 22 | "$sparql_query" > "$output_json_queryresult_file"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.