From a1356a20cd318ffe29c90e910a34da00776bae14 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Fri, 18 Oct 2024 12:26:15 +0200 Subject: [PATCH] Fix handling of `um` with multiple types, add output (RPB-205) --- conf/RPB-Export_HBZ_Titel_Test.txt | 1 + conf/output/test-output-86.json | 100 ++++++++++++++++++++++++++++ conf/output/test-output-87.json | 48 +++++++++++++ conf/output/test-output-88.json | 0 conf/output/test-output-strapi.json | 1 + conf/rpb-titel-to-strapi.fix | 10 +-- 6 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 conf/output/test-output-87.json create mode 100644 conf/output/test-output-88.json diff --git a/conf/RPB-Export_HBZ_Titel_Test.txt b/conf/RPB-Export_HBZ_Titel_Test.txt index 218a63ae..f4f9926c 100644 --- a/conf/RPB-Export_HBZ_Titel_Test.txt +++ b/conf/RPB-Export_HBZ_Titel_Test.txt @@ -72,3 +72,4 @@ [/]#00 107t182053[/]#20 Friedrich Christian Laukhard (1757-1822) : Schriftsteller, Radikalaufkl„rer und gelehrter Soldat[/]#30 _sn768030_[/]#31 _r99_ _o33105070_[/]#32 _118726692_ ; _4006804n3_[/]#35 _r99_ _o33105070_ ; _sn768030_[/]#36 s[/]#37 _sn768030_ ; _r99_ _o33105070_[/]#39 Guido Naschert (Hg.)[/]#41 _00Gn18s2053186a_[/]#74 Paderborn[/]#75 Ferdinand Sch”ningh[/]#76a[2017][/]#76b2017[/]#77 218 Seiten : Illustrationen, Karte[/]#83 Laukhard, Friedrich Christian / 1757-1822[/]#87 978-3-506-77967-0[/]#90b117-3134[/]#90d2020/1429[/]#90fhttp://digitale-objekte.hbz-nrw.de/storage2/2017/08/19/file_28/7343682.pdf[/]#90ghttps://www.hsozkult.de/publicationreview/id/reb-22111[/]#95 20180620/10:01:03HBZ[/]#96 20200603/09:22:21KO[/]#983HT019399122[/] [/]#00 929t160199[/]#20 Wandern auf Rheinsteig und Rheinburgenweg[/]#21 Wandern auf dem Rheinsteig und dem Rheinburgenweg[/]#30 _sn102070_[/]#31 _r22_ _4126432n0_[/]#32 _7501137n2_ ; _7500776n9_ ; _4064532n0_[/]#35 _r22_ _4126432n0_ ; _sn102070_[/]#36 s[/]#37 _sn102070_ ; _r22_ _4126432n0_[/]#39 Manfred B”ckling[/]#40 _124591736_[/]#71 4., aktualisierte Auflage[/]#74 Ostfildern[/]#75 DuMont Reiseverlag[/]#76a2012[/]#76b2012[/]#77 180 Seiten : Illustrationen, Diagramme, Karten[/]#81 Enth„lt Index[/]#83 Boeckling, Manfred / 1970-[/]#85 DuMont aktiv[/]#87 978-3-7701-8016-5[/]#90d2016/311[/]#90fhttp://d-nb.info/1069609889/04[/]#95 20160128/13:51:41HBZ[/]#96 20160208/08:24:33ZR[/]#983HT018859168[/] [/]#00 929t091078[/]#20 Zur Geschichte und Organisation der Neuwieder Feuerwehr[/]#30 _sn428074_[/]#31 _r99_ _o13800045_[/]#32 _5094678nX_ ; _4072821n3_ ; _00Sn09k1078995a_[/]#32a_5094678nX_ ; _4077814n9_ ; _00Sn09k1078114a_[/]#35 _r99_ _o13800045_ ; _sn428074_[/]#36 um[/]#37 _sn428074_ ; _r99_ _o13800045_[/]#39 Dr. Wolfgang Dietz[/]#40 _132532336_[/]#70 Landkreis Neuwied: Heimatjahrbuch des Landkreises Neuwied. - 2009, S. 383-392 (1. Teil: Innenstadt); 2010, S. 287-305 (2. Teil: Stadtteile)[/]#76a2008[/]#76b2008[/]#77 Ill.[/]#87 978-3-935690-66-9[/]#88 401745-6[/]#90bPer. 5998/2009-2010[/]#90dZ 37[/]#95 20090319/11:37:43KO[/]#96 20210212/11:44:44SP[/] +[/]#00 121t0146618[/]#20 2000 Jahre Meilbrck : vom r”mischen Tempelbezirk zur modernen Rastst„tte[/]#27 Zweitausend Jahre Meilbrck[/]#30 _sn240400_[/]#31 _r99_ _o232080600101_[/]#35 _r99_ _o232080600101_ ; _sn240400_[/]#36 um[/]#37 _sn240400_ ; _r99_ _o232080600101_[/]#40 _00Pn02t0375a_[/]#76a1990[/]#76b1990[/]#90cZ 1184;Z 1184[/]#95 ZR-19991015/00:00:00TR-MML-Import[/]#96 20230112/12:09:16ZR[/]#97xmbd[/]#97yEinspielung: Mittelrhein-Mosel-Literaturdokumentation 1945-1990 [mmb-1990-2183;Sign. Z 1184;Z 1184][/]#995Ortsbeschreibung und Ortsgeschichte, LandschaftenOrtsbeschreibung und Ortsgeschichte, Landschaften[/]#997Meilbrck[/]#01 1[/]#20 Von den Anf„ngen bis zum Ende der R”merherrschaft[/]#36 sbd[/]#70 Heimatkalender Landkreis Bitburg-Prm. - 1990, S. 74 - 78[/]#77 Ill.[/] diff --git a/conf/output/test-output-86.json b/conf/output/test-output-86.json index e69de29b..a43db1aa 100644 --- a/conf/output/test-output-86.json +++ b/conf/output/test-output-86.json @@ -0,0 +1,100 @@ +{ + "@context" : "http://lobid.org/resources/context.jsonld", + "type" : [ "BibliographicResource", "Article" ], + "rpbId" : "929t091078", + "id" : "https://lobid.org/resources/929t091078", + "isbn" : [ "978-3-935690-66-9" ], + "inCollection" : [ { + "id" : "http://lobid.org/resources/HT013494180#!", + "type" : [ "Collection" ], + "label" : "Rheinland-PfĂ€lzische Bibliographie" + } ], + "title" : "Zur Geschichte und Organisation der Neuwieder Feuerwehr", + "extent" : "Ill.", + "responsibilityStatement" : [ "Dr. Wolfgang Dietz" ], + "publication" : [ { + "startDate" : "2008", + "type" : [ "PublicationEvent" ] + } ], + "subject" : [ { + "id" : "http://purl.org/lobid/rpb#n428074", + "label" : "Feuerwehr", + "type" : [ "Concept" ], + "source" : { + "id" : "http://purl.org/lobid/rpb", + "label" : "Systematik der Rheinland-PfĂ€lzischen Bibliographie" + } + }, { + "type" : [ "ComplexSubject" ], + "label" : "Freiwillige Feuerwehr Neuwied | Innenstadt | Geschichte 1867-2008", + "componentList" : [ { + "id" : "https://d-nb.info/gnd/5094678nX", + "label" : "Freiwillige Feuerwehr Neuwied", + "source" : { + "id" : "https://d-nb.info/gnd/7749153-1", + "label" : "Gemeinsame Normdatei (GND)" + } + }, { + "id" : "https://d-nb.info/gnd/4072821-3", + "label" : "Innenstadt", + "source" : { + "id" : "https://d-nb.info/gnd/7749153-1", + "label" : "Gemeinsame Normdatei (GND)" + } + }, { + "id" : "http://rpb.lobid.org/sw/00Sn09k1078995a", + "label" : "Geschichte 1867-2008", + "source" : { + "id" : "http://rpb.lobid.org/sw", + "label" : "RPB-Sachsystematik" + } + } ] + }, { + "type" : [ "ComplexSubject" ], + "label" : "Freiwillige Feuerwehr Neuwied | Stadtviertel | Geschichte 1600-2008", + "componentList" : [ { + "id" : "https://d-nb.info/gnd/5094678nX", + "label" : "Freiwillige Feuerwehr Neuwied", + "source" : { + "id" : "https://d-nb.info/gnd/7749153-1", + "label" : "Gemeinsame Normdatei (GND)" + } + }, { + "id" : "https://d-nb.info/gnd/4077814-9", + "label" : "Stadtviertel", + "source" : { + "id" : "https://d-nb.info/gnd/7749153-1", + "label" : "Gemeinsame Normdatei (GND)" + } + }, { + "id" : "http://rpb.lobid.org/sw/00Sn09k1078114a", + "label" : "Geschichte 1600-2008", + "source" : { + "id" : "http://rpb.lobid.org/sw", + "label" : "RPB-Sachsystematik" + } + } ] + } ], + "spatial" : [ { + "id" : "https://rpb.lobid.org/spatial#n13800045", + "label" : "Neuwied, große kreisangehörige Stadt", + "type" : [ "Concept" ], + "source" : { + "id" : "https://rpb.lobid.org/spatial", + "label" : "RPB-Raumsystematik" + } + } ], + "contribution" : [ { + "agent" : { + "id" : "https://d-nb.info/gnd/132532336", + "label" : "Dietz, Wolfgang / 1956-", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/aut", + "label" : "Verfasser/in" + }, + "type" : [ "Contribution" ] + } ], + "bibliographicCitation" : "Landkreis Neuwied: Heimatjahrbuch des Landkreises Neuwied. - 2009, S. 383-392 (1. Teil: Innenstadt); 2010, S. 287-305 (2. Teil: Stadtteile)" +} diff --git a/conf/output/test-output-87.json b/conf/output/test-output-87.json new file mode 100644 index 00000000..1601e73f --- /dev/null +++ b/conf/output/test-output-87.json @@ -0,0 +1,48 @@ +{ + "@context" : "http://lobid.org/resources/context.jsonld", + "type" : [ "BibliographicResource", "Article" ], + "rpbId" : "121t0146618", + "id" : "https://lobid.org/resources/121t0146618", + "inCollection" : [ { + "id" : "http://lobid.org/resources/HT013494180#!", + "type" : [ "Collection" ], + "label" : "Rheinland-PfĂ€lzische Bibliographie" + } ], + "title" : "Von den AnfĂ€ngen bis zum Ende der Römerherrschaft", + "extent" : "Ill.", + "publication" : [ { + "startDate" : "1990", + "type" : [ "PublicationEvent" ] + } ], + "subject" : [ { + "id" : "http://purl.org/lobid/rpb#n240400", + "label" : "Ortsgeschichte", + "type" : [ "Concept" ], + "source" : { + "id" : "http://purl.org/lobid/rpb", + "label" : "Systematik der Rheinland-PfĂ€lzischen Bibliographie" + } + } ], + "spatial" : [ { + "id" : "https://rpb.lobid.org/spatial#n232080600101", + "label" : "MeilbrĂŒck", + "type" : [ "Concept" ], + "source" : { + "id" : "https://rpb.lobid.org/spatial", + "label" : "RPB-Raumsystematik" + } + } ], + "contribution" : [ { + "agent" : { + "id" : "http://rpb.lobid.org/sw/00Pn02t0375a", + "label" : "Schmitt, Heinz", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/aut", + "label" : "Verfasser/in" + }, + "type" : [ "Contribution" ] + } ], + "bibliographicCitation" : "Heimatkalender Landkreis Bitburg-PrĂŒm. - 1990, S. 74 - 78" +} diff --git a/conf/output/test-output-88.json b/conf/output/test-output-88.json new file mode 100644 index 00000000..e69de29b diff --git a/conf/output/test-output-strapi.json b/conf/output/test-output-strapi.json index 3fb5b89d..c11e9f5e 100644 --- a/conf/output/test-output-strapi.json +++ b/conf/output/test-output-strapi.json @@ -85,3 +85,4 @@ {"f35_":"_r99_ _o33105070_ ; _sn768030_","f37_":"_sn768030_ ; _r99_ _o33105070_","f83_":"Laukhard, Friedrich Christian / 1757-1822","f87_":"978-3-506-77967-0","f90b":"117-3134","f90d":"2020/1429","f96_":"20200603/09:22:21\u001FKO","f983":"HT019399122","rpbId":"107t182053","title":"Friedrich Christian Laukhard (1757-1822) : Schriftsteller, RadikalaufklĂ€rer und gelehrter Soldat","type":"Monografie","publicationLocation":"Paderborn","publishedBy":"Ferdinand Schöningh","publicationDate":"[2017]","publicationYear":"2017","extent":"218 Seiten : Illustrationen, Karte","created":"20180620/10:01:03\u001FHBZ","subject":[{"value":"http://purl.org/lobid/rpb#n768030"}],"spatial":[{"value":"https://rpb.lobid.org/spatial#n33105070"}],"subjectComponentList":[{"subjectComponent":[{"value":"https://d-nb.info/gnd/118726692"},{"value":"https://d-nb.info/gnd/4006804-3"}]}],"responsibilityStatement":"Guido Naschert (Hg.)","url":[{"value":"http://digitale-objekte.hbz-nrw.de/storage2/2017/08/19/file_28/7343682.pdf","type":"Andere URL"},{"value":"https://www.hsozkult.de/publicationreview/id/reb-22111","type":"Andere URL"}],"person":[{"value":"http://rpb.lobid.org/sw/00Gn18s2053186a","type":"Herausgeber/in"}],"inCollection":"nur RPB","isbn":[{"value":"978-3-506-77967-0","valid":true}]} {"f35_":"_r22_ _4126432n0_ ; _sn102070_","f37_":"_sn102070_ ; _r22_ _4126432n0_","f83_":"Boeckling, Manfred / 1970-","f87_":"978-3-7701-8016-5","f90d":"2016/311","f96_":"20160208/08:24:33\u001FZR","f983":"HT018859168","rpbId":"929t160199","title":"Wandern auf Rheinsteig und Rheinburgenweg","preferredTitle":"Wandern auf dem Rheinsteig und dem Rheinburgenweg","type":"Monografie","edition":"4., aktualisierte Auflage","publicationLocation":"Ostfildern","publishedBy":"DuMont Reiseverlag","publicationDate":"2012","publicationYear":"2012","extent":"180 Seiten : Illustrationen, Diagramme, Karten","note":[{"value":"EnthĂ€lt Index"}],"created":"20160128/13:51:41\u001FHBZ","subject":[{"value":"http://purl.org/lobid/rpb#n102070"}],"spatial":[{"value":"https://d-nb.info/gnd/4126432-0"}],"subjectComponentList":[{"subjectComponent":[{"value":"https://d-nb.info/gnd/7501137-2"},{"value":"https://d-nb.info/gnd/7500776-9"},{"value":"https://d-nb.info/gnd/4064532-0"}]}],"inSeries":[{"value":"DuMont aktiv"}],"responsibilityStatement":"Manfred Böckling","url":[{"value":"http://d-nb.info/1069609889/04","type":"Andere URL"}],"person":[{"value":"https://d-nb.info/gnd/124591736","type":"Verfasser/in"}],"inCollection":"nur RPB","isbn":[{"value":"978-3-7701-8016-5","valid":true}]} {"f35_":"_r99_ _o13800045_ ; _sn428074_","f37_":"_sn428074_ ; _r99_ _o13800045_","f87_":"978-3-935690-66-9","f88_":"401745-6","f90b":"Per. 5998/2009-2010","f90d":"Z 37","f96_":"20210212/11:44:44\u001FSP","rpbId":"929t091078","title":"Zur Geschichte und Organisation der Neuwieder Feuerwehr","type":"u","bibliographicCitation":{"value":"Landkreis Neuwied: Heimatjahrbuch des Landkreises Neuwied. - 2009, S. 383-392 (1. Teil: Innenstadt); 2010, S. 287-305 (2. Teil: Stadtteile)","pages":"Aus #70~, #701 ff.: S. 287-305"},"publicationDate":"2008","publicationYear":"2008","extent":"Ill.","created":"20090319/11:37:43\u001FKO","subject":[{"value":"http://purl.org/lobid/rpb#n428074"}],"spatial":[{"value":"https://rpb.lobid.org/spatial#n13800045"}],"subjectComponentList":[{"subjectComponent":[{"value":"https://d-nb.info/gnd/5094678nX"},{"value":"https://d-nb.info/gnd/4072821-3"},{"value":"http://rpb.lobid.org/sw/00Sn09k1078995a"}]},{"subjectComponent":[{"value":"https://d-nb.info/gnd/5094678nX"},{"value":"https://d-nb.info/gnd/4077814-9"},{"value":"http://rpb.lobid.org/sw/00Sn09k1078114a"}]}],"responsibilityStatement":"Dr. Wolfgang Dietz","person":[{"value":"https://d-nb.info/gnd/132532336","type":"Verfasser/in"}],"inCollection":"nur RPB","isbn":[{"value":"978-3-935690-66-9","valid":true}]} +{"f35_":"_r99_ _o232080600101_ ; _sn240400_","f37_":"_sn240400_ ; _r99_ _o232080600101_","f90c":"Z 1184;Z 1184","f96_":"20230112/12:09:16\u001FZR","f97x":"mbd","f97y":"Einspielung: Mittelrhein-Mosel-Literaturdokumentation 1945-1990 [mmb-1990-2183;Sign. Z 1184;Z 1184]","f995":"Ortsbeschreibung und Ortsgeschichte, LandschaftenOrtsbeschreibung und Ortsgeschichte, Landschaften","f997":"MeilbrĂŒck","rpbId":"121t0146618","numbering":"1","title":"2000 Jahre MeilbrĂŒck : vom römischen Tempelbezirk zur modernen RaststĂ€tte","title":"Von den AnfĂ€ngen bis zum Ende der Römerherrschaft","alternativeTitle":[{"value":"Zweitausend Jahre MeilbrĂŒck"}],"type":"u","bibliographicCitation":{"value":"Heimatkalender Landkreis Bitburg-PrĂŒm. - 1990, S. 74 - 78","pages":"Aus #70~, #701 ff.: S. 74 - 78"},"publicationDate":"1990","publicationYear":"1990","extent":"Ill.","created":"ZR-19991015/00:00:00\u001FTR-MML-Import","subject":[{"value":"http://purl.org/lobid/rpb#n240400"}],"spatial":[{"value":"https://rpb.lobid.org/spatial#n232080600101"}],"person":[{"value":"http://rpb.lobid.org/sw/00Pn02t0375a","type":"Verfasser/in"}],"inCollection":"nur RPB","volumeIn":{"numbering":"1","value":"https://lobid.org/resources/121t0146618"}} diff --git a/conf/rpb-titel-to-strapi.fix b/conf/rpb-titel-to-strapi.fix index f1ff44ae..3bad9018 100644 --- a/conf/rpb-titel-to-strapi.fix +++ b/conf/rpb-titel-to-strapi.fix @@ -75,7 +75,11 @@ call_macro("move_all", from: "f24?", to: "parallelTitle") call_macro("move_all", from: "f27?", to: "alternativeTitle") move_field("f28_", "alternativeSpelling") move_field("f36_", "type") -replace_all("type", "um", "u") # https://jira.hbz-nrw.de/browse/RPB-205 +if is_array("type") + move_field("type.$first", "_temp") + move_field("_temp", "type") # e.g. ["um","sbd"] -> "um" +end +lookup("type", "um": "u") # https://jira.hbz-nrw.de/browse/RPB-205 move_field("f70[_123456789]", "bibliographicCitation.value") join_field("bibliographicCitation.value", "; ") move_field("f70b", "bibliographicCitation.volume") @@ -190,10 +194,6 @@ unless exists("bibliographicCitation.pages") end # Menschenlesbare Werte nutzen (fĂŒr die Erfassung in Strapi) -if is_array("type") - # print_record("Mehrere Satztypen gefunden: ") - set_field("type", "type.$last") -end lookup("type", s: "Monografie", sm: "Mehrt. Mono (ÜO)", sbd: "Band")