Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip related relations with duplicate isbn #1975 #2006

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading