From 888a22fe10318230eb29cee87f736a806772f000 Mon Sep 17 00:00:00 2001 From: TobiasNx Date: Thu, 16 May 2024 15:57:42 +0200 Subject: [PATCH] Only map HT Nr. for hbz NZ resources #1996 --- src/main/resources/alma/alma.fix | 11 +++++++++++ src/main/resources/alma/fix/identifiers.fix | 12 +++++++----- src/test/resources/alma-fix/991005935279706485.json | 2 -- src/test/resources/alma-fix/99370678063606441.json | 2 -- src/test/resources/alma-fix/99370682219806441.json | 2 -- src/test/resources/alma-fix/99370694196806441.json | 2 -- src/test/resources/alma-fix/99370699582506441.json | 2 -- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/resources/alma/alma.fix b/src/main/resources/alma/alma.fix index 97320c127..7b8b90887 100644 --- a/src/main/resources/alma/alma.fix +++ b/src/main/resources/alma/alma.fix @@ -10,6 +10,17 @@ if any_equal("DEL??.a", "Y") reject() end +# Helper element that states if a record is part of the hbz NZ +if any_equal("MBD .M", "49HBZ_NETWORK") + if any_match("POR .A", ".*") + add_field("@inNZ", "true") + else + unless any_match("035 .a", "^\\(EXLCZ\\).*") + add_field("@inNZ", "true") + end + end +end + add_field("@context","http://lobid.org/resources/context.jsonld") do list(path:"880??","var":"$i") diff --git a/src/main/resources/alma/fix/identifiers.fix b/src/main/resources/alma/fix/identifiers.fix index 0655f6dfc..60e914a2b 100644 --- a/src/main/resources/alma/fix/identifiers.fix +++ b/src/main/resources/alma/fix/identifiers.fix @@ -155,9 +155,11 @@ do list(path:"028??", "var":"$i") copy_field("$i.a", "stockNumber[].$append") end -copy_field("zdbId","@hbzId") -lookup("@hbzId","zdbId2oldHbzId",delete:"true") -if exists("@hbzId") - paste("deprecatedUri", "~http://lobid.org/resources/", "@hbzId", "~#!", join_char: "") +if exists("@inNZ") + copy_field("zdbId","@hbzId") + lookup("@hbzId","zdbId2oldHbzId",delete:"true") + if exists("@hbzId") + paste("deprecatedUri", "~http://lobid.org/resources/", "@hbzId", "~#!", join_char: "") + end + copy_field("@hbzId","hbzId") end -copy_field("@hbzId","hbzId") diff --git a/src/test/resources/alma-fix/991005935279706485.json b/src/test/resources/alma-fix/991005935279706485.json index 3762a9769..8a62944e6 100644 --- a/src/test/resources/alma-fix/991005935279706485.json +++ b/src/test/resources/alma-fix/991005935279706485.json @@ -5,8 +5,6 @@ "oclcNumber" : [ "643524510" ], "dnbId" : "011156414", "zdbId" : "202777-X", - "deprecatedUri" : "http://lobid.org/resources/HT002212588#!", - "hbzId" : "HT002212588", "title" : "Wirtschaft & Erziehung", "alternativeTitle" : [ "Wirtschaft und Erziehung", "Organ für kaufmännisches Bildungswesen", "Monatsschrift des Bundesverbandes der Lehrerinnen und Lehrer an Wirtschaftsschulen (VLW) e.V.", "Wirtschaft und Erziehung ( Hauptsacht. bis 64.2012,6 )" ], "publication" : [ { diff --git a/src/test/resources/alma-fix/99370678063606441.json b/src/test/resources/alma-fix/99370678063606441.json index 8097330bb..c1d34ed31 100644 --- a/src/test/resources/alma-fix/99370678063606441.json +++ b/src/test/resources/alma-fix/99370678063606441.json @@ -4,8 +4,6 @@ "issn" : [ "21914664" ], "oclcNumber" : [ "60625631" ], "zdbId" : "2598795-1", - "deprecatedUri" : "http://lobid.org/resources/HT016745965#!", - "hbzId" : "HT016745965", "title" : "ABI-Technik", "alternativeTitle" : [ "A.B.I.-Technik" ], "publication" : [ { diff --git a/src/test/resources/alma-fix/99370682219806441.json b/src/test/resources/alma-fix/99370682219806441.json index 17778116b..b4d87c1ed 100644 --- a/src/test/resources/alma-fix/99370682219806441.json +++ b/src/test/resources/alma-fix/99370682219806441.json @@ -5,8 +5,6 @@ "oclcNumber" : [ "864921933" ], "dnbId" : "1045213144", "zdbId" : "2745694-8", - "deprecatedUri" : "http://lobid.org/resources/HT018103691#!", - "hbzId" : "HT018103691", "title" : "Kirche weltweit", "alternativeTitle" : [ "Kirche weltweit", "Mitteilungsblatt des Leipziger Missionswerkes der Evangelisch-Lutherischen Landeskirchen Mecklenburgs, Sachsens, Thüringens" ], "otherTitleInformation" : [ "Mitteilungsblatt des Leipziger Missionswerkes der Evangelisch-Lutherischen Landeskirche Sachsens und der Evangelischen Kirche in Mitteldeutschland" ], diff --git a/src/test/resources/alma-fix/99370694196806441.json b/src/test/resources/alma-fix/99370694196806441.json index cd1ddaeda..6218f2cb8 100644 --- a/src/test/resources/alma-fix/99370694196806441.json +++ b/src/test/resources/alma-fix/99370694196806441.json @@ -5,8 +5,6 @@ "oclcNumber" : [ "1184493801", "802544307" ], "dnbId" : "1023896001", "zdbId" : "2669828-6", - "deprecatedUri" : "http://lobid.org/resources/HT017306644#!", - "hbzId" : "HT017306644", "title" : "Rheinform", "alternativeTitle" : [ "Informationen für die rheinischen Museen" ], "otherTitleInformation" : [ "Informationen für die rheinischen Museen" ], diff --git a/src/test/resources/alma-fix/99370699582506441.json b/src/test/resources/alma-fix/99370699582506441.json index f76576c79..2cd45478c 100644 --- a/src/test/resources/alma-fix/99370699582506441.json +++ b/src/test/resources/alma-fix/99370699582506441.json @@ -4,8 +4,6 @@ "oclcNumber" : [ "1184295229", "642992354" ], "dnbId" : "995821623", "zdbId" : "2508993-6", - "deprecatedUri" : "http://lobid.org/resources/HT016024273#!", - "hbzId" : "HT016024273", "title" : "BUW-Output", "alternativeTitle" : [ "BUW-Output", "BUW-Output", "Output" ], "otherTitleInformation" : [ "Forschungsmagazin = Research bulletin / Universität Wuppertal ; hrsg. im Auftrag des Rektorates" ],