Last change
on this file since 37165 was 37165, checked in by davidb, 15 months ago |
Script to remove all the graphs generated both by Greenstone building, and also SimpleAnnotationServer ingesting manifests etc.
|
-
Property svn:executable
set to
*
|
File size:
653 bytes
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 |
|
---|
4 | query_url="http://localhost:4040/greenstone/query"
|
---|
5 | udpate_url="http://localhost:4040/greenstone/update"
|
---|
6 |
|
---|
7 |
|
---|
8 | read -r -d '' select_query << EOS
|
---|
9 | SELECT DISTINCT ?g
|
---|
10 | WHERE {
|
---|
11 | GRAPH ?g { }
|
---|
12 | }
|
---|
13 | EOS
|
---|
14 |
|
---|
15 |
|
---|
16 | if [ ! -d tmp ] ; then
|
---|
17 | echo ""
|
---|
18 | echo "Making directory 'tmp'"
|
---|
19 | mkdir tmp
|
---|
20 | fi
|
---|
21 |
|
---|
22 |
|
---|
23 | curl -X POST -d query="$select_query" -d output=csv "$query_url" > tmp/fuseki-all-graphs.csv
|
---|
24 |
|
---|
25 | echo "Dropping graphs:"
|
---|
26 | for g in $(cat tmp/fuseki-all-graphs.csv | tr '\r\n' ' ') ; do
|
---|
27 | echo " <$g>"
|
---|
28 |
|
---|
29 | delete_query="DROP GRAPH $g"
|
---|
30 | curl -X POST -d update="$delete_query" http://localhost:4040/greenstone/update
|
---|
31 | done
|
---|
32 |
|
---|
33 |
|
---|
34 | /bin/rm tmp/fuseki-all-graphs.csv
|
---|
Note:
See
TracBrowser
for help on using the repository browser.