Editing content of MARC field 300 - is this the way to go?
Hi We are working with Debian 8 and a package installation of Koha 16.11.04. The database is filled with bibliographic records which are connected to tables "issues" and "biblioitems", also they are linked to authority data. We want to edit the content of MARC field 300 which may look like: <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 map : col. ; 34 x 47 cm</subfield> <subfield code="c">9 pictures</subfield> </datafield> to (for example): <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield> </datafield> It seems not possible to do this using Koha menu "Tools > MARC modification templates" since the new content of MARC field 300 is different for every records and I would have to create many thousands of template actions. Thus I have tried the following: 1. I have unloaded the content of field "marcxml" for every record in table "biblioitems" and cut off everything except the tags and content for MARC field 300. I have then created an SQL statement replacing this content with the new content for the affected record: UPDATE biblioitems SET marcxml = REPLACE( marcxml, '<datafield tag="300" ind1=" " ind2=" ">\n <subfield code="a">1 map :</subfield>\n <subfield code="b">col. ;</subfield>\n <subfield code="c">34 x 47 cm. fold. to 25 x 10 cm.</subfield>', '<datafield tag="300" ind1=" " ind2=" ">\n <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield>') WHERE ExtractValue(biblioitems.marcxml,'//controlfield[@tag="001"]') = 5451649; 2. Like this the content for MARC field 300 in field "marcxml" was correctly changed and I can immediately see the desired result in the Koha OPAC and staff client. No reindexing was needed. 3. But the content of tag <leader> in field "marcxml" has NOT changed (so it still shows the old number of characters of the record). I don't know if this is a problem or how it could be easily solved. My question: Is this the way to go or does anyone have another idea how to accomplish this task? Maybe this is even described in some documentation? Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch
Hi Michael, On Tue, Jun 6, 2017 at 6:49 PM, Michael Kuhn <mik@adminkuhn.ch> wrote: <snipped>
3. But the content of tag <leader> in field "marcxml" has NOT changed (so it still shows the old number of characters of the record). I don't know if this is a problem or how it could be easily solved.
My question: Is this the way to go or does anyone have another idea how to accomplish this task? Maybe this is even described in some documentation?
I'm sure you understand that this happened as you bypassed the MARC21 data handling functions in Koha which would have updated your leaders, A crude way I can see to reset them to their actual values could be to export the data out to MarcEdit as a .mrk mnemonic file and then back to a .mrc file and importing the .mrc file back into Koha, *after* truncating everything in your biblio, biblioitems and items table and post import followed by a full zebra re-index. YMMV and of course back up the database before anything (but you know that already :-) ) just my 2p :-) cheers Indranil Das Gupta L2C2 Technologies Phone : +91-98300-20971 WWW : http://www.l2c2.co.in Blog : http://blog.l2c2.co.in IRC : indradg on irc://irc.freenode.net Twitter : indradg
Hi Indranil Thanks for your 2p! :-)
On Tue, Jun 6, 2017 at 6:49 PM, Michael Kuhn <mik@adminkuhn.ch> wrote: <snipped>
3. But the content of tag <leader> in field "marcxml" has NOT changed (so it still shows the old number of characters of the record). I don't know if this is a problem or how it could be easily solved.
Since I'm curious I'm wondering if this a problem at all? To show the results in the OPAC it seems to be no problem however.
My question: Is this the way to go or does anyone have another idea how to accomplish this task? Maybe this is even described in some documentation?> I'm sure you understand that this happened as you bypassed the MARC21 data handling functions in Koha which would have updated your leaders,
Yes, I understand.
A crude way I can see to reset them to their actual values could be to export the data out to MarcEdit as a .mrk mnemonic file and then back to a .mrc file and importing the .mrc file back into Koha, *after* truncating everything in your biblio, biblioitems and items table and post import followed by a full zebra re-index.
YMMV and of course back up the database before anything (but you know that already :-) )
Yes, I have also thought about this way but before going it I would like to know a) Is it really NECESSARY at all? I have unloaded the changed record (with the old length) and then reloaded the record via menu "Stage MARC records for import". The record could be loaded without problems even if the old length was wrong (the Stage MARC records tool even corrected the old length to the correct new length). It seems like this length doesn't mean too much, at least not under these circumstances. b) Can I also achieve the same result by just calculating the new length of the record and also directly write this via SQL UPDATE into field "biblioitems.marcxml"? This would spare me unloading, Marcedit, truncating, reimporting, reindexing and relinking authorities (but not backing up the database, of course ;-) All hints are very welcome! At the moment it seems to me the record length is nice if correct but Koha doesn't really need it. Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch
Do it in Perl, using C4::Biblio. That's the way to do it imho. El mar., 6 de jun. de 2017 10:19 AM, Michael Kuhn <mik@adminkuhn.ch> escribió:
Hi
We are working with Debian 8 and a package installation of Koha 16.11.04. The database is filled with bibliographic records which are connected to tables "issues" and "biblioitems", also they are linked to authority data.
We want to edit the content of MARC field 300 which may look like:
<datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 map : col. ; 34 x 47 cm</subfield> <subfield code="c">9 pictures</subfield> </datafield>
to (for example):
<datafield tag="300" ind1=" " ind2=" "> <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield> </datafield>
It seems not possible to do this using Koha menu "Tools > MARC modification templates" since the new content of MARC field 300 is different for every records and I would have to create many thousands of template actions.
Thus I have tried the following:
1. I have unloaded the content of field "marcxml" for every record in table "biblioitems" and cut off everything except the tags and content for MARC field 300. I have then created an SQL statement replacing this content with the new content for the affected record:
UPDATE biblioitems SET marcxml = REPLACE( marcxml, '<datafield tag="300" ind1=" " ind2=" ">\n <subfield code="a">1 map :</subfield>\n <subfield code="b">col. ;</subfield>\n <subfield code="c">34 x 47 cm. fold. to 25 x 10 cm.</subfield>', '<datafield tag="300" ind1=" " ind2=" ">\n <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield>') WHERE ExtractValue(biblioitems.marcxml,'//controlfield[@tag="001"]') = 5451649;
2. Like this the content for MARC field 300 in field "marcxml" was correctly changed and I can immediately see the desired result in the Koha OPAC and staff client. No reindexing was needed.
3. But the content of tag <leader> in field "marcxml" has NOT changed (so it still shows the old number of characters of the record). I don't know if this is a problem or how it could be easily solved.
My question: Is this the way to go or does anyone have another idea how to accomplish this task? Maybe this is even described in some documentation?
Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
-- Tomás Cohen Arazi Theke Solutions (https://theke.io <http://theke.io/>) ✆ +54 9351 3513384 GPG: B2F3C15F
Or....depending on the collection size... you could export your records, modify them with a marc modifier tool (MarcEdit or other) and then reimport matching on the biblionumber 999$c. -joy On Tue, Jun 6, 2017 at 9:33 PM, Tomas Cohen Arazi <tomascohen@gmail.com> wrote:
Do it in Perl, using C4::Biblio. That's the way to do it imho.
El mar., 6 de jun. de 2017 10:19 AM, Michael Kuhn <mik@adminkuhn.ch> escribió:
Hi
We are working with Debian 8 and a package installation of Koha 16.11.04. The database is filled with bibliographic records which are connected to tables "issues" and "biblioitems", also they are linked to authority data.
We want to edit the content of MARC field 300 which may look like:
<datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 map : col. ; 34 x 47 cm</subfield> <subfield code="c">9 pictures</subfield> </datafield>
to (for example):
<datafield tag="300" ind1=" " ind2=" "> <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield> </datafield>
It seems not possible to do this using Koha menu "Tools > MARC modification templates" since the new content of MARC field 300 is different for every records and I would have to create many thousands of template actions.
Thus I have tried the following:
1. I have unloaded the content of field "marcxml" for every record in table "biblioitems" and cut off everything except the tags and content for MARC field 300. I have then created an SQL statement replacing this content with the new content for the affected record:
UPDATE biblioitems SET marcxml = REPLACE( marcxml, '<datafield tag="300" ind1=" " ind2=" ">\n <subfield code="a">1 map :</subfield>\n <subfield code="b">col. ;</subfield>\n <subfield code="c">34 x 47 cm. fold. to 25 x 10 cm.</subfield>', '<datafield tag="300" ind1=" " ind2=" ">\n <subfield code="a">NEW CONTENT FOR THIS RECORD</subfield>') WHERE ExtractValue(biblioitems.marcxml,'//controlfield[@tag="001"]') = 5451649;
2. Like this the content for MARC field 300 in field "marcxml" was correctly changed and I can immediately see the desired result in the Koha OPAC and staff client. No reindexing was needed.
3. But the content of tag <leader> in field "marcxml" has NOT changed (so it still shows the old number of characters of the record). I don't know if this is a problem or how it could be easily solved.
My question: Is this the way to go or does anyone have another idea how to accomplish this task? Maybe this is even described in some documentation?
Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
-- Tomás Cohen Arazi Theke Solutions (https://theke.io <http://theke.io/>) ✆ +54 9351 3513384 GPG: B2F3C15F _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
-- Joy Nelson Director of Migrations ByWater Solutions <http://bywatersolutions.com> Support and Consulting for Open Source Software Office: Fort Worth, TX Phone/Fax (888)900-8944 What is Koha? <http://bywatersolutions.com/what-is-koha/>
participants (4)
-
Indranil Das Gupta -
Joy Nelson -
Michael Kuhn -
Tomas Cohen Arazi