-
Notifications
You must be signed in to change notification settings - Fork 0
/
ligatus2rdf_main.xsl
809 lines (789 loc) · 42.1 KB
/
ligatus2rdf_main.xsl
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
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:crm="http://www.cidoc-crm.org/cidoc-crm/" xmlns:lob="http://w3id.org/lob/concept/"
xmlns:aat="http://vocab.getty.edu/aat/" xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:dbp="http://dbpedia.org/resource/" xmlns:wr="http://wiktionary.dbpedia.org/resource/"
exclude-result-prefixes="xs" version="2.0">
<xsl:template match="/">
<xsl:result-document href="{$filepath_main}" method="xml" indent="yes" encoding="utf-8">
<rdf:RDF>
<xsl:call-template name="namespaceDeclaration"/>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#', $fileref)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/4886">
<rdfs:label xml:lang="en">codex-form books</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<xsl:for-each select="book/coverings/yes/cover">
<!-- These match templates for general types of bindings.
The templates are to be found in the coverings XSLT -->
<xsl:apply-templates mode="bindingTypes"/>
</xsl:for-each>
<crm:P1_is_identified_by>
<crm:E42_Identifier>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#', name(/book/bibliographical/shelfmark))"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/3437">
<rdfs:label xml:lang="en">shelfmarks</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P3_has_note>
<xsl:value-of select="book/bibliographical/shelfmark"/>
</crm:P3_has_note>
</crm:E42_Identifier>
</crm:P1_is_identified_by>
<xsl:choose>
<xsl:when test="$collectionURI eq 'http://diglib.hab.de'">
<crm:P55_has_current_location>
<crm:E53_Place
rdf:about="http://dbpedia.org/resource/Wolfenb%C3%BCttel">
<crm:P1_is_identified_by>
<crm:E48_Place_Name
rdf:about="http://sws.geonames.org/2806914">
<rdfs:label xml:lang="en">Wolfenbüttel</rdfs:label>
<rdfs:label xml:lang="de">Wolfenbüttel</rdfs:label>
<rdfs:label xml:lang="la">Guelpherbytum</rdfs:label>
</crm:E48_Place_Name>
</crm:P1_is_identified_by>
</crm:E53_Place>
</crm:P55_has_current_location>
<crm:P50_has_current_keeper>
<crm:E40_Legal_Body rdf:about="/actors/hab.rdf#hab">
<!-- CREATE ACTOR RESOURCE -->
<rdfs:label xml:lang="en">Herzog August Library</rdfs:label>
<rdfs:label xml:lang="de">Herzog August Bibliothek</rdfs:label>
<rdfs:label xml:lang="la">Bibliotheca Augusta</rdfs:label>
</crm:E40_Legal_Body>
</crm:P50_has_current_keeper>
</xsl:when>
</xsl:choose>
<crm:P108i_was_produced_by>
<crm:E12_Production>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#bookbindingEvent')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://vocab.getty.edu/aat/300053592">
<rdfs:label xml:lang="en">bookbinding (process)</rdfs:label>
<rdfs:label xml:lang="de">Buchbinden</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E12_Production>
</crm:P108i_was_produced_by>
<!-- REVISE CODE TO INCLUDE REFERENCE TO THE BIBLIOGRAPHICAL RDF RECORD -->
<crm:P128_carries>
<crm:E33_Linguistic_Object>
<xsl:attribute name="rdf:about"
select="concat($filename_content, '#', $fileref, '-content')"/>
</crm:E33_Linguistic_Object>
</crm:P128_carries>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#booktblock')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1227">
<rdfs:label xml:lang="en">bookblocks</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<xsl:apply-templates mode="bookblock"/>
<crm:P46i_forms_part_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#', $fileref)"/>
</crm:E22_Man-Made_Object>
</crm:P46i_forms_part_of>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
<xsl:apply-templates mode="main"/>
<crm:P141i_was_assigned_by>
<crm:E13_Attribute_Assignment>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#', $fileref, '-descriptionActivity')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://vocab.getty.edu/aat/300080091">
<rdfs:label xml:lang="en">description</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P14_carried_out_by>
<crm:E39_Actor>
<xsl:attribute name="rdf:about"
select="concat($collectionURI, '/', $collectionAcronym, 'bindings/actors/', $collectionAcronym, 'actors.rdf#', replace(book/surveyLog/pencilSurveyor, '[\s]', '_'))"/>
<crm:P1_is_identified_by>
<!-- Blank node -->
<xsl:comment>NB: Blank node</xsl:comment>
<crm:E82_Actor_Appellation>
<rdfs:label>
<xsl:value-of select="book/surveyLog/pencilSurveyor"
/>
</rdfs:label>
</crm:E82_Actor_Appellation>
</crm:P1_is_identified_by>
<crm:P2_has_type>
<!-- Blank node -->
<xsl:comment>NB: Blank node</xsl:comment>
<crm:E55_Type>
<rdfs:label xml:lang="en">pencil surveyor</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E39_Actor>
</crm:P14_carried_out_by>
<crm:P14_carried_out_by>
<crm:E39_Actor>
<xsl:attribute name="rdf:about"
select="concat($collectionURI, '/', $collectionAcronym, 'bindings/actors/', $collectionAcronym, 'actors.rdf#', replace(book/surveyLog/observerSurveyor, '[\s]', '_'))"/>
<crm:P1_is_identified_by>
<!-- Blank node -->
<xsl:comment>NB: Blank node</xsl:comment>
<crm:E82_Actor_Appellation>
<rdfs:label>
<xsl:value-of
select="book/surveyLog/observerSurveyor"/>
</rdfs:label>
</crm:E82_Actor_Appellation>
</crm:P1_is_identified_by>
<crm:P2_has_type>
<!-- Blank node -->
<xsl:comment>NB: Blank node</xsl:comment>
<crm:E55_Type>
<rdfs:label xml:lang="en">observer surveyor</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E39_Actor>
</crm:P14_carried_out_by>
<crm:P4_has_time-span>
<crm:E52_Time-Span>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#', $fileref, '-descriptionActivityTime')"/>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#date">
<xsl:value-of select="book/surveyLog/surveyDate"/>
</rdfs:label>
</crm:E52_Time-Span>
</crm:P4_has_time-span>
</crm:E13_Attribute_Assignment>
</crm:P141i_was_assigned_by>
</crm:E22_Man-Made_Object>
<crm:E53_place>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#spinePlace')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/3810">
<rdfs:label xml:lang="en">spine (place)</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E53_place>
<crm:E53_place>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#leftPlace')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/2947">
<rdfs:label xml:lang="en">left</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E53_place>
<crm:E53_place>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#rightPlace')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/3004">
<rdfs:label xml:lang="en">right</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E53_place>
<crm:E53_place>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#headPlace')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/3803">
<rdfs:label xml:lang="en">head</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E53_place>
<crm:E53_place>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#tailPlace')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/3805">
<rdfs:label xml:lang="en">tail</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E53_place>
<crm:E53_place>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#fore-edgePlace')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/3808">
<rdfs:label xml:lang="en">fore-edge (place)</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E53_place>
</rdf:RDF>
</xsl:result-document>
<!-- Calls all other templates in the other modules -->
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="book/dimensions/height" mode="main">
<crm:P43_has_dimensions>
<crm:E54_Dimension>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#height')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://vocab.getty.edu/aat/300055644">
<rdfs:label xml:lang="en">height</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P91_has_unit>
<crm:E58_Measuring_Unit rdf:about="http://vocab.getty.edu/aat/300379097">
<rdfs:label>mm</rdfs:label>
</crm:E58_Measuring_Unit>
</crm:P91_has_unit>
<crm:P90_has_value rdf:datatype="http://www.w3.org/2001/XMLSchema#positiveInteger">
<xsl:value-of select="."/>
</crm:P90_has_value>
</crm:E54_Dimension>
</crm:P43_has_dimensions>
</xsl:template>
<xsl:template match="book/dimensions/width" mode="main">
<crm:P43_has_dimensions>
<crm:E54_Dimension>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#width')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://vocab.getty.edu/aat/300055647">
<rdfs:label xml:lang="en">width</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P91_has_unit>
<crm:E58_Measuring_Unit rdf:about="http://vocab.getty.edu/aat/300379097">
<rdfs:label>mm</rdfs:label>
</crm:E58_Measuring_Unit>
</crm:P91_has_unit>
<crm:P90_has_value rdf:datatype="http://www.w3.org/2001/XMLSchema#positiveInteger">
<xsl:value-of select="."/>
</crm:P90_has_value>
</crm:E54_Dimension>
</crm:P43_has_dimensions>
</xsl:template>
<xsl:template match="book/dimensions/thickness" mode="main">
<crm:P43_has_dimensions>
<crm:E54_Dimension>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#thicknessMax')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://vocab.getty.edu/aat/300055646">
<rdfs:label xml:lang="en">thickness</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://wiktionary.dbpedia.org/resource/maximum">
<rdfs:label xml:lang="en">maximum value</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P91_has_unit>
<crm:E58_Measuring_Unit rdf:about="http://vocab.getty.edu/aat/300379097">
<rdfs:label>mm</rdfs:label>
</crm:E58_Measuring_Unit>
</crm:P91_has_unit>
<crm:P90_has_value rdf:datatype="http://www.w3.org/2001/XMLSchema#positiveInteger">
<xsl:value-of select="./max"/>
</crm:P90_has_value>
</crm:E54_Dimension>
</crm:P43_has_dimensions>
<crm:P43_has_dimensions>
<crm:E54_Dimension>
<xsl:attribute name="rdf:about" select="concat($filename_main, '#thicknessMin')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://vocab.getty.edu/aat/300055646">
<rdfs:label xml:lang="en">thickness</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://wiktionary.dbpedia.org/resource/minimum">
<rdfs:label xml:lang="en">minimum value</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P91_has_unit>
<crm:E58_Measuring_Unit rdf:about="http://vocab.getty.edu/aat/300379097">
<rdfs:label>mm</rdfs:label>
</crm:E58_Measuring_Unit>
</crm:P91_has_unit>
<crm:P90_has_value rdf:datatype="http://www.w3.org/2001/XMLSchema#positiveInteger">
<xsl:value-of
select="
if (./min = 'Same') then
./max
else
./min"
/>
</crm:P90_has_value>
</crm:E54_Dimension>
</crm:P43_has_dimensions>
</xsl:template>
<xsl:template match="book/openingCharacteristics" mode="main">
<xsl:choose>
<xsl:when test="./hollowBack/yes">
<crm:P56_bears_feature>
<crm:E25_Man-Made_Feature>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#openingCharacteristic')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1391">
<rdfs:label xml:lang="en">hollow backs</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P55_has_current_location>
<crm:E53_place>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#spinePlace')"/>
</crm:E53_place>
</crm:P55_has_current_location>
</crm:E25_Man-Made_Feature>
</crm:P56_bears_feature>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="book/textleaves" mode="bookblock">
<xsl:for-each select=".//editionMaterial">
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:variable name="editionNo">
<xsl:value-of select="editionNo"/>
</xsl:variable>
<xsl:attribute name="rdf:about"
select="
concat($filename_textblock, '#', $filename_fragment_textblock, (if ($editionNo eq '1') then
''
else
$editionNo))"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1663">
<rdfs:label xml:lang="en">textblocks</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:for-each>
</xsl:template>
<xsl:template match="book/endleaves" mode="bookblock">
<xsl:for-each select="child::element()">
<xsl:variable name="side" select="name()"/>
<xsl:choose>
<xsl:when test="yes">
<xsl:variable name="param-filename_fragment"
select="
concat($filename_fragment_endleaves, (if ($side eq 'left') then
'Lft'
else
'Rgt'))
"/>
<xsl:variable name="param-filename"
select="concat($fileref, '_', $param-filename_fragment, '.rdf')"/>
<xsl:variable name="param-filepath"
select="concat('../RDF/', $fileref, '/', $param-filename)"/>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($param-filename, '#', $param-filename_fragment)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1317">
<rdfs:label xml:lang="en">endleaves</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P55_has_current_location>
<crm:E53_place>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#', $side, 'Place')"/>
</crm:E53_place>
</crm:P55_has_current_location>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:when>
<xsl:when test="other">
<xsl:variable name="side" select="name()"/>
<xsl:variable name="param-filename_fragment"
select="
concat($filename_fragment_endleaves, (if ($side eq 'left') then
'Lft'
else
'Rgt'))
"/>
<xsl:variable name="param-filename"
select="concat($fileref, '_', $param-filename_fragment, '.rdf')"/>
<xsl:variable name="param-filepath"
select="concat('../RDF/', $fileref, '/', $param-filename)"/>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($param-filename, '#', $param-filename_fragment)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1317">
<rdfs:label xml:lang="en">endleaves</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P55_has_current_location>
<crm:E53_place>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#', $side, 'Place')"/>
</crm:E53_place>
</crm:P55_has_current_location>
<xsl:call-template name="other">
<xsl:with-param name="value" select="."/>
</xsl:call-template>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template match="book/edges" mode="bookblock">
<crm:P56_bears_feature>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($filename_edges, '#', $filename_fragment_edges)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1226">
<rdfs:label xml:lang="en">bookblock edges</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P56_bears_feature>
</xsl:template>
<xsl:template match="book/spine" mode="bookblock">
<crm:P56_bears_feature>
<crm:E25_Man-Made_feature>
<xsl:attribute name="rdf:about"
select="concat($filename_spine, '#', $filename_fragment_spine)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/2352">
<rdfs:label xml:lang="en">spine (bookblocks)</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E25_Man-Made_feature>
</crm:P56_bears_feature>
<xsl:choose>
<xsl:when test="book/spine/profile/joints/not(flat | none)">
<crm:P56_bears_feature>
<crm:E25_Man-Made_feature>
<xsl:attribute name="rdf:about"
select="concat($filename_spine, '#backingJoints')"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1205">
<rdfs:label xml:lang="en">backing joints</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E25_Man-Made_feature>
</crm:P56_bears_feature>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="book/markers/yes" mode="main">
<xsl:variable name="count" select="count(marker)"/>
<xsl:for-each select="marker">
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($filename_markers, '#', $filename_fragment_markers, (if ($count eq 1) then
''
else
position()))"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/2837">
<rdfs:label xml:lang="en">bookmarks</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:for-each>
</xsl:template>
<xsl:template match="book/boards" mode="main">
<xsl:choose>
<xsl:when test="yes/boards">
<xsl:variable name="boardsNo" select="count(board)"/>
<xsl:for-each select="yes/boards/board">
<xsl:variable name="location" select="location/element()/name()"/>
<xsl:variable name="boardsItem">
<xsl:choose>
<xsl:when test="$location eq 'left'">
<xsl:value-of
select="
concat((if ($boardsNo gt 2) then
concat(position(), '-')
else
''), 'Lft')"
/>
</xsl:when>
<xsl:when test="$location eq 'right'">
<xsl:value-of
select="
concat((if ($boardsNo gt 2) then
concat(position(), '-')
else
''), 'Rgt')"
/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="param-filename_fragment"
select="concat($filename_fragment_boards, $boardsItem)"/>
<xsl:variable name="param-filename"
select="concat($fileref, '_', $param-filename_fragment, '.rdf')"/>
<xsl:variable name="param-filepath"
select="concat('../RDF/', $fileref, '/', $param-filename)"/>
<xsl:variable name="namespaceFragment">
<xsl:choose>
<xsl:when test="$location eq 'left'">
<xsl:value-of
select="
concat((if ($boardsNo gt 2) then
concat(position(), '-')
else
''), 'blt')"
/>
</xsl:when>
<xsl:when test="$location eq 'right'">
<xsl:value-of
select="
concat((if ($boardsNo gt 2) then
concat(position(), '-')
else
''), 'brt')"
/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($param-filename, '#', $param-filename_fragment)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1222">
<rdfs:label xml:lang="en">boards</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:for-each>
</xsl:when>
<xsl:when test="other">
<xsl:variable name="param-filename_fragment"
select="concat($filename_fragment_boards, 's')"/>
<xsl:variable name="param-filename"
select="concat($fileref, '_', $param-filename_fragment, '.rdf')"/>
<xsl:variable name="param-filepath"
select="concat('../RDF/', $fileref, '/', $param-filename)"/>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($param-filename, '#', $param-filename_fragment)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1222">
<rdfs:label xml:lang="en">boards</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="book/sewing" mode="main">
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($filename_sewing, '#', $filename_fragment_sewing)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/3014">
<rdfs:label xml:lang="en">sewn structures</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:template>
<xsl:template match="book/spine/lining/yes" mode="main">
<xsl:variable name="count" select="count(lining)"/>
<xsl:for-each select="lining">
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($filename_lining, '#', $filename_fragment_lining, (if ($count gt 1) then
position()
else
''))"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1619">
<rdfs:label xml:lang="en">spine linings</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:for-each>
</xsl:template>
<xsl:template match="book/endbands" mode="main">
<xsl:choose>
<xsl:when test="yes/endband">
<xsl:for-each select="yes/endband">
<xsl:call-template name="endbands_main">
<xsl:with-param name="location" select="location/element()/name()"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="other">
<xsl:variable name="param-filename_fragment"
select="concat($filename_fragment_endbands, 's')"/>
<xsl:variable name="param-filename"
select="concat($fileref, '_', $param-filename_fragment, '.rdf')"/>
<xsl:variable name="param-filepath"
select="concat('../RDF/', $fileref, '/', $param-filename)"/>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($param-filename, '#', $param-filename_fragment)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/2370">
<rdfs:label xml:lang="en">endbands</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<xsl:call-template name="other">
<xsl:with-param name="value" select="."/>
</xsl:call-template>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="endbands_main">
<xsl:param name="location"/>
<xsl:variable name="param-filename_fragment"
select="
concat($filename_fragment_endbands, (if ($location eq 'head') then
'Hd'
else
'Tl'))
"/>
<xsl:variable name="param-filename"
select="concat($fileref, '_', $param-filename_fragment, '.rdf')"/>
<xsl:variable name="param-filepath"
select="concat('../RDF/', $fileref, '/', $param-filename)"/>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="concat($param-filename, '#', $param-filename_fragment)"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/2370">
<rdfs:label xml:lang="en">endbands</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<crm:P55_has_current_location>
<crm:E53_place>
<xsl:attribute name="rdf:about"
select="concat($filename_main, '#', $location, 'Place')"/>
</crm:E53_place>
</crm:P55_has_current_location>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:template>
<xsl:template match="book/coverings" mode="main">
<xsl:choose>
<xsl:when test="yes">
<xsl:variable name="count" select="count(cover)"/>
<xsl:for-each select="cover">
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($filename_covering, '#', $filename_fragment_covering, (if ($count eq 1) then
''
else
position()))"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1268">
<rdfs:label xml:lang="en">covers</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<xsl:choose>
<xsl:when test="use/primary">
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1515">
<rdfs:label xml:lang="en">primary covers</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</xsl:when>
<xsl:when test="use/secondary">
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1562">
<rdfs:label xml:lang="en">secondary covers</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</xsl:when>
</xsl:choose>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:for-each>
</xsl:when>
<xsl:when test="other">
<xsl:variable name="count" select="count(cover)"/>
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($filename_covering, '#', $filename_fragment_covering, (if ($count eq 1) then
''
else
position()))"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1268">
<rdfs:label xml:lang="en">covers</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
<xsl:call-template name="other">
<xsl:with-param name="value" select="."/>
</xsl:call-template>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template
match="book/furniture/yes/furniture[type[clasp | catchplate | pin | straps | strapPlates | strapCollars | ties]]"
mode="main">
<xsl:for-each
select="furniture/type[clasp | catchplate | pin | straps | strapPlates | strapCollars | ties]">
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($filename_furniture, '#fasteningComp', position())"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/2893">
<rdfs:label xml:lang="en">fastenings</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:for-each>
</xsl:template>
<xsl:template
match="book/furniture/yes/furniture[type[bosses | corners | plates | fullCover | articulatedMetalSpines]]"
mode="main">
<xsl:for-each
select="furniture/type[bosses | corners | plates | fullCover | articulatedMetalSpines]">
<crm:P46_is_composed_of>
<crm:E22_Man-Made_Object>
<xsl:attribute name="rdf:about"
select="
concat($filename_furniture, '#furnitureComp', position())"/>
<crm:P2_has_type>
<crm:E55_Type rdf:about="http://w3id.org/lob/concept/1353">
<rdfs:label xml:lang="en">furniture (components)</rdfs:label>
</crm:E55_Type>
</crm:P2_has_type>
</crm:E22_Man-Made_Object>
</crm:P46_is_composed_of>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>