From 457276bf6537a085baa6c06dc4d6c07e44e99984 Mon Sep 17 00:00:00 2001 From: Petra Maier Date: Thu, 15 Feb 2024 08:11:48 +0100 Subject: [PATCH] Adjust description.label and remove tableOfContents (#rpb-115) Delete line comment in title-to-strapi.fix --- conf/output/test-output-84.json | 7 +++---- conf/rpb-titel-to-lobid.fix | 18 +++++++++++------- conf/rpb-titel-to-strapi.fix | 1 - 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/conf/output/test-output-84.json b/conf/output/test-output-84.json index 855a1405..5ced85f8 100644 --- a/conf/output/test-output-84.json +++ b/conf/output/test-output-84.json @@ -67,10 +67,9 @@ } ], "description" : [ { "id" : "http://digitale-objekte.hbz-nrw.de/storage2/2017/08/19/file_28/7343682.pdf", - "label" : "Inhaltstext" - } ], - "tableOfContents" : [ { + "label" : "http://digitale-objekte.hbz-nrw.de/stor..." + }, { "id" : "https://www.hsozkult.de/publicationreview/id/reb-22111", - "label" : "Inhaltsverzeichnis" + "label" : "https://www.hsozkult.de/publ..." } ] } diff --git a/conf/rpb-titel-to-lobid.fix b/conf/rpb-titel-to-lobid.fix index 94a273ac..b5be175e 100644 --- a/conf/rpb-titel-to-lobid.fix +++ b/conf/rpb-titel-to-lobid.fix @@ -323,7 +323,11 @@ elsif exists ("f709") end replace_all("bibliographicCitation","¬","") -# fulltextOnline +# fulltextOnline and link to external description/ToC + +if any_match("f90[].*.n90", "Inhaltsverzeichnis|Inhaltstext") + set_array("description[]") +end do list(path:"f90[]", "var": "$i") if all_equal("$i.n90", "Volltext") @@ -333,17 +337,17 @@ do list(path:"f90[]", "var": "$i") replace_all("fulltextOnline[].$last.label", "https://nbn-resolving.org/", "") elsif all_equal("$i.n90", "Inhaltstext") - set_array("description[]") copy_field("$i.f90_", "description[].$append.id") - copy_field("$i.n90", "description[].$last.label") + copy_field("$i.f90_", "description[].$last.label") elsif all_equal("$i.n90", "Inhaltsverzeichnis") - set_array("tableOfContents[]") - copy_field("$i.f90_", "tableOfContents[].$append.id") - copy_field("$i.n90", "tableOfContents[].$last.label") + copy_field("$i.f90_", "description[].$append.id") + copy_field("$i.f90_", "description[].$last.label") end end -retain( "type[]", "contribution[]", "extent", "hasItem[]", "responsibilityStatement[]", "language[]", "medium[]", "subject[]", "title", "hbzId", "oclcNumber[]", "otherTitleInformation[]", "natureOfContent[]", "publication[]", "sameAs[]", "describedBy", "@context", "id", "zdbId", "spatial[]", "inCollection[]", "rpbId", "schoeneNummer", "bibliographicCitation", "isPartOf[]", "note[]", "fulltextOnline[]", "tableOfContents[]", "description[]") +replace_all("description[].*.label", "^([^\\.]+[^/]+/....).+$","$1...") + +retain( "type[]", "contribution[]", "extent", "hasItem[]", "responsibilityStatement[]", "language[]", "medium[]", "subject[]", "title", "hbzId", "oclcNumber[]", "otherTitleInformation[]", "natureOfContent[]", "publication[]", "sameAs[]", "describedBy", "@context", "id", "zdbId", "spatial[]", "inCollection[]", "rpbId", "schoeneNummer", "bibliographicCitation", "isPartOf[]", "note[]", "fulltextOnline[]", "description[]") vacuum() diff --git a/conf/rpb-titel-to-strapi.fix b/conf/rpb-titel-to-strapi.fix index 2d72c3be..59945532 100644 --- a/conf/rpb-titel-to-strapi.fix +++ b/conf/rpb-titel-to-strapi.fix @@ -34,7 +34,6 @@ do put_macro("add_url") if exists("$[from]") if all_match("$[from]", "(https?|ftp):\\/\\/(\\S+\\.)+\\S+(\\/\\S*)?|") move_field("$[from]", "f90[].$append.f90_") - #add_field("f90[].*.n90", "$[type]") set_field("f90[].$last.n90", "$[type]") end end