source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/05-PARSE-ADDITIONAL-METADATA-FROM-WIKIPEDIA.sh@ 35991

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

Make use of cutoff value

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3. ./_local_prepare_config.sh
4
5if [ $# = 2 ] ; then
6 startyear=$1
7 endyear=$2
8else
9 startyear=1956
10 endyear=$esc_cutoff_endyear
11fi
12
13prep_dir=errata-categories
14
15if [ ! -d ./$my_python ] ; then
16 echo "" 1>&2
17 echo "Failed to find: ./$my_python" 1>&2
18 echo "Have you run:" 1>&2
19 echo " ./CREATE-VENV-PYTHON3.sh $my_python" 1>&2
20 echo "" 1>&2
21
22 exit 1
23fi
24
25if [ ! -d "$prep_dir/metadata-esc-year" ] ; then
26 echo "Creating directory:"
27 echo " $prep_dir/metadata-esc-year"
28
29 mkdir "$prep_dir/metadata-esc-year"
30fi
31
32exit_status=0
33
34source ./$my_python/bin/activate
35
36$prep_dir/esc-wikipedia-download-and-process-votes.py \
37 --startyear $startyear \
38 --endyear $endyear \
39 --cachedir $prep_dir/cache-wikipedia \
40 $prep_dir/metadata-esc-year/metadata_esc.json
41
42if [ $? = 0 ] ; then
43
44 if [ ! -d "$prep_dir/missing-cat-countries" ] ; then
45 echo "Creating directory:"
46 echo " $prep_dir/missing-cat-countries"
47
48 mkdir "$prep_dir/missing-cat-countries"
49 fi
50
51 $prep_dir//esc-wikipedia-download-and-detect-missing-cat-entries.py \
52 --startyear $startyear \
53 --endyear $endyear \
54 --cachedir $prep_dir/cache-wikipedia \
55 --queryfile.sparql "$prep_dir/dbpedia--countries-missing-from-esc-category-in-the-year.sparql" \
56 $prep_dir/missing-cat-countries/metadata.json
57
58 if [ $? != 0 ] ; then
59 echo "!!!!" 1>&2
60 echo "! Error enountered determining which countries are missing on Wikipedia ESC Category-Year pages" 1>&2
61 echo "!!!!" 1>&2
62 exit_status=1
63 fi
64
65 /bin/cp $prep_dir/dbpedia--countries-missing-from-esc-category-in-the-year.sparql problem-lod-lists/dbpedia-problem-category-in-year.sparql
66
67else
68 echo "!!!!" 1>&2
69 echo "! Error enountered parsing out enriched metadata from Wikipedia ESC pages" 1>&2
70 echo "!!!!" 1>&2
71 exit_status=1
72fi
73
74
75deactivate
76
77if [ $exit_status != 0 ] ; then
78 exit $exit_status
79fi
Note: See TracBrowser for help on using the repository browser.