Skip to content

Commit

Permalink
Use Nwbib ttl files for labels #1905
Browse files Browse the repository at this point in the history
Instead of the source data labels in $a. The ttl File will be more up date and are provided as submodule lobid-vocabs
  • Loading branch information
TobiasNx committed Sep 27, 2023
1 parent f94fda2 commit 1e0413f
Show file tree
Hide file tree
Showing 8 changed files with 39,590 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public void run() {
fixVariables.put("rpb2.ttl", "../../../../../../vocabs/rpb/rpb2.ttl");
fixVariables.put("rpb-spatial.ttl", "../../../../../../vocabs/rpb/rpb-spatial.ttl");
fixVariables.put("rpb.ttl", "../../../../../../vocabs/rpb/rpb.ttl");
fixVariables.put("nwbib.ttl", "../../../../../../vocabs/nwbib/nwbib.ttl");
fixVariables.put("nwbib-spatial.ttl", "../../../../../../vocabs/nwbib/nwbib-spatial.ttl");
fixVariables.put("hbzId2zdbId.tsv", "./maps/hbzId2zdbId.tsv.gz");

XmlElementSplitter xmlElementSplitter = new XmlElementSplitter();
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/alma/fix/maps.fix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ put_rdfmap("$[rpb2.ttl]", "rpb2", target: "skos:prefLabel", select_language: "de
put_rdfmap("$[rpb-spatial.ttl]", "rpbr", target: "skos:prefLabel", select_language: "de") # RPB-Raumsystematik aka rpbr
put_rdfmap("$[rpb.ttl]", "rpb", target: "skos:prefLabel", select_language: "de") # RPB-Sachsystematik fka. Systematik der Rheinland-Pfälzischen Bibliographie

# NWBib SKOS Maps
put_rdfmap("$[nwbib-spatial.ttl]", "nwbib-spatial", target: "skos:prefLabel", select_language: "de") # NWBib-Raumsystematik
put_rdfmap("$[nwbib.ttl]", "nwbib", target: "skos:prefLabel", select_language: "de") # Sachsystematik der Nordrhein-Westfälischen Bibliographie

# Formschlagwort/Formangaben-Mapping -> GND (based on: https://wiki.dnb.de/download/attachments/106042227/AH-007.pdf)
put_filemap("$[formangabe.tsv]","formschlagwort2Gnd", sep_char:"\t",key_column:"0",value_column:"1",expected_columns:"-1")
Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/alma/fix/subjects.fix
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ do list(path:"084??", "var":"$i")
do list(path:"$i.0", "var":"$j")
if any_contain("$j","https://nwbib.de/subjects")
copy_field("$j", "subject[].$append.id")
copy_field("$i.a", "subject[].$last.label")
copy_field("$j","$i.@nwbibLabel")
lookup("$i.@nwbibLabel","nwbib")
copy_field("$i.@nwbibLabel", "subject[].$last.label")
if any_match("$j", "https://nwbib.de/subjects#N(.*)$")
copy_field("$j", "subject[].$last.notation")
replace_all("subject[].$last.notation","https://nwbib.de/subjects#N(.*)$","$1")
Expand Down Expand Up @@ -438,7 +440,9 @@ do list(path:"084??", "var":"$i")
# nwbib spatial
if any_contain("$j","https://nwbib.de/spatial#")
copy_field("$j", "spatial[].$append.id")
copy_field("$i.a", "spatial[].$last.label")
copy_field("$j","$i.@nwbib-spatialLabel")
lookup("$i.@nwbib-spatialLabel","nwbib-spatial")
copy_field("$i.@nwbib-spatialLabel", "spatial[].$last.label")
if any_match("$j", "https://nwbib.de/spatial#N(.*)$")
copy_field("$j", "spatial[].$last.notation")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public void setup() {
fixVariables.put("rpb2.ttl", "src/test/resources/alma/maps/rpb2.ttl");
fixVariables.put("rpb-spatial.ttl", "src/test/resources/alma/maps/rpb-spatial.ttl");
fixVariables.put("rpb.ttl", "src/test/resources/alma/maps/rpb.ttl");
fixVariables.put("nwbib.ttl", "src/test/resources/alma/maps/nwbib.ttl");
fixVariables.put("nwbib-spatial.ttl", "src/test/resources/alma/maps/nwbib-spatial.ttl");
fixVariables.put("hbzId2zdbId.tsv", "src/main/resources/alma/maps/hbzId2zdbId.tsv.gz");
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990054345550206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
} ],
"spatial" : [ {
"id" : "https://nwbib.de/spatial#Q1304021",
"label" : "Eilendorf",
"label" : "Eilendorf (Stadtbezirk)",
"type" : [ "Concept" ],
"source" : {
"id" : "https://nwbib.de/spatial",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990110714900206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
} ],
"spatial" : [ {
"id" : "https://nwbib.de/spatial#Q1374337",
"label" : "Euregio",
"label" : "Euregio (Sitz: Gronau)",
"type" : [ "Concept" ],
"source" : {
"id" : "https://nwbib.de/spatial",
Expand Down
Loading

0 comments on commit 1e0413f

Please sign in to comment.