With the MARC21 standard moving from the 440 to the 490 it would be nice to have to tool that would move information in the catalogue from the 440 to the 490. I've written a tool that switches the information in the two tags for records found to have series information in the database.
Created attachment 2978 [details] [review] proposed patch to add command-line tool to migration_tools
Seems this tool isn't perfect. Instead up updating fields it duplicates them. Quite messy. I've looked at it and can't tell what the problem is. Someone smarter than me will have to fix it if it gets used.
Marking "Failed QA" per Michael Hafen's last comment.
Changing assignment and setting to ASSIGNED.
Created attachment 14437 [details] [review] New script which works properly I've updated the script to use different methods in the MARC::XXX perl modules. This time it works right, and doesn't just copy fields. It even watches for duplicated tags and subfields.
Don't forget to set it to Needs Signoff Michael, or no one will notice it is ready to be tested :)
Michael, your second patch modify the first. So it's not supposed to be obsolete.
Michael, I tried your script. Apparently it works, at last it moved data from 440 to 490. But there is no indication of progress, nor command line options (at last -h or --help). I think you are missing some of the indications in http://wiki.koha-community.org/wiki/Coding_Guidelines#Perl Also, koha-qa complains about indentations.
Created attachment 15579 [details] [review] New patch which would pass QA tool I even ran the koha_qa tool myself to see if it would pass :)
Two things: a) Add "v" (verbose) option to usage b) when running without arguments, it seems to run anyway. Look at the last two lines. Is that ok? bgkriegel@oak:~/kohaclone$ misc/migration_tools/switch_marc21_series_info.pl misc/migration_tools/switch_marc21_series_info.pl: switch MARC21 440 tag and 490 tag contents Parameters: -c Commit the changes to the marc records -m Also update the Koha field to MARC framework mappings for the seriestitle and volume Koha fields. --help or -h show this message. Examining MARC records... There appears to be no series information to change
I like the idea behind this patch, Michael, but I don't think it is as comprehensive as it should be. Take a look at the "Field Definition and Scope" and "Conversion to Current Fields" sections of the MARC 440 page provided by the Library of Congress (http://www.loc.gov/marc/bibliographic/bd440.html). This page states that one should "concatenate field 440 subfields $a, $n and $p and place the new string into 490 subfield $a; and copy the content of 440 subfields $v, $x, $6, and $8 into the same subfields in field 490. Any additional subfields in field 440 do not convert to 490 but do convert to field 830." The additional subfields from 440 are the authority-related $w and $x, which would go into field 830, because it is the field used to link the bib record with the "uniform title" authority record for that series. -- Of course, not all libraries use authorities, so I think it would be useful to have a parameter that handles migrating the 440 to the 490, or migrating the 440 to the 490 AND the 830. If the 440 goes to the 490, the first indicator for the 490 should be 0. If the 440 goes to the 490 and the 830, the first indicator for the 490 should be 1.
(In reply to comment #10) > Two things: > > a) Add "v" (verbose) option to usage > > b) when running without arguments, it seems to run anyway. > Look at the last two lines. Is that ok? > > I've added the 'v' option to usage. When run without arguments it is supposed to look that way. My thinking was that by showing the usage the user would know something wasn't right, and it would show the number of records that would be changed. It might be confusing to some users though, so I'll add a line instructing them to run it with the 'c' option to make the changes.
Created attachment 15604 [details] [review] new patch to pass QA and with authorities linking option My thanks to David Cook for pointing out the information from LOC.gov about concatenating fields and creating 830 tags for authority information. This patch takes all that into account.
Created attachment 15660 [details] [review] [SIGNED-OFF] Bug 5608 - command-line tool to switch information in 440 and 490 tags With the MARC21 standard moving from the 440 tag to the 490, this tool is to help libraries make the move. It switches any information in 440 tags to 490 tags, and any information in 490 tags to 440 tags. That seemed like the best way to go to me. To Test: locate some biblios with 440 or 490 tags filled. run bin/migration_tools/switch_marc21_series_info.pl -c observe that the information in the biblios has switched 4xx tags. http://bugs.koha-community.org/show_bug.cgi?id=5608 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Works as described. No errors.
Created attachment 15661 [details] [review] [SIGNED-OFF] Bug 5608 - command-line tool to switch information in 440 and 490 tags With the MARC21 standard moving from the 440 tag to the 490, this tool is to help libraries make the move. It switches any information in 440 tags to 490 tags, and any information in 490 tags to 440 tags. That seemed like the best way to go to me. There is also an option to create 830 tags for any 44 information, like authorities, that can't be represented in the 490 tag. To Test: locate some biblios with 440 or 490 tags filled. run bin/migration_tools/switch_marc21_series_info.pl -c observe that the information in the biblios has switched 4xx tags. http://bugs.koha-community.org/show_bug.cgi?id=5608 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described. No errors.
Created attachment 15662 [details] [review] Proposed follow-up adding license statement Thanks for reminding me about the license statement requirement.
Ok, but put your name in it :-) Add a line # Copyright 2013 Michael Hafen <mdhafen@tech.washk12.org>
Created attachment 15663 [details] [review] Proposed follow-up adding license and copyright statements
Created attachment 15664 [details] [review] [SIGNED-OFF] Add license statement to switch_series_info CLI script License and copyright statement added. Thanks to Bernardo Gonzalez Kriegel for reminding me about this. http://bugs.koha-community.org/show_bug.cgi?id=5608 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: add license information. No errors.
QA comment: * passes koha-qa.pl * I've added a tiny follow-up to exit immediately if the database is UNIMARC * no side effect risk, it's just a new script passed QA
mmm... just an additionnal comment, jared, your decision/confirmation = haven't we decided to remove BEGIN { # find Koha's Perl modules # test carefully before changing this use FindBin; eval { require "$FindBin::Bin/../kohalib.pl" }; } ?
Created attachment 16670 [details] [review] [PASSED QA] Bug 5608 - command-line tool to switch information in 440 and 490 tags With the MARC21 standard moving from the 440 tag to the 490, this tool is to help libraries make the move. It switches any information in 440 tags to 490 tags, and any information in 490 tags to 440 tags. That seemed like the best way to go to me. To Test: locate some biblios with 440 or 490 tags filled. run bin/migration_tools/switch_marc21_series_info.pl -c observe that the information in the biblios has switched 4xx tags. http://bugs.koha-community.org/show_bug.cgi?id=5608 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Works as described. No errors. Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Created attachment 16671 [details] [review] [PASSED QA] Bug 5608 - command-line tool to switch information in 440 and 490 tags With the MARC21 standard moving from the 440 tag to the 490, this tool is to help libraries make the move. It switches any information in 440 tags to 490 tags, and any information in 490 tags to 440 tags. That seemed like the best way to go to me. There is also an option to create 830 tags for any 44 information, like authorities, that can't be represented in the 490 tag. To Test: locate some biblios with 440 or 490 tags filled. run bin/migration_tools/switch_marc21_series_info.pl -c observe that the information in the biblios has switched 4xx tags. http://bugs.koha-community.org/show_bug.cgi?id=5608 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Work as described. No errors. Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Created attachment 16672 [details] [review] [PASSED QA] Add license statement to switch_series_info CLI script License and copyright statement added. Thanks to Bernardo Gonzalez Kriegel for reminding me about this. http://bugs.koha-community.org/show_bug.cgi?id=5608 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: add license information. No errors. Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Created attachment 16673 [details] [review] [PASSED QA] bug 5608 follow-up: exit immediately if UNIMARC Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This patch has been pushed to master.