source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/07-DOWNLOAD-SPOTIFY-LOD-DATA.sh@ 35111

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

Next step of processing added in

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3prep_dir=spotify-musicbrainz
4
5if [ ! -d ./my-python3 ] ; then
6 echo "" 1>&2
7 echo "Failed to find: ./my-python3" 1>&2
8 echo "Have you run:" 1>&2
9 echo " ./CREATE-PYTHON-VENV.sh" 1>&2
10 echo "" 1>&2
11
12 exit 1
13fi
14
15source ./my-python3/bin/activate
16
17if [ ! -d "$prep_dir" ] ; then
18 echo "Checking out Spotify/MusicBrainz Alignment code:"
19 git clone https://github.com/musicog/LinkedEurovision.git "$prep_dir"
20 cd "$prep_dir" && pip3 install -r requirements.txt && cd ..
21
22 if [ $? != 0 ] ; then
23 echo "!!!!" 1>&2
24 echo "! Error enountered running gs-triplestore-reset3 followed by gs-triplestore-add3" 1>&2
25 echo "!!!!" 1>&2
26
27 deactivate
28 exit 1
29 fi
30fi
31
32if [ ! -f "$prep_dir/cached--esc-mir-gold-rdf.ttl" ] ; then
33 echo "Generating $prep_dir/cached--esc-mir-gold-rdf.ttl"
34
35 echo "Running Spotify/MusicBrainz Alignment" > 07-DOWNLOAD-runtime-log-$$.txt
36 echo "Started: " >> 07-DOWNLOAD-runtime-log-$$.txt
37 date >> 07-DOWNLOAD-runtime-log-$$.txt
38
39 cd "$prep_dir" && ./RUN.sh && cd ..
40
41 if [ $? != 0 ] ; then
42 echo "!!!!" 1>&2
43 echo "! Error enountered running $pref_dir/RUN.sh" 1>&2
44 echo "!!!!" 1>&2
45
46 deactivate
47 exit 1
48 fi
49
50 echo "Finished: " > 07-DOWNLOAD-runtime-log-$$.txt
51 date >> 07-DOWNLOAD-runtime-log-$$.txt
52
53fi
54
55# Reset graph and then Ingest the newly generated .ttl file
56echo "Reseting and then populating the triplestore graph-collection"
57echo " eurovision-mir"
58gs-triplestore-reset3 eurovision-mir && gs-triplestore-add3 eurovision-mir "$prep_dir/esc-mir-gold-rdf.ttl"
59
60if [ $? != 0 ] ; then
61 echo "!!!!" 1>&2
62 echo "! Error enountered running gs-triplestore-reset3 followed by gs-triplestore-add3" 1>&2
63 echo "!!!!" 1>&2
64
65 deactivate
66 exit 1
67fi
68
69echo "Generating:"
70echo " $prep_dir/local--esc-mir-gold.json"
71gs-triplestore-file-query3 "$prep_dir/local--esc-mir-gold.sparql"
72
73
74deactivate
75
Note: See TracBrowser for help on using the repository browser.