source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/01-DOWNLOAD-ESC-LOD-DATA.sh@ 35904

Last change on this file since 35904 was 35904, checked in by davidb, 2 years ago

Fixed error in just-year filename; improved info in echo statement

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3# Before the Errata was introduced, the SPARQL query could be run
4# directly against the DBPedia endpoint:
5#
6##echo "Downloading SPARQL query: countries-in-esc-by-year.sparql"
7##./DBPEDIA-LOD-SPARQL-QUERY.sh countries-in-esc-by-year.sparql
8
9# Now a more complicated federated search is used.
10# Because the DBPedia endpoint doesn't allow for queries that
11# use SERIVCE to combine results from other endpoints, the
12# query we issue is done on the local Greenstone Apache Jena endpoint,
13# (which does have this facility on), where the Errata information is
14# stored, but as part of the query run reaches out to the DBPedia endpoint.
15
16logfile="01-DOWNLOAD--runtime-log-$$.txt"
17echo "Running bash script: $0" > "$logfile"
18echo "" >> "$logfile"
19
20if [ $# == 0 ] ; then
21 sparql_query_list="local--countries-in-esc-by-year-in-1956--with-errata.sparql local--countries-in-esc-by-year-after-1956--with-errata.sparql"
22
23 echo ""
24 echo "Away to run the query:"
25 echo ""
26 echo " $sparql_query_list"
27 echo ""
28
29 echo "This can take a while to run. Worth considering running with 'nohup':"
30 echo " nohup $0 > nohup-01-download.out 2>&1 &"
31 echo ""
32
33 echo "Sleeping for 5 seconds as an opportunity to ^C the script and rerun it"
34 echo "..."
35 sleep 5
36 echo "... continuing"
37
38else
39 sparql_query_list="$*"
40fi
41
42for f in $sparql_query_list ; do
43
44 echo "Downloading JSON content via SPARQL query:" | tee -a "$logfile"
45 echo " errata-lod/$f" | tee -a "$logfile"
46
47 cd errata-lod \
48 && date >> "../$logfile" \
49 && ./LOCAL-LOD-QUERY.sh "$f" \
50 && date >> "../$logfile" \
51 && cd ..
52
53 echo "" >> "$logfile"
54
55done
56
57echo ""
58echo "Timed logged output:"
59echo " $logfile"
60echo ""
61
62# cd errata-lod \
63# && date > runtime-log-$$.txt && ./LOCAL-LOD-QUERY.sh ./local--countries-in-esc-by-year-after-1956--with-errata.sparql && date >> runtime-log-$$.txt
64
Note: See TracBrowser for help on using the repository browser.