forked from ld4l-labs/marc2rdf-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instance-algorithm-notes.txt
574 lines (506 loc) · 25.4 KB
/
instance-algorithm-notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
Algorithm to Generate BibFrame *Instances* from MaRC
reversed engineered from LoC xquery implementation of Marc -> BibFrame
https://github.com/lcnetdev/marc2bibframe
bf:Instances are created for bib records by:
modules/module.MBIB-2-BIBFRAME-Shared.xqy
a bf:Instance is created when the Bib record has:
case 1:
260 (except the first one) when leader6 == 'a' && leader7 == 'b', 'i' or 's'
case 2:
300 (except the first one) (?? only when NOT (leader6 == 'a' && leader7 == 'b', 'i' or 's') ??)
case 3:
first of 260|261|262|264|300
case 4:
for each unique ISBN in 020a (10/13 digit versions are already dedupped) if switch says so
case 5:
856|859 has at least one of:
|u containing 'hdl.' but no |3 matching 'finding aid'
|3 matches 'pdf' or 'page view'
ind1 is 4 and ind2 is 0
ind1 is 4 and ind2 is 1 and no |3
AND
856|859 if ind2 = 0 and not first occurrence of field or no |3 matching 'contributor'
or
856|859 with |3 matching 'contributor' AND
100|110|111
or 700|710|711|720 without |t
or 740 with ind2=2 and |a and there is a 100|110|111
or 430|534|774|775 with |a and |t
or 700|710|711 with |t and |a and ind2 = ( |0|1|2)
or 780 with ind2 = (0-7) and |a
or 785 with ind2 = (0-8) and |a
or 787 with |a and |t
or 760|762|765|767|770|772|773|774 with |a
or first 100|110|111 when 130|240 with |l
case 6:
for each (400|410|411|430|440|490|533|534|630|700|710|711|730|740|760|762|765|767|770|772|773|774|775|777|780|785|787|800|810|811|830)
if there is a 260|261|262|264|300
AND
if there are isbns in 020a and generate instances from isbns rule is NOT on
OR
if there are no isbns in 020a
case 7:
each 533 with |b, |c, |d, |e, |m or |n
case 8:
each 555u
================================================================================
Naomi's notes below this line
Looking for code that outputs bf:Instance
in modules/module.MBIB-2-BIBFRAME-Shared.xqy
# case 1
# 260 (except the first one) when leader6 == 'a' && leader7 == 'b', 'i' or 's'
function mbshared:generate-additional-instance
474:return element bf:Instance {element bf:instanceTitle{
Called by:
function mbshared:generate-instances
2075: if ($typeOf008!="SE") then
2076: for $i at $x in $marcxml/marcxml:datafield[@tag="260"][fn:position() != 1]
2077: return mbshared:generate-additional-instance($i, $workID , $x)
Called by:
function mbshared:generate-work(
2578: let $typeOf008:=
2579: if ($leader6="a") then
if ...
2582: else if (fn:matches($leader7,"(b|i|s)")) then
2583: "SE"
...
2595: let $instances := mbshared:generate-instances($marcxml, $typeOf008, $workID)
# case 2
# 300 (except the first one)
function mbshared:generate-addl-physical
515:return element bf:Instance {element bf:instanceTitle{
Called by:
function mbshared:generate-instances
2079: for $i at $x in $marcxml/marcxml:datafield[@tag="300"][fn:position() != 1]
2080: return mbshared:generate-addl-physical($i, $workID , $x)
Called by:
function mbshared:generate-work(
2595: let $instances := mbshared:generate-instances($marcxml, $typeOf008, $workID)
# red herring! info never used!
function mbshared:generate-instance-from260
# NOTE: $edition-instances variable is NEVER used
558: let $edition-instances:=
559: for $e in $d/../marcxml:datafield[@tag eq "250"][fn:not(1)]
560: return
561: (mbshared:generate-instance-from250($e,$workID),
562: element bf:relatedInstance {
563: element bf:Instance {
# case 3
# for first of 260|261|262|264|300
# and for each unique ISBN in 020a (10/13 digit versions are already dedupped) if switch says so
function mbshared:generate-instance-from260
756: element bf:Instance {
Called by:
function mbshared:generate-instances
2058: if ( $isbn-sets//bf:set) then
2060: let $instance:=
2061: for $i in $marcxml/marcxml:datafield[fn:matches(@tag, "(260|261|262|264|300)")][1]
2062: return mbshared:generate-instance-from260($i, $workID)
2063: return
2064: if (fn:string($mbshared:transform-rules//rule[@id="1"]/@status)="on" ) then
2065: for $set in $isbn-sets/bf:set
2066: return mbshared:generate-instance-fromISBN($marcxml,$set, $instance, $workID)
2067: else (:just return the instance with multiple isbns on it is handled inside instance-from260:)
2068: $instance
2069:
2070:
2071: else (: $isbn-sets//bf:set is false use the first edition, etc:)
2072: for $i in $marcxml/marcxml:datafield[fn:matches(@tag, "(260|261|262|264|300)")][1]
2073: return mbshared:generate-instance-from260($i, $workID)
Called by:
function mbshared:generate-work(
2595: let $instances := mbshared:generate-instances($marcxml, $typeOf008, $workID)
# case 4
# for each unique ISBN in 020a (10/13 digit versions are already dedupped) if switch says so
function mbshared:generate-instance-fromISBN
1622: element bf:Instance {
Called by:
function mbshared:generate-instances
2051: let $isbn-sets:=
2052: if ($marcxml/marcxml:datafield[@tag eq "020"]/marcxml:subfield[@code eq "a"]) then
2053: mbshared:process-isbns($marcxml)
...
2058: if ( $isbn-sets//bf:set) then
...
2064: if (fn:string($mbshared:transform-rules//rule[@id="1"]/@status)="on" ) then
2065: for $set in $isbn-sets/bf:set
2066: return mbshared:generate-instance-fromISBN($marcxml,$set, $instance, $workID)
Called by:
function mbshared:generate-work(
2595: let $instances := mbshared:generate-instances($marcxml, $typeOf008, $workID)
# red herring! this code is executed but the result is NEVER USED
function mbshared:generate-instance-from250
1678: element bf:Instance {
Called by:
function mbshared:generate-instance-from260
# NOTE: $edition-instances variable is NEVER used
558: let $edition-instances:=
559: for $e in $d/../marcxml:datafield[@tag eq "250"][fn:not(1)]
560: return
561: (mbshared:generate-instance-from250($e,$workID),
# case 5
# 856|859 if ind2 = 0 and not first occurrence of field or no |3 matching 'contributor'
#
# 856|859 with |3 matching 'contributor' AND
# 100|110|111
# or 700|710|711|720 without |t
# or 740 with ind2=2 and |a and there is a 100|110|111
# or 430|534|774|775 with |a and |t
# or 700|710|711 with |t and |a and ind2 = ( |0|1|2)
# or 780 with ind2 = (0-7) and |a
# or 785 with ind2 = (0-8) and |a
# or 787 with |a and |t
# or 760|762|765|767|770|772|773|774 with |a
#
# or first 100|110|111 when 130|240 with |l
#
#
# and
# 856|859 has at least one of:
# |u containing 'hdl.' but no |3 matching 'finding aid'
# |3 matches 'pdf' or 'page view'
# ind1 is 4 and ind2 is 0
# ind 1 is 4 and ind2 is 1 and no |3
#------
#
# case 1:
# 856|859 if ind2 = 0 and not first occurrence of field or no |3 matching 'contributor'
#
# case 2A:
# function mbshared:generate-work calls mbshared:related-works
# 2751: let $work-relateds := mbshared:related-works($marcxml,$workID,"work")
# function mbshared:related-works calls mbshared:generate-related-work for
# 400|410|411|430|440|534|774|775|800|810|811|830 with |t
# 490 with |a
# 700|710|711 with |t and ind2 = ( |0|1|2)
# 730 with ind2 = ( |0|1|2)
# 740 with ind2 = ( | 2)
# 780 with ind2 = (0-7)
# 785 with ind2 = (0-8)
# 787 with |t
# 760|762|765|767|770|772|773|774
#
# function mbshared:generate-related-work calls mbshared:get-name
# for (first) 100|110|111 when there is 740 with ind2=2 and subfld a
# field NOT (400|410|411|440|490|800|810|811|630|730|740|830) and has sub a
#
# function mbshared:get-name calls generate-instance-from856
# when 856|859 with |3 matching 'contributor'
#
# case 2B:
# function mbshared:generate-work calls mbshared:get-name for
# 100|110|111
# 700|710|711|720 without |t
#
# function mbshared:get-name calls generate-instance-from856
# when 856|859 with |3 matching 'contributor'
#
# case 2C:
# function mbshared:generate-work calls mbshared:get-uniformTitle when
# first 130|240
#
# function mbshared:get-uniformTitle calls mbshared:generate-translationOf when
# (130|240) has subfield l
#
# function mbshared:generate-translationOf calls mbshared:get-name for
# first of 100|110|111
#
# function mbshared:get-name calls generate-instance-from856
# when 856|859 with |3 matching 'contributor'
#
function mbshared:generate-instance-from856
1706: let $category:=
1707: if (fn:contains(
1708: fn:string-join($d/marcxml:subfield[@code="u"],""),"hdl.") and(:u is repeatable:)
1709: fn:not(fn:matches(fn:string($d/marcxml:subfield[@code="3"]),"finding aid","i") )
1710: ) then
1711: "instance"
1712: else if (fn:matches(fn:string($d/marcxml:subfield[@code="3"]) ,"(pdf|page view) ","i")) then
1713: "instance"
1714: else if ($d/@ind1="4" and $d/@ind2="0" ) then
1715: "instance"
1716: else if ($d/@ind1="4" and $d/@ind2="1" and fn:not(fn:string($d/marcxml:subfield[@code="3"]) ) ) then
1717: "instance"
...
# instance when:
# called with 'hdl.' in a |u but no |3 matching 'finding aid'
# |3 matches 'pdf' or 'page view'
# ind1 is 4 and ind2 is 0
# ind 1 is 4 and ind2 is 1 and no |3
1738: if ( $category="instance" ) then
1739 element bf:hasInstance {
1740: element bf:Instance {
Called by:
# generate-instance-from856 called when 856|859 if ind2 = 0 and not first occurrence of field or no |3 matching 'contributor'
function mbshared:generate-work
2596: let $instancesfrom856:=
2597: (:set up instances/annotations for each non-contributor bio link:)
2598: (:first 856 wi/ind2=0 is the existing Instance:)
2599: for $d at $x in $marcxml/marcxml:datafield[fn:matches(@tag,"(856|859)")]
2600: return if ( ($d/@ind2 = "0" and $x ne 1 ) or
2601: fn:not(fn:matches(fn:string($d/marcxml:subfield[@code="3"]),"contributor","i"))) then
2602: mbshared:generate-instance-from856($d, $workID)
2063: else ()
Called by (also):
# generate-instance-from856 called when 856|859 with |3 matching 'contributor'
function mbshared:get-name
3326: let $bio-links:=
3327: if ( $d/../marcxml:datafield[fn:matches(@tag,"(856|859)")][fn:matches(fn:string(marcxml:subfield[@code="3"]),"contributor","i")]) then
...
3329: for $link in $d/../marcxml:datafield[fn:matches(@tag,"(856|859)")][fn:matches(fn:string(marcxml:subfield[@code="3"]),"contributor","i")]
3330: return mbshared:generate-instance-from856($link, "person")
3331: else
3332: ()
Called by:
# get-name called
# for (first) 100|110|111 when there is 740 with ind2=2 and subfld a
# field NOT (400|410|411|440|490|800|810|811|630|730|740|830) and has sub a
function mbshared:generate-related-work
2338: let $name :=
2339: if (
2340: $d/marcxml:subfield[@code="a"] and
2341: $d/@tag="740" and
2342: $d/@ind2="2" and
2343: $d/ancestor::marcxml:record/marcxml:datafield[fn:matches(@tag, "(100|110|111)")][1]
2344: ) then
2345: mbshared:get-name($d/ancestor::marcxml:record/marcxml:datafield[fn:matches(@tag, "(100|110|111)")][1])
2346: else if ( $d/marcxml:subfield[@code="a"] and fn:not(fn:matches($d/@tag,"(400|410|411|440|490|800|810|811|630|730|740|830)")) ) then
2347: mbshared:get-name($d)
2348: else ()
Called by:
# generate-related-work called for all (third param NOT 'instance')
# 400|410|411|430|440|534|774|775|800|810|811|830 with |t
# 490 with |a
# 700|710|711 with |t and ind2 = ( |0|1|2)
# 730 with ind2 = ( |0|1|2)
# 740 with ind2 = ( | 2)
# 780 with ind2 = (0-7)
# 785 with ind2 = (0-8)
# 787 with |t
# 760|762|765|767|770|772|773|774
function mbshared:related-works
# get to the code below when this function called NOT with third param 'instance'
# 730 with ind2 = ( |0|1|2)
# 740 with ind2 = ( | 2)
# 780 with ind2 = (0-7)
# 785 with ind2 = (0-8)
2497: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(730|740|780|785)")]
2498: return (
2499: for $type in $relateds/type[fn:matches($d/@tag,@tag)][fn:matches(@ind2,$d/@ind2)]
...
from 285-327:
<work-relateds>
<type tag="(700|710|711|730)" ind2="2" property="hasPart">isIncludedIn</type>
<type tag="(700|710|711|730)" ind2="( |0|1)" property="relatedResource">relatedWork</type>
<type tag="740" ind2=" " property="relatedWork">relatedWork</type>
<type tag="740" property="partOf" ind2="2">hasPart</type>
<type tag="780" ind2="0" property="continues">continuationOf</type>
<type tag="780" ind2="1" property="continuesInPart">partiallyContinuedBy</type>
<type tag="780" ind2="2" property="supersedes">continuationOf</type>
<type tag="780" ind2="3" property="supersedesInPartBy">partiallyContinuedBy</type>
<type tag="780" ind2="4" property="unionOf">preceding</type>
<type tag="780" ind2="5" property="absorbed">isAbsorbedBy</type>
<type tag="780" ind2="6" property="absorbedInPartBy">isPartlyAbsorbedBy</type>
<type tag="780" ind2="7" property="separatedFrom">formerlyIncluded</type>
<type tag="785" ind2="0" property="continuedBy">continues</type>
<type tag="785" ind2="1" property="continuedInPartBy">partiallyContinues</type>
<type tag="785" ind2="2" property="supersededBy">continues</type>
<type tag="785" ind2="3" property="supersededInPartBy">partiallyContinues</type>
<type tag="785" ind2="4" property="absorbedBy">absorbs</type>
<type tag="785" ind2="5" property="absorbedInPartBy">partiallyAbsorbs</type>
<type tag="785" ind2="6" property="splitInto">splitFrom</type>
<type tag="785" ind2="7" property="mergedToForm">mergedFrom</type>
<type tag="785" ind2="8" property="succeededBy">formerlyNamed</type>
</work-relateds>
...
2500: return mbshared:generate-related-work($d,$type, $workID) )
# 787 with |t
2506: for $d in $marcxml/marcxml:datafield[@tag="787"][marcxml:subfield[@code="t"]]
2507: for $type in $relateds/type[fn:matches($d/@tag,@tag)]
2508: return mbshared:generate-related-work($d,$type, $workID)
# 700|710|711 with |t and ind2 = ( |0|1|2)
2510: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(700|710|711)")][marcxml:subfield[@code="t"]]
2511: for $type in $relateds/type[fn:matches($d/@tag,@tag)][fn:matches($d/@ind2,@ind2)]
...
from 285-327:
<work-relateds>
<type tag="(700|710|711|730)" ind2="2" property="hasPart">isIncludedIn</type>
<type tag="(700|710|711|730)" ind2="( |0|1)" property="relatedResource">relatedWork</type>
...
2512: return mbshared:generate-related-work($d,$type, $workID)
# 490 with |a
2514: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(490)")][marcxml:subfield[@code="a"]]
2515: for $type in $relateds/type[fn:matches($d/@tag,@tag)]
2516: return mbshared:generate-related-work($d,$type, $workID)
# 400|410|411|430|440|534|774|775|800|810|811|830 with |t
2518: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(400|410|411|430|440|534|774|775|800|810|811|830)")][marcxml:subfield[@code="t"]]
2519: for $type in $relateds/type[fn:matches($d/@tag,@tag)]
2520: return mbshared:generate-related-work($d,$type, $workID)
# 760|762|765|767|770|772|773|774
2523: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(760|762|765|767|770|772|773|774)")]
2524: for $type in $relateds/type[fn:matches(@tag,$d/@tag)]
2525: return
2526: mbshared:generate-related-work($d,$type, $workID)
Called by
function mbshared:generate-work
2751: let $work-relateds := mbshared:related-works($marcxml,$workID,"work")
Called by (also):
# get-name called when
# 100|110|111
# 700|710|711|720 and no |t
function mbshared:generate-work
2612: let $names :=
2613: ( for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(100|110|111)")]
2614: return mbshared:get-name($d),
...
2617: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(700|710|711|720)")][fn:not(marcxml:subfield[@code="t"])]
2618: return mbshared:get-name($d)
2619: )
Called by (also):
# get-name called when
function mbshared:generate-translationOf
3677: let $namenode:= mbshared:get-name($d/ancestor::marcxml:record/marcxml:datafield[fn:matches(@tag, "(100|110|111)")][1])
Called by:
function mbshared:get-uniformTitle
3857: let $translationOf :=
3858: if ($d/marcxml:subfield[@code="l"]) then
3859: (for $s in $d/marcxml:subfield[@code="l"]
3860: return marc2bfutils:process-language($s),
...
3870: mbshared:generate-880-label($d,"title"),
3871: mbshared:generate-translationOf($d)
3872: )
Called by:
function mbshared:generate-work
2609: let $uniformTitle := (:work title can be from 245 if no 240/130:)
2610: for $d in ($marcxml/marcxml:datafield[@tag eq "130"]|$marcxml/marcxml:datafield[@tag eq "240"])[1]
2611: return mbshared:get-uniformTitle($d)
# case 6
# mbshared:generate-work calls mbshared:generate-instances
#
# mbshared:generate-instances
# when there are isbns in 020a and generate instances from isbns rule is NOT on
# first of 260|261|262|264|300 passed to generate-instance-from260
# OR
# when there are no isbns in 020a
# first of 260|261|262|264|300 passed to generate-instance-from260
#
# mbshared:generate-instance-from260 calls mbshared:related-works
#
# mbshared:related-works calls mbshared:generate-related-instance for any of
# (400|410|411|430|440|490|533|534|630|700|710|711|730|740|760|762|765|767|770|772|773|774|775|777|780|785|787|800|810|811|830)
function mbshared:generate-related-instance
2162: element bf:Instance{
Called by: generate-related-instance is called by related-works when 3rd arg is "instance"
function mbshared:related-works # when 3rd arg is "instance"
2490: if ($resource="instance" ) then
2491: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,$relateds/@all-tags)]
from 285: <work-relateds all-tags="(400|410|411|430|440|490|533|534|630|700|710|711|730|740|760|762|765|767|770|772|773|774|775|777|780|785|787|800|810|811|830)">
2492: let $property:=$relateds/type[@tag=$d/@tag]/@property
2493: return mbshared:generate-related-instance($d,$property) # $property is predicate name, such as partOf
Called by: related-works with 3rd arg of 'instance' is called by generate-instance-from260
function mbshared:generate-instance-from260
745: let $instance-relateds := mbshared:related-works($d/ancestor::marcxml:record,$workID,"instance")
# NOTE: this execution chain is used to assign data to a variable that is NEVER USED
Called by: generate-instance-from260 is called by generate-instance-from250
function mbshared:generate-instance-from250
1670: let $instance := mbshared:generate-instance-from260($d/../marcxml:datafield[fn:matches(@tag, "(260|261|262|264|300)")][1], $workID)
Called by: generate-instance-from250 is called by generate-instance-from260
function mbshared:generate-instance-from260
# NOTE: $edition-instances variable is NEVER used
558: let $edition-instances:=
559: for $e in $d/../marcxml:datafield[@tag eq "250"][fn:not(1)]
560: return
561: (mbshared:generate-instance-from250($e,$workID),
562: element bf:relatedInstance {
563: element bf:Instance {
Called by (also): generate-instance-from260 is called by generate-instances
function mbshared:generate-instances
2058: if ( $isbn-sets//bf:set) then
...
2060: let $instance:=
2061: for $i in $marcxml/marcxml:datafield[fn:matches(@tag, "(260|261|262|264|300)")][1]
2062: return mbshared:generate-instance-from260($i, $workID)
2063: return
2064: if (fn:string($mbshared:transform-rules//rule[@id="1"]/@status)="on" ) then
...
2067: else (:just return the instance with multiple isbns on it is handled inside instance-from260:)
2068: $instance
...
2071: else (: $isbn-sets//bf:set is false use the first edition, etc:)
2072: for $i in $marcxml/marcxml:datafield[fn:matches(@tag, "(260|261|262|264|300)")][1]
2073: return mbshared:generate-instance-from260($i, $workID)
Called by:
function mbshared:generate-work(
2595: let $instances := mbshared:generate-instances($marcxml, $typeOf008, $workID)
# case 7
# generate-work calls related-works
# related works calls generate-related-reproduction for 533
# generate-related-reproduction outputs an instance when:
# |d or |b or |c or |e or |m or |n
function mbshared:generate-related-reproduction
2186: let $pubPlace:= for $pl in $d/marcxml:subfield[@code="b"]
2187: return element bf:providerPlace{
2188: element bf:Place {
2189: element bf:label {fn:string($pl)}
2190: }}
2191: let $agent:= for $aa in $d/marcxml:subfield[@code="c"]
2192: return element bf:providerName {
2193: element bf:Organization {
2194: element bf:label {fn:string($aa)}
2195: }
2196: }
2197: let $pubDate:= if ($d/marcxml:subfield[@code="d"]) then element bf:providerDate{ marc2bfutils:chopPunctuation($d/marcxml:subfield[@code="d"],".")} else ()
2198: let $extent:= fn:string($d/marcxml:subfield[@code="e"])
2199: let $coverage:= fn:string($d/marcxml:subfield[@code="m"])
...
2201: let $note:= for $n in $d/marcxml:subfield[@code="n"]
2202: return element bf:note { fn:string($n)}
...
2208: if ($pubDate or $pubPlace or $agent or $extent or $coverage or $note) then
2209: element bf:hasInstance {
2210: element bf:Instance {
Called by:
function mbshared:related-works with 3rd arg NOT 'instance'
2502: for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"(533)")]
2503: for $type in $relateds/type[@tag=$d/@tag]
2504: return mbshared:generate-related-reproduction($d,$type)
Called by
function mbshared:generate-work
2751: let $work-relateds := mbshared:related-works($marcxml,$workID,"work")
# case 8
# 555u
function mbshared:generate-finding-aid-work
2297: if ($d/marcxml:subfield[@code="u"]) then
2298 element bf:hasInstance {
2299: element bf:Instance {
Called by:
function mbshared:generate-work
2746: let $findaids:= for $d in $marcxml/marcxml:datafield[fn:matches(@tag,"555")]
2747: return if ($d/marcxml:subfield[@code="u"]) then
2748: mbshared:generate-finding-aid-work($d)
-------------------------------
ack output for 'Instance':
332: <!-- Instance to Work relationships (none!) -->
474:return element bf:Instance {element bf:instanceTitle{
483:: This is the function generates Instance resources when there are multiple 300s
515:return element bf:Instance {element bf:instanceTitle{
562: element bf:relatedInstance {
563: element bf:Instance {
756: element bf:Instance {
1488:: @param $instance element bf:Instance is generated fromthe first 260
1498: $instance as element (bf:Instance)?,
1622: element bf:Instance {
1678: element bf:Instance {
1739: element bf:hasInstance {
1740: element bf:Instance {
2162: element bf:Instance{
2209: element bf:hasInstance {
2210: element bf:Instance {
2299: element bf:Instance {
2402: (: element bf:hasInstance{
2403: element bf:Instance{
2598: (:first 856 wi/ind2=0 is the existing Instance:)
2824: return element bf:hasInstance{$i},
3442:: This is the function generates an Instance subclass.
4011: $marc2bfutils:classes//property[@domain="Instance"]