@@ -86,7 +86,7 @@ unless any_match("leader", "^.{7}[ad].*")
86
86
do list(path: "773??", "var": "$i")
87
87
unless any_equal("$i.9","LOCAL")
88
88
do list(path: "$i.w", "var": "$j")
89
- add_array ("isPartOf[].$append.type[]", "IsPartOfRelation ")
89
+ add_hash ("isPartOf[].$append")
90
90
add_array("isPartOf[].$last.hasSuperordinate[]")
91
91
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
92
92
if all_match("$j", "^\\((?:DE-600|DE-605)\\)(.*)$")
108
108
# 490 with 1. Indicator 1 has an identical entry in 830. So only 490 with 1. Indicator 0
109
109
110
110
do list(path: "4900?", "var": "$i")
111
- add_array ("isPartOf[].$append.type[]", "IsPartOfRelation ")
111
+ add_hash ("isPartOf[].$append")
112
112
add_array("isPartOf[].$last.hasSuperordinate[]")
113
113
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
114
114
add_array("isPartOf[].$last.hasSuperordinate[].$last.label")
@@ -130,18 +130,19 @@ end
130
130
# Element can be repeatable with local entries they have subfield $M.
131
131
132
132
do list(path: "830??", "var": "$i")
133
- add_array ("isPartOf[].$append.type[]", "IsPartOfRelation ")
133
+ add_hash ("isPartOf[].$append")
134
134
add_array("isPartOf[].$last.hasSuperordinate[]")
135
135
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
136
136
if all_match("$i.w", "^\\((?:DE-600|DE-605)\\)(.*)$")
137
137
copy_field("$i.w", "isPartOf[].$last.hasSuperordinate[].$last.id")
138
138
end
139
- add_array("isPartOf[].$last.hasSuperordinate[].$last.label")
140
139
do list(path:"$i.a", "var":"$j")
141
140
copy_field("$j", "isPartOf[].$last.hasSuperordinate[].$last.label.$append")
142
141
end
143
142
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
145
146
end
146
147
147
148
do list(path: "4901?", "var": "$j")
@@ -164,7 +165,7 @@ if any_match("leader", "^.{7}[ad].*")
164
165
do list(path: "773??", "var": "$i")
165
166
unless any_equal("$i.9","LOCAL")
166
167
do list(path: "$i.w", "var": "$j")
167
- add_array ("isPartOf[].$append.type[]", "IsPartOfRelation ")
168
+ add_hash ("isPartOf[].$append")
168
169
add_array("isPartOf[].$last.hasSuperordinate[]")
169
170
add_hash( "isPartOf[].$last.hasSuperordinate[].$append")
170
171
if all_match("$j", "^\\((?:DE-600|DE-605)\\)(.*)$")
@@ -192,21 +193,26 @@ if any_match("leader", "^.{7}[ad].*")
192
193
end
193
194
end
194
195
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")
198
204
end
199
205
end
200
206
201
207
replace_all("isPartOf[].*.hasSuperordinate[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
202
208
replace_all("isPartOf[].*.hasSuperordinate[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")
203
209
204
210
replace_all("isPartOf[].*.numbering", "^[©]|\\s?[,.:;/=]?$", "")
205
- do list(path:"isPartOf[]","var":"$i")
206
- call_macro("lobidResourcesFallbackLabel",field:"$i.hasSuperordinate[]")
207
- end
211
+
208
212
209
213
uniq("isPartOf[]")
214
+
215
+
210
216
replace_all("containedIn[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
211
217
replace_all("containedIn[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")
212
218
replace_all("containedIn[].*.label","<<|>>","")
0 commit comments