Skip to content

Commit

Permalink
Merge pull request #34 from lcnetdev/v2.8-dev
Browse files Browse the repository at this point in the history
V2.8
  • Loading branch information
kefo authored Nov 21, 2024
2 parents c93c304 + e7fbffd commit 5fb2723
Show file tree
Hide file tree
Showing 149 changed files with 14,369 additions and 3,233 deletions.
24 changes: 24 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
--- 2.8.0 2024/11/21

Changes for updated v2.8.0 specifications:

Instance-bf2marc
Updated creation of 008/06=q
Changed generation of indicators in MARC 246 field
Updated creation of MARC 504 field to use bf:note instead of bf:supplementaryContent
Work-bf2marc
Added creation of paired MARC 880 fields for agents and added titles
Added $u to MARC 510 field
Added creation of MARC 080 field
Changed generation of indicators in MARC 246 field
Corrected relationship URIs within the relation - Relation ... elements to align the specifications with the conversion program
008-bf2marc
Added bf:genreForm mapping to create 008/24-27 for ooks and serials; previously only bf:supplementaryContent values were mapped to these bytes
Added information about 008/06 creation that is also included in the Instance-bf2marc spec
Added reference to AdminMetadata spec regarding the creation of MARC 008/39 byte
AdminMetadata-bf2marc
Added creation of MARC 008/39 byte
Process0-4-bf2marc
Editorial changes to add new "biblio" notetype to Process 3 and update example of 066 field in Process 1


--- 2.7.0 2024/08/23

Changes for updated v2.7.0 specifications:
Expand Down
17 changes: 17 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# bibframe2marc release notes

## v2.8.0

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:

* Added creation of paired MARC 880 fields for agents
* Improved 880 support for variant titles
* Added conversion of MARC 080 field
* Added conversion of $u to MARC 510 field
* Updated creation of MARC 504 field to use bf:note instead of bf:supplementaryContent
* Corrected relationships within the relation - Relation ... elements to align the specifications with the conversion program
* Added bf:genreForm mapping to populate 008/24-27 bytes; previously only the bf:supplementaryContent values were mapped
* Add creation of 008/39 value from data elements in Admin Metadata
* Support for 008 date type 'q'
* Numerous bug fixes

See the [NEWS](NEWS) file for full details of changes.

## v2.7.0

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:
Expand Down
6 changes: 3 additions & 3 deletions rules/00-LDR.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
<switch>
<case test="$vAdminMetadata/bflc:encodingLevel[@rdf:resource] or
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[@rdf:about] or
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[bf:code]">
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[not(@rdf:about) and bf:code]">
<select xpath="$vAdminMetadata/bflc:encodingLevel/@rdf:resource |
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel/@rdf:about |
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel/bf:code">
$vAdminMetadata/bflc:encodingLevel/bflc:EncodingLevel[not(@rdf:about)]/bf:code">
<var name="vLdr17" xpath="substring(.,string-length(.))"/>
<switch>
<case test="$vLdr17='f'"><transform><xsl:value-of select="' '"/></transform></case>
Expand All @@ -88,7 +88,7 @@
</switch>
</position>
<!-- 18-23 -->
<position default="c 4500"/>
<position default="i 4500"/>
</fixed-field>
</cf>
</rules>
90 changes: 64 additions & 26 deletions rules/01-001-008.xml

Large diffs are not rendered by default.

92 changes: 58 additions & 34 deletions rules/02-010-048.xml
Original file line number Diff line number Diff line change
Expand Up @@ -936,14 +936,33 @@
-->

<switch>
<case test="$vAdminMetadata[bf:descriptionConventions]">
<case test="$vAdminMetadata[bf:descriptionLevel or bf:descriptionConventions or bflc:encodingLevel]">
<df tag="040" repeatable="false">
<var name="vLanguageUri">
<switch>
<case test="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/@rdf:resource"><transform><xsl:value-of select="$vAdminMetadata/bf:descriptionLanguage/@rdf:resource"/></transform></case>
<case test="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/*/@rdf:about"><transform><xsl:value-of select="$vAdminMetadata/bf:descriptionLanguage/*/@rdf:about"/></transform></case>
<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>
<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>
</switch>
</var>
<var name="df040sfsPreNS">
<switch>
<case test="$vAdminMetadata/bflc:marcKey[starts-with(., '040')]">
<transform>
<xsl:call-template name="tParseMarcKey">
<xsl:with-param name="pString" select="substring($vAdminMetadata/bflc:marcKey[starts-with(., '040')], 6)" />
</xsl:call-template>
</transform>
</case>
<case test="$vAdminMetadata/bf:note/bf:Note[rdf:type/@rdf:resource='http://id.loc.gov/vocabulary/mnotetype/internal']/rdfs:label[starts-with(., '040')]">
<transform>
<xsl:call-template name="tParseMarcKey">
<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)" />
</xsl:call-template>
</transform>
</case>
</switch>
</var>
<var name="df040sfs" xpath="exsl:node-set($df040sfsPreNS)" />
<ind1 default=" "/>
<ind2 default=" "/>
<var name="vAuri">
Expand Down Expand Up @@ -1004,14 +1023,14 @@
</transform>
</sf>
</case>
<case test="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/*/*[local-name()='code']">
<case test="$vAdminMetadata[bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionLanguage/*/*[local-name()='code']">
<sf code="b">
<transform><xsl:value-of select="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionLanguage/*/*[local-name()='code']"/></transform>
<transform><xsl:value-of select="$vAdminMetadata[bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionLanguage/*/*[local-name()='code']"/></transform>
</sf>
</case>
</switch>
<sf code="e">
<select xpath="$vAdminMetadata[bf:descriptionConventions]/bf:descriptionConventions[not(contains(@rdf:resource,'isbd')) and
<select xpath="$vAdminMetadata[bf:descriptionConventions or bflc:encodingLevel]/bf:descriptionConventions[not(contains(@rdf:resource,'isbd')) and
not(contains(*/@rdf:about,'isbd')) and
not(*/rdf:value='isbd') and
not(*/*[local-name()='code']='isbd') and
Expand Down Expand Up @@ -1045,8 +1064,11 @@
</switch>
</select>
</sf>
<!-- Logic for $c was/is identical to $a, so just using the $a stuff here. -->
<!-- Logic for $c: Look for the historical value. If not found, use $a. -->
<switch>
<case test="$df040sfs//marc:subfield[@code='c']">
<sf code="c" repeatable="false"><transform><xsl:value-of select="$df040sfs//marc:subfield[@code='c'][1]"/></transform></sf>
</case>
<case test="$vAcode = 'dlc'">
<sf code="c" repeatable="false"><transform><xsl:value-of select="translate($vAcode,$lower,$upper)"/></transform></sf>
</case>
Expand All @@ -1059,19 +1081,9 @@
<transform>
<xsl:variable name="modifierCodePreNS">
<marc:codes>
<xsl:if test="$vAdminMetadata/bflc:marcKey[starts-with(., '040')]">
<xsl:variable name="df040sfsPreNS">
<subfields>
<xsl:call-template name="tParseMarcKey">
<xsl:with-param name="pString" select="substring($vAdminMetadata/bflc:marcKey[starts-with(., '040')], 6)" />
</xsl:call-template>
</subfields>
</xsl:variable>
<xsl:variable name="df040sfs" select="exsl:node-set($df040sfsPreNS)" />
<xsl:for-each select="$df040sfs//marc:subfield[@code='d']">
<marc:modifierCode><xsl:value-of select="." /></marc:modifierCode>
</xsl:for-each>
</xsl:if>
<xsl:for-each select="$df040sfs//marc:subfield[@code='d' and .!='']">
<marc:modifierCode><xsl:value-of select="." /></marc:modifierCode>
</xsl:for-each>
<xsl:for-each select="$vAdminMetadata[bf:status/bf:Status[@rdf:about='http://id.loc.gov/vocabulary/mstatus/c']]">
<xsl:sort select="bf:date" data-type="text" order="ascending" />
<xsl:variable name="mCode">
Expand Down Expand Up @@ -1110,13 +1122,15 @@
</xsl:when>
</xsl:choose>
</xsl:variable>
<marc:modifierCode>
<xsl:choose>
<xsl:when test="$mCode = 'dlc'">DLC</xsl:when>
<xsl:when test="$mCode = 'dlcmrc'">DLCMRC</xsl:when>
<xsl:otherwise><xsl:value-of select="$mCode" /></xsl:otherwise>
</xsl:choose>
</marc:modifierCode>
<xsl:if test="$mCode != ''">
<marc:modifierCode>
<xsl:choose>
<xsl:when test="$mCode = 'dlc'">DLC</xsl:when>
<xsl:when test="$mCode = 'dlcmrc'">DLC-MRC</xsl:when>
<xsl:otherwise><xsl:value-of select="$mCode" /></xsl:otherwise>
</xsl:choose>
</marc:modifierCode>
</xsl:if>
</xsl:for-each>
</marc:codes>
</xsl:variable>
Expand Down Expand Up @@ -1177,7 +1191,7 @@
</switch>

<switch>
<case test="bf:Work/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/languages')] or bf:Work/bf:language/*/*[not(bf:source)]">
<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)]">
<var name="vAllLangElements" xpath="
bf:Work/bf:language/@rdf:resource[contains(., 'id.loc.gov/vocabulary/languages')] |
bf:Work/bf:language/bf:Language[not(bf:source) and not(bf:part)]//@rdf:about[contains(., 'id.loc.gov/vocabulary/languages')] |
Expand Down Expand Up @@ -1225,9 +1239,10 @@

<xsl:for-each select="$vAllLangElements">
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:when test="position() = 1 and $vFirstLangCode!='zxx'">
<marc:subfield code="a"><xsl:value-of select="$vFirstLangCode"/></marc:subfield>
</xsl:when>
<xsl:when test="position() = 1 and $vFirstLangCode='zxx'" />
<xsl:otherwise>
<xsl:variable name="vLangCode">
<xsl:choose>
Expand Down Expand Up @@ -1305,7 +1320,7 @@
</case>
</switch>
<switch>
<case test="bf:Work/bf:language//@rdf:*[not(contains(., 'id.loc.gov/vocabulary/languages'))] or bf:Work/bf:language/*/bf:source">
<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">
<df tag="041">
<ind1 default=" ">
<switch>
Expand Down Expand Up @@ -1680,10 +1695,11 @@
<df tag="043">
<context xpath="bf:Work/bf:geographicCoverage[
contains(@rdf:resource,'id.loc.gov/vocabulary/geographicAreas') or
contains(bf:GeographicCoverage/@rdf:about,'id.loc.gov/vocabulary/geographicAreas') or
bf:GeographicCoverage/rdf:value or
bf:GeographicCoverage/madsrdf:code or
madsrdf:Geographic/madsrdf:code]">
contains(bf:GeographicCoverage/@rdf:about,'id.loc.gov/vocabulary/geographicAreas') or
bf:GeographicCoverage/madsrdf:code or
bf:GeographicCoverage/bf:code or
madsrdf:Geographic/madsrdf:code or
bf:GeographicCoverage/rdf:value]">
<ind1 default=" "/>
<ind2 default=" "/>
<var name="vUri">
Expand All @@ -1693,6 +1709,14 @@
</switch>
</var>
<switch>
<case test="*/bf:code">
<sf code="a"><select xpath="*/bf:code" /></sf>
<switch>
<case test="*/@rdf:about">
<sf code="0"><transform><xsl:value-of select="*/@rdf:about"/></transform></sf>
</case>
</switch>
</case>
<case test="*/madsrdf:code">
<sf code="a"><select xpath="*/madsrdf:code" /></sf>
<switch>
Expand Down
79 changes: 66 additions & 13 deletions rules/03-050-088.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,50 @@
</context>
</df>

<df tag="066">
<context xpath="//@xml:lang[generate-id() = generate-id(key('langs',.)[1])]">
<ind1 default=" "/>
<ind2 default=" "/>
<var name="v880Script">
<lookup map="df880script" targetField="code">
<lookupField name="lang" xpath="translate(substring-after(.,'-'),$upper,$lower)"/>
</lookup>
</var>
<sf code="a"><transform><xsl:value-of select="$v880Script" /></transform></sf>
</context>
</df>

<switch>
<case test="/descendant::node()[bf:Title|bf:ProvisionActivity|bf:editionStatement|bf:Series]//@xml:lang[contains(., '-') and not(contains(., 'atn'))]">
<df tag="066">
<ind1 default=" "/>
<ind2 default=" "/>
<transform>
<xsl:variable name="scriptCodesPreNS">
<xsl:variable name="df880scriptNS" select="exsl:node-set($df880script)" />
<xsl:variable name="vLangs" select="//@xml:lang[contains(., '-') and not(contains(., 'atn'))]" />
<!-- <xsl:for-each select="$df880scriptNS/*[lang]/lang"> -->
<marc:codes>
<!-- Those defined in the map. -->
<xsl:for-each select="$df880scriptNS/script/lang">
<xsl:variable name="vLang" select="." />
<xsl:if test="$vLangs[translate(substring-after(.,'-'),$upper,$lower) = $vLang ]">
<marc:scriptCode><xsl:value-of select="../code" /></marc:scriptCode>
</xsl:if>
</xsl:for-each>

<!-- For those not defined in the map. -->
<xsl:for-each select="$vLangs">
<xsl:variable name="vLang" select="translate(substring-after(.,'-'),$upper,$lower)" />
<xsl:if test="count($df880scriptNS/script/lang[. = $vLang]) = 0">
<marc:scriptCode><xsl:value-of select="$vLang" /></marc:scriptCode>
</xsl:if>
</xsl:for-each>
</marc:codes>
</xsl:variable>
<xsl:variable name="scriptCodes" select="exsl:node-set($scriptCodesPreNS)" />
<xsl:for-each select="$scriptCodes//marc:scriptCode[not(.=preceding::*[1])]">
<xsl:choose>
<xsl:when test="contains(., '/')">
<marc:subfield code="c"><xsl:value-of select="substring-before(., '/')" /></marc:subfield>
</xsl:when>
<xsl:otherwise>
<marc:subfield code="c"><xsl:value-of select="." /></marc:subfield>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</transform>
</df>
</case>
</switch>

<df tag="070">
<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
bf:assigner/*/@rdf:about='http://id.loc.gov/vocabulary/organizations/dnal']">
Expand Down Expand Up @@ -351,6 +382,28 @@
</switch>
</context>
</df>

<df tag="080">
<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()]">
<ind1 default=" ">
<switch>
<case test="bf:edition = 'full'">0</case>
<case test="bf:edition = 'abridged'">1</case>
</switch>
</ind1>
<ind2 default=" " />
<sf code="a"><select xpath="bf:classificationPortion"/></sf>
<sf code="b" repeatable="false"><select xpath="bf:itemPortion"/></sf>
<switch>
<case test="not(bf:assigner[@rdf:resource='http://id.loc.gov/vocabulary/organizations/dlc' or */@rdf:about='http://id.loc.gov/vocabulary/organizations/dlc'])">
<sf code="q" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:Agent/rdfs:label"/></sf>
</case>
</switch>
<sf code="2" repeatable="false">
<select xpath="bf:source/bf:Source/bf:code" />
</sf>
</context>
</df>

<df tag="082">
<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()]">
Expand Down
Loading

0 comments on commit 5fb2723

Please sign in to comment.