source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/02-EXPLODE-SPARQLRESULTS-TO-IMPORT.sh@ 34867

Last change on this file since 34867 was 34867, checked in by davidb, 3 years ago

Tweaks after testing

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2
3tmp_cache="tmp-cache"
4
5echo ""
6
7if [ "x$GSDL3SRCHOME" = "x" ] ; then
8 echo "Environment variable GSDL3SRCHOME not set." 1>&2
9 echo "Have you sourced ./gs3-setup.sh?" 1>&2
10 exit 1
11fi
12
13if [ ! -d $tmp_cache ] ; then
14 echo "Making temporary directory:"
15 echo " $tmp_cache"
16 mkdir $tmp_cache
17else
18 echo "Removing existing content from:"
19 echo " $tmp_cache"
20 /bin/rm -rf $tmp_cache/*
21fi
22
23echo "Copying to '$tmp_cache' then exploding:"
24
25for f in "local--countries-in-esc-by-year-after-1956--with-errata.json" ; do
26
27 echo " errata-lod/$f -> $tmp_cache/sparqlresults-$f"
28 /bin/cp "errata-lod/$f" "$tmp_cache/sparqlresults-$f"
29
30 # rm -rf tmp/sparqlresults-local--countries-in-esc-by-year-after-1956--with-errata.* && cp import/sparqlresults-local--countries-in-esc-by-year-after-1956--with-errata.json tmp/.
31
32 explode_metadata_database.pl \
33 -collectdir $GSDL3SRCHOME/web/sites/eurovision-lod/collect \
34 -collection eurovision \
35 -plugin_options "-metadata_merge_on_concat_fields Country,Year -OIDtype assigned -OIDmetadata Identifier" \
36 -plugin JSONSPARQLResultPlugin \
37 $tmp_cache/sparqlresults-$f
38
39# -use_collection_plugin_options \
40
41 if [ $? != 0 ] ; then
42 echo "Error encountered when exploding:" 1>&2
43 echo " $tmp_cache/sparqlresults-$f" 1>&2
44 exit 1
45 fi
46done
47
48echo ""
49echo "Regenerating sparqlresults-* files in '../import' (from exploded results in '$tmp_cache')"
50
51/bin/rm -rf ../import/sparqlresults-*
52/bin/mv $tmp_cache/sparqlresults-* ../import/.
53
54echo ""
Note: See TracBrowser for help on using the repository browser.