From 07696e3ef0ffea2bd9f98a7500b99c035423a540 Mon Sep 17 00:00:00 2001 From: Petra Maier Date: Thu, 2 Nov 2023 15:24:28 +0100 Subject: [PATCH] Add relatedPerson (RPB-102) --- conf/output/test-output-rppd-lobid-0.json | 4 +++ conf/output/test-output-rppd-lobid-12.json | 7 ++++++ conf/output/test-output-rppd-lobid-13.json | 13 ++++++++++ conf/output/test-output-rppd-lobid-16.json | 7 ++++++ conf/output/test-output-rppd-lobid-22.json | 4 +++ conf/output/test-output-rppd-lobid-26.json | 7 ++++++ conf/output/test-output-rppd-lobid-5.json | 4 +++ conf/output/test-output-rppd-lobid-9.json | 4 +++ conf/rppd-to-lobid.fix | 29 +++++++++++++++++++--- 9 files changed, 75 insertions(+), 4 deletions(-) diff --git a/conf/output/test-output-rppd-lobid-0.json b/conf/output/test-output-rppd-lobid-0.json index ba491598..1117bafc 100644 --- a/conf/output/test-output-rppd-lobid-0.json +++ b/conf/output/test-output-rppd-lobid-0.json @@ -49,6 +49,10 @@ "label" : "Neustrelitz", "id" : "https://rpb.lobid.org/dummi/Neustrelitz" } ], + "relatedPerson" : [ { + "label" : "Wagner, Richard", + "id" : "https://rpb.lobid.org/dummi/Wagner, Richard" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/output/test-output-rppd-lobid-12.json b/conf/output/test-output-rppd-lobid-12.json index 82cf0d33..b0c6c700 100644 --- a/conf/output/test-output-rppd-lobid-12.json +++ b/conf/output/test-output-rppd-lobid-12.json @@ -37,6 +37,13 @@ "label" : "New York, NY", "id" : "https://rpb.lobid.org/dummi/New York, NY" } ], + "relatedPerson" : [ { + "label" : "Anschuez, Joseph Andreas", + "id" : "https://d-nb.info/gnd/118649558" + }, { + "label" : "Anschütz, Hermann", + "id" : "https://d-nb.info/gnd/116312351" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/output/test-output-rppd-lobid-13.json b/conf/output/test-output-rppd-lobid-13.json index 39452f82..09513d0e 100644 --- a/conf/output/test-output-rppd-lobid-13.json +++ b/conf/output/test-output-rppd-lobid-13.json @@ -31,6 +31,19 @@ "label" : "Koblenz, Kreisfreie Stadt", "id" : "https://rpb.lobid.org/spatial#n11100000" } ], + "relatedPerson" : [ { + "label" : "Anschuez, Carl", + "id" : "https://d-nb.info/gnd/1051147395" + }, { + "label" : "Anschuez, Franz Caspar", + "id" : "https://d-nb.info/gnd/1051177324" + }, { + "label" : "Anschuez, Heinrich Franz", + "id" : "https://d-nb.info/gnd/1051177332" + }, { + "label" : "Anschütz, Hermann", + "id" : "https://d-nb.info/gnd/116312351" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/output/test-output-rppd-lobid-16.json b/conf/output/test-output-rppd-lobid-16.json index 1410abbb..524ba39e 100644 --- a/conf/output/test-output-rppd-lobid-16.json +++ b/conf/output/test-output-rppd-lobid-16.json @@ -31,6 +31,13 @@ "label" : "Köln", "id" : "https://rpb.lobid.org/dummi/Köln" } ], + "relatedPerson" : [ { + "label" : "Meister, Ernst", + "id" : "https://d-nb.info/gnd/1051179556" + }, { + "label" : "Meister, Nikolaus", + "id" : "https://d-nb.info/gnd/1051179564" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/output/test-output-rppd-lobid-22.json b/conf/output/test-output-rppd-lobid-22.json index b36190d9..12ebdafd 100644 --- a/conf/output/test-output-rppd-lobid-22.json +++ b/conf/output/test-output-rppd-lobid-22.json @@ -23,6 +23,10 @@ "label" : "Konzentrationslager Dachau", "id" : "https://rpb.lobid.org/dummi/Konzentrationslager Dachau" } ], + "relatedPerson" : [ { + "label" : "Ziegler, Hans", + "id" : "https://d-nb.info/gnd/1051203023" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/output/test-output-rppd-lobid-26.json b/conf/output/test-output-rppd-lobid-26.json index 439c8293..561e02cd 100644 --- a/conf/output/test-output-rppd-lobid-26.json +++ b/conf/output/test-output-rppd-lobid-26.json @@ -31,6 +31,13 @@ "label" : "Konzentrationslager Dachau", "id" : "https://rpb.lobid.org/dummi/Konzentrationslager Dachau" } ], + "relatedPerson" : [ { + "label" : "Schulz, Johannes", + "id" : "https://d-nb.info/gnd/119273861" + }, { + "label" : "Bettendorff, Ludwig", + "id" : "https://d-nb.info/gnd/1051206464" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/output/test-output-rppd-lobid-5.json b/conf/output/test-output-rppd-lobid-5.json index 517ebc77..54b48599 100644 --- a/conf/output/test-output-rppd-lobid-5.json +++ b/conf/output/test-output-rppd-lobid-5.json @@ -25,6 +25,10 @@ "label" : "Werdohl", "id" : "https://rpb.lobid.org/dummi/Werdohl" } ], + "relatedPerson" : [ { + "label" : "Heyberger, Renate", + "id" : "https://rpb.lobid.org/dummi/Heyberger, Renate" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/output/test-output-rppd-lobid-9.json b/conf/output/test-output-rppd-lobid-9.json index cf51cf65..1a8e2368 100644 --- a/conf/output/test-output-rppd-lobid-9.json +++ b/conf/output/test-output-rppd-lobid-9.json @@ -28,6 +28,10 @@ "label" : "Unkel, Stadt", "id" : "https://rpb.lobid.org/spatial#n13807073" } ], + "relatedPerson" : [ { + "label" : "Reinirkens, Ernst Leonhard", + "id" : "https://d-nb.info/gnd/139865985" + } ], "gender" : [ { "id" : "https://d-nb.info/standards/vocab/gnd/gender#male", "label" : "Männlich" diff --git a/conf/rppd-to-lobid.fix b/conf/rppd-to-lobid.fix index 9f938be3..2dff51fd 100644 --- a/conf/rppd-to-lobid.fix +++ b/conf/rppd-to-lobid.fix @@ -7,6 +7,11 @@ end do once("map_spatial") put_rdfmap("https://raw.githubusercontent.com/hbz/lobid-vocabs/master/rpb/rpb-spatial.ttl", "spatial_map", target:"skos:prefLabel", select_language:"de") end +# für lookup relatedPerson +do once("map_rel") + put_filemap("conf/maps/gndId-to-rppdId.tsv", "map_rel_gndId",key_column:"0",value_column:"1", sep_char: "\t", expected_columns:"-1") + put_filemap("conf/maps/gndId-to-rppdId.tsv", "map_rel_preferredName",key_column:"0",value_column:"2", sep_char: "\t", expected_columns:"-1") +end # ------ @@ -181,9 +186,24 @@ end # Kommentar Doku: RPPD-ID-Nr. mit Unterstrichen, falls Person bereits in RPPD aufgenommen (Bsp.: _pk0000_), sonst Klartext: Nachname, Vorname / Lebensdaten; getrennt mit @; nähere Ausführungen in 1nz notwendig; verknüpfte Person ist anklickbar # TODO: Wenn rppd ID angegeben wird, unterstriche löschen und zu URL transformieren (wie id) und auf Feld relatedPerson[].*.id mappen. -# ------- -# #1nt (persönl. Beziehungen (m, R)) -> relatedPerson (unspezifisch) -# Kommentar Doku: RPPD-ID-Nr. mit Unterstrichen, falls Person bereits in RPPD aufgenommen (Bsp.: _pk0000_), sonst Klartext: Nachname, Vorname / Lebensdaten; getrennt mit @; nähere Ausführungen in 1nz notwendig; verknüpfte Person ist anklickbar + +set_array("relatedPerson[]") +do list(path:"f1nt[]", "var": "$i") + if any_match("$i.f1nt", "^_.+") + replace_all("$i.f1nt", "_", "") + copy_field("$i.f1nt", "relatedPerson[].$append.label") + copy_field("$i.f1nt", "relatedPerson[].$last.id") + lookup("relatedPerson[].$last.label", "map_rel_preferredName") + lookup("relatedPerson[].$last.id", "map_rel_gndId") + prepend("relatedPerson[].$last.id","https://d-nb.info/gnd/") + else + copy_field("$i.f1nt", "relatedPerson[].$append.label") + prepend("$i.f1nt", "https://rpb.lobid.org/dummi/") + copy_field("$i.f1nt", "relatedPerson[].$last.id") + end +end + + # ------- # #1nu (Werke (m)) -> publication @@ -261,6 +281,7 @@ retain( "placeOfActivity[]", "gndSubjectCategory[]", "placeOfBirth[]", - "placeOfDeath[]" + "placeOfDeath[]", + "relatedPerson[]" ) \ No newline at end of file