diff --git a/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix b/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix index 60f47d0e1..f3eafb3a5 100644 --- a/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix +++ b/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix @@ -342,21 +342,23 @@ set_array("related[]") do list(path:"775??|776??", "var":"$i") unless any_match ("$i.i", ".*eproduktion von.*|.*eproduktion") do list_as("$hbzId":"$i.w", "$isbn":"$i.z", "$label":"$i.t", "$note":"$i.n", "$issn":"$i.x", "$info":"$i.i") - set_hash("related[].$append") - if all_match("$hbzId", "^\\((DE-600|DE-605)\\).*$") - copy_field("$hbzId", "related[].$last.id") + unless in("$isbn", "related[].*.isbn[]") # Skip duplicates + set_hash("related[].$append") + if all_match("$hbzId", "^\\((DE-600|DE-605)\\).*$") + copy_field("$hbzId", "related[].$last.id") + end + set_array("related[].$last.note[]") + paste("related[].$last.note[].$append","$info", "$note") + replace_all("related[].$last.note[].$last", "Erscheint auch als ","") + copy_field("$label", "related[].$last.label") + set_array("related[].$last.issn[]") + copy_field("$issn", "related[].$last.issn[].$append") + set_array("related[].$last.isbn[]") + isbn("$isbn", to:"isbn13") + copy_field("$isbn", "related[].$last.isbn[].$append") + isbn("$isbn", to:"isbn10") + copy_field("$isbn", "related[].$last.isbn[].$append") end - set_array("related[].$last.note[]") - paste("related[].$last.note[].$append","$info", "$note") - replace_all("related[].$last.note[].$last", "Erscheint auch als ","") - copy_field("$label", "related[].$last.label") - set_array("related[].$last.issn[]") - copy_field("$issn", "related[].$last.issn[].$append") - set_array("related[].$last.isbn[]") - isbn("$isbn", to:"isbn13") - copy_field("$isbn", "related[].$last.isbn[].$append") - isbn("$isbn", to:"isbn10") - copy_field("$isbn", "related[].$last.isbn[].$append") end end end diff --git a/src/test/resources/alma-fix/990206060640206441.json b/src/test/resources/alma-fix/990206060640206441.json index 25c7a1745..bdf4c8e96 100644 --- a/src/test/resources/alma-fix/990206060640206441.json +++ b/src/test/resources/alma-fix/990206060640206441.json @@ -78,9 +78,6 @@ "related" : [ { "note" : [ "Druck-Ausgabe" ], "isbn" : [ "9783412221607", "3412221600" ] - }, { - "note" : [ "Druck-Ausgabe" ], - "isbn" : [ "9783412221607", "3412221600" ] } ], "inCollection" : [ { "id" : "http://lobid.org/organisations/DE-655#!", diff --git a/src/test/resources/alma-fix/990213367870206441.json b/src/test/resources/alma-fix/990213367870206441.json index b7484d593..ddff4a989 100644 --- a/src/test/resources/alma-fix/990213367870206441.json +++ b/src/test/resources/alma-fix/990213367870206441.json @@ -60,9 +60,6 @@ "related" : [ { "note" : [ "Druck-Ausgabe" ], "isbn" : [ "9783736992580", "3736992580" ] - }, { - "note" : [ "Druck-Ausgabe, Paperback" ], - "isbn" : [ "9783736992580", "3736992580" ] } ], "inCollection" : [ { "id" : "http://lobid.org/organisations/DE-655#!", diff --git a/src/test/resources/alma-fix/990367731740206441.json b/src/test/resources/alma-fix/990367731740206441.json index 544b1afd0..ff2254c44 100644 --- a/src/test/resources/alma-fix/990367731740206441.json +++ b/src/test/resources/alma-fix/990367731740206441.json @@ -62,8 +62,6 @@ "note" : [ "Druck-Ausgabe" ], "isbn" : [ "9783451388798", "3451388790" ], "label" : "lobid Ressource" - }, { - "isbn" : [ "9783451388798", "3451388790" ] } ], "inCollection" : [ { "id" : "http://lobid.org/organisations/DE-655#!",