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

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
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
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#
19export PATH=/usr/bin:$PATH
20
21s-query --service http://localhost:4040/greenstone/query \
22 "$sparql_query" > "$output_json_queryresult_file"
Note: See TracBrowser for help on using the repository browser.