Skip to content

Commit

Permalink
Merge #2137 from branch '2136-missingIsPartOf' of github.com:hbz/lobi…
Browse files Browse the repository at this point in the history
…d-resources
  • Loading branch information
dr0i committed Jan 24, 2025
2 parents ed9b852 + 8e9700f commit 22e9ef6
Show file tree
Hide file tree
Showing 61 changed files with 1,300 additions and 181 deletions.
30 changes: 18 additions & 12 deletions src/main/resources/alma/fix/relatedRessourcesAndLinks.fix
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ unless any_match("leader", "^.{7}[ad].*")
do list(path: "773??", "var": "$i")
unless any_equal("$i.9","LOCAL")
do list(path: "$i.w", "var": "$j")
add_array("isPartOf[].$append.type[]", "IsPartOfRelation")
add_hash("isPartOf[].$append")
add_array("isPartOf[].$last.hasSuperordinate[]")
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
if all_match("$j", "^\\((?:DE-600|DE-605)\\)(.*)$")
Expand All @@ -108,7 +108,7 @@ end
# 490 with 1. Indicator 1 has an identical entry in 830. So only 490 with 1. Indicator 0

do list(path: "4900?", "var": "$i")
add_array("isPartOf[].$append.type[]", "IsPartOfRelation")
add_hash("isPartOf[].$append")
add_array("isPartOf[].$last.hasSuperordinate[]")
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
add_array("isPartOf[].$last.hasSuperordinate[].$last.label")
Expand All @@ -130,18 +130,19 @@ end
# Element can be repeatable with local entries they have subfield $M.

do list(path: "830??", "var": "$i")
add_array("isPartOf[].$append.type[]", "IsPartOfRelation")
add_hash("isPartOf[].$append")
add_array("isPartOf[].$last.hasSuperordinate[]")
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
if all_match("$i.w", "^\\((?:DE-600|DE-605)\\)(.*)$")
copy_field("$i.w", "isPartOf[].$last.hasSuperordinate[].$last.id")
end
add_array("isPartOf[].$last.hasSuperordinate[].$last.label")
do list(path:"$i.a", "var":"$j")
copy_field("$j", "isPartOf[].$last.hasSuperordinate[].$last.label.$append")
end
join_field("isPartOf[].$last.hasSuperordinate[].$last.label", " / ")
copy_field("$i.v", "isPartOf[].$last.numbering")
unless is_empty("isPartOf[].$last.hasSuperordinate[].1")
copy_field("$i.v", "isPartOf[].$last.numbering")
end
end

do list(path: "4901?", "var": "$j")
Expand All @@ -164,7 +165,7 @@ if any_match("leader", "^.{7}[ad].*")
do list(path: "773??", "var": "$i")
unless any_equal("$i.9","LOCAL")
do list(path: "$i.w", "var": "$j")
add_array("isPartOf[].$append.type[]", "IsPartOfRelation")
add_hash("isPartOf[].$append")
add_array("isPartOf[].$last.hasSuperordinate[]")
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
if all_match("$j", "^\\((?:DE-600|DE-605)\\)(.*)$")
Expand Down Expand Up @@ -192,21 +193,26 @@ if any_match("leader", "^.{7}[ad].*")
end
end

do list(path: "isPartOf[].*.hasSuperordinate[]", "var": "$i")
unless exists("$i.label")
copy_field("@title", "$i.label")
do list(path: "isPartOf[]","var":"$i")
unless is_empty("$i.hasSuperordinate[].1")
do list(path:"$i.hasSuperordinate[]", "var": "$j") ## This is the fallback for isPartOf[].*.hasSuperordinate[].*.label
unless exists("$j.label")
copy_field("@title", "$j.label")
end
end
add_array("$i.type[]", "IsPartOfRelation")
end
end

replace_all("isPartOf[].*.hasSuperordinate[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
replace_all("isPartOf[].*.hasSuperordinate[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")

replace_all("isPartOf[].*.numbering", "^[©]|\\s?[,.:;/=]?$", "")
do list(path:"isPartOf[]","var":"$i")
call_macro("lobidResourcesFallbackLabel",field:"$i.hasSuperordinate[]")
end


uniq("isPartOf[]")


replace_all("containedIn[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
replace_all("containedIn[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")
replace_all("containedIn[].*.label","<<|>>","")
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990011470300206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "SUNY series in political theory"
} ]
} ],
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
8 changes: 4 additions & 4 deletions src/test/resources/alma-fix/990051552280206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
"label" : "Culturegraph Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "Les films du losange"
} ]
} ],
"type" : [ "IsPartOfRelation" ]
}, {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "Collection libre échange"
} ]
} ],
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990058434730206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT001247609#!",
"label" : "Studia Judaica"
} ],
"numbering" : "4"
"numbering" : "4",
"type" : [ "IsPartOfRelation" ]
} ],
"tableOfContents" : [ {
"label" : "Inhaltsverzeichnis",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990058567920206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT001237175#!",
"label" : "Wege der Forschung"
} ],
"numbering" : "239"
"numbering" : "239",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990059571560206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT002156469#!",
"label" : "DIN-Taschenbuch"
} ],
"numbering" : "29"
"numbering" : "29",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990063549080206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/ZDB-328-1#!",
"label" : "The annals of the American Academy of Political and Social Science"
} ],
"numbering" : "509"
"numbering" : "509",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990065341720206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/ZDB-208844-7#!",
"label" : "Netherlands journal of zoology"
} ],
"numbering" : "42,2,3"
"numbering" : "42,2,3",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990075429930206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT003004165#!",
"label" : "Sitzungsberichte der Bayerischen Akademie der Wissenschaften, Philosophisch-Historische Abteilung"
} ],
"numbering" : "1934,4"
"numbering" : "1934,4",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990075538650206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT003184101#!",
"label" : "Sports injury management"
} ],
"numbering" : "1,2"
"numbering" : "1,2",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990109712970206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
"label" : "NWBib-Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "Veröffentlichungen des Beethoven-Hauses Bonn : Reihe 5"
} ]
} ],
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
8 changes: 4 additions & 4 deletions src/test/resources/alma-fix/990110509950206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@
"label" : "NWBib-Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "Euro cart : Euro-Regionalkarte"
} ]
} ],
"type" : [ "IsPartOfRelation" ]
}, {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/BT000100437#!",
"label" : "Deutschland"
} ],
"numbering" : "2"
"numbering" : "2",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990114098170206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "Oxford India paperbacks"
} ]
} ],
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990114617880206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/ZDB-1118317-2#!",
"label" : "Programm der Realschule zu Rostock"
} ],
"numbering" : "1",
"note" : [ "Enthalten in" ]
"note" : [ "Enthalten in" ],
"type" : [ "IsPartOfRelation" ]
} ],
"secondaryForm" : [ {
"id" : "http://lobid.org/resources/CT003055819#!",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990118562160206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
"label" : "Culturegraph Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/ZDB-795799-3#!",
"label" : "Die Rechtsprechung des Bundesverfassungsgerichts im Jahre ..."
} ],
"numbering" : "2001"
"numbering" : "2001",
"type" : [ "IsPartOfRelation" ]
} ],
"primaryForm" : [ {
"id" : "http://lobid.org/resources/HT013365271#!",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990123613330206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@
"label" : "Culturegraph Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/TT000034241#!",
"label" : "Die Sonnenblume [Medienkombination]"
} ],
"numbering" : "Tonkassette"
"numbering" : "Tonkassette",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990124590390206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT013911051#!",
"label" : "Eutropia-CD"
} ],
"numbering" : "5"
"numbering" : "5",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990141342350206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/TT001197763#!",
"label" : "[Bibliotheca Palatina"
} ],
"numbering" : "F,2001,1"
"numbering" : "F,2001,1",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990143325070206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "Royal Asiatic Society books"
} ]
} ],
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990150856900206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT001375579#!",
"label" : "Apollinaris von Laodicea und seine Schule"
} ],
"numbering" : "1"
"numbering" : "1",
"type" : [ "IsPartOfRelation" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/alma-fix/990156060190206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
"label" : "OCLC Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://lobid.org/resources/HT012827392#!",
"label" : "BIT online : Innovativ"
} ],
"numbering" : "13"
"numbering" : "13",
"type" : [ "IsPartOfRelation" ]
} ],
"tableOfContents" : [ {
"label" : "Inhaltsverzeichnis",
Expand Down
Loading

0 comments on commit 22e9ef6

Please sign in to comment.