-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rpb-59' of https://github.com/hbz/rpb into main
- Loading branch information
Showing
11 changed files
with
186 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
default outfile = "conf/output/bulk/rppd/bulk-rppd-${i}.jsonl"; // lobid-gnd expects *.jsonl suffix | ||
"conf/output/output-rppd-strapi.ndjson" | ||
// Defaults, use Allegro data: | ||
// 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-to-lobid.flux" | ||
|
||
// To use Strapi export data: | ||
// zgrep -a '"type":"api::person.person"' conf/strapi-export.tar.gz > conf/output/rppd-export.json | ||
// sbt "runMain rpb.ETL conf/rppd-to-lobid.flux IN_FILE=rppd-export.json RECORD_PATH=data" | ||
|
||
default IN_FILE = "output-rppd-strapi.ndjson"; // pass e.g. OUT_FILE=output-rppd-export.ndjson | ||
default RECORD_PATH = ""; // pass e.g. RECORD_PATH=data | ||
default OUT_FILE = "conf/output/bulk/rppd/bulk-rppd-${i}.jsonl"; // lobid-gnd expects *.jsonl suffix | ||
"conf/output/" + IN_FILE | ||
| open-file | ||
| as-lines | ||
| decode-json | ||
| decode-json(recordPath=RECORD_PATH) | ||
| fix(FLUX_DIR + "rppd-to-lobid.fix") | ||
| batch-reset(batchsize="1000") | ||
| encode-json(prettyPrinting="false") | ||
| json-to-elasticsearch-bulk(idkey="id", type="authority", index="gnd-rppd-test") | ||
| write(outfile) | ||
| write(OUT_FILE) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Get test data for the specified type; for each record, | ||
// fetch the entry from Strapi, convert that to lobid, write. | ||
|
||
// sbt "runMain rpb.ETL conf/rppd-to-strapi.flux IN_FILE=RPB-Export_HBZ_Bio_Test.txt OUT_FILE=test-output-rppd.json" | ||
// sbt -mem 2048 "runMain rpb.ETL conf/test-export-compare-rppd.flux" | ||
FLUX_DIR + "output/test-output-rppd.json" | ||
| open-file | ||
| as-lines | ||
| decode-json | ||
| fix(" | ||
prepend(rppdId, 'https://rpb-cms-test.lobid.org/api/persons?populate=*&filters[rppdId][$eq]=') | ||
retain(rppdId) | ||
") | ||
| literal-to-object | ||
| log-object("Strapi URL: ") | ||
| open-http | ||
| as-records | ||
| decode-json(recordPath="data.[*].attributes") | ||
| fix(FLUX_DIR + "rppd-to-lobid.fix") | ||
| encode-json | ||
| write(FLUX_DIR + "output/test-rppd-output-from-strapi.json") | ||
; | ||
|
||
// To compare, convert test data directly to lobid, write. | ||
FLUX_DIR + "output/test-output-rppd.json" | ||
| open-file | ||
| as-lines | ||
| decode-json | ||
| fix(FLUX_DIR + "rppd-to-lobid.fix") | ||
| encode-json | ||
| write(FLUX_DIR + "output/test-rppd-output-from-file.json") | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Get test data for the specified type; for each record, | ||
// fetch the entry from Strapi, convert that to lobid, write. | ||
FLUX_DIR + "output/test-output-strapi.json" | ||
| open-file | ||
| as-lines | ||
| decode-json | ||
| fix(" | ||
unless " + PICK + " | ||
reject() | ||
end | ||
prepend(f00_, 'https://rpb-cms-test.lobid.org/api/" + PATH + "?populate=*&filters[f00_][$eq]=') | ||
retain(f00_) | ||
") | ||
| literal-to-object | ||
| log-object("Strapi URL: ") | ||
| open-http | ||
| as-records | ||
| decode-json(recordPath="data.[*].attributes") | ||
| fix(FLUX_DIR + "rpb-titel-to-lobid.fix") | ||
| encode-json | ||
| write(FLUX_DIR + "output/test-lobid-output-from-strapi.json") | ||
; | ||
|
||
// To compare, convert test data directly to lobid, write. | ||
FLUX_DIR + "output/test-output-strapi.json" | ||
| open-file | ||
| as-lines | ||
| decode-json | ||
| fix(" | ||
unless " + PICK + " | ||
reject() | ||
end | ||
") | ||
| fix(FLUX_DIR + "rpb-titel-to-lobid.fix") | ||
| encode-json | ||
| write(FLUX_DIR + "output/test-lobid-output-from-file.json") | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"https://rpb-cms-test.lobid.org/api/articles?populate=*&pagination[pageSize]=5" | ||
| open-http | ||
| as-records | ||
| decode-json(recordPath="data.[*].attributes") | ||
| fix(FLUX_DIR + "rpb-titel-to-lobid.fix") | ||
| batch-reset(batchsize="1") | ||
| encode-json(prettyPrinting="true") | ||
| write(FLUX_DIR + "output/test-strapi-to-lobid-output-${i}.json") | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters