#!/bin/bash # Before the Errata was introduced, the SPARQL query could be run # directly against the DBPedia endpoint: # ##echo "Downloading SPARQL query: countries-in-esc-by-year.sparql" ##./DBPEDIA-LOD-SPARQL-QUERY.sh countries-in-esc-by-year.sparql # Now a more complicated federated search is used. # Because the DBPedia endpoint doesn't allow for queries that # use SERIVCE to combine results from other endpoints, the # query we issue is done on the local Greenstone Apache Jena endpoint, # (which does have this facility on), where the Errata information is # stored, but as part of the query run reaches out to the DBPedia endpoint. logfile="01-DOWNLOAD--runtime-log-$$.txt" echo "Running bash script: $0" > "$logfile" echo "" >> "$logfile" if [ $# == 0 ] ; then 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" echo "" echo "Away to run the query:" echo "" echo " $sparql_query_list" echo "" echo "This can take a while to run. Worth considering running with 'nohup':" echo " nohup $0 &" echo "" echo "Sleeping for 5 seconds as an opportunity to ^C the script and rerun it" echo "..." sleep 5 echo "... continuing" else sparql_query_list="$*" fi for f in $sparql_query_list ; do echo "Downloading JSON content via SPARQL query:" | tee -a "$logfile" echo " errata-lod/$f" | tee -a "$logfile" cd errata-lod \ && date >> "../$logfile" \ && ./LOCAL-LOD-QUERY.sh "$f" \ && date >> "../$logfile" \ && cd .. echo "" >> "$logfile" done echo "" echo "Timed logged output:" echo " $logfile" echo "" # cd errata-lod \ # && date > runtime-log-$$.txt && ./LOCAL-LOD-QUERY.sh ./local--countries-in-esc-by-year-after-1956--with-errata.sparql && date >> runtime-log-$$.txt