Skip to content

Commit 32fe4bd

Browse files
committed
Merge branch 'master' into 2132-cdata
2 parents 9484359 + 22e9ef6 commit 32fe4bd

File tree

61 files changed

+1300
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1300
-181
lines changed

src/main/resources/alma/fix/relatedRessourcesAndLinks.fix

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ unless any_match("leader", "^.{7}[ad].*")
8686
do list(path: "773??", "var": "$i")
8787
unless any_equal("$i.9","LOCAL")
8888
do list(path: "$i.w", "var": "$j")
89-
add_array("isPartOf[].$append.type[]", "IsPartOfRelation")
89+
add_hash("isPartOf[].$append")
9090
add_array("isPartOf[].$last.hasSuperordinate[]")
9191
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
9292
if all_match("$j", "^\\((?:DE-600|DE-605)\\)(.*)$")
@@ -108,7 +108,7 @@ end
108108
# 490 with 1. Indicator 1 has an identical entry in 830. So only 490 with 1. Indicator 0
109109

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

132132
do list(path: "830??", "var": "$i")
133-
add_array("isPartOf[].$append.type[]", "IsPartOfRelation")
133+
add_hash("isPartOf[].$append")
134134
add_array("isPartOf[].$last.hasSuperordinate[]")
135135
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
136136
if all_match("$i.w", "^\\((?:DE-600|DE-605)\\)(.*)$")
137137
copy_field("$i.w", "isPartOf[].$last.hasSuperordinate[].$last.id")
138138
end
139-
add_array("isPartOf[].$last.hasSuperordinate[].$last.label")
140139
do list(path:"$i.a", "var":"$j")
141140
copy_field("$j", "isPartOf[].$last.hasSuperordinate[].$last.label.$append")
142141
end
143142
join_field("isPartOf[].$last.hasSuperordinate[].$last.label", " / ")
144-
copy_field("$i.v", "isPartOf[].$last.numbering")
143+
unless is_empty("isPartOf[].$last.hasSuperordinate[].1")
144+
copy_field("$i.v", "isPartOf[].$last.numbering")
145+
end
145146
end
146147

147148
do list(path: "4901?", "var": "$j")
@@ -164,7 +165,7 @@ if any_match("leader", "^.{7}[ad].*")
164165
do list(path: "773??", "var": "$i")
165166
unless any_equal("$i.9","LOCAL")
166167
do list(path: "$i.w", "var": "$j")
167-
add_array("isPartOf[].$append.type[]", "IsPartOfRelation")
168+
add_hash("isPartOf[].$append")
168169
add_array("isPartOf[].$last.hasSuperordinate[]")
169170
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
170171
if all_match("$j", "^\\((?:DE-600|DE-605)\\)(.*)$")
@@ -192,21 +193,26 @@ if any_match("leader", "^.{7}[ad].*")
192193
end
193194
end
194195

195-
do list(path: "isPartOf[].*.hasSuperordinate[]", "var": "$i")
196-
unless exists("$i.label")
197-
copy_field("@title", "$i.label")
196+
do list(path: "isPartOf[]","var":"$i")
197+
unless is_empty("$i.hasSuperordinate[].1")
198+
do list(path:"$i.hasSuperordinate[]", "var": "$j") ## This is the fallback for isPartOf[].*.hasSuperordinate[].*.label
199+
unless exists("$j.label")
200+
copy_field("@title", "$j.label")
201+
end
202+
end
203+
add_array("$i.type[]", "IsPartOfRelation")
198204
end
199205
end
200206

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

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

209213
uniq("isPartOf[]")
214+
215+
210216
replace_all("containedIn[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
211217
replace_all("containedIn[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")
212218
replace_all("containedIn[].*.label","<<|>>","")

src/test/resources/alma-fix/990011470300206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464
"label" : "OCLC Ressource"
6565
} ],
6666
"isPartOf" : [ {
67-
"type" : [ "IsPartOfRelation" ],
6867
"hasSuperordinate" : [ {
6968
"label" : "SUNY series in political theory"
70-
} ]
69+
} ],
70+
"type" : [ "IsPartOfRelation" ]
7171
} ],
7272
"inCollection" : [ {
7373
"id" : "https://nrw.digibib.net/search/hbzvk/",

src/test/resources/alma-fix/990051552280206441.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@
6767
"label" : "Culturegraph Ressource"
6868
} ],
6969
"isPartOf" : [ {
70-
"type" : [ "IsPartOfRelation" ],
7170
"hasSuperordinate" : [ {
7271
"label" : "Les films du losange"
73-
} ]
72+
} ],
73+
"type" : [ "IsPartOfRelation" ]
7474
}, {
75-
"type" : [ "IsPartOfRelation" ],
7675
"hasSuperordinate" : [ {
7776
"label" : "Collection libre échange"
78-
} ]
77+
} ],
78+
"type" : [ "IsPartOfRelation" ]
7979
} ],
8080
"inCollection" : [ {
8181
"id" : "https://nrw.digibib.net/search/hbzvk/",

src/test/resources/alma-fix/990058434730206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@
7575
"label" : "OCLC Ressource"
7676
} ],
7777
"isPartOf" : [ {
78-
"type" : [ "IsPartOfRelation" ],
7978
"hasSuperordinate" : [ {
8079
"id" : "http://lobid.org/resources/HT001247609#!",
8180
"label" : "Studia Judaica"
8281
} ],
83-
"numbering" : "4"
82+
"numbering" : "4",
83+
"type" : [ "IsPartOfRelation" ]
8484
} ],
8585
"tableOfContents" : [ {
8686
"label" : "Inhaltsverzeichnis",

src/test/resources/alma-fix/990058567920206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@
7575
"label" : "OCLC Ressource"
7676
} ],
7777
"isPartOf" : [ {
78-
"type" : [ "IsPartOfRelation" ],
7978
"hasSuperordinate" : [ {
8079
"id" : "http://lobid.org/resources/HT001237175#!",
8180
"label" : "Wege der Forschung"
8281
} ],
83-
"numbering" : "239"
82+
"numbering" : "239",
83+
"type" : [ "IsPartOfRelation" ]
8484
} ],
8585
"inCollection" : [ {
8686
"id" : "https://nrw.digibib.net/search/hbzvk/",

src/test/resources/alma-fix/990059571560206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@
7575
"label" : "OCLC Ressource"
7676
} ],
7777
"isPartOf" : [ {
78-
"type" : [ "IsPartOfRelation" ],
7978
"hasSuperordinate" : [ {
8079
"id" : "http://lobid.org/resources/HT002156469#!",
8180
"label" : "DIN-Taschenbuch"
8281
} ],
83-
"numbering" : "29"
82+
"numbering" : "29",
83+
"type" : [ "IsPartOfRelation" ]
8484
} ],
8585
"inCollection" : [ {
8686
"id" : "https://nrw.digibib.net/search/hbzvk/",

src/test/resources/alma-fix/990063549080206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@
7272
"label" : "OCLC Ressource"
7373
} ],
7474
"isPartOf" : [ {
75-
"type" : [ "IsPartOfRelation" ],
7675
"hasSuperordinate" : [ {
7776
"id" : "http://lobid.org/resources/ZDB-328-1#!",
7877
"label" : "The annals of the American Academy of Political and Social Science"
7978
} ],
80-
"numbering" : "509"
79+
"numbering" : "509",
80+
"type" : [ "IsPartOfRelation" ]
8181
} ],
8282
"inCollection" : [ {
8383
"id" : "https://nrw.digibib.net/search/hbzvk/",

src/test/resources/alma-fix/990065341720206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@
7171
"label" : "OCLC Ressource"
7272
} ],
7373
"isPartOf" : [ {
74-
"type" : [ "IsPartOfRelation" ],
7574
"hasSuperordinate" : [ {
7675
"id" : "http://lobid.org/resources/ZDB-208844-7#!",
7776
"label" : "Netherlands journal of zoology"
7877
} ],
79-
"numbering" : "42,2,3"
78+
"numbering" : "42,2,3",
79+
"type" : [ "IsPartOfRelation" ]
8080
} ],
8181
"inCollection" : [ {
8282
"id" : "https://nrw.digibib.net/search/hbzvk/",

src/test/resources/alma-fix/990075429930206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
"label" : "OCLC Ressource"
6767
} ],
6868
"isPartOf" : [ {
69-
"type" : [ "IsPartOfRelation" ],
7069
"hasSuperordinate" : [ {
7170
"id" : "http://lobid.org/resources/HT003004165#!",
7271
"label" : "Sitzungsberichte der Bayerischen Akademie der Wissenschaften, Philosophisch-Historische Abteilung"
7372
} ],
74-
"numbering" : "1934,4"
73+
"numbering" : "1934,4",
74+
"type" : [ "IsPartOfRelation" ]
7575
} ],
7676
"inCollection" : [ {
7777
"id" : "https://nrw.digibib.net/search/hbzvk/",

src/test/resources/alma-fix/990075538650206441.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@
6363
"label" : "OCLC Ressource"
6464
} ],
6565
"isPartOf" : [ {
66-
"type" : [ "IsPartOfRelation" ],
6766
"hasSuperordinate" : [ {
6867
"id" : "http://lobid.org/resources/HT003184101#!",
6968
"label" : "Sports injury management"
7069
} ],
71-
"numbering" : "1,2"
70+
"numbering" : "1,2",
71+
"type" : [ "IsPartOfRelation" ]
7272
} ],
7373
"inCollection" : [ {
7474
"id" : "https://nrw.digibib.net/search/hbzvk/",

0 commit comments

Comments
 (0)