Right now it is impossible to overlay existing records when importing new authority records. There needs to be a script that handles the following overlay options: * Overlay (or discard) based on matching preferred headings (1xx in MARC21, 2xx in UNIMARC) * Overlay (or discard) based on matching LCCNs (010 in MARC21) * Overlay (or discard) based on matching control numbers (001 for both MARC21 and UNIMARC) * Overlay (or discard) based on matching an earlier form of the heading (4xx$w/2=[aeo] in MARC21, 4xx$5=a in UNIMARC) * Select which record to keep based on the date last modified (003 in MARC21) This script will enable libraries to keep their authority records up to date with the latest national authority files, without polluting the local authority file with numerous copies of authority records (every time they are updated).
Created attachment 10262 [details] [review] Bug 7475: Enable authority overlay This patch does the following: * Completes authority support within Koha's import batch code * Completes authority support in Koha's matching rule code * Exposes the ability to stage and commit batches of authorities using the renamed scripts misc/stage_file.pl and misc/commit_file.pl To test: 1. Find a file of authorities (a sample file with MARC21 authorities is attached to bug 7475) and download it to your server 2. Stage the file using the following command (replace <filename> with the name of the file you saved in step 1): > misc/stage_file.pl --file <filename> --authorities 3. Note the batch number the script assigns to your batch 4. Commit the records using the following command (replace <batchnumber> with the batch number you made note of in step 3): > misc/commit_file.pl --batch-number <batchnumber> 5. Index the authorities Zebraqueue (or wait) 6. Confirm that the new authorities appear. 7. Revert the import with the following command: > misc/commit_file.pl --batch-number <batchnumber> --revert 8. Index the authorities Zebraqueue (or wait) 9. Confirm that the records have been removed
Comment on attachment 10262 [details] [review] Bug 7475: Enable authority overlay False alarm, sorry. This was the wrong patch.
Created attachment 10263 [details] Example authority record Example authority record (version 1)
Created attachment 10264 [details] Example authority record Example authority record (version 2)
Created attachment 10423 [details] [review] Bug 7475: Enable authority overlay This patch does the following: * Completes authority support within Koha's import batch code * Completes authority support in Koha's matching rule code * Exposes the ability to stage and commit batches of authorities using the renamed scripts misc/stage_file.pl and misc/commit_file.pl To test (note that these instructions assume you have a MARC21 installation and are using the provided sample file): 1. Find a file of authorities (a sample file with MARC21 authorities is attached to bug 7475) and download it to your server 2. Stage the file using the following command (replace <filename> with the name of the file you saved in step 1): > misc/stage_file.pl --file <filename> --authorities 3. Note the batch number the script assigns to your batch 4. Commit the records using the following command (replace <batchnumber> with the batch number you made note of in step 3): > misc/commit_file.pl --batch-number <batchnumber> 5. Index the authorities Zebraqueue (or wait) 6. Confirm that the new authorities appear. 7. Create a matching rule with the following settings: Code: AUTHTEST Description: Personal name main entry Match threshold: 999 Record type: Authority record Search index: Heading-main Score: 1000 Tag: 100 Subfields: a Offset: 0 Length: 0 (note the ID of this matching rule) 8. Stage the authority file again, this time using the following command: > misc/stage_file.pl --file <filename> --authorities \ --match <matchingrule> 7. Revert the import with the following command: > misc/commit_file.pl --batch-number <batchnumber> --revert 8. Index the authorities Zebraqueue (or wait) 9. Confirm that the records have been removed
The commit message and functionality in this version of the patch should actually line up.
I am preparing the patch for bug 2060, and the test plan is pretty much exactly the same, so I would suggest holding off on signing off on this one, and I will submit one combined patch (or a series of combined patches) which can then be signed off with exactly as much work as either one was going to be individually.
Patches are available in the bug_2060 branch in my repository: https://github.com/jcamins/koha.git
Please see bug 2060 for the signed-off patches for this feature.
This feature is available in Master.