Last change
on this file since 38274 was 38274, checked in by davidb, 8 months ago |
Updated to work as a GS3 extension without the need for Ruby
|
-
Property svn:executable
set to
*
|
File size:
637 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:-8383}
|
---|
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/fuseki3/greenstone/query \
|
---|
24 | # "$sparql_query" > "$output_json_queryresult_file"
|
---|
25 |
|
---|
26 | curl -X GET \
|
---|
27 | -d "query=$sparql_query" > "$output_json_queryresult_file"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.