jules
4 years ago
1 changed files with 29 additions and 0 deletions
@ -0,0 +1,29 @@ |
|||
#!/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 |
Loading…
Reference in new issue