Skip to content

Commit

Permalink
Merge branch 'rpb-243-variantName' of https://github.com/hbz/rpb into…
Browse files Browse the repository at this point in the history
… main

See #121
  • Loading branch information
fsteeg committed Jan 21, 2025
2 parents 08f8792 + 14ee5d2 commit 647a7cb
Show file tree
Hide file tree
Showing 15 changed files with 192,454 additions and 192,394 deletions.
384,781 changes: 192,406 additions & 192,375 deletions conf/RPB-Export_HBZ_SW.tsv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions conf/output/test-output-32.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"componentList" : [ {
"id" : "http://rpb.lobid.org/sw/107n220353",
"label" : "Wilhelm-von-Humboldt-Gymnasium / Ludwigshafen am Rhein / Medien-AG",
"altLabel" : [ "WHG-Medien-AG" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
Expand Down
1 change: 1 addition & 0 deletions conf/output/test-output-52.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"componentList" : [ {
"id" : "http://rpb.lobid.org/sw/929n110300",
"label" : "Volleyballclub Neuwied 77 / Neuwied",
"altLabel" : [ "VC Neuwied 77 / Neuwied" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
Expand Down
1 change: 1 addition & 0 deletions conf/output/test-output-54.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"agent" : {
"id" : "http://rpb.lobid.org/sw/00Pn08k0685884a",
"label" : "Ruland, Wolfgang",
"altLabel" : [ "WR" ],
"type" : [ "Person" ]
},
"role" : {
Expand Down
2 changes: 2 additions & 0 deletions conf/output/test-output-55.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"componentList" : [ {
"id" : "http://rpb.lobid.org/sw/929n090287",
"label" : "Deutscher Orden / Kommende Waldbreitbach",
"altLabel" : [ "Kommende Waldbreitbach", "Deutschordenskommende Waldbreitbach", "Deutschherren-Ordenshaus Waldbreitbach", "Commende Waldbreitbach", "Deutsches Huis zu Brettbach" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
Expand Down Expand Up @@ -83,6 +84,7 @@
"agent" : {
"id" : "http://rpb.lobid.org/sw/00Pn08k0685884a",
"label" : "Ruland, Wolfgang",
"altLabel" : [ "WR" ],
"type" : [ "Person" ]
},
"role" : {
Expand Down
1 change: 1 addition & 0 deletions conf/output/test-output-56.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"agent" : {
"id" : "http://rpb.lobid.org/sw/929n991002",
"label" : "Weger, Joachim",
"altLabel" : [ "jw" ],
"type" : [ "Person" ]
},
"role" : {
Expand Down
3 changes: 3 additions & 0 deletions conf/output/test-output-6.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
"componentList" : [ {
"id" : "http://rpb.lobid.org/sw/929n110302",
"label" : "Unkeler Sonnenberg",
"altLabel" : [ "Unkeler Sonneberg", "Sonnenberg / Unkel", "Sonneberg / Unkel", "Unkel / Sonneberg" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
}
}, {
"id" : "http://rpb.lobid.org/sw/929n110303",
"label" : "Weingut Krupp",
"altLabel" : [ "Krupp, Oliver / Firma" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
Expand Down Expand Up @@ -70,6 +72,7 @@
"agent" : {
"id" : "http://rpb.lobid.org/sw/00Pn08k0685884a",
"label" : "Ruland, Wolfgang",
"altLabel" : [ "WR" ],
"type" : [ "Person" ]
},
"role" : {
Expand Down
1 change: 1 addition & 0 deletions conf/output/test-output-72.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"agent" : {
"id" : "http://rpb.lobid.org/sw/929n981242",
"label" : "Strauß, Torsten",
"altLabel" : [ "TS", "T.S." ],
"type" : [ "Person" ]
},
"role" : {
Expand Down
2 changes: 2 additions & 0 deletions conf/output/test-output-81.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
}, {
"id" : "http://rpb.lobid.org/sw/z48",
"label" : "Geschichte 1800-",
"altLabel" : [ "Neuzeit 1800-Gegenwart" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
Expand All @@ -58,6 +59,7 @@
}, {
"id" : "http://rpb.lobid.org/sw/z48",
"label" : "Geschichte 1800-",
"altLabel" : [ "Neuzeit 1800-Gegenwart" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
Expand Down
1 change: 1 addition & 0 deletions conf/output/test-output-88.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"componentList" : [ {
"id" : "http://rpb.lobid.org/sw/00Sn01s167281807a",
"label" : "Verein für Pfälzische Kirchengeschichte / Hauptversammlung / 1925",
"altLabel" : [ "Hauptversammlung / 1925 / Verein für Pfälzische Kirchengeschichte" ],
"source" : {
"id" : "http://rpb.lobid.org/sw",
"label" : "RPB-Sachsystematik"
Expand Down
3 changes: 2 additions & 1 deletion conf/output/test-output-rppd-lobid-19.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"variantName" : [ "Altgelt, Johann Philipp" ],
"professionOrOccupation" : [ {
"label" : "Pfarrer / Katholische Kirche",
"id" : "https://rpb.lobid.org/sw/929n170632"
"id" : "https://rpb.lobid.org/sw/929n170632",
"altLabel" : [ "Katholische Kirche / Pfarrer" ]
}, {
"label" : "Lehrer",
"id" : "https://d-nb.info/gnd/4035088-5"
Expand Down
3 changes: 2 additions & 1 deletion conf/output/test-output-rppd-lobid-23.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"preferredName" : "Ziegler, Jakob Anton",
"professionOrOccupation" : [ {
"label" : "Pfarrer / Katholische Kirche",
"id" : "https://rpb.lobid.org/sw/929n170632"
"id" : "https://rpb.lobid.org/sw/929n170632",
"altLabel" : [ "Katholische Kirche / Pfarrer" ]
} ],
"dateOfBirth" : [ "1893-06-15" ],
"placeOfBirth" : [ {
Expand Down
5 changes: 4 additions & 1 deletion conf/rpb-sw.flux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ FLUX_DIR + "output/output-strapi-sw.ndjson"
| as-lines
| decode-json
| fix("
paste('row', 'data.rpbId', 'data.preferredName', join_char : '\t')
set_array('variantNames')
copy_field('data.variantName[].*.value', 'variantNames.$append')
join_field('variantNames', '; ')
paste('row', 'data.rpbId', 'data.preferredName', 'variantNames', join_char : '\t')
retain(row)
")
| stream-to-triples
Expand Down
37 changes: 22 additions & 15 deletions conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ do once("map")
put_rdfmap("https://raw.githubusercontent.com/hbz/lbz-vocabs/main/rpb-spatial.ttl", "spatial_map", target:"skos:prefLabel", select_language:"de")
put_rdfmap("https://raw.githubusercontent.com/hbz/lbz-vocabs/main/rpb.ttl", "subject_map", target:"skos:prefLabel", select_language:"de")

put_filemap("./RPB-Export_HBZ_SW.tsv", "sw-rpb_map", "sep_char": "\t")
put_filemap("./RPB-Export_HBZ_SW.tsv", "sw-rpb_map", sep_char: "\t", allow_empty_values: "true", expected_columns:"3", key_column:"0", value_column:"1")
put_filemap("./RPB-Export_HBZ_SW.tsv", "sw-rpb-variants_map", sep_char: "\t", allow_empty_values: "true", expected_columns:"3", key_column:"0", value_column:"2")
put_filemap("./RPB-Export_HBZ_SW_GND.tsv", "sw-gnd_map", "sep_char": "\t")
end

Expand All @@ -16,6 +17,24 @@ do put_macro("move_here")
move_field("_temp", "$[field]")
end

do put_macro("normalize")
replace_all("$[field]","^http.+[/#](.+)$","$1")
replace_all("$[field]","^(\\d+)-(\\d+)$","$1n$2")
end

do put_macro("add_labels")
unless exists("$[field].label")
copy_field("$[field].id", "$[field].label")
call_macro("normalize", field: "$[field].label")
lookup("$[field].label", "sw-rpb_map")
lookup("$[field].label", "sw-gnd_map")
end
copy_field("$[field].id", "$[field].altLabel[]")
call_macro("normalize", field: "$[field].altLabel[]")
lookup("$[field].altLabel[]", "sw-rpb-variants_map", delete: "true")
split_field("$[field].altLabel[]", "; ")
end

if all_equal("doNotIndex", "true")
reject()
end
Expand Down Expand Up @@ -243,13 +262,7 @@ end
do
list (path:"temp_subject.*.componentList[]", "var": "$i")
move_field("$i.value", "$i.id")
unless exists("$i.label")
copy_field("$i.id", "$i.label")
replace_all("$i.label","^http.+[/#](.+)$","$1")
replace_all("$i.label","^(\\d+)-(\\d+)$","$1n$2")
lookup("$i.label", "sw-rpb_map")
lookup("$i.label", "sw-gnd_map")
end
call_macro("add_labels", field: "$i")
if all_match("$i.id","^http://rpb.lobid.org/sw/.*$")
add_field("$i.source.id", "http://rpb.lobid.org/sw")
add_field("$i.source.label", "RPB-Sachsystematik")
Expand Down Expand Up @@ -327,13 +340,7 @@ do put_macro("contributions")
copy_field("$[from][].*.value", "_temp.$append.agent.id")
do list_as(f: "$[from][]", c: "_temp")
copy_field("f.label", "c.agent.label")
unless exists("c.agent.label")
copy_field("c.agent.id", "c.agent.label")
replace_all("c.agent.label","^http.+[/#](.+)$","$1")
replace_all("c.agent.label","^(\\d+)-(\\d+)$","$1n$2")
lookup("c.agent.label", "sw-rpb_map")
lookup("c.agent.label", "sw-gnd_map")
end
call_macro("add_labels", field: "c.agent")
set_array("c.agent.type[]", "Person")
copy_field("f.type", "c.role.id")
copy_field("f.type", "c.role.label")
Expand Down
6 changes: 5 additions & 1 deletion conf/rppd-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ do put_macro("move_here")
end

do once("map")
put_filemap("conf/RPB-Export_HBZ_SW.tsv", "SW_map", sep_char: "\t")
put_filemap("./RPB-Export_HBZ_SW.tsv", "SW_map", sep_char: "\t", allow_empty_values: "true", expected_columns:"3", key_column:"0", value_column:"1")
put_filemap("./RPB-Export_HBZ_SW.tsv", "SW_variants-map", sep_char: "\t", allow_empty_values: "true", expected_columns:"3", key_column:"0", value_column:"2")
put_filemap("conf/RPB-Export_HBZ_SW_GND.tsv", "SW_GND_map", sep_char: "\t")
put_filemap("conf/RPB-Export_HBZ_SWN.tsv", "SWN_map", sep_char: "\t")
put_rdfmap("https://raw.githubusercontent.com/hbz/lbz-vocabs/main/rpb-spatial.ttl", "spatial_map", target:"skos:prefLabel", select_language:"de")
Expand Down Expand Up @@ -171,8 +172,11 @@ end
do list(path:"_temp", "var": "$i")
replace_all("$i.label", "^http.+/(\\d.+)", "$1")
replace_all("$i.label", "^(\\d*)-(\\d)", "$1n$2")
copy_field("$i.label", "$i.altLabel[]")
lookup("$i.label", "SW_map", delete: "false")
lookup("$i.label", "SW_GND_map", delete: "false")
lookup("$i.altLabel[]", "SW_variants-map", delete: "true")
split_field("$i.altLabel[]", "; ")
end

move_field("_temp", "professionOrOccupation[]")
Expand Down

0 comments on commit 647a7cb

Please sign in to comment.