-
Notifications
You must be signed in to change notification settings - Fork 1
/
update
24 lines (18 loc) · 850 Bytes
/
update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Before running this ....
# Ensure the two services "update/service" and "sparql/read" exists
# Named graph update only works on a mutable dataset (so not an ad-hoc in-memory one)
UPDATE="${1:-update.ru}"
export http_proxy=
echo "=== Update"
## Either a HTML form (Content-Type:application/x-www-form-urlencoded)
## Needs a "request="
#wget -q -O - --post-data="request=$(cat $UPDATE)" 'http://localhost:2020/update/service'
## Or another Content-Type and the raw request.
wget -q -O - --header "Content-Type: " --post-data="$(cat $UPDATE)" 'http://localhost:2020/update/service'
echo
echo "=== Default graph"
wget -q -O - 'http://localhost:2020/sparql/read?query=SELECT * { ?s ?p ?o}&output=text'
echo
echo "=== Named graphs"
wget -q -O - 'http://localhost:2020/sparql/read?query=SELECT * { GRAPH ?g { ?s ?p ?o}}&output=text'