bibframe_ruby 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +24 -2
- data/docs/superpowers/plans/2026-09-09-marc-conversion.md +537 -0
- data/docs/superpowers/specs/2026-09-09-marc-conversion-design.md +110 -0
- data/lib/bibframe_ruby/marc_converter.rb +67 -0
- data/lib/bibframe_ruby/parser.rb +4 -2
- data/lib/bibframe_ruby/version.rb +1 -1
- data/lib/bibframe_ruby.rb +7 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-001-007.xsl +2276 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-006,008.xsl +1295 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-010-048.xsl +1712 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-050-088.xsl +713 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-1XX,7XX,8XX-names.xsl +1141 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-200-247not240-Titles.xsl +771 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-240andX30-UnifTitle.xsl +535 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-250-270.xsl +283 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-3XX.xsl +2245 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-460-468-SeriesTreat.xsl +135 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-490-510-Links.xsl +145 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-5XX.xsl +1448 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-600-662.xsl +1417 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-720+740to755.xsl +333 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-758.xsl +102 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-760-788-Links.xsl +771 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-841-887.xsl +328 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-880.xsl +119 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-ControlSubfields.xsl +495 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-LDR.xsl +183 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-Preprocess0-Splitting.xsl +765 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-Process6-Series.xsl +627 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-Process8-ProvAct.xsl +1021 -0
- data/vendor/marc2bibframe2/xsl/conf/abbreviations.xml +13 -0
- data/vendor/marc2bibframe2/xsl/conf/code-to-script.xml +399 -0
- data/vendor/marc2bibframe2/xsl/conf/codeMaps.xml +723 -0
- data/vendor/marc2bibframe2/xsl/conf/exclusions.xml +4 -0
- data/vendor/marc2bibframe2/xsl/conf/iso6392-to-1.xml +615 -0
- data/vendor/marc2bibframe2/xsl/conf/languageCrosswalk.xml +1503 -0
- data/vendor/marc2bibframe2/xsl/conf/map880.xml +175 -0
- data/vendor/marc2bibframe2/xsl/conf/scriptCrosswalk.xml +210 -0
- data/vendor/marc2bibframe2/xsl/conf/subjectThesaurus.xml +29 -0
- data/vendor/marc2bibframe2/xsl/marc2bibframe2.xsl +610 -0
- data/vendor/marc2bibframe2/xsl/naco-normalize.xsl +205 -0
- data/vendor/marc2bibframe2/xsl/utils.xsl +963 -0
- data/vendor/marc2bibframe2/xsl/variables.xsl +108 -0
- metadata +68 -1
|
@@ -0,0 +1,1417 @@
|
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
4
|
+
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
|
5
|
+
xmlns:marc="http://www.loc.gov/MARC21/slim"
|
|
6
|
+
xmlns:bf="http://id.loc.gov/ontologies/bibframe/"
|
|
7
|
+
xmlns:bflc="http://id.loc.gov/ontologies/bflc/"
|
|
8
|
+
xmlns:madsrdf="http://www.loc.gov/mads/rdf/v1#"
|
|
9
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
10
|
+
exclude-result-prefixes="xsl marc">
|
|
11
|
+
|
|
12
|
+
<!--
|
|
13
|
+
Conversion specs for 600-662
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
<xsl:template match="marc:datafield[@tag='600' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='600')] |
|
|
17
|
+
marc:datafield[@tag='610' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='610')] |
|
|
18
|
+
marc:datafield[@tag='611' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='611')]"
|
|
19
|
+
mode="work">
|
|
20
|
+
<xsl:param name="recordid"/>
|
|
21
|
+
<xsl:param name="pPosition" select="position()"/>
|
|
22
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
23
|
+
<xsl:variable name="agentiri">
|
|
24
|
+
<xsl:choose>
|
|
25
|
+
<xsl:when test="marc:subfield[@code='1']">
|
|
26
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
27
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
28
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
29
|
+
</xsl:apply-templates>
|
|
30
|
+
</xsl:when>
|
|
31
|
+
<xsl:when test="marc:subfield[@code='0'][contains(text(),'id.loc.gov/authorities/names/')]">
|
|
32
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
33
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
34
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
35
|
+
</xsl:apply-templates>
|
|
36
|
+
</xsl:when>
|
|
37
|
+
<xsl:otherwise>
|
|
38
|
+
<xsl:apply-templates mode="generateUriFrom0" select=".">
|
|
39
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
40
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
41
|
+
</xsl:apply-templates>
|
|
42
|
+
</xsl:otherwise>
|
|
43
|
+
</xsl:choose>
|
|
44
|
+
</xsl:variable>
|
|
45
|
+
<xsl:variable name="vHubIri">
|
|
46
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
47
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Hub<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
48
|
+
<xsl:with-param name="pEntity">bf:Hub</xsl:with-param>
|
|
49
|
+
</xsl:apply-templates>
|
|
50
|
+
</xsl:variable>
|
|
51
|
+
<xsl:variable name="vTopicUri">
|
|
52
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
53
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Topic<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
54
|
+
<xsl:with-param name="pEntity">bf:Topic</xsl:with-param>
|
|
55
|
+
</xsl:apply-templates>
|
|
56
|
+
</xsl:variable>
|
|
57
|
+
<xsl:apply-templates mode="work6XXName" select=".">
|
|
58
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
59
|
+
<xsl:with-param name="pHubIri" select="$vHubIri"/>
|
|
60
|
+
<xsl:with-param name="pTopicUri" select="$vTopicUri"/>
|
|
61
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
62
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
63
|
+
</xsl:apply-templates>
|
|
64
|
+
</xsl:template>
|
|
65
|
+
|
|
66
|
+
<xsl:template match="marc:datafield" mode="work6XXName">
|
|
67
|
+
<xsl:param name="agentiri"/>
|
|
68
|
+
<xsl:param name="pHubIri"/>
|
|
69
|
+
<xsl:param name="pTopicUri"/>
|
|
70
|
+
<xsl:param name="recordid"/>
|
|
71
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
72
|
+
<xsl:variable name="vTag">
|
|
73
|
+
<xsl:choose>
|
|
74
|
+
<xsl:when test="@tag='880'"><xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/></xsl:when>
|
|
75
|
+
<xsl:otherwise><xsl:value-of select="@tag"/></xsl:otherwise>
|
|
76
|
+
</xsl:choose>
|
|
77
|
+
</xsl:variable>
|
|
78
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
79
|
+
<xsl:variable name="vSourceURI"><xsl:value-of select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/bfsource"/></xsl:variable>
|
|
80
|
+
<xsl:variable name="vMADSClass">
|
|
81
|
+
<xsl:choose>
|
|
82
|
+
<xsl:when test="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">ComplexSubject</xsl:when>
|
|
83
|
+
<xsl:when test="marc:subfield[@code='t']">NameTitle</xsl:when>
|
|
84
|
+
<xsl:when test="$vTag='600'">
|
|
85
|
+
<xsl:choose>
|
|
86
|
+
<xsl:when test="@ind1='3'">FamilyName</xsl:when>
|
|
87
|
+
<xsl:otherwise>PersonalName</xsl:otherwise>
|
|
88
|
+
</xsl:choose>
|
|
89
|
+
</xsl:when>
|
|
90
|
+
<xsl:when test="$vTag='610'">CorporateName</xsl:when>
|
|
91
|
+
<xsl:when test="$vTag='611'">ConferenceName</xsl:when>
|
|
92
|
+
</xsl:choose>
|
|
93
|
+
</xsl:variable>
|
|
94
|
+
<xsl:variable name="vMADSNameClass">
|
|
95
|
+
<xsl:choose>
|
|
96
|
+
<xsl:when test="$vTag='600'">
|
|
97
|
+
<xsl:choose>
|
|
98
|
+
<xsl:when test="@ind1='3'">FamilyName</xsl:when>
|
|
99
|
+
<xsl:otherwise>PersonalName</xsl:otherwise>
|
|
100
|
+
</xsl:choose>
|
|
101
|
+
</xsl:when>
|
|
102
|
+
<xsl:when test="$vTag='610'">CorporateName</xsl:when>
|
|
103
|
+
<xsl:when test="$vTag='611'">ConferenceName</xsl:when>
|
|
104
|
+
</xsl:choose>
|
|
105
|
+
</xsl:variable>
|
|
106
|
+
<xsl:variable name="vNameLabel">
|
|
107
|
+
<xsl:apply-templates select="." mode="tNameLabel"/>
|
|
108
|
+
</xsl:variable>
|
|
109
|
+
<xsl:variable name="vTitleLabel">
|
|
110
|
+
<xsl:apply-templates select="." mode="tTitleLabel"/>
|
|
111
|
+
</xsl:variable>
|
|
112
|
+
<xsl:variable name="vMADSLabel">
|
|
113
|
+
<xsl:call-template name="tChopPunct">
|
|
114
|
+
<xsl:with-param name="pEndPunct" select="'-'"/>
|
|
115
|
+
<xsl:with-param name="pString">
|
|
116
|
+
<xsl:call-template name="tChopPunct">
|
|
117
|
+
<xsl:with-param name="pString" select="concat($vNameLabel,' ',$vTitleLabel)"/>
|
|
118
|
+
</xsl:call-template>
|
|
119
|
+
<xsl:text>--</xsl:text>
|
|
120
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
121
|
+
<xsl:value-of select="concat(.,'--')"/>
|
|
122
|
+
</xsl:for-each>
|
|
123
|
+
</xsl:with-param>
|
|
124
|
+
</xsl:call-template>
|
|
125
|
+
</xsl:variable>
|
|
126
|
+
|
|
127
|
+
<xsl:variable name="v880Label">
|
|
128
|
+
<xsl:if test="marc:subfield[@code='6'] and not(contains(marc:subfield[@code='6'], '-00'))">
|
|
129
|
+
<xsl:variable name="v880Occurrence">
|
|
130
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
131
|
+
</xsl:variable>
|
|
132
|
+
<xsl:variable name="v880Ref">
|
|
133
|
+
<xsl:value-of select="concat($vTag, '-', $v880Occurrence)"/>
|
|
134
|
+
</xsl:variable>
|
|
135
|
+
<xsl:for-each select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]">
|
|
136
|
+
<xsl:variable name="vXmlLang880"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
137
|
+
<xsl:variable name="vNameLabel880">
|
|
138
|
+
<xsl:apply-templates select="." mode="tNameLabel"/>
|
|
139
|
+
</xsl:variable>
|
|
140
|
+
<xsl:variable name="vTitleLabel880">
|
|
141
|
+
<xsl:apply-templates select="." mode="tTitleLabel"/>
|
|
142
|
+
</xsl:variable>
|
|
143
|
+
<xsl:variable name="vMADSLabel880">
|
|
144
|
+
<xsl:call-template name="tChopPunct">
|
|
145
|
+
<xsl:with-param name="pEndPunct" select="'-'"/>
|
|
146
|
+
<xsl:with-param name="pString">
|
|
147
|
+
<xsl:call-template name="tChopPunct">
|
|
148
|
+
<xsl:with-param name="pString" select="concat($vNameLabel880,' ',$vTitleLabel880)"/>
|
|
149
|
+
</xsl:call-template>
|
|
150
|
+
<xsl:text>--</xsl:text>
|
|
151
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
152
|
+
<xsl:value-of select="concat(.,'--')"/>
|
|
153
|
+
</xsl:for-each>
|
|
154
|
+
</xsl:with-param>
|
|
155
|
+
</xsl:call-template>
|
|
156
|
+
</xsl:variable>
|
|
157
|
+
<madsrdf:authoritativeLabel>
|
|
158
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
159
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
160
|
+
</xsl:if>
|
|
161
|
+
<xsl:value-of select="$vMADSLabel880"/>
|
|
162
|
+
</madsrdf:authoritativeLabel>
|
|
163
|
+
</xsl:for-each>
|
|
164
|
+
</xsl:if>
|
|
165
|
+
</xsl:variable>
|
|
166
|
+
|
|
167
|
+
<xsl:variable name="v880MarcKey">
|
|
168
|
+
<xsl:if test="marc:subfield[@code='6'] and not(contains(marc:subfield[@code='6'], '-00'))">
|
|
169
|
+
<xsl:variable name="v880Occurrence">
|
|
170
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
171
|
+
</xsl:variable>
|
|
172
|
+
<xsl:variable name="v880Ref">
|
|
173
|
+
<xsl:value-of select="concat($vTag, '-', $v880Occurrence)"/>
|
|
174
|
+
</xsl:variable>
|
|
175
|
+
<xsl:for-each select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]">
|
|
176
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey"/></bflc:marcKey>
|
|
177
|
+
</xsl:for-each>
|
|
178
|
+
</xsl:if>
|
|
179
|
+
</xsl:variable>
|
|
180
|
+
|
|
181
|
+
<xsl:choose>
|
|
182
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
183
|
+
<xsl:variable name="vSource">
|
|
184
|
+
<xsl:choose>
|
|
185
|
+
<xsl:when test="$vSourceURI != ''">
|
|
186
|
+
<bf:source>
|
|
187
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$vSourceURI"/></xsl:attribute>
|
|
188
|
+
</bf:source>
|
|
189
|
+
</xsl:when>
|
|
190
|
+
<xsl:when test="@ind2='4' or @ind2='7'">
|
|
191
|
+
<xsl:apply-templates select="marc:subfield[@code='2']" mode="subfield2">
|
|
192
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
193
|
+
<xsl:with-param name="pVocabStem" select="$subjectSchemes"/>
|
|
194
|
+
</xsl:apply-templates>
|
|
195
|
+
</xsl:when>
|
|
196
|
+
</xsl:choose>
|
|
197
|
+
</xsl:variable>
|
|
198
|
+
<bf:subject>
|
|
199
|
+
<xsl:choose>
|
|
200
|
+
<xsl:when test="marc:subfield[@code='t']">
|
|
201
|
+
<xsl:choose>
|
|
202
|
+
<xsl:when test="$vMADSClass='ComplexSubject'">
|
|
203
|
+
<bf:Topic>
|
|
204
|
+
<xsl:if test="$pTopicUri != ''">
|
|
205
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$pTopicUri"/></xsl:attribute>
|
|
206
|
+
</xsl:if>
|
|
207
|
+
<rdf:type>
|
|
208
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,$vMADSClass)"/></xsl:attribute>
|
|
209
|
+
</rdf:type>
|
|
210
|
+
<madsrdf:authoritativeLabel>
|
|
211
|
+
<xsl:if test="$vXmlLang != ''">
|
|
212
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
213
|
+
</xsl:if>
|
|
214
|
+
<xsl:value-of select="$vMADSLabel"/>
|
|
215
|
+
</madsrdf:authoritativeLabel>
|
|
216
|
+
<xsl:copy-of select="$v880Label"/>
|
|
217
|
+
<!-- <xsl:copy-of select="$v880MarcKey"/> -->
|
|
218
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
219
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
220
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
221
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
222
|
+
</xsl:for-each>
|
|
223
|
+
<xsl:if test="$vSource">
|
|
224
|
+
<xsl:copy-of select="$vSource"/>
|
|
225
|
+
</xsl:if>
|
|
226
|
+
<!-- build the ComplexSubject -->
|
|
227
|
+
<madsrdf:componentList rdf:parseType="Collection">
|
|
228
|
+
<xsl:apply-templates select="." mode="work6XXHub">
|
|
229
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
230
|
+
<xsl:with-param name="pHubIri" select="$pHubIri"/>
|
|
231
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
232
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
233
|
+
<xsl:with-param name="pMADSClass" select="'NameTitle'"/>
|
|
234
|
+
<xsl:with-param name="pMADSLabel">
|
|
235
|
+
<xsl:call-template name="tChopPunct">
|
|
236
|
+
<xsl:with-param name="pString" select="normalize-space(concat($vNameLabel,' ',$vTitleLabel))"/>
|
|
237
|
+
</xsl:call-template>
|
|
238
|
+
</xsl:with-param>
|
|
239
|
+
<xsl:with-param name="pSource" select="$vSource"/>
|
|
240
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
241
|
+
</xsl:apply-templates>
|
|
242
|
+
<xsl:apply-templates select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
243
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
244
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
245
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
246
|
+
</xsl:apply-templates>
|
|
247
|
+
</madsrdf:componentList>
|
|
248
|
+
</bf:Topic>
|
|
249
|
+
</xsl:when>
|
|
250
|
+
<xsl:otherwise>
|
|
251
|
+
<xsl:apply-templates select="." mode="work6XXHub">
|
|
252
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
253
|
+
<xsl:with-param name="pHubIri" select="$pHubIri"/>
|
|
254
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
255
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
256
|
+
<xsl:with-param name="pMADSClass" select="$vMADSClass"/>
|
|
257
|
+
<xsl:with-param name="pMADSLabel" select="$vMADSLabel"/>
|
|
258
|
+
<xsl:with-param name="pSource" select="$vSource"/>
|
|
259
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
260
|
+
</xsl:apply-templates>
|
|
261
|
+
</xsl:otherwise>
|
|
262
|
+
</xsl:choose>
|
|
263
|
+
</xsl:when>
|
|
264
|
+
<xsl:otherwise>
|
|
265
|
+
<xsl:choose>
|
|
266
|
+
<xsl:when test="$vMADSClass='ComplexSubject'">
|
|
267
|
+
<bf:Topic>
|
|
268
|
+
<xsl:if test="$pTopicUri != ''">
|
|
269
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$pTopicUri"/></xsl:attribute>
|
|
270
|
+
</xsl:if>
|
|
271
|
+
<rdf:type>
|
|
272
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,$vMADSClass)"/></xsl:attribute>
|
|
273
|
+
</rdf:type>
|
|
274
|
+
<madsrdf:authoritativeLabel>
|
|
275
|
+
<xsl:if test="$vXmlLang != ''">
|
|
276
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
277
|
+
</xsl:if>
|
|
278
|
+
<xsl:value-of select="$vMADSLabel"/>
|
|
279
|
+
</madsrdf:authoritativeLabel>
|
|
280
|
+
<xsl:copy-of select="$v880Label"/>
|
|
281
|
+
<!-- <xsl:copy-of select="$v880MarcKey"/> -->
|
|
282
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
283
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
284
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
285
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
286
|
+
</xsl:for-each>
|
|
287
|
+
<xsl:if test="$vSource">
|
|
288
|
+
<xsl:copy-of select="$vSource"/>
|
|
289
|
+
</xsl:if>
|
|
290
|
+
<!-- build the ComplexSubject -->
|
|
291
|
+
<madsrdf:componentList rdf:parseType="Collection">
|
|
292
|
+
<xsl:apply-templates select="." mode="agent">
|
|
293
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
294
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
295
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
296
|
+
<xsl:with-param name="pMADSClass" select="$vMADSNameClass"/>
|
|
297
|
+
<xsl:with-param name="pMADSLabel">
|
|
298
|
+
<xsl:call-template name="tChopPunct">
|
|
299
|
+
<xsl:with-param name="pString" select="normalize-space(concat($vNameLabel,' ',$vTitleLabel))"/>
|
|
300
|
+
</xsl:call-template>
|
|
301
|
+
</xsl:with-param>
|
|
302
|
+
<xsl:with-param name="pSource" select="$vSource"/>
|
|
303
|
+
</xsl:apply-templates>
|
|
304
|
+
<xsl:apply-templates select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
305
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
306
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
307
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
308
|
+
</xsl:apply-templates>
|
|
309
|
+
</madsrdf:componentList>
|
|
310
|
+
</bf:Topic>
|
|
311
|
+
</xsl:when>
|
|
312
|
+
<xsl:otherwise>
|
|
313
|
+
<xsl:apply-templates select="." mode="agent">
|
|
314
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
315
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
316
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
317
|
+
<xsl:with-param name="pMADSClass" select="$vMADSClass"/>
|
|
318
|
+
<xsl:with-param name="pMADSLabel" select="$vMADSLabel"/>
|
|
319
|
+
<xsl:with-param name="pSource" select="$vSource"/>
|
|
320
|
+
</xsl:apply-templates>
|
|
321
|
+
</xsl:otherwise>
|
|
322
|
+
</xsl:choose>
|
|
323
|
+
</xsl:otherwise>
|
|
324
|
+
</xsl:choose>
|
|
325
|
+
</bf:subject>
|
|
326
|
+
</xsl:when>
|
|
327
|
+
</xsl:choose>
|
|
328
|
+
</xsl:template>
|
|
329
|
+
|
|
330
|
+
<xsl:template match="marc:datafield" mode="work6XXHub">
|
|
331
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
332
|
+
<xsl:param name="pHubIri"/>
|
|
333
|
+
<xsl:param name="agentiri"/>
|
|
334
|
+
<xsl:param name="recordid"/>
|
|
335
|
+
<xsl:param name="pMADSClass"/>
|
|
336
|
+
<xsl:param name="pMADSLabel"/>
|
|
337
|
+
<xsl:param name="pSource"/>
|
|
338
|
+
<xsl:param name="pTag"/>
|
|
339
|
+
|
|
340
|
+
<xsl:variable name="v880Label">
|
|
341
|
+
<xsl:if test="marc:subfield[@code='6'] and not(contains(marc:subfield[@code='6'], '-00'))">
|
|
342
|
+
<xsl:variable name="v880Occurrence">
|
|
343
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
344
|
+
</xsl:variable>
|
|
345
|
+
<xsl:variable name="v880Ref">
|
|
346
|
+
<xsl:value-of select="concat($pTag, '-', $v880Occurrence)"/>
|
|
347
|
+
</xsl:variable>
|
|
348
|
+
<xsl:for-each select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]">
|
|
349
|
+
<xsl:variable name="vXmlLang880"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
350
|
+
<xsl:variable name="vNameLabel880">
|
|
351
|
+
<xsl:apply-templates select="." mode="tNameLabel"/>
|
|
352
|
+
</xsl:variable>
|
|
353
|
+
<xsl:variable name="vTitleLabel880">
|
|
354
|
+
<xsl:apply-templates select="." mode="tTitleLabel"/>
|
|
355
|
+
</xsl:variable>
|
|
356
|
+
<xsl:variable name="vMADSLabel880">
|
|
357
|
+
<xsl:call-template name="tChopPunct">
|
|
358
|
+
<xsl:with-param name="pEndPunct" select="'-'"/>
|
|
359
|
+
<xsl:with-param name="pString">
|
|
360
|
+
<xsl:call-template name="tChopPunct">
|
|
361
|
+
<xsl:with-param name="pString" select="concat($vNameLabel880,' ',$vTitleLabel880)"/>
|
|
362
|
+
</xsl:call-template>
|
|
363
|
+
</xsl:with-param>
|
|
364
|
+
</xsl:call-template>
|
|
365
|
+
</xsl:variable>
|
|
366
|
+
<madsrdf:authoritativeLabel>
|
|
367
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
368
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
369
|
+
</xsl:if>
|
|
370
|
+
<xsl:value-of select="$vMADSLabel880"/>
|
|
371
|
+
</madsrdf:authoritativeLabel>
|
|
372
|
+
</xsl:for-each>
|
|
373
|
+
</xsl:if>
|
|
374
|
+
</xsl:variable>
|
|
375
|
+
|
|
376
|
+
<xsl:variable name="v880MarcKey">
|
|
377
|
+
<xsl:if test="marc:subfield[@code='6'] and not(contains(marc:subfield[@code='6'], '-00'))">
|
|
378
|
+
<xsl:variable name="v880Occurrence">
|
|
379
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
380
|
+
</xsl:variable>
|
|
381
|
+
<xsl:variable name="v880Ref">
|
|
382
|
+
<xsl:value-of select="concat($pTag, '-', $v880Occurrence)"/>
|
|
383
|
+
</xsl:variable>
|
|
384
|
+
<xsl:for-each select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]">
|
|
385
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey"/></bflc:marcKey>
|
|
386
|
+
</xsl:for-each>
|
|
387
|
+
</xsl:if>
|
|
388
|
+
</xsl:variable>
|
|
389
|
+
|
|
390
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
391
|
+
<xsl:choose>
|
|
392
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
393
|
+
<bf:Hub>
|
|
394
|
+
<xsl:if test="$pHubIri != ''">
|
|
395
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$pHubIri"/></xsl:attribute>
|
|
396
|
+
</xsl:if>
|
|
397
|
+
<xsl:if test="$pMADSClass != ''">
|
|
398
|
+
<rdf:type>
|
|
399
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,$pMADSClass)"/></xsl:attribute>
|
|
400
|
+
</rdf:type>
|
|
401
|
+
</xsl:if>
|
|
402
|
+
<xsl:if test="$pMADSLabel != ''">
|
|
403
|
+
<madsrdf:authoritativeLabel>
|
|
404
|
+
<xsl:if test="$vXmlLang != ''">
|
|
405
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
406
|
+
</xsl:if>
|
|
407
|
+
<xsl:value-of select="$pMADSLabel"/>
|
|
408
|
+
</madsrdf:authoritativeLabel>
|
|
409
|
+
</xsl:if>
|
|
410
|
+
<xsl:copy-of select="$v880Label" />
|
|
411
|
+
<!-- <xsl:copy-of select="$v880MarcKey"/> -->
|
|
412
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
413
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
414
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
415
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
416
|
+
</xsl:for-each>
|
|
417
|
+
<xsl:if test="$pSource != ''">
|
|
418
|
+
<xsl:copy-of select="$pSource"/>
|
|
419
|
+
</xsl:if>
|
|
420
|
+
<xsl:apply-templates select="." mode="workName">
|
|
421
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
422
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
423
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
424
|
+
</xsl:apply-templates>
|
|
425
|
+
</bf:Hub>
|
|
426
|
+
</xsl:when>
|
|
427
|
+
</xsl:choose>
|
|
428
|
+
</xsl:template>
|
|
429
|
+
|
|
430
|
+
<xsl:template match="marc:datafield[@tag='630' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='630')]" mode="work">
|
|
431
|
+
<xsl:param name="recordid"/>
|
|
432
|
+
<xsl:param name="pPosition" select="position()"/>
|
|
433
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
434
|
+
<xsl:variable name="vHubIri">
|
|
435
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
436
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Hub<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
437
|
+
<xsl:with-param name="pEntity">bf:Hub</xsl:with-param>
|
|
438
|
+
</xsl:apply-templates>
|
|
439
|
+
</xsl:variable>
|
|
440
|
+
<xsl:variable name="vTopicUri">
|
|
441
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
442
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Topic<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
443
|
+
<xsl:with-param name="pEntity">bf:Topic</xsl:with-param>
|
|
444
|
+
</xsl:apply-templates>
|
|
445
|
+
</xsl:variable>
|
|
446
|
+
<xsl:apply-templates mode="work630" select=".">
|
|
447
|
+
<xsl:with-param name="pHubIri" select="$vHubIri"/>
|
|
448
|
+
<xsl:with-param name="pTopicUri" select="$vTopicUri"/>
|
|
449
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
450
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
451
|
+
</xsl:apply-templates>
|
|
452
|
+
</xsl:template>
|
|
453
|
+
|
|
454
|
+
<xsl:template match="marc:datafield" mode="work630">
|
|
455
|
+
<xsl:param name="recordid"/>
|
|
456
|
+
<xsl:param name="pHubIri"/>
|
|
457
|
+
<xsl:param name="pTopicUri"/>
|
|
458
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
459
|
+
<xsl:variable name="vTag">
|
|
460
|
+
<xsl:choose>
|
|
461
|
+
<xsl:when test="@tag='880'"><xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/></xsl:when>
|
|
462
|
+
<xsl:otherwise><xsl:value-of select="@tag"/></xsl:otherwise>
|
|
463
|
+
</xsl:choose>
|
|
464
|
+
</xsl:variable>
|
|
465
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
466
|
+
<xsl:variable name="vSourceURI"><xsl:value-of select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/bfsource"/></xsl:variable>
|
|
467
|
+
<xsl:variable name="vMADSClass">
|
|
468
|
+
<xsl:choose>
|
|
469
|
+
<xsl:when test="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">ComplexSubject</xsl:when>
|
|
470
|
+
<xsl:otherwise>Title</xsl:otherwise>
|
|
471
|
+
</xsl:choose>
|
|
472
|
+
</xsl:variable>
|
|
473
|
+
<xsl:variable name="vTitleLabel">
|
|
474
|
+
<xsl:apply-templates select="." mode="tTitleLabel"/>
|
|
475
|
+
</xsl:variable>
|
|
476
|
+
<xsl:variable name="vMADSLabel">
|
|
477
|
+
<xsl:call-template name="tChopPunct">
|
|
478
|
+
<xsl:with-param name="pEndPunct" select="'-'"/>
|
|
479
|
+
<xsl:with-param name="pString">
|
|
480
|
+
<xsl:call-template name="tChopPunct">
|
|
481
|
+
<xsl:with-param name="pString" select="$vTitleLabel"/>
|
|
482
|
+
</xsl:call-template>
|
|
483
|
+
<xsl:text>--</xsl:text>
|
|
484
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
485
|
+
<xsl:value-of select="concat(.,'--')"/>
|
|
486
|
+
</xsl:for-each>
|
|
487
|
+
</xsl:with-param>
|
|
488
|
+
</xsl:call-template>
|
|
489
|
+
</xsl:variable>
|
|
490
|
+
<xsl:choose>
|
|
491
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
492
|
+
<xsl:variable name="vSource">
|
|
493
|
+
<xsl:choose>
|
|
494
|
+
<xsl:when test="$vSourceURI != ''">
|
|
495
|
+
<bf:source>
|
|
496
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$vSourceURI"/></xsl:attribute>
|
|
497
|
+
</bf:source>
|
|
498
|
+
</xsl:when>
|
|
499
|
+
<xsl:when test="@ind2='4' or @ind2='7'">
|
|
500
|
+
<xsl:apply-templates select="marc:subfield[@code='2']" mode="subfield2">
|
|
501
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
502
|
+
<xsl:with-param name="pVocabStem" select="$subjectSchemes"/>
|
|
503
|
+
</xsl:apply-templates>
|
|
504
|
+
</xsl:when>
|
|
505
|
+
</xsl:choose>
|
|
506
|
+
</xsl:variable>
|
|
507
|
+
<bf:subject>
|
|
508
|
+
<xsl:choose>
|
|
509
|
+
<xsl:when test="$vMADSClass='ComplexSubject'">
|
|
510
|
+
<bf:Topic>
|
|
511
|
+
<xsl:if test="$pTopicUri != ''">
|
|
512
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$pTopicUri"/></xsl:attribute>
|
|
513
|
+
</xsl:if>
|
|
514
|
+
<rdf:type>
|
|
515
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,$vMADSClass)"/></xsl:attribute>
|
|
516
|
+
</rdf:type>
|
|
517
|
+
<madsrdf:authoritativeLabel>
|
|
518
|
+
<xsl:if test="$vXmlLang != ''">
|
|
519
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
520
|
+
</xsl:if>
|
|
521
|
+
<xsl:value-of select="$vMADSLabel"/>
|
|
522
|
+
</madsrdf:authoritativeLabel>
|
|
523
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
524
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
525
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
526
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
527
|
+
</xsl:for-each>
|
|
528
|
+
<xsl:if test="$vSource">
|
|
529
|
+
<xsl:copy-of select="$vSource"/>
|
|
530
|
+
</xsl:if>
|
|
531
|
+
<!-- build the ComplexSubject -->
|
|
532
|
+
<madsrdf:componentList rdf:parseType="Collection">
|
|
533
|
+
<xsl:apply-templates select="." mode="work630Hub">
|
|
534
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
535
|
+
<xsl:with-param name="pHubIri" select="$pHubIri"/>
|
|
536
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
537
|
+
<xsl:with-param name="pMADSClass" select="'Title'"/>
|
|
538
|
+
<xsl:with-param name="pMADSLabel">
|
|
539
|
+
<xsl:call-template name="tChopPunct">
|
|
540
|
+
<xsl:with-param name="pString" select="normalize-space($vTitleLabel)"/>
|
|
541
|
+
</xsl:call-template>
|
|
542
|
+
</xsl:with-param>
|
|
543
|
+
<xsl:with-param name="pSource" select="$vSource"/>
|
|
544
|
+
</xsl:apply-templates>
|
|
545
|
+
<xsl:apply-templates select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
546
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
547
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
548
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
549
|
+
</xsl:apply-templates>
|
|
550
|
+
</madsrdf:componentList>
|
|
551
|
+
</bf:Topic>
|
|
552
|
+
</xsl:when>
|
|
553
|
+
<xsl:otherwise>
|
|
554
|
+
<xsl:apply-templates select="." mode="work630Hub">
|
|
555
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
556
|
+
<xsl:with-param name="pHubIri" select="$pHubIri"/>
|
|
557
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
558
|
+
<xsl:with-param name="pMADSClass" select="'Title'"/>
|
|
559
|
+
<xsl:with-param name="pMADSLabel" select="$vMADSLabel"/>
|
|
560
|
+
<xsl:with-param name="pSource" select="$vSource"/>
|
|
561
|
+
</xsl:apply-templates>
|
|
562
|
+
</xsl:otherwise>
|
|
563
|
+
</xsl:choose>
|
|
564
|
+
</bf:subject>
|
|
565
|
+
</xsl:when>
|
|
566
|
+
</xsl:choose>
|
|
567
|
+
</xsl:template>
|
|
568
|
+
|
|
569
|
+
<xsl:template match="marc:datafield" mode="work630Hub">
|
|
570
|
+
<xsl:param name="recordid"/>
|
|
571
|
+
<xsl:param name="pHubIri"/>
|
|
572
|
+
<xsl:param name="pMADSClass"/>
|
|
573
|
+
<xsl:param name="pMADSLabel"/>
|
|
574
|
+
<xsl:param name="pSource"/>
|
|
575
|
+
<xsl:choose>
|
|
576
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
577
|
+
<bf:Hub>
|
|
578
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$pHubIri"/></xsl:attribute>
|
|
579
|
+
<xsl:if test="$pMADSClass != ''">
|
|
580
|
+
<rdf:type>
|
|
581
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,$pMADSClass)"/></xsl:attribute>
|
|
582
|
+
</rdf:type>
|
|
583
|
+
</xsl:if>
|
|
584
|
+
<madsrdf:authoritativeLabel><xsl:value-of select="$pMADSLabel"/></madsrdf:authoritativeLabel>
|
|
585
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
586
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
587
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
588
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
589
|
+
</xsl:for-each>
|
|
590
|
+
<!-- remove creating bf:role
|
|
591
|
+
<xsl:apply-templates select="marc:subfield[@code='e']" mode="contributionRole">
|
|
592
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
593
|
+
<xsl:with-param name="pMode">relationship</xsl:with-param>
|
|
594
|
+
<xsl:with-param name="pRelatedTo"><xsl:value-of select="$recordid"/>#Work</xsl:with-param>
|
|
595
|
+
</xsl:apply-templates>
|
|
596
|
+
<xsl:for-each select="marc:subfield[@code='4']">
|
|
597
|
+
<xsl:variable name="vRelationUri">
|
|
598
|
+
<xsl:choose>
|
|
599
|
+
<xsl:when test="string-length(.) = 3">
|
|
600
|
+
<xsl:variable name="encoded">
|
|
601
|
+
<xsl:call-template name="url-encode">
|
|
602
|
+
<xsl:with-param name="str" select="."/>
|
|
603
|
+
</xsl:call-template>
|
|
604
|
+
</xsl:variable>
|
|
605
|
+
<xsl:value-of select="concat($relators,$encoded)"/>
|
|
606
|
+
</xsl:when>
|
|
607
|
+
<xsl:when test="contains(.,'://')">
|
|
608
|
+
<xsl:value-of select="."/>
|
|
609
|
+
</xsl:when>
|
|
610
|
+
</xsl:choose>
|
|
611
|
+
</xsl:variable>
|
|
612
|
+
<bf:role>
|
|
613
|
+
<bf:Role>
|
|
614
|
+
<xsl:choose>
|
|
615
|
+
<xsl:when test="$vRelationUri != ''">
|
|
616
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$vRelationUri"/></xsl:attribute>
|
|
617
|
+
</xsl:when>
|
|
618
|
+
<xsl:otherwise>
|
|
619
|
+
<bf:code><xsl:value-of select="."/></bf:code>
|
|
620
|
+
</xsl:otherwise>
|
|
621
|
+
</xsl:choose>
|
|
622
|
+
</bf:Role>
|
|
623
|
+
</bf:role>
|
|
624
|
+
</xsl:for-each> -->
|
|
625
|
+
<xsl:apply-templates select="." mode="hubUnifTitle">
|
|
626
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
627
|
+
<xsl:with-param name="pSource" select="$pSource"/>
|
|
628
|
+
</xsl:apply-templates>
|
|
629
|
+
</bf:Hub>
|
|
630
|
+
</xsl:when>
|
|
631
|
+
</xsl:choose>
|
|
632
|
+
</xsl:template>
|
|
633
|
+
|
|
634
|
+
<xsl:template match="marc:datafield[@tag='647' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='647')] |
|
|
635
|
+
marc:datafield[@tag='648' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='648')] |
|
|
636
|
+
marc:datafield[@tag='650' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='650')] |
|
|
637
|
+
marc:datafield[@tag='651' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='651')] |
|
|
638
|
+
marc:datafield[@tag='655' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='655')][@ind1=' ']"
|
|
639
|
+
mode="work">
|
|
640
|
+
<xsl:param name="recordid"/>
|
|
641
|
+
<xsl:param name="pPosition" select="position()"/>
|
|
642
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
643
|
+
<xsl:param name="pHasItem" select="false()"/>
|
|
644
|
+
<!-- note special $5 processing for LoC below -->
|
|
645
|
+
<!-- special processing only for 655 -->
|
|
646
|
+
<xsl:if test="@tag != '655' or $pHasItem or not($localfields and marc:subfield[@code='5'])">
|
|
647
|
+
<xsl:variable name="vDefaultUri">
|
|
648
|
+
<xsl:choose>
|
|
649
|
+
<xsl:when test="@tag='647'">
|
|
650
|
+
<xsl:value-of select="$recordid"/>#Event<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/>
|
|
651
|
+
</xsl:when>
|
|
652
|
+
<xsl:when test="@tag='648'">
|
|
653
|
+
<xsl:value-of select="$recordid"/>#Temporal<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/>
|
|
654
|
+
</xsl:when>
|
|
655
|
+
<xsl:when test="@tag='651'">
|
|
656
|
+
<xsl:value-of select="$recordid"/>#Place<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/>
|
|
657
|
+
</xsl:when>
|
|
658
|
+
<xsl:when test="@tag='655'">
|
|
659
|
+
<xsl:value-of select="$recordid"/>#GenreForm<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/>
|
|
660
|
+
</xsl:when>
|
|
661
|
+
<xsl:otherwise>
|
|
662
|
+
<xsl:value-of select="$recordid"/>#Topic<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/>
|
|
663
|
+
</xsl:otherwise>
|
|
664
|
+
</xsl:choose>
|
|
665
|
+
</xsl:variable>
|
|
666
|
+
<!--
|
|
667
|
+
<xsl:variable name="vTopicUri">
|
|
668
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
669
|
+
<xsl:with-param name="pDefaultUri" select="$vDefaultUri"/>
|
|
670
|
+
</xsl:apply-templates>
|
|
671
|
+
</xsl:variable>
|
|
672
|
+
-->
|
|
673
|
+
<xsl:apply-templates select="." mode="work6XXAuth">
|
|
674
|
+
<xsl:with-param name="pDefaultUri" select="$vDefaultUri"/>
|
|
675
|
+
<xsl:with-param name="recordid" select="$recordid"/>
|
|
676
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
677
|
+
</xsl:apply-templates>
|
|
678
|
+
</xsl:if>
|
|
679
|
+
</xsl:template>
|
|
680
|
+
|
|
681
|
+
<xsl:template match="marc:datafield" mode="work6XXAuth">
|
|
682
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
683
|
+
<xsl:param name="recordid"/>
|
|
684
|
+
<xsl:param name="pDefaultUri"/>
|
|
685
|
+
<xsl:variable name="vTag">
|
|
686
|
+
<xsl:choose>
|
|
687
|
+
<xsl:when test="@tag='880'"><xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/></xsl:when>
|
|
688
|
+
<xsl:otherwise><xsl:value-of select="@tag"/></xsl:otherwise>
|
|
689
|
+
</xsl:choose>
|
|
690
|
+
</xsl:variable>
|
|
691
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
692
|
+
<xsl:variable name="vProp">
|
|
693
|
+
<xsl:choose>
|
|
694
|
+
<xsl:when test="$vTag='655' and not(marc:subfield[@code='v' or @code='x' or @code='y' or @code='z'])">bf:genreForm</xsl:when>
|
|
695
|
+
<xsl:otherwise>bf:subject</xsl:otherwise>
|
|
696
|
+
</xsl:choose>
|
|
697
|
+
</xsl:variable>
|
|
698
|
+
<xsl:variable name="vResource">
|
|
699
|
+
<xsl:choose>
|
|
700
|
+
<xsl:when test="$vTag='651' and not(marc:subfield[@code='v' or @code='x' or @code='y'])">bf:Place</xsl:when>
|
|
701
|
+
<xsl:when test="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">bf:Topic</xsl:when>
|
|
702
|
+
<xsl:when test="$vTag='647'">bf:Event</xsl:when>
|
|
703
|
+
<xsl:when test="$vTag='648'">bf:Temporal</xsl:when>
|
|
704
|
+
<xsl:when test="$vTag='651'">bf:Place</xsl:when>
|
|
705
|
+
<xsl:when test="$vTag='655'">bf:GenreForm</xsl:when>
|
|
706
|
+
<xsl:otherwise>bf:Topic</xsl:otherwise>
|
|
707
|
+
</xsl:choose>
|
|
708
|
+
</xsl:variable>
|
|
709
|
+
<xsl:variable name="resourceUri">
|
|
710
|
+
<xsl:choose>
|
|
711
|
+
<!-- If one of these types, preference the 0. -->
|
|
712
|
+
<xsl:when test="$vResource='bf:Topic' or $vResource='bf:GenreForm' or $vResource='bf:Temporal' or $vResource='bf:Event'">
|
|
713
|
+
<xsl:apply-templates mode="generateUriFrom0" select=".">
|
|
714
|
+
<xsl:with-param name="pDefaultUri" select="$pDefaultUri"/>
|
|
715
|
+
</xsl:apply-templates>
|
|
716
|
+
</xsl:when>
|
|
717
|
+
<!-- If Event, sure, preference the 1. Why not? It's all arbitrary anyways. -->
|
|
718
|
+
<!--
|
|
719
|
+
<xsl:when test="$vResource='bf:Event'">
|
|
720
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
721
|
+
<xsl:with-param name="pDefaultUri" select="$pDefaultUri"/>
|
|
722
|
+
</xsl:apply-templates>
|
|
723
|
+
</xsl:when>
|
|
724
|
+
-->
|
|
725
|
+
<!-- If Place, you bet it is an RWO. Can't be anything else. Nope. -->
|
|
726
|
+
<xsl:when test="$vResource='bf:Place'">
|
|
727
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
728
|
+
<xsl:with-param name="pDefaultUri" select="$pDefaultUri"/>
|
|
729
|
+
</xsl:apply-templates>
|
|
730
|
+
</xsl:when>
|
|
731
|
+
</xsl:choose>
|
|
732
|
+
</xsl:variable>
|
|
733
|
+
<!-- Let's see if there is a dollar 0. This only applies when the resource type uses the dollar 1 as the identifier. -->
|
|
734
|
+
<xsl:variable name="dollar0">
|
|
735
|
+
<xsl:if test="$vResource='bf:Place'">
|
|
736
|
+
<xsl:apply-templates mode="generateUriFrom0" select="." />
|
|
737
|
+
</xsl:if>
|
|
738
|
+
</xsl:variable>
|
|
739
|
+
<!-- Let's see if there is a dollar 1. This only applies when the resource type uses the dollar 0 as the identifier. -->
|
|
740
|
+
<xsl:variable name="dollar1">
|
|
741
|
+
<xsl:if test="$vResource='bf:Topic' or $vResource='bf:GenreForm' or $vResource='bf:Temporal' or $vResource='bf:Event'">
|
|
742
|
+
<xsl:apply-templates mode="generateUriFrom1" select="." />
|
|
743
|
+
</xsl:if>
|
|
744
|
+
</xsl:variable>
|
|
745
|
+
<xsl:variable name="vSourceURI"><xsl:value-of select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/bfsource"/></xsl:variable>
|
|
746
|
+
<xsl:variable name="vMADSClass">
|
|
747
|
+
<xsl:choose>
|
|
748
|
+
<xsl:when test="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">ComplexSubject</xsl:when>
|
|
749
|
+
<xsl:when test="$vTag='648'">Temporal</xsl:when>
|
|
750
|
+
<xsl:when test="$vTag='650'">Topic</xsl:when>
|
|
751
|
+
<xsl:when test="$vTag='651'">Geographic</xsl:when>
|
|
752
|
+
<xsl:when test="$vTag='655'">GenreForm</xsl:when>
|
|
753
|
+
</xsl:choose>
|
|
754
|
+
</xsl:variable>
|
|
755
|
+
<xsl:variable name="vLabel">
|
|
756
|
+
<xsl:call-template name="tChopPunct">
|
|
757
|
+
<xsl:with-param name="pEndPunct" select="'.'" />
|
|
758
|
+
<xsl:with-param name="pString">
|
|
759
|
+
<xsl:choose>
|
|
760
|
+
<xsl:when test="$vTag='647'">
|
|
761
|
+
<xsl:call-template name="tChopPunct">
|
|
762
|
+
<xsl:with-param name="pString">
|
|
763
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('acd', @code)]"/>
|
|
764
|
+
</xsl:with-param>
|
|
765
|
+
</xsl:call-template>
|
|
766
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
767
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
768
|
+
</xsl:for-each>
|
|
769
|
+
</xsl:when>
|
|
770
|
+
<xsl:when test="$vTag='650'">
|
|
771
|
+
<xsl:variable name="tLabel">
|
|
772
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('abcd', @code)]"/>
|
|
773
|
+
</xsl:variable>
|
|
774
|
+
<xsl:value-of select="normalize-space($tLabel)"/>
|
|
775
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
776
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
777
|
+
</xsl:for-each>
|
|
778
|
+
</xsl:when>
|
|
779
|
+
<xsl:when test="$vTag='651'">
|
|
780
|
+
<xsl:variable name="tLabel">
|
|
781
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('ab', @code)]"/>
|
|
782
|
+
</xsl:variable>
|
|
783
|
+
<xsl:value-of select="normalize-space($tLabel)"/>
|
|
784
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
785
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
786
|
+
</xsl:for-each>
|
|
787
|
+
</xsl:when>
|
|
788
|
+
<xsl:otherwise>
|
|
789
|
+
<xsl:variable name="tLabel">
|
|
790
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('a', @code)]"/>
|
|
791
|
+
</xsl:variable>
|
|
792
|
+
<xsl:value-of select="normalize-space($tLabel)"/>
|
|
793
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
794
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
795
|
+
</xsl:for-each>
|
|
796
|
+
</xsl:otherwise>
|
|
797
|
+
</xsl:choose>
|
|
798
|
+
</xsl:with-param>
|
|
799
|
+
</xsl:call-template>
|
|
800
|
+
</xsl:variable>
|
|
801
|
+
|
|
802
|
+
<xsl:variable name="v880Occurrence">
|
|
803
|
+
<xsl:if test="marc:subfield[@code='6'] and not(contains(marc:subfield[@code='6'], '-00'))">
|
|
804
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
805
|
+
</xsl:if>
|
|
806
|
+
</xsl:variable>
|
|
807
|
+
<xsl:variable name="v880Ref">
|
|
808
|
+
<xsl:if test="marc:subfield[@code='6'] and not(contains(marc:subfield[@code='6'], '-00'))">
|
|
809
|
+
<xsl:value-of select="concat($vTag, '-', $v880Occurrence)"/>
|
|
810
|
+
</xsl:if>
|
|
811
|
+
</xsl:variable>
|
|
812
|
+
<xsl:variable name="vRelated880s" select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]" />
|
|
813
|
+
|
|
814
|
+
<xsl:variable name="v880Label">
|
|
815
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
816
|
+
<xsl:for-each select="$vRelated880s">
|
|
817
|
+
<xsl:variable name="vXmlLang880"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
818
|
+
<xsl:variable name="vMADSLabel880">
|
|
819
|
+
<xsl:call-template name="tChopPunct">
|
|
820
|
+
<xsl:with-param name="pEndPunct">
|
|
821
|
+
<xsl:choose>
|
|
822
|
+
<xsl:when test="$vTag='648'"><xsl:value-of select="'-'"/></xsl:when>
|
|
823
|
+
<xsl:otherwise><xsl:value-of select="'-.'"/></xsl:otherwise>
|
|
824
|
+
</xsl:choose>
|
|
825
|
+
</xsl:with-param>
|
|
826
|
+
<xsl:with-param name="pString">
|
|
827
|
+
<xsl:choose>
|
|
828
|
+
<xsl:when test="$vTag='647'">
|
|
829
|
+
<xsl:call-template name="tChopPunct">
|
|
830
|
+
<xsl:with-param name="pString">
|
|
831
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('acd', @code)]"/>
|
|
832
|
+
</xsl:with-param>
|
|
833
|
+
</xsl:call-template>
|
|
834
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
835
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
836
|
+
</xsl:for-each>
|
|
837
|
+
</xsl:when>
|
|
838
|
+
<xsl:when test="$vTag='650'">
|
|
839
|
+
<xsl:variable name="tLabel">
|
|
840
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('abcd', @code)]"/>
|
|
841
|
+
</xsl:variable>
|
|
842
|
+
<xsl:value-of select="normalize-space($tLabel)"/>
|
|
843
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
844
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
845
|
+
</xsl:for-each>
|
|
846
|
+
</xsl:when>
|
|
847
|
+
<xsl:when test="$vTag='651'">
|
|
848
|
+
<xsl:variable name="tLabel">
|
|
849
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('ab', @code)]"/>
|
|
850
|
+
</xsl:variable>
|
|
851
|
+
<xsl:value-of select="normalize-space($tLabel)"/>
|
|
852
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
853
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
854
|
+
</xsl:for-each>
|
|
855
|
+
</xsl:when>
|
|
856
|
+
<xsl:otherwise>
|
|
857
|
+
<xsl:variable name="tLabel">
|
|
858
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('a', @code)]"/>
|
|
859
|
+
</xsl:variable>
|
|
860
|
+
<xsl:value-of select="normalize-space($tLabel)"/>
|
|
861
|
+
<xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
|
|
862
|
+
<xsl:value-of select="concat('--', .)"/>
|
|
863
|
+
</xsl:for-each>
|
|
864
|
+
</xsl:otherwise>
|
|
865
|
+
</xsl:choose>
|
|
866
|
+
</xsl:with-param>
|
|
867
|
+
</xsl:call-template>
|
|
868
|
+
</xsl:variable>
|
|
869
|
+
<xsl:if test="$vMADSLabel880 != ''">
|
|
870
|
+
<madsrdf:authoritativeLabel>
|
|
871
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
872
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
873
|
+
</xsl:if>
|
|
874
|
+
<xsl:value-of select="$vMADSLabel880"/>
|
|
875
|
+
</madsrdf:authoritativeLabel>
|
|
876
|
+
</xsl:if>
|
|
877
|
+
</xsl:for-each>
|
|
878
|
+
</xsl:if>
|
|
879
|
+
</xsl:variable>
|
|
880
|
+
|
|
881
|
+
<xsl:variable name="v880MarcKey">
|
|
882
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
883
|
+
<xsl:for-each select="$vRelated880s">
|
|
884
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey"/></bflc:marcKey>
|
|
885
|
+
</xsl:for-each>
|
|
886
|
+
</xsl:if>
|
|
887
|
+
</xsl:variable>
|
|
888
|
+
|
|
889
|
+
<xsl:choose>
|
|
890
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
891
|
+
<xsl:element name="{$vProp}">
|
|
892
|
+
<xsl:element name="{$vResource}">
|
|
893
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$resourceUri" /></xsl:attribute>
|
|
894
|
+
<xsl:if test="$vMADSClass != ''">
|
|
895
|
+
<rdf:type>
|
|
896
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,$vMADSClass)"/></xsl:attribute>
|
|
897
|
+
</rdf:type>
|
|
898
|
+
</xsl:if>
|
|
899
|
+
<rdfs:label>
|
|
900
|
+
<xsl:if test="$vXmlLang != ''">
|
|
901
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
902
|
+
</xsl:if>
|
|
903
|
+
<xsl:value-of select="$vLabel"/>
|
|
904
|
+
</rdfs:label>
|
|
905
|
+
<madsrdf:authoritativeLabel>
|
|
906
|
+
<xsl:if test="$vXmlLang != ''">
|
|
907
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
908
|
+
</xsl:if>
|
|
909
|
+
<xsl:value-of select="$vLabel"/>
|
|
910
|
+
</madsrdf:authoritativeLabel>
|
|
911
|
+
<xsl:copy-of select="$v880Label" />
|
|
912
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
913
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
914
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
915
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
916
|
+
</xsl:for-each>
|
|
917
|
+
<!-- build the ComplexSubject -->
|
|
918
|
+
<xsl:if test="$vMADSClass='ComplexSubject'">
|
|
919
|
+
<madsrdf:componentList rdf:parseType="Collection">
|
|
920
|
+
<xsl:choose>
|
|
921
|
+
<xsl:when test="$vTag='647'">
|
|
922
|
+
<bf:Event>
|
|
923
|
+
<xsl:variable name="vL">
|
|
924
|
+
<xsl:call-template name="tChopPunct">
|
|
925
|
+
<xsl:with-param name="pString">
|
|
926
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('acd', @code)]"/>
|
|
927
|
+
</xsl:with-param>
|
|
928
|
+
</xsl:call-template>
|
|
929
|
+
</xsl:variable>
|
|
930
|
+
<madsrdf:authoritativeLabel><xsl:value-of select="$vL"/></madsrdf:authoritativeLabel>
|
|
931
|
+
<rdfs:label><xsl:value-of select="$vL"/></rdfs:label>
|
|
932
|
+
<xsl:if test="marc:subfield[contains('cd', @code)]">
|
|
933
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey" /></bflc:marcKey>
|
|
934
|
+
</xsl:if>
|
|
935
|
+
</bf:Event>
|
|
936
|
+
<xsl:apply-templates select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
937
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
938
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
939
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
940
|
+
</xsl:apply-templates>
|
|
941
|
+
</xsl:when>
|
|
942
|
+
<xsl:when test="$vTag='650'">
|
|
943
|
+
<madsrdf:Topic>
|
|
944
|
+
<xsl:variable name="vL">
|
|
945
|
+
<xsl:call-template name="tChopPunct">
|
|
946
|
+
<xsl:with-param name="pString">
|
|
947
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('abcd', @code)]"/>
|
|
948
|
+
</xsl:with-param>
|
|
949
|
+
</xsl:call-template>
|
|
950
|
+
</xsl:variable>
|
|
951
|
+
<madsrdf:authoritativeLabel><xsl:value-of select="$vL"/></madsrdf:authoritativeLabel>
|
|
952
|
+
<xsl:if test="marc:subfield[contains('bcd', @code)]">
|
|
953
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey" /></bflc:marcKey>
|
|
954
|
+
</xsl:if>
|
|
955
|
+
</madsrdf:Topic>
|
|
956
|
+
<xsl:apply-templates select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
957
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
958
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
959
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
960
|
+
<xsl:with-param name="pRelated880s" select="$vRelated880s" />
|
|
961
|
+
</xsl:apply-templates>
|
|
962
|
+
</xsl:when>
|
|
963
|
+
<xsl:when test="$vTag='651'">
|
|
964
|
+
<madsrdf:Geographic>
|
|
965
|
+
<xsl:variable name="vL">
|
|
966
|
+
<xsl:call-template name="tChopPunct">
|
|
967
|
+
<xsl:with-param name="pString">
|
|
968
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[contains('ab', @code)]"/>
|
|
969
|
+
</xsl:with-param>
|
|
970
|
+
</xsl:call-template>
|
|
971
|
+
</xsl:variable>
|
|
972
|
+
<madsrdf:authoritativeLabel><xsl:value-of select="$vL"/></madsrdf:authoritativeLabel>
|
|
973
|
+
<xsl:if test="marc:subfield[contains('b', @code)]">
|
|
974
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey" /></bflc:marcKey>
|
|
975
|
+
</xsl:if>
|
|
976
|
+
</madsrdf:Geographic>
|
|
977
|
+
<xsl:apply-templates select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
978
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
979
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
980
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
981
|
+
<xsl:with-param name="pRelated880s" select="$vRelated880s" />
|
|
982
|
+
</xsl:apply-templates>
|
|
983
|
+
</xsl:when>
|
|
984
|
+
<xsl:otherwise>
|
|
985
|
+
<xsl:apply-templates select="marc:subfield[@code='a' or @code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
986
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
987
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
988
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
989
|
+
<xsl:with-param name="pRelated880s" select="$vRelated880s" />
|
|
990
|
+
</xsl:apply-templates>
|
|
991
|
+
</xsl:otherwise>
|
|
992
|
+
</xsl:choose>
|
|
993
|
+
</madsrdf:componentList>
|
|
994
|
+
</xsl:if>
|
|
995
|
+
<xsl:for-each select="marc:subfield[@code='g']">
|
|
996
|
+
<bf:note>
|
|
997
|
+
<bf:Note>
|
|
998
|
+
<rdfs:label>
|
|
999
|
+
<xsl:if test="$vXmlLang != ''">
|
|
1000
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
1001
|
+
</xsl:if>
|
|
1002
|
+
<xsl:call-template name="tChopPunct">
|
|
1003
|
+
<xsl:with-param name="pString" select="."/>
|
|
1004
|
+
</xsl:call-template>
|
|
1005
|
+
</rdfs:label>
|
|
1006
|
+
</bf:Note>
|
|
1007
|
+
</bf:note>
|
|
1008
|
+
</xsl:for-each>
|
|
1009
|
+
<xsl:choose>
|
|
1010
|
+
<xsl:when test="$vSourceURI != ''">
|
|
1011
|
+
<bf:source>
|
|
1012
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$vSourceURI"/></xsl:attribute>
|
|
1013
|
+
</bf:source>
|
|
1014
|
+
</xsl:when>
|
|
1015
|
+
<xsl:when test="@ind2='4' or @ind2='7'">
|
|
1016
|
+
<xsl:variable name="vVocabStem">
|
|
1017
|
+
<xsl:choose>
|
|
1018
|
+
<xsl:when test="$vTag='655'"><xsl:value-of select="$genreFormSchemes"/></xsl:when>
|
|
1019
|
+
<xsl:otherwise><xsl:value-of select="$subjectSchemes"/></xsl:otherwise>
|
|
1020
|
+
</xsl:choose>
|
|
1021
|
+
</xsl:variable>
|
|
1022
|
+
<xsl:apply-templates select="marc:subfield[@code='2']" mode="subfield2">
|
|
1023
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1024
|
+
<xsl:with-param name="pVocabStem" select="$vVocabStem"/>
|
|
1025
|
+
</xsl:apply-templates>
|
|
1026
|
+
</xsl:when>
|
|
1027
|
+
</xsl:choose>
|
|
1028
|
+
<!-- remove creating bf:role
|
|
1029
|
+
<xsl:for-each select="marc:subfield[@code='e']">
|
|
1030
|
+
<bf:role>
|
|
1031
|
+
<bf:Role>
|
|
1032
|
+
<rdfs:label>
|
|
1033
|
+
<xsl:call-template name="tChopPunct">
|
|
1034
|
+
<xsl:with-param name="pString" select="."/>
|
|
1035
|
+
</xsl:call-template>
|
|
1036
|
+
</rdfs:label>
|
|
1037
|
+
</bf:Role>
|
|
1038
|
+
</bf:role>
|
|
1039
|
+
</xsl:for-each> -->
|
|
1040
|
+
<xsl:if test="$dollar0 != '' and $dollar0 != $resourceUri">
|
|
1041
|
+
<madsrdf:isIdentifiedByAuthority>
|
|
1042
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$dollar0"/></xsl:attribute>
|
|
1043
|
+
</madsrdf:isIdentifiedByAuthority>
|
|
1044
|
+
</xsl:if>
|
|
1045
|
+
<xsl:if test="$dollar1 != '' and $dollar1 != $resourceUri">
|
|
1046
|
+
<madsrdf:identifiesRWO>
|
|
1047
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$dollar1"/></xsl:attribute>
|
|
1048
|
+
</madsrdf:identifiesRWO>
|
|
1049
|
+
</xsl:if>
|
|
1050
|
+
<xsl:for-each select="marc:subfield[@code='0' or @code='w']">
|
|
1051
|
+
<xsl:if test="substring(text(),1,5) != '(uri)' and substring(text(),1,4) != 'http' and not(contains(text(), '(OCoLC)fst'))">
|
|
1052
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
1053
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1054
|
+
</xsl:apply-templates>
|
|
1055
|
+
</xsl:if>
|
|
1056
|
+
</xsl:for-each>
|
|
1057
|
+
<xsl:apply-templates mode="subfield3" select="marc:subfield[@code='3']">
|
|
1058
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1059
|
+
</xsl:apply-templates>
|
|
1060
|
+
<xsl:apply-templates mode="subfield5" select="marc:subfield[@code='5']">
|
|
1061
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1062
|
+
</xsl:apply-templates>
|
|
1063
|
+
<xsl:if test="$vResource='bf:Event'">
|
|
1064
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey" /></bflc:marcKey>
|
|
1065
|
+
</xsl:if>
|
|
1066
|
+
</xsl:element>
|
|
1067
|
+
</xsl:element>
|
|
1068
|
+
</xsl:when>
|
|
1069
|
+
</xsl:choose>
|
|
1070
|
+
</xsl:template>
|
|
1071
|
+
|
|
1072
|
+
<xsl:template match="marc:datafield[@tag='653' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='653')]" mode="work">
|
|
1073
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
1074
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
1075
|
+
<xsl:variable name="vProp">
|
|
1076
|
+
<xsl:choose>
|
|
1077
|
+
<xsl:when test="@ind2='6'">bf:genreForm</xsl:when>
|
|
1078
|
+
<xsl:otherwise>bf:subject</xsl:otherwise>
|
|
1079
|
+
</xsl:choose>
|
|
1080
|
+
</xsl:variable>
|
|
1081
|
+
<xsl:variable name="vResource">
|
|
1082
|
+
<xsl:choose>
|
|
1083
|
+
<xsl:when test="@ind2='1'">bf:Person</xsl:when>
|
|
1084
|
+
<xsl:when test="@ind2='2'">bf:Organization</xsl:when>
|
|
1085
|
+
<xsl:when test="@ind2='3'">bf:Meeting</xsl:when>
|
|
1086
|
+
<xsl:when test="@ind2='4'">bf:Temporal</xsl:when>
|
|
1087
|
+
<xsl:when test="@ind2='5'">bf:Place</xsl:when>
|
|
1088
|
+
<xsl:when test="@ind2='6'">bf:GenreForm</xsl:when>
|
|
1089
|
+
<xsl:otherwise>bf:Topic</xsl:otherwise>
|
|
1090
|
+
</xsl:choose>
|
|
1091
|
+
</xsl:variable>
|
|
1092
|
+
<xsl:choose>
|
|
1093
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
1094
|
+
<xsl:for-each select="marc:subfield[@code='a']">
|
|
1095
|
+
<xsl:element name="{$vProp}">
|
|
1096
|
+
<xsl:element name="{$vResource}">
|
|
1097
|
+
<xsl:if test="../marc:subfield[@code='0' or @code='w'][starts-with(text(),'(uri)') or starts-with(text(),'http')]">
|
|
1098
|
+
<xsl:attribute name="rdf:about">
|
|
1099
|
+
<xsl:apply-templates mode="generateUri" select="../marc:subfield[@code='0' or @code='w'][starts-with(text(),'(uri)') or starts-with(text(),'http')]">
|
|
1100
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1101
|
+
</xsl:apply-templates>
|
|
1102
|
+
</xsl:attribute>
|
|
1103
|
+
</xsl:if>
|
|
1104
|
+
<rdf:type rdf:resource="http://id.loc.gov/ontologies/bflc/Uncontrolled" />
|
|
1105
|
+
<rdfs:label>
|
|
1106
|
+
<xsl:if test="$vXmlLang != ''">
|
|
1107
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
1108
|
+
</xsl:if>
|
|
1109
|
+
<xsl:call-template name="tChopPunct">
|
|
1110
|
+
<xsl:with-param name="pString" select="."/>
|
|
1111
|
+
</xsl:call-template>
|
|
1112
|
+
</rdfs:label>
|
|
1113
|
+
<xsl:apply-templates mode="subfield5" select="../marc:subfield[@code='5']">
|
|
1114
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1115
|
+
</xsl:apply-templates>
|
|
1116
|
+
</xsl:element>
|
|
1117
|
+
</xsl:element>
|
|
1118
|
+
</xsl:for-each>
|
|
1119
|
+
</xsl:when>
|
|
1120
|
+
</xsl:choose>
|
|
1121
|
+
</xsl:template>
|
|
1122
|
+
|
|
1123
|
+
<xsl:template match="marc:datafield[@tag='656' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='656')]" mode="work">
|
|
1124
|
+
<xsl:param name="recordid"/>
|
|
1125
|
+
<xsl:param name="pPosition" select="position()"/>
|
|
1126
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
1127
|
+
<xsl:variable name="vDefaultUri">
|
|
1128
|
+
<xsl:value-of select="$recordid"/>#Topic<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/>
|
|
1129
|
+
</xsl:variable>
|
|
1130
|
+
<xsl:variable name="vTag">
|
|
1131
|
+
<xsl:choose>
|
|
1132
|
+
<xsl:when test="@tag='880'"><xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/></xsl:when>
|
|
1133
|
+
<xsl:otherwise><xsl:value-of select="@tag"/></xsl:otherwise>
|
|
1134
|
+
</xsl:choose>
|
|
1135
|
+
</xsl:variable>
|
|
1136
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
1137
|
+
<xsl:variable name="vLabel">
|
|
1138
|
+
<xsl:call-template name="tChopPunct">
|
|
1139
|
+
<xsl:with-param name="pEndPunct" select="'-'"/>
|
|
1140
|
+
<xsl:with-param name="pString">
|
|
1141
|
+
<xsl:for-each select="marc:subfield[@code='a' or @code='z']">
|
|
1142
|
+
<xsl:value-of select="concat(.,'--')"/>
|
|
1143
|
+
</xsl:for-each>
|
|
1144
|
+
</xsl:with-param>
|
|
1145
|
+
</xsl:call-template>
|
|
1146
|
+
</xsl:variable>
|
|
1147
|
+
<xsl:variable name="vTopicUri">
|
|
1148
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
1149
|
+
<xsl:with-param name="pDefaultUri" select="$vDefaultUri"/>
|
|
1150
|
+
</xsl:apply-templates>
|
|
1151
|
+
</xsl:variable>
|
|
1152
|
+
|
|
1153
|
+
<xsl:variable name="v880Occurrence">
|
|
1154
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
1155
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
1156
|
+
</xsl:if>
|
|
1157
|
+
</xsl:variable>
|
|
1158
|
+
<xsl:variable name="v880Ref">
|
|
1159
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
1160
|
+
<xsl:value-of select="concat($vTag, '-', $v880Occurrence)"/>
|
|
1161
|
+
</xsl:if>
|
|
1162
|
+
</xsl:variable>
|
|
1163
|
+
<xsl:variable name="vRelated880s" select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]" />
|
|
1164
|
+
|
|
1165
|
+
<xsl:variable name="v880Label">
|
|
1166
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
1167
|
+
<xsl:for-each select="$vRelated880s">
|
|
1168
|
+
<xsl:variable name="vXmlLang880"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
1169
|
+
<xsl:variable name="vMADSLabel880">
|
|
1170
|
+
<xsl:call-template name="tChopPunct">
|
|
1171
|
+
<xsl:with-param name="pEndPunct" select="'-'"/>
|
|
1172
|
+
<xsl:with-param name="pString">
|
|
1173
|
+
<xsl:for-each select="marc:subfield[@code='a' or @code='z']">
|
|
1174
|
+
<xsl:value-of select="concat(.,'--')"/>
|
|
1175
|
+
</xsl:for-each>
|
|
1176
|
+
</xsl:with-param>
|
|
1177
|
+
</xsl:call-template>
|
|
1178
|
+
</xsl:variable>
|
|
1179
|
+
<xsl:if test="$vMADSLabel880 != ''">
|
|
1180
|
+
<madsrdf:authoritativeLabel>
|
|
1181
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
1182
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
1183
|
+
</xsl:if>
|
|
1184
|
+
<xsl:value-of select="$vMADSLabel880"/>
|
|
1185
|
+
</madsrdf:authoritativeLabel>
|
|
1186
|
+
</xsl:if>
|
|
1187
|
+
</xsl:for-each>
|
|
1188
|
+
</xsl:if>
|
|
1189
|
+
</xsl:variable>
|
|
1190
|
+
|
|
1191
|
+
<xsl:variable name="v880MarcKey">
|
|
1192
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
1193
|
+
<xsl:for-each select="$vRelated880s">
|
|
1194
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey"/></bflc:marcKey>
|
|
1195
|
+
</xsl:for-each>
|
|
1196
|
+
</xsl:if>
|
|
1197
|
+
</xsl:variable>
|
|
1198
|
+
|
|
1199
|
+
<xsl:choose>
|
|
1200
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
1201
|
+
<bf:subject>
|
|
1202
|
+
<bf:Topic>
|
|
1203
|
+
<xsl:if test="$vTopicUri != ''">
|
|
1204
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$vTopicUri"/></xsl:attribute>
|
|
1205
|
+
</xsl:if>
|
|
1206
|
+
<rdf:type>
|
|
1207
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,'ComplexSubject')"/></xsl:attribute>
|
|
1208
|
+
</rdf:type>
|
|
1209
|
+
<rdfs:label>
|
|
1210
|
+
<xsl:if test="$vXmlLang != ''">
|
|
1211
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
1212
|
+
</xsl:if>
|
|
1213
|
+
<xsl:value-of select="$vLabel"/>
|
|
1214
|
+
</rdfs:label>
|
|
1215
|
+
<madsrdf:componentList rdf:parseType="Collection">
|
|
1216
|
+
<xsl:apply-templates select="marc:subfield[@code='a' or @code='k' or @code='v' or @code='x' or @code='y' or @code='z']" mode="complexSubject">
|
|
1217
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1218
|
+
<xsl:with-param name="pTag" select="$vTag"/>
|
|
1219
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
1220
|
+
<xsl:with-param name="pRelated880s" select="$vRelated880s" />
|
|
1221
|
+
</xsl:apply-templates>
|
|
1222
|
+
</madsrdf:componentList>
|
|
1223
|
+
<xsl:for-each select="marc:subfield[@code='0' or @code='w'][starts-with(text(),'(uri)') or starts-with(text(),'http')]">
|
|
1224
|
+
<xsl:if test="position() != 1">
|
|
1225
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
1226
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1227
|
+
</xsl:apply-templates>
|
|
1228
|
+
</xsl:if>
|
|
1229
|
+
</xsl:for-each>
|
|
1230
|
+
<xsl:for-each select="marc:subfield[@code='0' or @code='w']">
|
|
1231
|
+
<xsl:if test="substring(text(),1,5) != '(uri)' and substring(text(),1,4) != 'http' and substring(text(),1,10) != '(OCoLC)fst'">
|
|
1232
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
1233
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1234
|
+
</xsl:apply-templates>
|
|
1235
|
+
</xsl:if>
|
|
1236
|
+
</xsl:for-each>
|
|
1237
|
+
<xsl:apply-templates select="marc:subfield[@code='2']" mode="subfield2">
|
|
1238
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1239
|
+
</xsl:apply-templates>
|
|
1240
|
+
<xsl:apply-templates select="marc:subfield[@code='3']" mode="subfield3">
|
|
1241
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1242
|
+
</xsl:apply-templates>
|
|
1243
|
+
</bf:Topic>
|
|
1244
|
+
</bf:subject>
|
|
1245
|
+
</xsl:when>
|
|
1246
|
+
</xsl:choose>
|
|
1247
|
+
</xsl:template>
|
|
1248
|
+
|
|
1249
|
+
<xsl:template match="marc:datafield[@tag='662' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='662')]" mode="work">
|
|
1250
|
+
<xsl:param name="recordid"/>
|
|
1251
|
+
<xsl:param name="pPosition" select="position()"/>
|
|
1252
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
1253
|
+
<xsl:variable name="vDefaultUri">
|
|
1254
|
+
<xsl:value-of select="$recordid"/>#Place<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/>
|
|
1255
|
+
</xsl:variable>
|
|
1256
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
1257
|
+
<xsl:variable name="vLabel">
|
|
1258
|
+
<xsl:call-template name="tChopPunct">
|
|
1259
|
+
<xsl:with-param name="pEndPunct" select="'-'"/>
|
|
1260
|
+
<xsl:with-param name="pString">
|
|
1261
|
+
<xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c' or @code='d' or @code='f' or @code='g' or @code='h']">
|
|
1262
|
+
<xsl:value-of select="concat(.,'--')"/>
|
|
1263
|
+
</xsl:for-each>
|
|
1264
|
+
</xsl:with-param>
|
|
1265
|
+
</xsl:call-template>
|
|
1266
|
+
</xsl:variable>
|
|
1267
|
+
<xsl:variable name="vPlaceUri">
|
|
1268
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
1269
|
+
<xsl:with-param name="pDefaultUri" select="$vDefaultUri"/>
|
|
1270
|
+
</xsl:apply-templates>
|
|
1271
|
+
</xsl:variable>
|
|
1272
|
+
<xsl:choose>
|
|
1273
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
1274
|
+
<bf:subject>
|
|
1275
|
+
<bf:Place>
|
|
1276
|
+
<xsl:if test="$vPlaceUri != ''">
|
|
1277
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$vPlaceUri"/></xsl:attribute>
|
|
1278
|
+
</xsl:if>
|
|
1279
|
+
<rdf:type>
|
|
1280
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,'HierarchicalGeographic')"/></xsl:attribute>
|
|
1281
|
+
</rdf:type>
|
|
1282
|
+
<rdfs:label>
|
|
1283
|
+
<xsl:if test="$vXmlLang != ''">
|
|
1284
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
1285
|
+
</xsl:if>
|
|
1286
|
+
<xsl:value-of select="$vLabel"/>
|
|
1287
|
+
</rdfs:label>
|
|
1288
|
+
<madsrdf:componentList rdf:parseType="Collection">
|
|
1289
|
+
<xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c' or @code='d' or @code='f' or @code='g' or @code='h']">
|
|
1290
|
+
<xsl:variable name="vResource">
|
|
1291
|
+
<xsl:choose>
|
|
1292
|
+
<xsl:when test="@code='a'">madsrdf:Country</xsl:when>
|
|
1293
|
+
<xsl:when test="@code='b'">madsrdf:State</xsl:when>
|
|
1294
|
+
<xsl:when test="@code='c'">madsrdf:County</xsl:when>
|
|
1295
|
+
<xsl:when test="@code='d'">madsrdf:City</xsl:when>
|
|
1296
|
+
<xsl:when test="@code='f'">madsrdf:CitySection</xsl:when>
|
|
1297
|
+
<xsl:when test="@code='g'">madsrdf:Region</xsl:when>
|
|
1298
|
+
<xsl:when test="@code='h'">madsrdf:ExtraterrestrialArea</xsl:when>
|
|
1299
|
+
</xsl:choose>
|
|
1300
|
+
</xsl:variable>
|
|
1301
|
+
<xsl:element name="{$vResource}">
|
|
1302
|
+
<rdfs:label>
|
|
1303
|
+
<xsl:if test="$vXmlLang != ''">
|
|
1304
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
1305
|
+
</xsl:if>
|
|
1306
|
+
<xsl:call-template name="tChopPunct">
|
|
1307
|
+
<xsl:with-param name="pString" select="."/>
|
|
1308
|
+
</xsl:call-template>
|
|
1309
|
+
</rdfs:label>
|
|
1310
|
+
</xsl:element>
|
|
1311
|
+
</xsl:for-each>
|
|
1312
|
+
</madsrdf:componentList>
|
|
1313
|
+
<!-- remove creating bf:role
|
|
1314
|
+
<xsl:for-each select="marc:subfield[@code='e']">
|
|
1315
|
+
<bf:role>
|
|
1316
|
+
<bf:Role>
|
|
1317
|
+
<rdfs:label>
|
|
1318
|
+
<xsl:call-template name="tChopPunct">
|
|
1319
|
+
<xsl:with-param name="pString" select="."/>
|
|
1320
|
+
</xsl:call-template>
|
|
1321
|
+
</rdfs:label>
|
|
1322
|
+
</bf:Role>
|
|
1323
|
+
</bf:role>
|
|
1324
|
+
</xsl:for-each> -->
|
|
1325
|
+
<xsl:for-each select="marc:subfield[@code='0' or @code='w'][starts-with(text(),'(uri)') or starts-with(text(),'http')]">
|
|
1326
|
+
<xsl:if test="position() != 1">
|
|
1327
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
1328
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1329
|
+
</xsl:apply-templates>
|
|
1330
|
+
</xsl:if>
|
|
1331
|
+
</xsl:for-each>
|
|
1332
|
+
<xsl:for-each select="marc:subfield[@code='0' or @code='w']">
|
|
1333
|
+
<xsl:if test="substring(text(),1,5) != '(uri)' and substring(text(),1,4) != 'http'">
|
|
1334
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
1335
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1336
|
+
</xsl:apply-templates>
|
|
1337
|
+
</xsl:if>
|
|
1338
|
+
</xsl:for-each>
|
|
1339
|
+
<xsl:apply-templates select="marc:subfield[@code='2']" mode="subfield2">
|
|
1340
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1341
|
+
<xsl:with-param name="pVocabStem" select="$subjectSchemes"/>
|
|
1342
|
+
</xsl:apply-templates>
|
|
1343
|
+
</bf:Place>
|
|
1344
|
+
</bf:subject>
|
|
1345
|
+
</xsl:when>
|
|
1346
|
+
</xsl:choose>
|
|
1347
|
+
</xsl:template>
|
|
1348
|
+
|
|
1349
|
+
<xsl:template match="marc:subfield" mode="complexSubject">
|
|
1350
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
1351
|
+
<xsl:param name="pTag"/>
|
|
1352
|
+
<xsl:param name="pXmlLang"/>
|
|
1353
|
+
<xsl:param name="pRelated880s"/>
|
|
1354
|
+
<xsl:variable name="vLabelProp">
|
|
1355
|
+
<xsl:choose>
|
|
1356
|
+
<xsl:when test="$pTag='656'">rdfs:label</xsl:when>
|
|
1357
|
+
<xsl:otherwise>madsrdf:authoritativeLabel</xsl:otherwise>
|
|
1358
|
+
</xsl:choose>
|
|
1359
|
+
</xsl:variable>
|
|
1360
|
+
<xsl:variable name="vMADSClass">
|
|
1361
|
+
<xsl:choose>
|
|
1362
|
+
<xsl:when test="@code='v'">madsrdf:GenreForm</xsl:when>
|
|
1363
|
+
<xsl:when test="@code='x'">madsrdf:Topic</xsl:when>
|
|
1364
|
+
<xsl:when test="@code='y'">madsrdf:Temporal</xsl:when>
|
|
1365
|
+
<xsl:when test="@code='z'">madsrdf:Geographic</xsl:when>
|
|
1366
|
+
<xsl:when test="$pTag='647'">bf:Event</xsl:when>
|
|
1367
|
+
<xsl:when test="$pTag='648'">madsrdf:Temporal</xsl:when>
|
|
1368
|
+
<xsl:when test="$pTag='650'">
|
|
1369
|
+
<xsl:choose>
|
|
1370
|
+
<xsl:when test="@code='c'">madsrdf:Geographic</xsl:when>
|
|
1371
|
+
<xsl:when test="@code='d'">madsrdf:Temporal</xsl:when>
|
|
1372
|
+
<xsl:otherwise>madsrdf:Topic</xsl:otherwise>
|
|
1373
|
+
</xsl:choose>
|
|
1374
|
+
</xsl:when>
|
|
1375
|
+
<xsl:when test="$pTag='651'">madsrdf:Geographic</xsl:when>
|
|
1376
|
+
<xsl:when test="$pTag='655'">madsrdf:GenreForm</xsl:when>
|
|
1377
|
+
<xsl:when test="$pTag='656'">
|
|
1378
|
+
<xsl:choose>
|
|
1379
|
+
<xsl:when test="@code='a'">madsrdf:Occupation</xsl:when>
|
|
1380
|
+
<xsl:when test="@code='k'">madsrdf:GenreForm</xsl:when>
|
|
1381
|
+
</xsl:choose>
|
|
1382
|
+
</xsl:when>
|
|
1383
|
+
</xsl:choose>
|
|
1384
|
+
</xsl:variable>
|
|
1385
|
+
<xsl:choose>
|
|
1386
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
1387
|
+
<xsl:element name="{$vMADSClass}">
|
|
1388
|
+
<xsl:element name="{$vLabelProp}">
|
|
1389
|
+
<xsl:if test="$pXmlLang != ''">
|
|
1390
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
1391
|
+
</xsl:if>
|
|
1392
|
+
<xsl:call-template name="tChopPunct">
|
|
1393
|
+
<xsl:with-param name="pString" select="."/>
|
|
1394
|
+
</xsl:call-template>
|
|
1395
|
+
</xsl:element>
|
|
1396
|
+
<xsl:if test="$pRelated880s != ''">
|
|
1397
|
+
<xsl:variable name="vThisCode" select="@code"/>
|
|
1398
|
+
<xsl:if test="@code='a' or ($pTag='650' and (@code='c' or @code='d'))">
|
|
1399
|
+
<xsl:for-each select="$pRelated880s">
|
|
1400
|
+
<xsl:variable name="vXmlLang880"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
1401
|
+
<xsl:element name="{$vLabelProp}">
|
|
1402
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
1403
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880" /></xsl:attribute>
|
|
1404
|
+
</xsl:if>
|
|
1405
|
+
<xsl:call-template name="tChopPunct">
|
|
1406
|
+
<xsl:with-param name="pString" select="marc:subfield[@code=$vThisCode][1]"/>
|
|
1407
|
+
</xsl:call-template>
|
|
1408
|
+
</xsl:element>
|
|
1409
|
+
</xsl:for-each>
|
|
1410
|
+
</xsl:if>
|
|
1411
|
+
</xsl:if>
|
|
1412
|
+
</xsl:element>
|
|
1413
|
+
</xsl:when>
|
|
1414
|
+
</xsl:choose>
|
|
1415
|
+
</xsl:template>
|
|
1416
|
+
|
|
1417
|
+
</xsl:stylesheet>
|