Skip to content

Commit

Permalink
Merge #2006 from branch '1975-duplicateRelatedRelations' of github.co…
Browse files Browse the repository at this point in the history
…m:hbz/lobid-resources
  • Loading branch information
dr0i committed May 23, 2024
2 parents 38b929a + 6f7c391 commit 4a1d551
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
30 changes: 16 additions & 14 deletions src/main/resources/alma/fix/relatedRessourcesAndLinks.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/test/resources/alma-fix/990206060640206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -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#!",
Expand Down
3 changes: 0 additions & 3 deletions src/test/resources/alma-fix/990213367870206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -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#!",
Expand Down
2 changes: 0 additions & 2 deletions src/test/resources/alma-fix/990367731740206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
"note" : [ "Druck-Ausgabe" ],
"isbn" : [ "9783451388798", "3451388790" ],
"label" : "lobid Ressource"
}, {
"isbn" : [ "9783451388798", "3451388790" ]
} ],
"inCollection" : [ {
"id" : "http://lobid.org/organisations/DE-655#!",
Expand Down

0 comments on commit 4a1d551

Please sign in to comment.