[Koha-bugs] [Bug 14863] New: Koha authorities update linking authorities in subfield '0'

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Sep 21 13:52:09 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14863

            Bug ID: 14863
           Summary: Koha authorities update linking authorities in
                    subfield '0'
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Cataloging
          Assignee: gmcharlt at gmail.com
          Reporter: eugenegf at yahoo.com
        QA Contact: testopia at bugs.koha-community.org
                CC: m.de.rooy at rijksmuseum.nl

In current iteration of Koha ILS, given the following marc authorities in
marcxml format: 

The first record: 
<record>
  <leader>01877nz  a2200433o  4500</leader>
  <controlfield tag="001">1</controlfield>
      .... 
  </datafield>
  <datafield tag="151" ind1=" " ind2=" ">
    <subfield code="a">Borneo</subfield>
  </datafield>
  <datafield tag="550" ind1=" " ind2=" ">
    <subfield code="w">g</subfield>
    <subfield code="a">South East Asia</subfield>
    <subfield code="c">c_7260</subfield>
  </datafield>
</record>

The second record: 
<record>
  <leader>02462nz  a2200553o  4500</leader>
  <controlfield tag="001">2</controlfield>
       ... 
  <datafield tag="151" ind1=" " ind2=" ">
    <subfield code="a">South East Asia</subfield>
  </datafield>
  <datafield tag="550" ind1=" " ind2=" ">
    <subfield code="w">h</subfield>
    <subfield code="a">Borneo</subfield>
    <subfield code="c">c_1017</subfield>
  </datafield>

</record>

There is no automatic way in linking Borneo with Southeast Asia and vice versa?
Such that the control no. (subfield 9) is added in 550 tag like below: 

Authority Record no. 1: 
  <datafield tag="151" ind1=" " ind2=" ">
    <subfield code="a">Borneo</subfield>
  </datafield>
  <datafield tag="550" ind1=" " ind2=" ">
    <subfield code="w">g</subfield>
    <subfield code="a">South East Asia</subfield>
    <subfield code="c">c_7260</subfield>
    <subfield code="9">2</subfield>
  </datafield>

Authority Record no. 2: 
  <datafield tag="151" ind1=" " ind2=" ">
    <subfield code="a">South East Asia</subfield>
  </datafield>
  <datafield tag="550" ind1=" " ind2=" ">
    <subfield code="w">h</subfield>
    <subfield code="a">Borneo</subfield>
    <subfield code="c">c_1017</subfield>
    <subfield code="9">1</subfield>

Or if this was in MARC: 

=001  1 
=035  \\$ac_1017 
=151  \\$aBorneo 
=550  \\$wg$aSouth East Asia$cc_7260$92 

=LDR  02462nz  a2200553o  4500 
=001  2 
=035  \\$ac_7260 
=151  \\$aSouth East Asia 
=550  \\$wh$aBorneo$cc_1017$91 

Outside of Koha ILS, I was able to do transform the records using below XSLT,
however it will be better if this can be done inside Koha or through a
migration tool script, but will be better if done inside Koha:


<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:dc="http://purl.org/dc/elements/1.1/"  
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="rdf
dc marc">
 <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
 <xsl:key name="term" match="datafield[@tag='151']|datafield[@tag='150']"
use="subfield[@code='a']" />

 <xsl:template match="datafield[@tag='550'][subfield[@code='a']]">
   <xsl:variable name="t550a" select="subfield[@code='a']" />
   <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
     <xsl:for-each select="key('term',$t550a)">
       <subfield code="9">
         <xsl:value-of select="../controlfield[@tag='001']" />
       </subfield>
      </xsl:for-each>
    </xsl:copy>
 </xsl:template>

 <xsl:template match="@*|node()">
  <xsl:copy>
   <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
 </xsl:template>    
</xsl:stylesheet>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list