You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.3 KiB
29 lines
1.3 KiB
#!/bin/sh
|
|
#
|
|
# a script that automatically syncs data
|
|
# between the wikibase and wqds containers
|
|
# gnd, 2020
|
|
##########################################
|
|
# generate a temp file name
|
|
TMP_FILE=`mktemp`
|
|
|
|
# dump the data:
|
|
docker exec wikibase-docker_wikibase_1 php ./extensions/Wikibase/repo/maintenance/dumpRdf.php --server http://daap.bannerrepeater.org --output $TMP_FILE
|
|
|
|
# copy from container to container (direct copying is not supported so..)
|
|
# plz note here its actually three different files having the same name
|
|
# across the host system and two containers
|
|
docker cp wikibase-docker_wikibase_1:$TMP_FILE $TMP_FILE
|
|
docker cp $TMP_FILE wikibase-docker_wdqs_1:$TMP_FILE
|
|
|
|
# import with munge using directly the java executable
|
|
docker exec -w /wdqs wikibase-docker_wdqs_1 java -cp /wdqs/lib/wikidata-query-tools-0.3.10-SNAPSHOT-jar-with-dependencies.jar org.wikidata.query.rdf.tool.Munge --from $TMP_FILE --to /tmp/mungeOut/wikidump-%09d.ttl.gz --skipSiteLinks --chunkSize 100000 -w daap.bannerrepeater.org
|
|
|
|
# load the data into the wdqs
|
|
docker exec wikibase-docker_wdqs_1 ./loadData.sh -n wdq -d /tmp/mungeOut
|
|
|
|
# cleanup
|
|
rm $TMP_FILE
|
|
docker exec wikibase-docker_wikibase_1 rm $TMP_FILE
|
|
docker exec wikibase-docker_wdqs_1 rm $TMP_FILE
|
|
docker exec wikibase-docker_wdqs_1 rm -rf /tmp/mungeOut
|
|
|