-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdateFromRefSources.sh
More file actions
executable file
·39 lines (31 loc) · 3.48 KB
/
Copy pathupdateFromRefSources.sh
File metadata and controls
executable file
·39 lines (31 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
SDIR=/home/www-data/vendor/bin
LDIR=/home/www-data/log
ODIR=/home/www-data/docroot/status
CDIR=`dirname "$BASH_SOURCE[0]"`
VERBOSE="--verbose"
REPOURL="`curl -s http://127.0.0.1/api/describe | grep urlBase: | sed -e 's/^.* //'`/api/"
ACDH="https://vocabs.acdh.oeaw.ac.at/schema#"
PSWD=`grep "password:" "$CDIR/initScripts/config.yaml" | head -n 1 | sed -E 's/^.*password: *"?(.*)"? *$/\1/g'`
CDIR="$CDIR/ref-sources/"
mkdir -p $ODIR
# acdh:Place
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-place-title.ttl" --class ${ACDH}Place --withoutProperty ${ACDH}hasTitle $CDIR/place-title.yaml > "$ODIR/ref-place-title_log.txt" 2>&1
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-place-lat.ttl" --class ${ACDH}Place --withoutProperty ${ACDH}hasLatitude $CDIR/place-latlon.yaml > "$ODIR/ref-place-lat_log.txt" 2>&1
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-place-lon.ttl" --class ${ACDH}Place --withoutProperty ${ACDH}hasLongitude $CDIR/place-latlon.yaml > "$ODIR/ref-place-lon_log.txt" 2>&1
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-place-wkt.ttl" --class ${ACDH}Place --withoutProperty ${ACDH}hasWKT $CDIR/place-wkt.yaml > "$ODIR/ref-place-wkt_log.txt" 2>&1
# acdh:Person
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-person-title.ttl" --class ${ACDH}Person --withoutProperty ${ACDH}hasTitle $CDIR/person.yaml > "$ODIR/ref-person-title_log.txt" 2>&1
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-person-firstname.ttl" --class ${ACDH}Person --withoutProperty ${ACDH}hasFirstName $CDIR/person.yaml > "$ODIR/ref-person-firstname.txt" 2>&1
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-person-lastname.ttl" --class ${ACDH}Person --withoutProperty ${ACDH}hasLastName $CDIR/person.yaml > "$ODIR/ref-person-lastname.txt" 2>&1
# acdh:Organisation
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-organisation.ttl" --class ${ACDH}Organisation --withoutProperty ${ACDH}hasTitle $CDIR/organisation.yaml > "$ODIR/ref-organisation.txt" 2>&1
# lacking class and title
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-onlyid-place.ttl" --withoutProperty ${ACDH}hasTitle $CDIR/place-title.yaml > "$ODIR/ref-onlyid-place.txt" 2>&1
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-onlyid-person.ttl" --withoutProperty ${ACDH}hasTitle $CDIR/person.yaml > "$ODIR/ref-onlyid-person.txt" 2>&1
$SDIR/arche-ref-sources --user init --pswd "$PSWD" --repositoryUrl $REPOURL --mode update $VERBOSE --output "$ODIR/ref-onlyid-organisation.ttl" --withoutProperty ${ACDH}hasTitle $CDIR/organisation.yaml > "$ODIR/ref-onlyid-organisation.txt" 2>&1
# once a month scrap ids
if [ "`date +%d`" == "01" ] ; then
$SDIR/arche-ref-sources --repositoryUrl $REPOURL --mode resolve cfg/id.yaml --output "$ODIR/ids.ttl" > "$ODIR/ref-ids.txt" 2>&1
fi
chown www-data:www-data $ODIR/*