Skip to content

Commit

Permalink
Set up separate transformAndImport scripts for test and full data
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Oct 6, 2023
1 parent 870f2e6 commit 0859971
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ sbt "runMain rpb.ETL conf/rppd-import.flux"

This attempts to import RPPD data to strapi, and prints the server responses.

Same for RPB-Normdaten (`rpb-sw-to-strapi.flux` / `rpb-sw-import.flux`), see also `transformAndImport.sh`.
Same for RPB-Normdaten (`rpb-sw-to-strapi.flux` / `rpb-sw-import.flux`).

See also `transformAndImportTest.sh` (test data) and `transformAndImportFull.sh` (full data).

### Run transformation to lobid data

Expand Down
33 changes: 33 additions & 0 deletions transformAndImportFull.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
set -eu
IFS=$'\n\t'

# Call e.g.: bash transformAndImportFull.sh test-metadaten-nrw.hbz-nrw.de

if [ -z "$@" ]; then echo "Pass host, e.g. 'localhost'"; else echo "Will import to '$@'"; fi
HOST=$1

# Notationen
# curl --request DELETE "http://$HOST:1339/api/rpb-notations/[1-5]"
sbt "runMain rpb.ETL conf/rpb-systematik-import.flux INPUT=rpb.ndjson PATH=rpb-notations HOST=$HOST"
# curl --request DELETE "http://$HOST:1339/api/rpb-spatials/[1-5]"
sbt "runMain rpb.ETL conf/rpb-systematik-import.flux INPUT=rpb-spatial.ndjson PATH=rpb-spatials HOST=$HOST"

# Personen
# curl --request DELETE "http://$HOST:1339/api/rppds/[1-5]"
sbt "runMain rpb.ETL conf/rppd-to-strapi.flux IN_FILE=RPB-Export_HBZ_Bio.txt OUT_FILE=output-rppd-strapi.ndjson"
sbt "runMain rpb.ETL conf/rppd-import.flux IN_FILE=output-rppd-strapi.ndjson HOST=$HOST"

# Normdaten
# curl --request DELETE "http://$HOST:1339/api/rpb-authorities/[1-5]"
sbt "runMain rpb.ETL conf/rpb-sw-to-strapi.flux IN_FILE=RPB-Export_HBZ_SW.txt OUT_FILE=output-sw-strapi.ndjson"
sbt "runMain rpb.ETL conf/rpb-sw-import.flux IN_FILE=output-sw-strapi.ndjson HOST=$HOST"

# Titeldaten
sbt "runMain rpb.ETL conf/rpb-titel-to-strapi.flux"
# curl --request DELETE "http://$HOST:1339/api/articles/[1-5]"
sbt "runMain rpb.ETL conf/rpb-titel-import.flux PICK=all_equal('f36_','u') PATH=articles HOST=$HOST"
# curl --request DELETE "http://$HOST:1339/api/independent-works/[1-5]"
sbt "runMain rpb.ETL conf/rpb-titel-import.flux PICK=all_equal('f36_','Monografie') PATH=independent-works HOST=$HOST"
sbt "runMain rpb.ETL conf/rpb-titel-import.flux PICK=all_equal('f36_','Band') PATH=independent-works HOST=$HOST"
sbt "runMain rpb.ETL conf/rpb-titel-import.flux PICK=all_equal('f36t','MultiVolumeBook') PATH=independent-works HOST=$HOST"
2 changes: 1 addition & 1 deletion transformAndImport.sh → transformAndImportTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eu
IFS=$'\n\t'

# Call e.g.: bash transformAndImport.sh test-metadaten-nrw.hbz-nrw.de
# Call e.g.: bash transformAndImportTest.sh test-metadaten-nrw.hbz-nrw.de

if [ -z "$@" ]; then echo "Pass host, e.g. 'localhost'"; else echo "Will import to '$@'"; fi
HOST=$1
Expand Down

0 comments on commit 0859971

Please sign in to comment.