From c39128cf819f9e98a46e933d2c47cfc57270872c Mon Sep 17 00:00:00 2001 From: Petra Maier Date: Thu, 21 Mar 2024 11:29:48 +0100 Subject: [PATCH] Fix extent for repeated 300 with multiple Subfields Adjust replacement of brackets --- src/main/resources/alma/fix/otherFields.fix | 33 ++- .../alma-fix/990198383780206441.json | 2 +- .../resources/alma-fix/99371426239306441.json | 204 ++++++++++++++++ .../resources/alma-fix/99371426239306441.xml | 222 ++++++++++++++++++ 4 files changed, 449 insertions(+), 12 deletions(-) create mode 100644 src/test/resources/alma-fix/99371426239306441.json create mode 100644 src/test/resources/alma-fix/99371426239306441.xml diff --git a/src/main/resources/alma/fix/otherFields.fix b/src/main/resources/alma/fix/otherFields.fix index 46a8d92fb..44f0b73a1 100644 --- a/src/main/resources/alma/fix/otherFields.fix +++ b/src/main/resources/alma/fix/otherFields.fix @@ -23,21 +23,31 @@ prepend("language[].*.id", "http://id.loc.gov/vocabulary/iso639-2/") # We reuse the introx transformation here. set_array("@300a") -copy_field("300 .a", "@300a.$append") +set_array("@300c") +do list(path: "300 ", "var": "$i") + copy_field("$i.a", "@300a.$append") + do list(path: "$i.b", "var": "$j") + replace_all("$j", "\\s?[:;+(]?$", "") + copy_field("$j", "@300b") + end + copy_field("$i.c", "@300c.$append") + do list(path: "$i.e", "var": "$j") + replace_all("$j", "[.]?\\s?\\(?$", "") + copy_field("$j", "@300e") + end +end if exists("@300a.1") copy_field("@300a.1", "@300a1") replace_all("@300a1", "\\s?[:;+(]?$", "") end if exists("@300a.2") copy_field("@300a.2", "@300a2") - replace_all("@300a2", "\\s?[:;+)]?$", "") + replace_all("@300a2", "\\s?[:;+]?$", "") end -do list(path: "300 .b", "var": "$i") - replace_all("$i", "\\s?[:;+(]?$", "") - copy_field("$i", "@300b") +if exists("@300a.3") + copy_field("@300a.3", "@300a3") + replace_all("@300a3", "\\s?[:;+]?$", "") end -set_array("@300c") -copy_field("300 .c", "@300c.$append") if exists("@300c.1") copy_field("@300c.1", "@300c1") replace_all("@300c1", "[.]?\\s?[:;+(]?$", "") @@ -46,16 +56,15 @@ if exists("@300c.2") copy_field("@300c.2", "@300c2") replace_all("@300c2", "[.]?\\s?[:;+)]?$", "") end -do list(path: "300 .e", "var": "$i") - replace_all("$i", "[.]?\\s?\\(?$", "") - copy_field("$i", "@300e") -end if exists("@300a2") if exists("@300c2") paste("@300a2_punct", "@300a2", "~ ; ", join_char: "") else paste("@300a2_punct", "@300a2", "~)", join_char: "") end +if exists("@300a3") + paste("@300a2_punct", "@300a2_punct", "~, (","@300a3", "~)", join_char: "") +end end if exists("@300b") if exists("@300a1") @@ -84,6 +93,8 @@ if exists("300 .e") end end paste("extent", "@300a1", "@300b_punct", "@300c1_punct", "@300e_punct", "@300a2_punct", "@300c2_punct", join_char: "") +replace_all("extent", " ", " ") + # 500 - General Note (R) Subfield: $a (NR) diff --git a/src/test/resources/alma-fix/990198383780206441.json b/src/test/resources/alma-fix/990198383780206441.json index 18693f4a6..9d9bf381a 100644 --- a/src/test/resources/alma-fix/990198383780206441.json +++ b/src/test/resources/alma-fix/990198383780206441.json @@ -71,7 +71,7 @@ "id" : "http://id.loc.gov/vocabulary/iso639-2/ger", "label" : "Deutsch" } ], - "extent" : "1 CD : digital ; 12 cm, 100 gr ; 1 Booklet [(2)] S (1 CD (75 04 Min. ; 12 cm", + "extent" : "1 CD : digital ; 12 cm, 100 gr ; 1 Booklet [(2)] S (1 CD (75 04 Min.) ; 12 cm", "hasItem" : [ { "label" : "lobid Bestandsressource", "type" : [ "Item", "PhysicalObject" ], diff --git a/src/test/resources/alma-fix/99371426239306441.json b/src/test/resources/alma-fix/99371426239306441.json new file mode 100644 index 000000000..fc61ddc24 --- /dev/null +++ b/src/test/resources/alma-fix/99371426239306441.json @@ -0,0 +1,204 @@ +{ + "@context" : "http://lobid.org/resources/context.jsonld", + "almaMmsId" : "99371426239306441", + "isbn" : [ "3319599526", "9783319599526" ], + "doi" : [ "10.1007/978-3-319-59952-6" ], + "title" : "Pediatric Vaccines and Vaccinations", + "otherTitleInformation" : [ "A European Textbook" ], + "edition" : [ "1st ed. 2017" ], + "publication" : [ { + "startDate" : "2017", + "type" : [ "PublicationEvent" ], + "location" : [ "Cham" ], + "publishedBy" : [ "Springer International Publishing", "Imprint: Springer" ] + } ], + "describedBy" : { + "id" : "http://lobid.org/resources/99371426239306441", + "label" : "Webseite der hbz-Ressource 99371426239306441", + "type" : [ "BibliographicDescription" ], + "inDataset" : { + "id" : "http://lobid.org/resources/dataset#!", + "label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data" + }, + "resultOf" : { + "type" : [ "CreateAction" ], + "endTime" : "0000-00-00T00:00:00", + "instrument" : { + "id" : "https://github.com/hbz/lobid-resources", + "type" : [ "SoftwareApplication" ], + "label" : "Software lobid-resources" + }, + "object" : { + "id" : "https://lobid.org/marcxml/99371426239306441", + "dateCreated" : "2022-07-06", + "dateModified" : "2023-10-24", + "type" : [ "DataFeedItem" ], + "label" : "hbz-Ressource 99371426239306441 im Exportformat MARC21 XML", + "inDataset" : { + "id" : "https://datahub.io/dataset/hbz_unioncatalog", + "label" : "hbz_unioncatalog" + }, + "sourceOrganization" : { + "id" : "http://lobid.org/organisations/DE-MiAaPQ#!", + "label" : "lobid Organisation" + }, + "provider" : { + "id" : "http://lobid.org/organisations/DE-MiAaPQ#!", + "label" : "lobid Organisation" + }, + "modifiedBy" : [ { + "id" : "http://lobid.org/organisations/DE-MiAaPQ#!", + "label" : "lobid Organisation" + } ] + } + }, + "license" : [ { + "id" : "http://creativecommons.org/publicdomain/zero/1.0", + "label" : "Creative Commons-Lizenz CC0 1.0 Universal" + } ] + }, + "sameAs" : [ { + "id" : "https://doi.org/10.1007/978-3-319-59952-6", + "label" : "978-3-319-59952-6" + } ], + "isPartOf" : [ { + "type" : [ "IsPartOfRelation" ], + "hasSuperordinate" : [ { + "label" : "Springer biomedical and life sciences ebooks." + } ] + } ], + "fulltextOnline" : [ { + "id" : "https://doi.org/10.1007/978-3-319-59952-6", + "label" : "DOI-Link" + } ], + "language" : [ { + "id" : "http://id.loc.gov/vocabulary/iso639-2/eng", + "label" : "Englisch" + } ], + "extent" : "1 v. : il. ; 26 cm ; (XIII, 264 p.), (1 online resource (XIII, 264 p. 61 illus., 57 illus. in color.))", + "note" : [ "Incluye índice" ], + "abstract" : [ "This graduate textbook serves as a highly readable guide on vaccines and vaccination in infants, children and adolescents from an European perspective. The first part of the book is dedicated to childhood and adolescent vaccine schedules, maternal and neonatal immunization and safety of vaccines. In a second part we focus on viral and bacterial vaccines. Further chapters discuss pediatric travel vaccines, vaccines in the pipeline and the European registration process. This book is intended to be a reference textbook and will help to standardize the information on vaccines and immunization program in the WHO European Region." ], + "subject" : [ { + "type" : [ "Concept" ], + "source" : { + "label" : "Freie Verschlagwortung", + "id" : "https://www.wikidata.org/wiki/Q47524318" + }, + "label" : "Vaccine." + }, { + "type" : [ "Concept" ], + "source" : { + "label" : "Freie Verschlagwortung", + "id" : "https://www.wikidata.org/wiki/Q47524318" + }, + "label" : "Immunology." + }, { + "type" : [ "Concept" ], + "source" : { + "label" : "Freie Verschlagwortung", + "id" : "https://www.wikidata.org/wiki/Q47524318" + }, + "label" : "Pediatrics." + }, { + "type" : [ "Concept" ], + "source" : { + "label" : "Library of Congress Subject Headings", + "id" : "https://id.loc.gov/authorities/subjects.html" + }, + "label" : "Vaccines." + }, { + "type" : [ "Concept" ], + "source" : { + "label" : "Library of Congress Subject Headings", + "id" : "https://id.loc.gov/authorities/subjects.html" + }, + "label" : "Immunology." + }, { + "type" : [ "Concept" ], + "source" : { + "label" : "Library of Congress Subject Headings", + "id" : "https://id.loc.gov/authorities/subjects.html" + }, + "label" : "Pediatrics." + } ], + "subjectslabels" : [ "Vaccine.", "Immunology.", "Pediatrics.", "Vaccines." ], + "hasItem" : [ { + "type" : [ "Item", "DigitalDocument" ], + "label" : "Electronic Portfolio", + "electronicLocator" : "https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_HHL/openurl?u.ignore_date_coverage=true&portfolio_pid=5343924960006482&Force_direct=true", + "sublocation" : "https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_HHL/openurl?u.ignore_date_coverage=true&rft.mms_id=991001245702106482", + "heldBy" : { + "isil" : "DE-1871", + "id" : "http://lobid.org/organisations/DE-1871#!", + "label" : "Zentrum für Wissensmanagement, Bibliothek Hamm" + }, + "id" : "http://lobid.org/items/99371426239306441:DE-1871:5343924960006482#!" + }, { + "type" : [ "Item", "DigitalDocument" ], + "label" : "Electronic Portfolio", + "electronicLocator" : "https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_PAD/openurl?u.ignore_date_coverage=true&portfolio_pid=53180977560006463&Force_direct=true", + "sublocation" : "https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_PAD/openurl?u.ignore_date_coverage=true&rft.mms_id=9925035148406463", + "heldBy" : { + "isil" : "DE-466", + "id" : "http://lobid.org/organisations/DE-466#!", + "label" : "Universitätsbibliothek Paderborn" + }, + "seeAlso" : [ "https://katalog.ub.uni-paderborn.de/local/s?sr%5Bq,any%5D=99371426239306441" ], + "id" : "http://lobid.org/items/99371426239306441:DE-466:53180977560006463#!" + } ], + "medium" : [ { + "label" : "Datenträger", + "id" : "http://rdaregistry.info/termList/RDAMediaType/1003" + }, { + "label" : "Online-Ressource", + "id" : "http://rdaregistry.info/termList/RDACarrierType/1018" + } ], + "bibliographicLevel" : { + "label" : "Monograph/Item", + "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" + }, + "type" : [ "BibliographicResource", "Book" ], + "responsibilityStatement" : [ "edited by Timo Vesikari, Pierre Van Damme." ], + "contribution" : [ { + "agent" : { + "label" : "Vesikari, Timo", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/edt", + "label" : "Herausgeber/in" + }, + "type" : [ "Contribution" ] + }, { + "agent" : { + "label" : "Vesikari, Timo", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/http://id.loc.gov/vocabulary/relators/edt", + "label" : "edt" + }, + "type" : [ "Contribution" ] + }, { + "agent" : { + "label" : "Van Damme, Pierre", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/edt", + "label" : "Herausgeber/in" + }, + "type" : [ "Contribution" ] + }, { + "agent" : { + "label" : "Van Damme, Pierre", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/http://id.loc.gov/vocabulary/relators/edt", + "label" : "edt" + }, + "type" : [ "Contribution" ] + } ], + "id" : "http://lobid.org/resources/99371426239306441#!" +} diff --git a/src/test/resources/alma-fix/99371426239306441.xml b/src/test/resources/alma-fix/99371426239306441.xml new file mode 100644 index 000000000..9eda6f52f --- /dev/null +++ b/src/test/resources/alma-fix/99371426239306441.xml @@ -0,0 +1,222 @@ + + + 03862nam a22005175i 4500 + 99371426239306441 + 20200704024809.0 + m o d | + cr cnu|||||||| + 171103s2017 gw | o |||| 0|eng d + + 3-319-59952-6 + + + 10.1007/978-3-319-59952-6 + doi + + + (CKB)4340000000223230 + + + (DE-He213)978-3-319-59952-6 + + + (MiAaPQ)EBC5576796 + + + (PPN)221254080 + + + (EXLCZ)994340000000223230 + + + MiAaPQ + eng + rda + pn + MiAaPQ + MiAaPQ + + + RM281 + .P43 2017 + + + MJCM + bicssc + + + MED044000 + bisacsh + + + 315.371:616.9 + + + 614.47:616-053.2 + + + 615.372 + 23 + + + Pediatric Vaccines and Vaccinations + [electronic resource] : + A European Textbook / + edited by Timo Vesikari, Pierre Van Damme. + + + 1st ed. 2017. + + + Cham : + Springer International Publishing : + Imprint: Springer, + 2017. + + + 1 v. + XIII, 264 p. : + il. ; + 26 cm + + + 1 online resource (XIII, 264 p. 61 illus., 57 illus. in color.) + + + text + txt + rdacontent + + + computer + c + rdamedia + + + online resource + cr + rdacarrier + + + Incluye índice + + + Disponible en versión electrónica e impresa + + + Includes bibliographical references and index. + + + Foreword -- Part I: General Vaccinology -- Expected and unexpected effects of vaccination -- How vaccinating people can also protect others -- Childhood and adolescent immunization programmes in Europe -- Vaccine hesitancy, acceptance and demand -- Adjuvants in pediatric vaccines -- Maternal immunization -- Neonatal immunization -- Part II: Viral vaccines and vaccinations -- Poliovirus vaccines -- Measles-mumps-rubella (MMR) vaccine -- Varicella vaccine -- Rotavirus vaccine -- Hepatitis A vaccine -- Hepatitis B vaccine -- Influenza vaccines -- Human papillomavirus (HPV) vaccines -- Tick borne encephalitis vaccines (TBE) -- Part III: Bacterial vaccines and vaccination -- Tuberculosis vaccines -- Pertussis vaccines -- Haemophilus influenza type b Hib vaccines -- Pediatric combination vaccines -- Pneumococcal vaccines -- Meningococcal vaccines -- Pediatric vaccines for travel outside Europe: yellow fever vaccine, Japanese encephalitis vaccine, typhoid vaccines, cholera vaccines, dengue vaccines, malaria vaccine -- New vaccines in pipeline development -- GBS, CMV and RSV vaccines -- Norovirus vaccines -- Registration of vaccines, safety follow-up and Paediatric Investigation Plan. + + + This graduate textbook serves as a highly readable guide on vaccines and vaccination in infants, children and adolescents from an European perspective. The first part of the book is dedicated to childhood and adolescent vaccine schedules, maternal and neonatal immunization and safety of vaccines. In a second part we focus on viral and bacterial vaccines. Further chapters discuss pediatric travel vaccines, vaccines in the pipeline and the European registration process. This book is intended to be a reference textbook and will help to standardize the information on vaccines and immunization program in the WHO European Region. + + + Vaccines. + + + Immunology. + + + Pediatrics. + + + Vaccine. + https://scigraph.springernature.com/ontologies/product-market-codes/B16010 + + + Immunology. + https://scigraph.springernature.com/ontologies/product-market-codes/B14000 + + + Pediatrics. + https://scigraph.springernature.com/ontologies/product-market-codes/H49006 + + + Vesikari, Timo. + editor. + edt + http://id.loc.gov/vocabulary/relators/edt + + + Van Damme, Pierre. + editor. + edt + http://id.loc.gov/vocabulary/relators/edt + + + Springer biomedical and life sciences ebooks. + + + BOOK + + + 49HBZ_NETWORK + 99371426239306441 + HBZ Network + + + 49HBZ_HHL + 991001245702106482 + Hochschule Hamm-Lippstadt + + + 49HBZ_PAD + 9925035148406463 + Universitätsbibliothek Paderborn + + + System + SPRINGER + marc21 + false + 2023-10-24 18:09:07 Europe/Berlin + 994340000000223230 + 00 + CKB + 2022-07-06 10:54:06 Europe/Berlin + + + SpringerLink - AutoHoldings + System + 5343924960006482 + 49HBZ_HHL + 6135517190006482 + SpringerLink Books - AutoHoldings + param + 613860000000000883 + 2024-02-27 19:42:25 Europe/Berlin + 2024-02-26 22:13:20 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5343924960006482&Force_direct=true + System + 2024-02-26 21:13:20 + false + 6235517180006482 + https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&rft.mms_id=991001245702106482 + Available + BOOK + 5343924960006482 + + + SpringerLink - AutoHoldings + System + 53180977560006463 + 49HBZ_PAD + 61165840130006463 + SpringerLink Books - AutoHoldings + param + 613860000000000883 + 2022-08-21 23:57:18 Europe/Berlin + 2022-08-21 23:56:26 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=53180977560006463&Force_direct=true + System + 2022-08-21 21:56:26 + false + 62165840120006463 + https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&rft.mms_id=9925035148406463 + Available + BOOK + 53180977560006463 + +