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,135 @@
|
|
|
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
|
+
<!-- Conversion specs for 460-468 - Series treatment -->
|
|
13
|
+
|
|
14
|
+
<xsl:template match="marc:datafield[@tag='462' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='462')] |
|
|
15
|
+
marc:datafield[@tag='463' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='463')] |
|
|
16
|
+
marc:datafield[@tag='464' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='464')] |
|
|
17
|
+
marc:datafield[@tag='465' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='465')] |
|
|
18
|
+
marc:datafield[@tag='466' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='466')] |
|
|
19
|
+
marc:datafield[@tag='467' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='467')] |
|
|
20
|
+
marc:datafield[@tag='468' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='468')]"
|
|
21
|
+
mode="work">
|
|
22
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
23
|
+
<xsl:variable name="vTag">
|
|
24
|
+
<xsl:choose>
|
|
25
|
+
<xsl:when test="@tag='880'"><xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/></xsl:when>
|
|
26
|
+
<xsl:otherwise><xsl:value-of select="@tag"/></xsl:otherwise>
|
|
27
|
+
</xsl:choose>
|
|
28
|
+
</xsl:variable>
|
|
29
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
30
|
+
<xsl:variable name="vClass">
|
|
31
|
+
<xsl:choose>
|
|
32
|
+
<xsl:when test="$vTag='462'">bflc:SeriesSequentialDesignation</xsl:when>
|
|
33
|
+
<xsl:when test="$vTag='463'">bflc:SeriesNumberingPeculiarities</xsl:when>
|
|
34
|
+
<xsl:when test="$vTag='464'">bflc:SeriesNumbering</xsl:when>
|
|
35
|
+
<xsl:when test="$vTag='465'">bflc:SeriesProvider</xsl:when>
|
|
36
|
+
<xsl:when test="$vTag='466'">bflc:SeriesAnalysis</xsl:when>
|
|
37
|
+
<xsl:when test="$vTag='467'">bflc:SeriesTracing</xsl:when>
|
|
38
|
+
<xsl:when test="$vTag='468'">bflc:SeriesClassification</xsl:when>
|
|
39
|
+
</xsl:choose>
|
|
40
|
+
</xsl:variable>
|
|
41
|
+
<xsl:variable name="vCode">
|
|
42
|
+
<xsl:if test="$vTag='466' or $vTag='467' or $vTag='468'">
|
|
43
|
+
<xsl:value-of select="marc:subfield[@code='a']"/>
|
|
44
|
+
</xsl:if>
|
|
45
|
+
</xsl:variable>
|
|
46
|
+
<xsl:variable name="vLabel">
|
|
47
|
+
<xsl:choose>
|
|
48
|
+
<!-- no label for 465 -->
|
|
49
|
+
<xsl:when test="$vTag='465'"/>
|
|
50
|
+
<xsl:when test="$vTag='466'">
|
|
51
|
+
<xsl:choose>
|
|
52
|
+
<xsl:when test="marc:subfield[@code='a']='f'">analyzed in full</xsl:when>
|
|
53
|
+
<xsl:when test="marc:subfield[@code='a']='p'">analyzed in part</xsl:when>
|
|
54
|
+
<xsl:when test="marc:subfield[@code='a']='n'">not analyzed</xsl:when>
|
|
55
|
+
</xsl:choose>
|
|
56
|
+
</xsl:when>
|
|
57
|
+
<xsl:when test="$vTag='467'">
|
|
58
|
+
<xsl:choose>
|
|
59
|
+
<xsl:when test="marc:subfield[@code='a']='t'">traced</xsl:when>
|
|
60
|
+
<xsl:when test="marc:subfield[@code='a']='n'">not traced</xsl:when>
|
|
61
|
+
</xsl:choose>
|
|
62
|
+
</xsl:when>
|
|
63
|
+
<xsl:when test="$vTag='468'">
|
|
64
|
+
<xsl:choose>
|
|
65
|
+
<xsl:when test="marc:subfield[@code='a']='c'">classed together</xsl:when>
|
|
66
|
+
<xsl:when test="marc:subfield[@code='a']='m'">classed with main or other series</xsl:when>
|
|
67
|
+
<xsl:when test="marc:subfield[@code='a']='s'">classed separately</xsl:when>
|
|
68
|
+
</xsl:choose>
|
|
69
|
+
</xsl:when>
|
|
70
|
+
<xsl:otherwise><xsl:value-of select="marc:subfield[@code='a']"/></xsl:otherwise>
|
|
71
|
+
</xsl:choose>
|
|
72
|
+
</xsl:variable>
|
|
73
|
+
<xsl:variable name="vPart"><xsl:value-of select="marc:subfield[@code='d']"/></xsl:variable>
|
|
74
|
+
<xsl:variable name="vSource"><xsl:value-of select="marc:subfield[@code='z']"/></xsl:variable>
|
|
75
|
+
<xsl:choose>
|
|
76
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
77
|
+
<bflc:seriesTreatment>
|
|
78
|
+
<xsl:element name="{$vClass}">
|
|
79
|
+
<xsl:if test="$vCode != ''">
|
|
80
|
+
<bf:code><xsl:value-of select="$vCode"/></bf:code>
|
|
81
|
+
</xsl:if>
|
|
82
|
+
<xsl:if test="$vLabel != ''">
|
|
83
|
+
<rdfs:label><xsl:value-of select="$vLabel"/></rdfs:label>
|
|
84
|
+
</xsl:if>
|
|
85
|
+
<xsl:if test="$vTag='465'">
|
|
86
|
+
<xsl:for-each select="marc:subfield[@code='a']">
|
|
87
|
+
<bf:place>
|
|
88
|
+
<bf:Place>
|
|
89
|
+
<rdfs:label><xsl:value-of select="."/></rdfs:label>
|
|
90
|
+
</bf:Place>
|
|
91
|
+
</bf:place>
|
|
92
|
+
</xsl:for-each>
|
|
93
|
+
<xsl:for-each select="marc:subfield[@code='b']">
|
|
94
|
+
<bf:agent>
|
|
95
|
+
<bf:Agent>
|
|
96
|
+
<rdfs:label><xsl:value-of select="."/></rdfs:label>
|
|
97
|
+
</bf:Agent>
|
|
98
|
+
</bf:agent>
|
|
99
|
+
</xsl:for-each>
|
|
100
|
+
</xsl:if>
|
|
101
|
+
<xsl:if test="$vTag='466'">
|
|
102
|
+
<xsl:for-each select="marc:subfield[@code='b']">
|
|
103
|
+
<bf:note>
|
|
104
|
+
<bf:Note>
|
|
105
|
+
<rdfs:label><xsl:value-of select="."/></rdfs:label>
|
|
106
|
+
</bf:Note>
|
|
107
|
+
</bf:note>
|
|
108
|
+
</xsl:for-each>
|
|
109
|
+
</xsl:if>
|
|
110
|
+
<xsl:if test="$vPart != ''">
|
|
111
|
+
<bf:part><xsl:value-of select="$vPart"/></bf:part>
|
|
112
|
+
</xsl:if>
|
|
113
|
+
<xsl:if test="$vTag='462' or $vTag='463'">
|
|
114
|
+
<xsl:for-each select="marc:subfield[@code='z']">
|
|
115
|
+
<bf:source>
|
|
116
|
+
<bf:Source>
|
|
117
|
+
<rdfs:label><xsl:value-of select="."/></rdfs:label>
|
|
118
|
+
</bf:Source>
|
|
119
|
+
</bf:source>
|
|
120
|
+
</xsl:for-each>
|
|
121
|
+
</xsl:if>
|
|
122
|
+
<xsl:for-each select="marc:subfield[@code='5']">
|
|
123
|
+
<bflc:applicableInstitution>
|
|
124
|
+
<bf:Agent>
|
|
125
|
+
<rdfs:label><xsl:value-of select="."/></rdfs:label>
|
|
126
|
+
</bf:Agent>
|
|
127
|
+
</bflc:applicableInstitution>
|
|
128
|
+
</xsl:for-each>
|
|
129
|
+
</xsl:element>
|
|
130
|
+
</bflc:seriesTreatment>
|
|
131
|
+
</xsl:when>
|
|
132
|
+
</xsl:choose>
|
|
133
|
+
</xsl:template>
|
|
134
|
+
|
|
135
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<?xml version='1.0' encoding="UTF-8"?>
|
|
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 510 - Other linking entries.
|
|
14
|
+
See process 6 for 490 now
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<xsl:template match="marc:datafield[
|
|
18
|
+
(@tag='510' and (@ind1='3' or @ind1='4')) or
|
|
19
|
+
(@tag='880' and substring(marc:subfield[@code='6'],1,3)='510') and (@ind1='3' or @ind1='4')]"
|
|
20
|
+
mode="instance">
|
|
21
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
22
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
23
|
+
<xsl:variable name="vLabel">
|
|
24
|
+
<xsl:apply-templates mode="concat-nodes-space" select="marc:subfield[@code='a' or @code='b']"/>
|
|
25
|
+
</xsl:variable>
|
|
26
|
+
<xsl:choose>
|
|
27
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
28
|
+
<bf:note>
|
|
29
|
+
<bf:Note>
|
|
30
|
+
<rdf:type rdf:resource="http://id.loc.gov/vocabulary/mnotetype/refcitation" />
|
|
31
|
+
<rdfs:label>
|
|
32
|
+
<xsl:if test="$vXmlLang != ''">
|
|
33
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
34
|
+
</xsl:if>
|
|
35
|
+
<xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/>
|
|
36
|
+
</rdfs:label>
|
|
37
|
+
<xsl:if test="marc:subfield[@code='b']">
|
|
38
|
+
<bf:enumerationAndChronology>
|
|
39
|
+
<bf:EnumerationAndChronology>
|
|
40
|
+
<rdfs:label><xsl:value-of select="normalize-space(marc:subfield[@code='b'])"/></rdfs:label>
|
|
41
|
+
</bf:EnumerationAndChronology>
|
|
42
|
+
</bf:enumerationAndChronology>
|
|
43
|
+
</xsl:if>
|
|
44
|
+
<xsl:if test="marc:subfield[@code='c']">
|
|
45
|
+
<bflc:citation><xsl:value-of select="normalize-space(marc:subfield[@code='c'])"/></bflc:citation>
|
|
46
|
+
</xsl:if>
|
|
47
|
+
<xsl:apply-templates select="marc:subfield[@code='u']" mode="subfieldu">
|
|
48
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
49
|
+
</xsl:apply-templates>
|
|
50
|
+
<xsl:apply-templates select="marc:subfield[@code='3']" mode="subfield3">
|
|
51
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
52
|
+
</xsl:apply-templates>
|
|
53
|
+
</bf:Note>
|
|
54
|
+
</bf:note>
|
|
55
|
+
</xsl:when>
|
|
56
|
+
</xsl:choose>
|
|
57
|
+
</xsl:template>
|
|
58
|
+
|
|
59
|
+
<xsl:template match="marc:datafield[
|
|
60
|
+
(@tag='510' and (@ind1='0' or @ind1='1' or @ind1='2')) or
|
|
61
|
+
(@tag='880' and substring(marc:subfield[@code='6'],1,3)='510') and (@ind1='0' or @ind1='1' or @ind1='2')]"
|
|
62
|
+
mode="work">
|
|
63
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
64
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
65
|
+
<xsl:variable name="vProperty">
|
|
66
|
+
<xsl:choose>
|
|
67
|
+
<xsl:when test="@ind1='0' or @ind1='1' or @ind1='2'">http://id.loc.gov/vocabulary/relationship/indexedin</xsl:when>
|
|
68
|
+
<xsl:otherwise>http://id.loc.gov/vocabulary/relationship/references</xsl:otherwise>
|
|
69
|
+
</xsl:choose>
|
|
70
|
+
</xsl:variable>
|
|
71
|
+
<xsl:choose>
|
|
72
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
73
|
+
<bf:relation>
|
|
74
|
+
<bf:Relation>
|
|
75
|
+
<bf:relationship>
|
|
76
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$vProperty"/></xsl:attribute>
|
|
77
|
+
</bf:relationship>
|
|
78
|
+
<bf:associatedResource>
|
|
79
|
+
<bf:Work>
|
|
80
|
+
<xsl:for-each select="marc:subfield[@code='a']">
|
|
81
|
+
<bf:title>
|
|
82
|
+
<bf:Title>
|
|
83
|
+
<bf:mainTitle>
|
|
84
|
+
<xsl:if test="$vXmlLang != ''">
|
|
85
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
86
|
+
</xsl:if>
|
|
87
|
+
<xsl:call-template name="tChopPunct">
|
|
88
|
+
<xsl:with-param name="pString" select="."/>
|
|
89
|
+
</xsl:call-template>
|
|
90
|
+
</bf:mainTitle>
|
|
91
|
+
</bf:Title>
|
|
92
|
+
</bf:title>
|
|
93
|
+
</xsl:for-each>
|
|
94
|
+
<xsl:for-each select="marc:subfield[@code='b' or @code='c']">
|
|
95
|
+
<bf:note>
|
|
96
|
+
<bf:Note>
|
|
97
|
+
<xsl:choose>
|
|
98
|
+
<xsl:when test="@code='b'">
|
|
99
|
+
<rdf:type>
|
|
100
|
+
<xsl:attribute name="rdf:resource">http://id.loc.gov/vocabulary/mnotetype/coverage</xsl:attribute>
|
|
101
|
+
</rdf:type>
|
|
102
|
+
</xsl:when>
|
|
103
|
+
<xsl:when test="@code='c'">
|
|
104
|
+
<rdf:type>
|
|
105
|
+
<xsl:attribute name="rdf:resource">http://id.loc.gov/vocabulary/mnotetype/loc</xsl:attribute>
|
|
106
|
+
</rdf:type>
|
|
107
|
+
</xsl:when>
|
|
108
|
+
</xsl:choose>
|
|
109
|
+
<rdfs:label>
|
|
110
|
+
<xsl:if test="$vXmlLang != ''">
|
|
111
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
112
|
+
</xsl:if>
|
|
113
|
+
<xsl:call-template name="tChopPunct">
|
|
114
|
+
<xsl:with-param name="pString" select="."/>
|
|
115
|
+
</xsl:call-template>
|
|
116
|
+
</rdfs:label>
|
|
117
|
+
</bf:Note>
|
|
118
|
+
</bf:note>
|
|
119
|
+
</xsl:for-each>
|
|
120
|
+
<xsl:for-each select="marc:subfield[@code='x']">
|
|
121
|
+
<bf:identifiedBy>
|
|
122
|
+
<bf:Issn>
|
|
123
|
+
<rdf:value>
|
|
124
|
+
<xsl:call-template name="tChopPunct">
|
|
125
|
+
<xsl:with-param name="pString" select="."/>
|
|
126
|
+
</xsl:call-template>
|
|
127
|
+
</rdf:value>
|
|
128
|
+
</bf:Issn>
|
|
129
|
+
</bf:identifiedBy>
|
|
130
|
+
</xsl:for-each>
|
|
131
|
+
<xsl:apply-templates select="marc:subfield[@code='u']" mode="subfieldu">
|
|
132
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
133
|
+
</xsl:apply-templates>
|
|
134
|
+
</bf:Work>
|
|
135
|
+
</bf:associatedResource>
|
|
136
|
+
<xsl:apply-templates select="marc:subfield[@code='3']" mode="subfield3">
|
|
137
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
138
|
+
</xsl:apply-templates>
|
|
139
|
+
</bf:Relation>
|
|
140
|
+
</bf:relation>
|
|
141
|
+
</xsl:when>
|
|
142
|
+
</xsl:choose>
|
|
143
|
+
</xsl:template>
|
|
144
|
+
|
|
145
|
+
</xsl:stylesheet>
|