Skip to content

Commit 5fb2723

Browse files
authored
Merge pull request #34 from lcnetdev/v2.8-dev
V2.8
2 parents c93c304 + e7fbffd commit 5fb2723

149 files changed

Lines changed: 14369 additions & 3233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NEWS

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
--- 2.8.0 2024/11/21
2+
3+
Changes for updated v2.8.0 specifications:
4+
5+
Instance-bf2marc
6+
Updated creation of 008/06=q
7+
Changed generation of indicators in MARC 246 field
8+
Updated creation of MARC 504 field to use bf:note instead of bf:supplementaryContent
9+
Work-bf2marc
10+
Added creation of paired MARC 880 fields for agents and added titles
11+
Added $u to MARC 510 field
12+
Added creation of MARC 080 field
13+
Changed generation of indicators in MARC 246 field
14+
Corrected relationship URIs within the relation - Relation ... elements to align the specifications with the conversion program
15+
008-bf2marc
16+
Added bf:genreForm mapping to create 008/24-27 for ooks and serials; previously only bf:supplementaryContent values were mapped to these bytes
17+
Added information about 008/06 creation that is also included in the Instance-bf2marc spec
18+
Added reference to AdminMetadata spec regarding the creation of MARC 008/39 byte
19+
AdminMetadata-bf2marc
20+
Added creation of MARC 008/39 byte
21+
Process0-4-bf2marc
22+
Editorial changes to add new "biblio" notetype to Process 3 and update example of 066 field in Process 1
23+
24+
125
--- 2.7.0 2024/08/23
226

327
Changes for updated v2.7.0 specifications:

release-notes.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# bibframe2marc release notes
22

3+
## v2.8.0
4+
5+
Conversion updates based on specifications v2.8. See the Library of Congress’s [BIBFRAME site](https://www.loc.gov/bibframe/) for more details. Specifications are included in the distribution in the [spec](spec/) directory. Changes of note:
6+
7+
* Added creation of paired MARC 880 fields for agents
8+
* Improved 880 support for variant titles
9+
* Added conversion of MARC 080 field
10+
* Added conversion of $u to MARC 510 field
11+
* Updated creation of MARC 504 field to use bf:note instead of bf:supplementaryContent
12+
* Corrected relationships within the relation - Relation ... elements to align the specifications with the conversion program
13+
* Added bf:genreForm mapping to populate 008/24-27 bytes; previously only the bf:supplementaryContent values were mapped
14+
* Add creation of 008/39 value from data elements in Admin Metadata
15+
* Support for 008 date type 'q'
16+
* Numerous bug fixes
17+
18+
See the [NEWS](NEWS) file for full details of changes.
19+
320
## v2.7.0
421

522
Conversion updates based on specifications v2.7. See the Library of Congress’s [BIBFRAME site](https://www.loc.gov/bibframe/) for more details. Specifications are included in the distribution in the [spec](spec/) directory. Changes of note:

rules/00-LDR.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
<switch>
7474
<case test="$vAdminMetadata/bflc:encodingLevel[@rdf:resource] or
7575
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[@rdf:about] or
76-
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[bf:code]">
76+
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[not(@rdf:about) and bf:code]">
7777
<select xpath="$vAdminMetadata/bflc:encodingLevel/@rdf:resource |
7878
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel/@rdf:about |
79-
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel/bf:code">
79+
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[not(@rdf:about)]/bf:code">
8080
<var name="vLdr17" xpath="substring(.,string-length(.))"/>
8181
<switch>
8282
<case test="$vLdr17='f'"><transform><xsl:value-of select="' '"/></transform></case>
@@ -88,7 +88,7 @@
8888
</switch>
8989
</position>
9090
<!-- 18-23 -->
91-
<position default="c 4500"/>
91+
<position default="i 4500"/>
9292
</fixed-field>
9393
</cf>
9494
</rules>

rules/01-001-008.xml

Lines changed: 64 additions & 26 deletions
Large diffs are not rendered by default.

rules/02-010-048.xml

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -936,14 +936,33 @@
936936
-->
937937

938938
<switch>
939-
<case test="$vAdminMetadata[bf:descriptionConventions]">
939+
<case test="$vAdminMetadata[bf:descriptionLevel or bf:descriptionConventions or bflc:encodingLevel]">
940940
<df tag="040" repeatable="false">
941941
<var name="vLanguageUri">
942942
<switch>
943-
<case test="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/@rdf:resource"><transform><xsl:value-of select="$vAdminMetadata/bf:descriptionLanguage/@rdf:resource"/></transform></case>
944-
<case test="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/*/@rdf:about"><transform><xsl:value-of select="$vAdminMetadata/bf:descriptionLanguage/*/@rdf:about"/></transform></case>
943+
<case test="$vAdminMetadata[bf:descriptionLevel or bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionLanguage/@rdf:resource"><transform><xsl:value-of select="$vAdminMetadata/bf:descriptionLanguage/@rdf:resource"/></transform></case>
944+
<case test="$vAdminMetadata[bf:descriptionLevel or bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionLanguage/*/@rdf:about"><transform><xsl:value-of select="$vAdminMetadata/bf:descriptionLanguage/*/@rdf:about"/></transform></case>
945945
</switch>
946946
</var>
947+
<var name="df040sfsPreNS">
948+
<switch>
949+
<case test="$vAdminMetadata/bflc:marcKey[starts-with(., '040')]">
950+
<transform>
951+
<xsl:call-template name="tParseMarcKey">
952+
<xsl:with-param name="pString" select="substring($vAdminMetadata/bflc:marcKey[starts-with(., '040')], 6)" />
953+
</xsl:call-template>
954+
</transform>
955+
</case>
956+
<case test="$vAdminMetadata/bf:note/bf:Note[rdf:type/@rdf:resource='http://id.loc.gov/vocabulary/mnotetype/internal']/rdfs:label[starts-with(., '040')]">
957+
<transform>
958+
<xsl:call-template name="tParseMarcKey">
959+
<xsl:with-param name="pString" select="substring($vAdminMetadata/bf:note/bf:Note[rdf:type/@rdf:resource='http://id.loc.gov/vocabulary/mnotetype/internal']/rdfs:label[starts-with(., '040')], 6)" />
960+
</xsl:call-template>
961+
</transform>
962+
</case>
963+
</switch>
964+
</var>
965+
<var name="df040sfs" xpath="exsl:node-set($df040sfsPreNS)" />
947966
<ind1 default=" "/>
948967
<ind2 default=" "/>
949968
<var name="vAuri">
@@ -1004,14 +1023,14 @@
10041023
</transform>
10051024
</sf>
10061025
</case>
1007-
<case test="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/*/*[local-name()='code']">
1026+
<case test="$vAdminMetadata[bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionLanguage/*/*[local-name()='code']">
10081027
<sf code="b">
1009-
<transform><xsl:value-of select="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/*/*[local-name()='code']"/></transform>
1028+
<transform><xsl:value-of select="$vAdminMetadata[bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionLanguage/*/*[local-name()='code']"/></transform>
10101029
</sf>
10111030
</case>
10121031
</switch>
10131032
<sf code="e">
1014-
<select xpath="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionConventions[not(contains(@rdf:resource,'isbd')) and
1033+
<select xpath="$vAdminMetadata[bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionConventions[not(contains(@rdf:resource,'isbd')) and
10151034
not(contains(*/@rdf:about,'isbd')) and
10161035
not(*/rdf:value='isbd') and
10171036
not(*/*[local-name()='code']='isbd') and
@@ -1045,8 +1064,11 @@
10451064
</switch>
10461065
</select>
10471066
</sf>
1048-
<!-- Logic for $c was/is identical to $a, so just using the $a stuff here. -->
1067+
<!-- Logic for $c: Look for the historical value. If not found, use $a. -->
10491068
<switch>
1069+
<case test="$df040sfs//marc:subfield[@code='c']">
1070+
<sf code="c" repeatable="false"><transform><xsl:value-of select="$df040sfs//marc:subfield[@code='c'][1]"/></transform></sf>
1071+
</case>
10501072
<case test="$vAcode = 'dlc'">
10511073
<sf code="c" repeatable="false"><transform><xsl:value-of select="translate($vAcode,$lower,$upper)"/></transform></sf>
10521074
</case>
@@ -1059,19 +1081,9 @@
10591081
<transform>
10601082
<xsl:variable name="modifierCodePreNS">
10611083
<marc:codes>
1062-
<xsl:if test="$vAdminMetadata/bflc:marcKey[starts-with(., '040')]">
1063-
<xsl:variable name="df040sfsPreNS">
1064-
<subfields>
1065-
<xsl:call-template name="tParseMarcKey">
1066-
<xsl:with-param name="pString" select="substring($vAdminMetadata/bflc:marcKey[starts-with(., '040')], 6)" />
1067-
</xsl:call-template>
1068-
</subfields>
1069-
</xsl:variable>
1070-
<xsl:variable name="df040sfs" select="exsl:node-set($df040sfsPreNS)" />
1071-
<xsl:for-each select="$df040sfs//marc:subfield[@code='d']">
1072-
<marc:modifierCode><xsl:value-of select="." /></marc:modifierCode>
1073-
</xsl:for-each>
1074-
</xsl:if>
1084+
<xsl:for-each select="$df040sfs//marc:subfield[@code='d' and .!='']">
1085+
<marc:modifierCode><xsl:value-of select="." /></marc:modifierCode>
1086+
</xsl:for-each>
10751087
<xsl:for-each select="$vAdminMetadata[bf:status/bf:Status[@rdf:about='http://id.loc.gov/vocabulary/mstatus/c']]">
10761088
<xsl:sort select="bf:date" data-type="text" order="ascending" />
10771089
<xsl:variable name="mCode">
@@ -1110,13 +1122,15 @@
11101122
</xsl:when>
11111123
</xsl:choose>
11121124
</xsl:variable>
1113-
<marc:modifierCode>
1114-
<xsl:choose>
1115-
<xsl:when test="$mCode = 'dlc'">DLC</xsl:when>
1116-
<xsl:when test="$mCode = 'dlcmrc'">DLCMRC</xsl:when>
1117-
<xsl:otherwise><xsl:value-of select="$mCode" /></xsl:otherwise>
1118-
</xsl:choose>
1119-
</marc:modifierCode>
1125+
<xsl:if test="$mCode != ''">
1126+
<marc:modifierCode>
1127+
<xsl:choose>
1128+
<xsl:when test="$mCode = 'dlc'">DLC</xsl:when>
1129+
<xsl:when test="$mCode = 'dlcmrc'">DLC-MRC</xsl:when>
1130+
<xsl:otherwise><xsl:value-of select="$mCode" /></xsl:otherwise>
1131+
</xsl:choose>
1132+
</marc:modifierCode>
1133+
</xsl:if>
11201134
</xsl:for-each>
11211135
</marc:codes>
11221136
</xsl:variable>
@@ -1177,7 +1191,7 @@
11771191
</switch>
11781192

11791193
<switch>
1180-
<case test="bf:Work/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/languages')] or bf:Work/bf:language/*/*[not(bf:source)]">
1194+
<case test="bf:Work/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/languages') and not(contains(., '/zxx'))] or bf:Work/bf:language/*/*[not(bf:source)]">
11811195
<var name="vAllLangElements" xpath="
11821196
bf:Work/bf:language/@rdf:resource[contains(., 'id.loc.gov/vocabulary/languages')] |
11831197
bf:Work/bf:language/bf:Language[not(bf:source) and not(bf:part)]//@rdf:about[contains(., 'id.loc.gov/vocabulary/languages')] |
@@ -1225,9 +1239,10 @@
12251239

12261240
<xsl:for-each select="$vAllLangElements">
12271241
<xsl:choose>
1228-
<xsl:when test="position() = 1">
1242+
<xsl:when test="position() = 1 and $vFirstLangCode!='zxx'">
12291243
<marc:subfield code="a"><xsl:value-of select="$vFirstLangCode"/></marc:subfield>
12301244
</xsl:when>
1245+
<xsl:when test="position() = 1 and $vFirstLangCode='zxx'" />
12311246
<xsl:otherwise>
12321247
<xsl:variable name="vLangCode">
12331248
<xsl:choose>
@@ -1305,7 +1320,7 @@
13051320
</case>
13061321
</switch>
13071322
<switch>
1308-
<case test="bf:Work/bf:language//@rdf:*[not(contains(., 'id.loc.gov/vocabulary/languages'))] or bf:Work/bf:language/*/bf:source">
1323+
<case test="bf:Work/bf:language//@rdf:*[(local-name='resource' or local-name='about') and not(contains(., 'id.loc.gov/vocabulary/languages'))] or bf:Work/bf:language/*/bf:source">
13091324
<df tag="041">
13101325
<ind1 default=" ">
13111326
<switch>
@@ -1680,10 +1695,11 @@
16801695
<df tag="043">
16811696
<context xpath="bf:Work/bf:geographicCoverage[
16821697
contains(@rdf:resource,'id.loc.gov/vocabulary/geographicAreas') or
1683-
contains(bf:GeographicCoverage/@rdf:about,'id.loc.gov/vocabulary/geographicAreas') or
1684-
bf:GeographicCoverage/rdf:value or
1685-
bf:GeographicCoverage/madsrdf:code or
1686-
madsrdf:Geographic/madsrdf:code]">
1698+
contains(bf:GeographicCoverage/@rdf:about,'id.loc.gov/vocabulary/geographicAreas') or
1699+
bf:GeographicCoverage/madsrdf:code or
1700+
bf:GeographicCoverage/bf:code or
1701+
madsrdf:Geographic/madsrdf:code or
1702+
bf:GeographicCoverage/rdf:value]">
16871703
<ind1 default=" "/>
16881704
<ind2 default=" "/>
16891705
<var name="vUri">
@@ -1693,6 +1709,14 @@
16931709
</switch>
16941710
</var>
16951711
<switch>
1712+
<case test="*/bf:code">
1713+
<sf code="a"><select xpath="*/bf:code" /></sf>
1714+
<switch>
1715+
<case test="*/@rdf:about">
1716+
<sf code="0"><transform><xsl:value-of select="*/@rdf:about"/></transform></sf>
1717+
</case>
1718+
</switch>
1719+
</case>
16961720
<case test="*/madsrdf:code">
16971721
<sf code="a"><select xpath="*/madsrdf:code" /></sf>
16981722
<switch>

rules/03-050-088.xml

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,50 @@
217217
</context>
218218
</df>
219219

220-
<df tag="066">
221-
<context xpath="//@xml:lang[generate-id() = generate-id(key('langs',.)[1])]">
222-
<ind1 default=" "/>
223-
<ind2 default=" "/>
224-
<var name="v880Script">
225-
<lookup map="df880script" targetField="code">
226-
<lookupField name="lang" xpath="translate(substring-after(.,'-'),$upper,$lower)"/>
227-
</lookup>
228-
</var>
229-
<sf code="a"><transform><xsl:value-of select="$v880Script" /></transform></sf>
230-
</context>
231-
</df>
232-
220+
<switch>
221+
<case test="/descendant::node()[bf:Title|bf:ProvisionActivity|bf:editionStatement|bf:Series]//@xml:lang[contains(., '-') and not(contains(., 'atn'))]">
222+
<df tag="066">
223+
<ind1 default=" "/>
224+
<ind2 default=" "/>
225+
<transform>
226+
<xsl:variable name="scriptCodesPreNS">
227+
<xsl:variable name="df880scriptNS" select="exsl:node-set($df880script)" />
228+
<xsl:variable name="vLangs" select="//@xml:lang[contains(., '-') and not(contains(., 'atn'))]" />
229+
<!-- <xsl:for-each select="$df880scriptNS/*[lang]/lang"> -->
230+
<marc:codes>
231+
<!-- Those defined in the map. -->
232+
<xsl:for-each select="$df880scriptNS/script/lang">
233+
<xsl:variable name="vLang" select="." />
234+
<xsl:if test="$vLangs[translate(substring-after(.,'-'),$upper,$lower) = $vLang ]">
235+
<marc:scriptCode><xsl:value-of select="../code" /></marc:scriptCode>
236+
</xsl:if>
237+
</xsl:for-each>
238+
239+
<!-- For those not defined in the map. -->
240+
<xsl:for-each select="$vLangs">
241+
<xsl:variable name="vLang" select="translate(substring-after(.,'-'),$upper,$lower)" />
242+
<xsl:if test="count($df880scriptNS/script/lang[. = $vLang]) = 0">
243+
<marc:scriptCode><xsl:value-of select="$vLang" /></marc:scriptCode>
244+
</xsl:if>
245+
</xsl:for-each>
246+
</marc:codes>
247+
</xsl:variable>
248+
<xsl:variable name="scriptCodes" select="exsl:node-set($scriptCodesPreNS)" />
249+
<xsl:for-each select="$scriptCodes//marc:scriptCode[not(.=preceding::*[1])]">
250+
<xsl:choose>
251+
<xsl:when test="contains(., '/')">
252+
<marc:subfield code="c"><xsl:value-of select="substring-before(., '/')" /></marc:subfield>
253+
</xsl:when>
254+
<xsl:otherwise>
255+
<marc:subfield code="c"><xsl:value-of select="." /></marc:subfield>
256+
</xsl:otherwise>
257+
</xsl:choose>
258+
</xsl:for-each>
259+
</transform>
260+
</df>
261+
</case>
262+
</switch>
263+
233264
<df tag="070">
234265
<context xpath="bf:Work/bf:classification/bf:ClassificationNal|bf:Work/bf:classification/bf:Classification[bf:assigner/@rdf:resource='http://id.loc.gov/vocabulary/organizations/dnal' or
235266
bf:assigner/*/@rdf:about='http://id.loc.gov/vocabulary/organizations/dnal']">
@@ -351,6 +382,28 @@
351382
</switch>
352383
</context>
353384
</df>
385+
386+
<df tag="080">
387+
<context xpath="bf:Work/bf:classification/*[(local-name()='ClassificationUdc' or rdf:type/@rdf:resource='http://id.loc.gov/ontologies/bibframe/ClassificationUdc') and bf:classificationPortion/text()]">
388+
<ind1 default=" ">
389+
<switch>
390+
<case test="bf:edition = 'full'">0</case>
391+
<case test="bf:edition = 'abridged'">1</case>
392+
</switch>
393+
</ind1>
394+
<ind2 default=" " />
395+
<sf code="a"><select xpath="bf:classificationPortion"/></sf>
396+
<sf code="b" repeatable="false"><select xpath="bf:itemPortion"/></sf>
397+
<switch>
398+
<case test="not(bf:assigner[@rdf:resource='http://id.loc.gov/vocabulary/organizations/dlc' or */@rdf:about='http://id.loc.gov/vocabulary/organizations/dlc'])">
399+
<sf code="q" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:Agent/rdfs:label"/></sf>
400+
</case>
401+
</switch>
402+
<sf code="2" repeatable="false">
403+
<select xpath="bf:source/bf:Source/bf:code" />
404+
</sf>
405+
</context>
406+
</df>
354407

355408
<df tag="082">
356409
<context xpath="bf:Work/bf:classification/*[(local-name()='ClassificationDdc' or rdf:type/@rdf:resource='http://id.loc.gov/ontologies/bibframe/ClassificationDdc') and bf:classificationPortion/text()]">

0 commit comments

Comments
 (0)