Skip to content

Commit

Permalink
ADDED: client/swish-ask.sh working --format option and new --applic…
Browse files Browse the repository at this point in the history
…ation

option.
  • Loading branch information
JanWielemaker committed Nov 26, 2020
1 parent 06e75f8 commit bbbbcf3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions client/swish-ask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
server=${SWISH_SERVER-http://localhost:3050}
srctext=
curlarg=
format=${SWISH_FORMAT-prolog}
format=${SWISH_FORMAT-csv}
program=$(basename $0)
application=swish

usage()
{
Expand Down Expand Up @@ -51,7 +52,7 @@ while [ $done = false ]; do
--format=*)
format=$(echo $1 | sed 's/.*=//')
case "$format" in
rdf|prolog)
rdf|prolog|json)
;;
*)
usage
Expand All @@ -60,6 +61,10 @@ while [ $done = false ]; do
esac
shift
;;
--application=*)
application=$(echo $1 | sed 's/.*=//')
shift
;;
https://*.pl|http://*.pl)
curlarg+=" -d src_url=$1"
shift
Expand All @@ -86,9 +91,9 @@ fi
curl -s \
-d ask="$query" \
-d template="$format($vars)" \
-d application="swish" \
-d application="$application" \
-d src_text="$srctext" \
-d format=csv \
-d format="$format" \
-d chunk=10 \
-d solutions=all \
$curlarg \
Expand Down

0 comments on commit bbbbcf3

Please sign in to comment.