Catmandu-MARC-0.214000755000765000024 012616110204 14064 5ustar00hochstenstaff000000000000README100644000765000024 536512616110204 15036 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214NAME Catmandu::MARC - Catmandu modules for working with MARC data SYNOPSIS # On the command line $ catmandu convert MARC to JSON < data.mrc $ catmandu convert MARC --type MiJ to YAML < data.marc_in_json $ catmandu convert MARC --fix "marc_map(245,title)" < data.mrc $ catmandu convert MARC --fix myfixes.txt < data.mrc myfixes: marc_map("245a", title) marc_map("5**", note.$append) marc_map('710','my.authors.$append') marc_map('008_/35-35','my.language') remove_field(record) add_field(my.funny.field,'test123') $ catmandu import MARC --fix myfixes.txt to ElasticSearch --index_name 'catmandu' < data.marc # In perl use Catmandu; my $importer = Catmandu->importer('MARC', file => 'data.mrc' ); my $fixer = Catmandu->fixer('myfixes.txt'); my $store = Catmandu->store('ElasticSearch', index_name => 'catmandu'); $store->add_many( $fixer->fix($importer) ); MODULES * Catmandu::Importer::MARC * Catmandu::Exporter::MARC * Catmandu::Fix::marc_map * Catmandu::Fix::marc_add * Catmandu::Fix::marc_remove * Catmandu::Fix::marc_xml * Catmandu::Fix::marc_in_json * Catmandu::Fix::marc_set * Catmandu::Fix::Bind::marc_each * Catmandu::Fix::Condition::marc_match * Catmandu::Fix::Inline::marc_map * Catmandu::Fix::Inline::marc_add * Catmandu::Fix::Inline::marc_remove DESCRIPTION With Catmandu, LibreCat tools abstract digital library and research services as data warehouse processes. As stores we reuse MongoDB or ElasticSearch providing us with developer friendly APIs. Catmandu works with international library standards such as MARC, MODS and Dublin Core, protocols such as OAI-PMH, SRU and open repositories such as DSpace and Fedora. And, of course, we speak the evolving Semantic Web. Follow us on http://librecat.org and read an introduction into Catmandu data processing at https://github.com/LibreCat/Catmandu/wiki. SEE ALSO Catmandu, Catmandu::Importer, Catmandu::Fix, Catmandu::Store AUTHOR Patrick Hochstenbach, CONTRIBUTORS * Nicolas Steenlant, * Nicolas Franck, * Johann Rolschewski, johann.rolschewski at sbb.spk-berlin.de * Chris Cormack * Robin Sheat LICENSE AND COPYRIGHT This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. Changes100644000765000024 1100412616110204 15454 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214Revision history for Catmandu-MARC 0.214 2015-11-03 11:46:22 CET - Maintenance release skipping buggy Catmandu versions 0.213 2015-09-30 16:00:11 CEST - Adding support for setting anf adding JSON paths 0.212 2015-09-29 11:07:13 CEST - Fixed marc_each single execution bug 0.211 2015-08-31 16:17:42 CEST - Fixed POD spelling - Adding marc_each bind 0.210 2015-05-20 11:23:46 CEST - Optimizing Aleph sequentials exports - Fixed round tripping of Aleph sequential - Fixing marc_in_json - Adding support for marc_in_json back to catmandu marc mapping 0.209 2015-02-20 13:39:05 CET - Fixed value feature 0.208 2015-02-04 20:16:39 CET - Fixing CLI arguments and options bug #12 - Adding support for double encoded subfields 0.207 2015-01-09 10:02:48 CET - Fixed: Parser "RAW" and fix "marc_map": got field content twice #12 - Removed double generator fix magic for command line support 0.206 2014-10-21 12:01:35 CEST - Adding pluck support 0.205 2014-06-23 21:18:06 CEST - Fixed collection bug in the MARC exporter 0.204 2014-06-11 07:41:39 BST - Need Catmandu 0.9202 to get the delegations working properly 0.203 2014-05-30 17:37:37 CEST - Adding marc_set fix - Making marc_map and marc_set indicator aware - Supporting deletion of subfields for marc_remove - Fixing EOF bug in RAW importer 0.202 2014-05-29 19:46:40 CEST - Fixing the catmandu command line fixes bug 0.201 2014-05-29 09:11:24 CEST - Adding the MARC::Parser::RAW and updating the pod 0.2 2014-05-28 15:24:03 CEST - Refactoring MARC import and export parsers and serializers - Add importers for MARCMaker, MARC-in-JSON and MARC::Catmandu - Add Lint based validator for USMARC - Add exporters for USMARC, MARCMaker and MARC-in-JSON 0.117 2014-05-23 12:06:40 CEST - Adding more documentation hints - Fixing the marc_match (deleting temporary keys) 0.116 2014-05-23 09:31:14 CEST - Switched to Dist::Milla 0.115 2014-05-22 - Fixed broken MANIFEST 0.114 2014-05-20 - Adding the if marc_match condition 0.112 2014-04-03 - Adding the new files to the manifest :-/ 0.112 2014-04-03 - Adding the inline marc_remove fix 0.111 2014-03-19 - fixed marc_add test to reflect the correct number of tests 0.110 2014-03-18 - adding support for marc_add fixes 0.109 2014-03-14 - in response to popular request adding Aleph sequential export support 0.108 2014-03-11 - all Catmandu::Exporter::MARC methods should be instance and class methods to make marc_xml work 0.107 2014-03-04 - adding Robin Sheat as contributor - bumping version to resolve verson conflict at CPAN 0.106 2014-03-03 - allow for non-standard system identifier fields 0.105 2014-02-11 - handle Aleph FMT tags 0.104 2013-12-20 - Exporter::MARC now skips also skips empty strings by default - improved marc_map pod 0.103 2013-12-18 - Exporter::MARC skips undef (sub)fields by default 0.102 2013-12-10 - Importer::MARC skips empty fields 0.101 2013-12-04 - fix importer tests 0.1 2013-12-03 - consume MARC::Record objects 0.09 2013-10-31 - fixed export formatting bug 0.08 2013-09-27 - inline marc_map 0.07 2013-09-17 - fixed the underscore subfields in non-control fields - adding backwards compatibility 0.06 2013-06-28 - marc_remove fix - marc_map -split option 0.05 2013-06-19 - marc_map exclude subfields syntax 0.0401 2013-06-17 - remove given/when statements 0.04 2013-06-14 - faster marc_xml fix 0.0304 2013-03-26 - import confess 0.0303 2013-03-13 - fix MARCXML namespace 0.0302 2013-03-13 - fix perl version im marc_map test 0.0301 2013-03-12 - safe substr outside string in marc_map 0.03 2013-02-26 - compile marc_map fix 0.0201 2013-02-07 - fix dependencies 0.02 2013-02-05 - MARCXML exporter - make MARC record key configurable everywhere 0.0109 2013-02-01 - fix MARC21 xml export 0.0108 2013-01-22 - fix leader in xml export 0.0107 2013-01-11 - fix creation of undef value with nonexisting $append key 0.0106 2012-11-09 - fix _id field value 0.0105 2012-10-10 - fix missing uppercase subfield datafield 0.0104 2012-10-09 - only allow alphanumeric fields in MARCXML export - utf8 fixes 0.0103 2012-06-14 - add configurable identifier field (default 001) - add virtual '_' to every field to make USMARC|MicroLIF|XML and ALEPHSEQ output equal 0.0102 2012-05-25 - fix indicator bug 0.0101 2012-05-16 - fix control field bug 0.01 2012-05-04 - initial release LICENSE100644000765000024 4370512616110204 15203 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214This software is copyright (c) 2015 by Patrick Hochstenbach. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2015 by Patrick Hochstenbach. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2015 by Patrick Hochstenbach. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End cpanfile100644000765000024 107612616110204 15655 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214requires 'perl', 'v5.10.1'; on 'test', sub { requires 'Test::Simple', '1.001003'; requires 'Test::More', '1.001003'; requires 'Test::Deep', '0'; requires 'XML::XPath', '1.13'; requires 'Pod::Simple::HTML', '>=3.23'; requires 'Test::Pod' , '0'; }; requires 'Catmandu', '>=0.94,!=0.9502,!=0.9503'; requires 'JSON::XS', '2.3'; requires 'YAML::XS', '0.34'; requires 'MARC::File::XML', '0.93'; requires 'MARC::File::MARCMaker', '0.05'; requires 'MARC::File::MiJ' , '0.04'; requires 'MARC::Record', '2.0.6'; requires 'MARC::Parser::RAW', '0'; requires 'Moo', '1.0'; Build.PL100644000765000024 312512616110204 15442 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214 # This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v5.039. use strict; use warnings; use Module::Build 0.28; my %module_build_args = ( "build_requires" => { "Module::Build" => "0.28" }, "configure_requires" => { "Module::Build" => "0.28" }, "dist_abstract" => "Catmandu modules for working with MARC data", "dist_author" => [ "Patrick Hochstenbach, C<< >>" ], "dist_name" => "Catmandu-MARC", "dist_version" => "0.214", "license" => "perl", "module_name" => "Catmandu::MARC", "recursive_test_files" => 1, "requires" => { "Catmandu" => ">= 0.94, != 0.9502, != 0.9503", "JSON::XS" => "2.3", "MARC::File::MARCMaker" => "0.05", "MARC::File::MiJ" => "0.04", "MARC::File::XML" => "0.93", "MARC::Parser::RAW" => 0, "MARC::Record" => "v2.0.6", "Moo" => "1.0", "YAML::XS" => "0.34", "perl" => "v5.10.1" }, "test_requires" => { "Pod::Simple::HTML" => "3.23", "Test::Deep" => 0, "Test::More" => "1.001003", "Test::Pod" => 0, "Test::Simple" => "1.001003", "XML::XPath" => "1.13" } ); my %fallback_build_requires = ( "Module::Build" => "0.28", "Pod::Simple::HTML" => "3.23", "Test::Deep" => 0, "Test::More" => "1.001003", "Test::Pod" => 0, "Test::Simple" => "1.001003", "XML::XPath" => "1.13" ); unless ( eval { Module::Build->VERSION(0.4004) } ) { delete $module_build_args{test_requires}; $module_build_args{build_requires} = \%fallback_build_requires; } my $build = Module::Build->new(%module_build_args); $build->create_build_script; META.yml100644000765000024 276012616110204 15423 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214--- abstract: 'Catmandu modules for working with MARC data' author: - 'Patrick Hochstenbach, C<< >>' build_requires: Module::Build: '0.28' Pod::Simple::HTML: '3.23' Test::Deep: '0' Test::More: '1.001003' Test::Pod: '0' Test::Simple: '1.001003' XML::XPath: '1.13' configure_requires: Module::Build: '0.28' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.039, Dist::Milla version v1.0.15, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Catmandu-MARC no_index: directory: - t - xt - inc - share - eg - examples requires: Catmandu: '>= 0.94, != 0.9502, != 0.9503' JSON::XS: '2.3' MARC::File::MARCMaker: '0.05' MARC::File::MiJ: '0.04' MARC::File::XML: '0.93' MARC::Parser::RAW: '0' MARC::Record: v2.0.6 Moo: '1.0' YAML::XS: '0.34' perl: v5.10.1 resources: bugtracker: https://github.com/LibreCat/Catmandu-MARC/issues homepage: https://github.com/LibreCat/Catmandu-MARC repository: https://github.com/LibreCat/Catmandu-MARC.git version: '0.214' x_contributors: - 'Chris Cormack ' - 'Johann Rolschewski ' - 'Johann Rolschewski ' - 'Nicolas Steenlant ' - 'Patrick Hochstenbach ' - 'Patrick Hochstenbach ' - 'Robin Sheat ' MANIFEST100644000765000024 327212616110204 15302 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.039. Build.PL Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml README cpanfile lib/Catmandu/Exporter/MARC.pm lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm lib/Catmandu/Exporter/MARC/Base.pm lib/Catmandu/Exporter/MARC/MARCMaker.pm lib/Catmandu/Exporter/MARC/MiJ.pm lib/Catmandu/Exporter/MARC/USMARC.pm lib/Catmandu/Exporter/MARC/XML.pm lib/Catmandu/Fix/Bind/marc_each.pm lib/Catmandu/Fix/Condition/marc_match.pm lib/Catmandu/Fix/Inline/marc_add.pm lib/Catmandu/Fix/Inline/marc_map.pm lib/Catmandu/Fix/Inline/marc_remove.pm lib/Catmandu/Fix/Inline/marc_set.pm lib/Catmandu/Fix/marc_add.pm lib/Catmandu/Fix/marc_decode_dollar_subfields.pm lib/Catmandu/Fix/marc_in_json.pm lib/Catmandu/Fix/marc_map.pm lib/Catmandu/Fix/marc_remove.pm lib/Catmandu/Fix/marc_set.pm lib/Catmandu/Fix/marc_xml.pm lib/Catmandu/Importer/MARC.pm lib/Catmandu/Importer/MARC/ALEPHSEQ.pm lib/Catmandu/Importer/MARC/Decoder.pm lib/Catmandu/Importer/MARC/Lint.pm lib/Catmandu/Importer/MARC/MARCMaker.pm lib/Catmandu/Importer/MARC/MiJ.pm lib/Catmandu/Importer/MARC/MicroLIF.pm lib/Catmandu/Importer/MARC/RAW.pm lib/Catmandu/Importer/MARC/Record.pm lib/Catmandu/Importer/MARC/USMARC.pm lib/Catmandu/Importer/MARC/XML.pm lib/Catmandu/MARC.pm t/00-load.t t/01-importer.t t/02-aleph.t t/03-marc_map.t t/04-marc21.t t/05-marc_remove.t t/06-old-new-internal-syntax.t t/07-inline-fix.t t/08-exporter.t t/09-marc_add.t t/10-marcmaker.t t/11-mij.t t/12-marc_set.t t/13-marcxml.t t/14-marc_decode_dollar_subfields.t t/15-marc_in_json.t t/16-marc-each.t t/camel.mrk t/camel.usmarc t/dollar_subfields.mrc t/marc.xml t/old_new.json t/release-pod-syntax.t t/rug01.aleph t/test.fix t/test.ndj META.json100644000765000024 476512616110204 15602 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214{ "abstract" : "Catmandu modules for working with MARC data", "author" : [ "Patrick Hochstenbach, C<< >>" ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.039, Dist::Milla version v1.0.15, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Catmandu-MARC", "no_index" : { "directory" : [ "t", "xt", "inc", "share", "eg", "examples" ] }, "prereqs" : { "build" : { "requires" : { "Module::Build" : "0.28" } }, "configure" : { "requires" : { "Module::Build" : "0.28" } }, "develop" : { "requires" : { "Dist::Milla" : "v1.0.15", "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Catmandu" : ">= 0.94, != 0.9502, != 0.9503", "JSON::XS" : "2.3", "MARC::File::MARCMaker" : "0.05", "MARC::File::MiJ" : "0.04", "MARC::File::XML" : "0.93", "MARC::Parser::RAW" : "0", "MARC::Record" : "v2.0.6", "Moo" : "1.0", "YAML::XS" : "0.34", "perl" : "v5.10.1" } }, "test" : { "requires" : { "Pod::Simple::HTML" : "3.23", "Test::Deep" : "0", "Test::More" : "1.001003", "Test::Pod" : "0", "Test::Simple" : "1.001003", "XML::XPath" : "1.13" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/LibreCat/Catmandu-MARC/issues" }, "homepage" : "https://github.com/LibreCat/Catmandu-MARC", "repository" : { "type" : "git", "url" : "https://github.com/LibreCat/Catmandu-MARC.git", "web" : "https://github.com/LibreCat/Catmandu-MARC" } }, "version" : "0.214", "x_contributors" : [ "Chris Cormack ", "Johann Rolschewski ", "Johann Rolschewski ", "Nicolas Steenlant ", "Patrick Hochstenbach ", "Patrick Hochstenbach ", "Robin Sheat " ] } t000755000765000024 012616110204 14250 5ustar00hochstenstaff000000000000Catmandu-MARC-0.21411-mij.t100644000765000024 56512616110204 15561 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use utf8; use Catmandu::Importer::MARC; use Test::More tests => 3; my $importer = Catmandu::Importer::MARC->new(file => 't/test.ndj', type => 'MiJ'); my $records = $importer->to_array; ok(@$records == 9); is($records->[0]->{record}->[1]->[4] , '000000040'); is($records->[0]->{record}->[13]->[4] , 'Pevsner, Nikolaus,'); 1;marc.xml100644000765000024 454312616110204 16062 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t periodical00000nas-a2200000z--4500130127s----------------------000---kor-d991042727010838ejn01991042727010838TRANSACTIONS ON ELECTRICAL AND ELECTRONIC MATERIALSTEEMTEEM (한국전기전자재료학회)TEEM (한국전기전자재료학회)TEEM 한 국 전 기 전 자 재 료 학 회Seoul, KoreaKorean Institute of Electrical and Electronic Material Engineers1229-76072092-7592Available from 2000. 111061245432001111061245432000DOAJ Directory of Open Access Journals:Full Text2670000000686647EngineeringElectrical Engineering test.fix100644000765000024 113412616110204 16076 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/tmarc_map('001', 'my.id'); marc_map('245a', 'my.title'); marc_map('666', 'my.references.$append'); marc_map('001/3-5', 'my.substr_id'); marc_map('001/1003-1005', 'my.failed_substr_id'); marc_map('245', 'my.split_title', '-split', 1); add_field('my.found005',0); if_marc_match('005','20000613133448.0'); set_field('my.found005',1); end(); add_field('my.found008','0'); if_marc_match('008_/6-7','s'); set_field('my.found008','1'); end(); marc_map('050ba','my.pluck', -pluck => 1) marc_map('245','my.has_title', -value => 'Y') marc_xml('record'); #remove_field('record'); test.ndj100644000765000024 6316312616110204 16115 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t{"leader":"01470nam^a22004451^^4500","fields":[{"001":"000000040"},{"005":"19880715000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1968^^^^nyuae^^^^b^^^|00100^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"68027371"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0001728-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818044"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00001728"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"},{"d":"CStRLIN"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"N6350"},{"b":".P4 1968b"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"709.03"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Pevsner, Nikolaus,"},{"d":"1902-1983."}]}},{"245":{"ind1":"1","ind2":"0","subfields":[{"a":"Studies in art, architecture, and design."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"New York,"},{"b":"Walker"},{"c":"[1968]"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"2 v."},{"b":"illus., plans."},{"c":"30 cm."}]}},{"504":{"ind1":" ","ind2":" ","subfields":[{"a":"Includes bibliographical references."}]}},{"505":{"ind1":"0","ind2":" ","subfields":[{"a":"v. 1. From mannerism to romanticism.--v. 2. Victorian and after."}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Art"},{"x":"History"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"BUHR"},{"c":"AAEL"},{"h":"N 5303 .P52 1968"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"N 5303 .P52 1968"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"z":"v.1"},{"u":"mdp.39015005817484"},{"r":"ic"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"z":"v.1"},{"u":"mdp.39015006324134"},{"r":"ic"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"z":"v.2"},{"u":"mdp.39015006324142"},{"r":"ic"},{"d":"20090907"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"z":"v.2"},{"u":"mdp.39015007230850"},{"r":"ic"},{"d":"20091119"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"c":"GAC"},{"s":"9125"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"form"},{"b":"form character life trend modern merely self world romantic attitude nature expression element mean principle"},{"c":"761"}]}}]} {"leader":"01593nam^a22004451^^4500","fields":[{"001":"000000212"},{"005":"20031119000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1969^^^^mauae^^^^bc^^|00100^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"79089648"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0020036-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818260"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00020036"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"NA737.E4"},{"b":"Z3"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"720/.924"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Zaitzevsky, Cynthia."}]}},{"245":{"ind1":"1","ind2":"4","subfields":[{"a":"The architecture of William Ralph Emerson, 1833-1917;"},{"b":"catalogue."},{"c":"Photography by Myron Miller."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"[Cambridge? Mass."},{"c":"1969]"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"100 p."},{"b":"illus., plans."},{"c":"26 cm."}]}},{"500":{"ind1":" ","ind2":" ","subfields":[{"a":"Catalog of an exhibition presented by the Fogg Art Museum in collaboration with the Carpenter Center for the Visual Arts, Harvard University, May 30-June 20, 1969."}]}},{"504":{"ind1":" ","ind2":" ","subfields":[{"a":"Includes bibliographical references."}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"600":{"ind1":"1","ind2":"0","subfields":[{"a":"Emerson, William Ralph,"},{"d":"1833-1917."}]}},{"710":{"ind1":"2","ind2":" ","subfields":[{"a":"Fogg Art Museum."}]}},{"710":{"ind1":"2","ind2":" ","subfields":[{"a":"Carpenter Center for the Visual Arts."}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"STO"},{"h":"NA737.E53 Z22"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"STO"},{"h":"NA 737 .E53 Z22"},{"x":"acq. Gift. 510-1086"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015006349636"},{"r":"ic"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015013176907"},{"r":"ic"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"s":"9665"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"architecture"},{"b":"roof front gable porch bay corner cornice entrance rear brick window chimney wing dormer door"},{"c":"474"}]}}]} {"leader":"01426nam^a22003971^^4500","fields":[{"001":"000000250"},{"005":"20060630100341.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1969^^^^nyua^^^^^b^^^|00000^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"69015895"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0023127-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818301"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00023127"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"ND1283"},{"b":".B47"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"751.4"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Birren, Faber,"},{"d":"1900-1988."}]}},{"245":{"ind1":"1","ind2":"0","subfields":[{"a":"Principles of color;"},{"b":"a review of past traditions and modern theories of color harmony."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"New York,"},{"b":"Van Nostrand Reinhold Co."},{"c":"[1969]"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"96 p."},{"b":"illus. (part col.)"},{"c":"21 cm."}]}},{"504":{"ind1":" ","ind2":" ","subfields":[{"a":"Bibliography: p. 79-80."}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Color"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"ND1283 .B62"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015012235738"},{"r":"ic"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"s":"9665"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"color"},{"b":"blue red green yellow brown white dark pink orange pale purple grey deep bright rose"},{"c":"282"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"color"},{"b":"color colored gray coloring colorful modeling colorist ocher favorite tan colorless ored modeled practiced centered"},{"c":"573"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"color"},{"b":"red yellow blue green hue hues light orange violet pigment contrast complementary eye intensity mixture"},{"c":"727"}]}}]} {"leader":"01440nam^a22004451^^4500","fields":[{"001":"000000310"},{"005":"19981110000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1969^^^^gh^abe^^^b^^^|00000^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"75005747"}]}},{"020":{"ind1":" ","ind2":" ","subfields":[{"a":"0197138098"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0030116-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818386"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00030116"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"NA6097.A8"},{"b":"S95"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"726/.1/96"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Swithenbank, Michael."}]}},{"245":{"ind1":"1","ind2":"0","subfields":[{"a":"Ashanti fetish houses."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"Accra,"},{"b":"Ghana Universities Press,"},{"c":"1969."}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"68 p."},{"b":"illus., map, plans."},{"c":"19 x 23 cm."}]}},{"504":{"ind1":" ","ind2":" ","subfields":[{"a":"Bibliography: p. 68."}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Temples"},{"z":"Ashanti."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Fetishism"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"NA 6097 .A8 S97"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"BUHR"},{"c":"GRAD"},{"h":"NA 6097 .A8 S97"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015006744604"},{"r":"ic"},{"d":"20090621"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015023466272"},{"r":"ic"},{"d":"20090711"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"s":"9665"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"entryways"},{"b":"entrance stair courtyard wall front door staircase corridor corner level court upper stairway balcony leading"},{"c":"44"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"figures"},{"b":"mask figure head spirit object cloth chief female power people male ancestor bead human region"},{"c":"411"}]}}]} {"leader":"01597nam^a22004811^^4500","fields":[{"001":"000000338"},{"005":"19880715000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1969^^^^nyua^^^^^b^^^|00000^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"77084094//r71"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0032478-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818417"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00032478"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"ND673.M35"},{"b":"S92"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"759.4"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Sylvester, David."}]}},{"245":{"ind1":"0","ind2":"0","subfields":[{"a":"Magritte."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"New York,"},{"b":"Praeger"},{"c":"[1969]"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"126 p."},{"b":"illus. (part col.)"},{"c":"24 cm."}]}},{"500":{"ind1":" ","ind2":" ","subfields":[{"a":"\"Revised version ... of the catalogue of the retrospective exhibition presented by the Arts Council of Great Britain at the Tate Gallery, London, in the spring of 1969.\""}]}},{"504":{"ind1":" ","ind2":" ","subfields":[{"a":"Includes bibliographical references."}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"600":{"ind1":"1","ind2":"0","subfields":[{"a":"Magritte, René,"},{"d":"1898-1967."}]}},{"710":{"ind1":"2","ind2":" ","subfields":[{"a":"Arts Council of Great Britain."}]}},{"710":{"ind1":"2","ind2":" ","subfields":[{"a":"Tate Gallery."}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"UGL"},{"h":"ND673.M33 S99"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"ND 673 .M33 S99"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"FINE"},{"h":"ND 673 .M33 S99"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"FINE"},{"h":"ND 673 .M33 S99"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040809"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015009416986"},{"r":"ic"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"s":"9665"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"collage"},{"b":"collage cardboard assemblage cut version newspaper bottle photograph mine mounted pasted gouache fragment readymade wooden"},{"c":"110"}]}}]} {"leader":"01531nam^a22004331^^4500","fields":[{"001":"000000385"},{"005":"19880715000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715r1967^^^^enkaf^^^^^^^^|00000^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"70371182"}]}},{"015":{"ind1":" ","ind2":" ","subfields":[{"a":"B68-22096"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0037351-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818471"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00037351"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"NK928"},{"b":".L57 1967"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"913.36"}]}},{"110":{"ind1":"2","ind2":" ","subfields":[{"a":"London Museum."}]}},{"245":{"ind1":"1","ind2":"0","subfields":[{"a":"Medieval catalogue."}]}},{"250":{"ind1":" ","ind2":" ","subfields":[{"a":"[1st ed., 4th impression]."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"London,"},{"b":"H.M.S.O.,"},{"c":"1975."}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"319 p."},{"b":"99 plates, illus. (some col.)."},{"c":"26 cm."}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Decorative arts"},{"z":"England."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Decorative arts, Medieval"},{"z":"England."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Archaeology, Medieval"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"BUHR"},{"c":"GRAD"},{"h":"NK928 .L85 1975"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015010558024"},{"r":"ic"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"s":"9665"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"archaeology"},{"b":"vessel excavation type pottery fragment excavated grave burial archaeological evidence figurine period date fabric sherd"},{"c":"595"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"metalwork"},{"b":"gilt engraved diam oval chased ring head bezel handle hoop circular mount shaped ornament pierced"},{"c":"731"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"time periods"},{"b":"century centuries cen tury quarter beginning dating llth turies import ury l7th centur progenitor craftmanship"},{"c":"771"}]}}]} {"leader":"01318nam^a22004331^^4500","fields":[{"001":"000000396"},{"005":"19880715000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1968^^^^enka^^^^^^^^^^00000^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"74366090"}]}},{"015":{"ind1":" ","ind2":" ","subfields":[{"a":"B68-24743"}]}},{"020":{"ind1":" ","ind2":" ","subfields":[{"a":"0289277884"},{"c":"25/-"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0040363-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818483"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00040363"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"N6493 1920"},{"b":".H5"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"709.04/2"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Hillier, Bevis,"},{"d":"1940-"}]}},{"245":{"ind1":"1","ind2":"0","subfields":[{"a":"Art Deco of the 20s and 30s."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"[London]"},{"b":"Studio Vista,"},{"c":"[1968]"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"168 p. (chiefly illus. (some col.))."},{"c":"19 cm."}]}},{"490":{"ind1":"0","ind2":" ","subfields":[{"a":"Studio Vista/Dutton pictureback"}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Art, Modern"},{"y":"20th century"}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Decorative arts"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"N 6494 .A7 H65"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"N 6494 .A7 H65"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015033751887"},{"r":"ic"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"c":"GAC"},{"s":"9125"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"eras"},{"b":"time sixties thirties twenties fifties decade seventies forties eighties own world generation late period example"},{"c":"287"}]}}]} {"leader":"01921nam^a22004931^^4500","fields":[{"001":"000000499"},{"005":"19880715000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1969^^^^nyuabe^^^b^^^^00110^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"69015754"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0051006-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818600"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00051006"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"NA275"},{"b":".S3 1969"}]}},{"082":{"ind1":" ","ind2":" ","subfields":[{"a":"726.1/2/08"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Scully, Vincent Joseph,"},{"d":"1920-"}]}},{"245":{"ind1":"1","ind2":"4","subfields":[{"a":"The earth, the temple, and the gods;"},{"b":"Greek sacred architecture"},{"c":"[by] Vincent Scully."}]}},{"250":{"ind1":" ","ind2":" ","subfields":[{"a":"Rev. ed."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"New York,"},{"b":"Praeger"},{"c":"[1969]"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"xxxii, 271, [192] p."},{"b":"illus., maps, plans."},{"c":"26 cm."}]}},{"500":{"ind1":" ","ind2":" ","subfields":[{"a":"\"Illustrations\": p. [1]-[192] (3d group)"}]}},{"504":{"ind1":" ","ind2":" ","subfields":[{"a":"Bibliographical references included in \"Notes\" (p. 227-251)"}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Architecture, Greek"}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Temples, Greek"}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Mythology, Greek"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"NA275 .S44 1969"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"HATCH"},{"c":"GRAD"},{"h":"NA 275 .S44 1969"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015004888684"},{"r":"ic"},{"d":"20090702"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015006345766"},{"r":"ic"},{"d":"20091105"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"s":"9665"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"deities"},{"b":"god ancient goddess sacred cult ritual power sun legend priest myth king animal sacrifice worship"},{"c":"417"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"nature"},{"b":"mountain river valley mile rock road lake stream bank near slope plain peak beyond cliff"},{"c":"618"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"ancient architecture"},{"b":"temple wall tomb pyramid court palace chamber colonnade capital sanctuary built plan cella stone architecture"},{"c":"683"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"space"},{"b":"effect space colorplate heavy weight contrast strong powerful power detail force entire structural solid massive"},{"c":"776"}]}}]} {"leader":"01692nam^a22004931^^4500","fields":[{"001":"000000719"},{"005":"20010330000000.0"},{"006":"m^^^^^^^^d^^^^^^^^"},{"007":"cr^bn^---auaua"},{"008":"880715s1969^^^^nyuac^^^^^^^^|00100^eng^^"},{"010":{"ind1":" ","ind2":" ","subfields":[{"a":"78093950"}]}},{"020":{"ind1":" ","ind2":" ","subfields":[{"a":"0876631065"},{"c":"10.00"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(RLIN)MIUG0063058-B"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(CaOTULAS)159818857"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"a":"(OCoLC)ocm00063058"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"DLC"},{"c":"DLC"},{"d":"MiU"}]}},{"041":{"ind1":"1","ind2":" ","subfields":[{"a":"engita"}]}},{"050":{"ind1":"0","ind2":" ","subfields":[{"a":"NX210"},{"b":".D6"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Dorfles, Gillo,"},{"d":"1910-"}]}},{"240":{"ind1":"0","ind2":"3","subfields":[{"a":"Il Kitsch."},{"l":"English"}]}},{"245":{"ind1":"0","ind2":"0","subfields":[{"a":"Kitsch; the world of bad taste."},{"c":"With special contributions by John McHale [and others] and essays by Clement Greenberg and Hermann Broch. [Editorial assistance on the English-language ed. by Vivienne Menkes."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"[New York]"},{"b":"Universe Books"},{"c":"[1969]"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"313 p."},{"b":"illus. (part col.), ports. (part col.)"},{"c":"25 cm."}]}},{"500":{"ind1":" ","ind2":" ","subfields":[{"a":"Translation of Il Kitsch."}]}},{"504":{"ind1":" ","ind2":" ","subfields":[{"a":"Includes bibliography."}]}},{"538":{"ind1":" ","ind2":" ","subfields":[{"a":"Mode of access: Internet."}]}},{"650":{"ind1":" ","ind2":"0","subfields":[{"a":"Kitsch"}]}},{"700":{"ind1":"1","ind2":" ","subfields":[{"a":"McHale, John."}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"FINE"},{"h":"NX 600 .K5 D693 1969"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"AAEL"},{"c":"BKS"},{"h":"NX 600 .K5 D693 1969"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"HATCH"},{"c":"GRAD"},{"h":"NX 600 .K5 D693 1969"}]}},{"852":{"ind1":"0","ind2":" ","subfields":[{"a":"MiU"},{"b":"FINE"},{"h":"NX 600 .K5 D693 1969"},{"x":"Gift"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"BK"},{"b":"Book"}]}},{"970":{"ind1":" ","ind2":" ","subfields":[{"a":"CE"},{"b":"Electronic Resource"}]}},{"971":{"ind1":" ","ind2":" ","subfields":[{"a":"MiU"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"972":{"ind1":" ","ind2":" ","subfields":[{"c":"20040625"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"HT"},{"b":"avail_ht"}]}},{"973":{"ind1":" ","ind2":" ","subfields":[{"a":"AC"},{"b":"avail_circ"}]}},{"974":{"ind1":" ","ind2":" ","subfields":[{"u":"mdp.39015012241918"},{"r":"ic"}]}},{"998":{"ind1":" ","ind2":" ","subfields":[{"s":"9665"}]}},{"995":{"ind1":" ","ind2":" ","subfields":[{"a":"mythology"},{"b":"myth reality own language anti sense condition situation history context past attempt kitsch truth contradiction"},{"c":"200"}]}}]} 00-load.t100644000765000024 76512616110204 15721 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!perl use strict; use warnings; use Test::More; BEGIN { use_ok 'Catmandu::Importer::MARC'; use_ok 'Catmandu::Exporter::MARC'; use_ok 'Catmandu::Fix::marc_map'; use_ok 'Catmandu::Fix::marc_xml'; use_ok 'Catmandu::Fix::marc_in_json'; use_ok 'Catmandu::Fix::marc_set'; use_ok 'Catmandu::Fix::marc_remove'; use_ok 'Catmandu::Fix::marc_add'; use_ok 'Catmandu::Fix::marc_decode_dollar_subfields'; use_ok 'Catmandu::Fix::Condition::marc_match'; } done_testing 10; camel.mrk100644000765000024 1275412616110204 16235 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t=LDR 00755cam 22002414a 4500 =001 fol05731351\ =003 IMchF =005 20000613133448.0 =008 000107s2000\\\\nyua\\\\\\\\\\001\0\eng\\ =010 \\$a 00020737 =020 \\$a0471383147 (paper/cd-rom : alk. paper) =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bM33 2000 =082 00$a005.13/3$221 =100 1\$aMartinsson, Tobias,$d1976- =245 10$aActivePerl with ASP and ADO /$cTobias Martinsson. =260 \\$aNew York :$bJohn Wiley & Sons,$c2000. =300 \\$axxi, 289 p. :$bill. ;$c23 cm. +$e1 computer laser disc (4 3/4 in.) =500 \\$a"Wiley Computer Publishing." =650 \0$aPerl (Computer program language) =630 00$aActive server pages. =630 00$aActiveX. =LDR 00647pam 2200241 a 4500 =001 fol05754809\ =003 IMchF =005 20000601115601.0 =008 000203s2000\\\\mau\\\\\\\\\\\001\0\eng\\ =010 \\$a 00022023 =020 \\$a1565926994 =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bD47 2000 =082 00$a005.74$221 =100 1\$aDescartes, Alligator. =245 10$aProgramming the Perl DBI /$cAlligator Descartes and Tim Bunce. =260 \\$aCmabridge, MA :$bO'Reilly,$c2000. =263 \\$a1111 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =650 \0$aDatabase management. =700 1\$aBunce, Tim. =LDR 00605cam 22002054a 4500 =001 fol05843555\ =003 IMchF =005 20000525142739.0 =008 000318s1999\\\\cau\\\\\\b\\\\001\0\eng\\ =010 \\$a 00501349 =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bB763 1999 =082 00$a005.13/3$221 =100 1\$aBrown, Martin C. =245 10$aPerl :$bprogrammer's reference /$cMartin C. Brown. =260 \\$aBerkeley :$bOsborne/McGraw-Hill,$cc1999. =300 \\$axix, 380 p. ;$c22 cm. =504 \\$aIncludes bibliographical references and index. =650 \0$aPerl (Computer program language) =LDR 00579cam 22002054a 4500 =001 fol05843579\ =003 IMchF =005 20000525142716.0 =008 000318s1999\\\\caua\\\\\\\\\\001\0\eng\\ =010 \\$a 00502116 =020 \\$a0072120002 =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bB762 1999 =082 00$a005.13/3$221 =100 1\$aBrown, Martin C. =245 10$aPerl :$bthe complete reference /$cMartin C. Brown. =260 \\$aBerkeley :$bOsborne/McGraw-Hill,$cc1999. =300 \\$axxxv, 1179 p. :$bill. ;$c24 cm. =650 \0$aPerl (Computer program language) =LDR 00801nam 22002778a 4500 =001 fol05848297\ =003 IMchF =005 20000524125727.0 =008 000518s2000\\\\mau\\\\\\\\\\\001\0\eng\\ =010 \\$a 00041664 =020 \\$a1565924193 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bG84 2000 =082 00$a005.2/762$221 =100 1\$aGuelich, Scott. =245 10$aCGI programming with Perl /$cScott Guelich, Shishir Gundavaram & Gunther Birznieks. =250 \\$a2nd ed., expanded & updated =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0006 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =650 \0$aCGI (Computer network protocol) =650 \0$aInternet programming. =700 1\$aGundavaram, Shishir. =700 1\$aBirznieks, Gunther. =LDR 00665nam 22002298a 4500 =001 fol05865950\ =003 IMchF =005 20000615103017.0 =008 000612s2000\\\\mau\\\\\\\\\\\100\0\eng\\ =010 \\$a 00055759 =020 \\$a0596000138 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bP475 2000 =082 00$a005.13/3$221 =111 2\$aPerl Conference 4.0$d(2000 :$cMonterey, Calif.) =245 10$aProceedings of the Perl Conference 4.0 :$bJuly 17-20, 2000, Monterey, California. =250 \\$a1st ed. =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0006 =300 \\$ap. cm. =650 \0$aPerl (Computer program language)$vCongresses. =LDR 00579nam 22002178a 4500 =001 fol05865956\ =003 IMchF =005 20000615102948.0 =008 000612s2000\\\\mau\\\\\\\\\\\000\0\eng\\ =010 \\$a 00055770 =020 \\$a1565926099 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bB43 2000 =082 00$a005.13/3$221 =100 1\$aBlank-Edelman, David N. =245 10$aPerl for system administration /$cDavid N. Blank-Edelman. =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0006 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =LDR 00661nam 22002538a 4500 =001 fol05865967\ =003 IMchF =005 20000615102611.0 =008 000614s2000\\\\mau\\\\\\\\\\\000\0\eng\\ =010 \\$a 00055799 =020 \\$a0596000278 =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bW35 2000 =082 00$a005.13/3$221 =100 1\$aWall, Larry. =245 10$aProgramming Perl /$cLarry Wall, Tom Christiansen & Jon Orwant. =250 \\$a3rd ed. =260 \\$aCambridge, Mass. :$bO'Reilly,$c2000. =263 \\$a0007 =300 \\$ap. cm. =650 \0$aPerl (Computer program language) =700 1\$aChristiansen, Tom. =700 1\$aOrwant, Jon. =LDR 00603cam 22002054a 4500 =001 fol05872355\ =003 IMchF =005 20000706095105.0 =008 000315s1999\\\\njua\\\\\\\\\\001\0\eng\\ =010 \\$a 00500678 =020 \\$a013020868X =040 \\$aDLC$cDLC$dDLC =042 \\$apcc =050 00$aQA76.73.P22$bL69 1999 =082 00$a005.13/3$221 =100 1\$aLowe, Vincent$q(Vincent D.) =245 10$aPerl programmer's interactive workbook /$cVincent Lowe. =260 \\$aUpper Saddle River, NJ :$bPrentice Hall PTP,$cc1999. =300 \\$axx, 633 p. :$bill. ;$c23 cm. =650 \0$aPerl (Computer program language) =LDR 00696nam 22002538a 4500 =001 fol05882032\ =003 IMchF =005 20000707091904.0 =008 000630s2000\\\\cau\\\\\\\\\\\001\0\eng\\ =010 \\$a 00058174 =020 \\$a0764547291 (alk. paper) =040 \\$aDLC$cDLC =042 \\$apcc =050 00$aQA76.73.P22$bF64 2000 =082 00$a005.13/3$221 =100 2\$aFoster-Johnson, Eric. =245 10$aCross-platform Perl /$cEric F. Johnson. =260 \\$aFoster City, CA :$bIDG Books Worldwide,$c2000. =263 \\$a0009 =300 \\$ap. cm. =500 \\$aIncludes index. =650 \0$aPerl (Computer program language) =650 \0$aWeb servers. =650 \0$aCross-platform software development. 02-aleph.t100644000765000024 65112616110204 16067 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use Catmandu::Importer::MARC; use Test::Simple tests => 3; use Data::Dumper; my $importer = Catmandu::Importer::MARC->new( file => 't/rug01.aleph', type => "ALEPHSEQ" ); my @records; my $n = $importer->each( sub { push( @records, $_[0] ); } ); ok(@records == 1); ok($records[0]->{record}->[1]->[0] eq 'LDR'); ok($records[0]->{record}->[1]->[-1] !~ /\^/); 1; MANIFEST.SKIP100644000765000024 1112616110204 15773 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214dist.ini 04-marc21.t100644000765000024 60612616110204 16065 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use utf8; use Catmandu::Importer::MARC; use Test::Simple tests => 3; my $importer = Catmandu::Importer::MARC->new(file => 't/marc.xml', type => 'XML'); my $records = $importer->to_array; ok(@$records == 1); ok($records->[0]->{record}->[1]->[0] eq '920'); ok($records->[0]->{record}->[8]->[4] eq 'TEEM (한국전기전자재료학회)'); 1; rug01.aleph100644000765000024 730112616110204 16362 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t000000002 FMT L BK 000000002 LDR L 00000nam^a2200301^i^4500 000000002 001 L 000000002 000000002 005 L 20060108100247.0 000000002 008 L 780804s1977^^^^enk^^^^^^b^^^^001^0^eng^^ 000000002 010 L $$a78307846 000000002 015 L $$aGB*** 000000002 020 L $$a0855275103 :$$c13.50 000000002 035 L $$9(DLC) 78307846 000000002 040 L $$aDLC$$cDLC$$dDLC 000000002 05000 L $$aP325$$b.K34 1977b 000000002 08200 L $$a415 000000002 1001 L $$aKatz, Jerrold J. 000000002 24510 L $$aPropositional structure and illocutionary force :$$ba study of the contribution of sentence meaning to speech acts /$$cJerrold J. Katz. 000000002 260 L $$aHassocks :$$bHarvester press,$$c1977. 000000002 300 L $$axv, 249 p. ;$$c25 cm. 000000002 4900 L $$aThe Language and thought series 000000002 504 L $$aIncludes bibliographical references and index. 000000002 650 0 L $$aSemantics. 000000002 650 0 L $$aProposition (Logic) 000000002 650 0 L $$aSpeech acts (Linguistics) 000000002 650 0 L $$aGenerative grammar. 000000002 650 0 L $$aCompetence and performance (Linguistics) 000000002 920 L $$abook 000000002 SID L $$aZ39$$bLOC 000000002 CAT L $$a$$b00$$c19970601$$lRUG01$$h0958 000000002 CAT L $$a$$b00$$c19961224$$lRUG01$$h1724 000000002 CAT L $$a$$b00$$c19990325$$lRUG01$$h1346 000000002 CAT L $$a$$b$$c19990326$$lRUG01$$h1900 000000002 CAT L $$a$$b$$c19990507$$lRUG01$$h0500 000000002 CAT L $$a$$b$$c19990923$$lRUG01$$h1200 000000002 CAT L $$a$$b00$$c19990924$$lRUG01$$h0849 000000002 CAT L $$a$$b$$c19991129$$lRUG01$$h1723 000000002 CAT L $$c20000107$$lRUG01$$h1725 000000002 CAT L $$c20000114$$lRUG01$$h1836 000000002 CAT L $$c20000529$$lRUG01$$h1845 000000002 CAT L $$c20000711$$lRUG01$$h1200 000000002 CAT L $$c20000731$$lRUG01$$h2006 000000002 CAT L $$c20000828$$lRUG01$$h1700 000000002 CAT L $$c20000828$$lRUG01$$h1800 000000002 CAT L $$c20001004$$lRUG01$$h1839 000000002 CAT L $$c20001004$$lRUG01$$h2006 000000002 CAT L $$c20001005$$lRUG01$$h1309 000000002 CAT L $$c20001005$$lRUG01$$h2000 000000002 CAT L $$c20001006$$lRUG01$$h0500 000000002 CAT L $$c20010427$$lRUG01$$h1549 000000002 CAT L $$c20020608$$lRUG01$$h2215 000000002 CAT L $$c20021129$$lRUG01$$h0000 000000002 CAT L $$aFVDPITTE$$b20$$c20030702$$lRUG01$$h1115 000000002 CAT L $$c20030702$$lRUG01$$h2200 000000002 CAT L $$aUPGRADE$$b$$c20050826$$lRUG01$$h2001 000000002 CAT L $$c20050829$$lRUG01$$h1146 000000002 CAT L $$aFVDPITTE$$b20$$c20050904$$lRUG01$$h2047 000000002 CAT L $$c20050910$$lRUG01$$h1823 000000002 CAT L $$c20050911$$lRUG01$$h1100 000000002 CAT L $$aGDVREEZE$$b20$$c20050913$$lRUG01$$h0746 000000002 CAT L $$c20050917$$lRUG01$$h2146 000000002 CAT L $$aGDVREEZE$$b20$$c20060108$$lRUG01$$h1002 000000002 CAT L $$c20060914$$lRUG01$$h2200 000000002 CAT L $$c20060930$$lRUG01$$h2005 000000002 CAT L $$c20070120$$lRUG01$$h1426 000000002 CAT L $$c20080806$$lRUG01$$h0940 000000002 CAT L $$c20090117$$lRUG01$$h2259 000000002 8524 L $$bLW01$$cL27$$jL27.18M201$$4Dept. LW01$$5L27 000000002 8524 L $$bLW06$$cL18$$jL18.L010F128$$4Dept. LW06$$5L18 000000002 8524 L $$bLW11$$cL33$$jL33.D01.006.063$$4Dept. LW11$$5L33 000000002 8524 L $$bLW09$$cL17$$jL17.XIX02.01.242C$$4Dept. LW09$$5L17 000000002 Z30-1 L $$lRUG01$$LRUG01$$mBOOK$$1LW01$$ADept. LW01$$2L27$$BL27$$3L27.18M201$$5000010206368$$819870213$$f02$$FLOAN/openkast 000000002 Z30-1 L $$lRUG01$$LRUG01$$mBOOK$$1LW06$$ADept. LW06$$2L18$$BL18$$3L18.L010F128$$5902-20$$819970730$$f02$$FLOAN/openkast 000000002 Z30-1 L $$lRUG01$$LRUG01$$mBOOK$$1LW09$$ADept. LW09$$2L17$$BL17$$3L17.XIX02.01.242C$$5000010400338$$820070820$$f02$$FLOAN/openkast 000000002 Z30-1 L $$lRUG01$$LRUG01$$mBOOK$$1LW11$$ADept. LW11$$2L33$$BL33$$3L33.D01.006.063$$5000010184913$$820061023$$f02$$FLOAN/openkast 13-marcxml.t100644000765000024 322012616110204 16456 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/tuse strict; use warnings; use Catmandu::Exporter::MARC; use XML::LibXML; use Test::More; my $record = { record => [ ['001', undef, undef, undef, 'rec002'], ['100', ' ', ' ', 'a', 'Slayer'], ['245', ' ', ' ', 'a', 'Reign in Blood' , ] ] }; # XML exporter with default arguments my $xml = undef; my $exporter = Catmandu::Exporter::MARC->new(file => \$xml, type => 'XML'); $exporter->add($record); $exporter->commit; my $dom = XML::LibXML->load_xml( string => $xml ); ok($dom->version() eq '1.0', 'document version'); ok($dom->encoding() eq 'UTF-8', 'document encoding'); my $root = $dom->documentElement(); ok($root->localname eq 'collection', 'root collection'); ok($root->prefix eq 'marc', 'namespace prefix'); # XML exporter with arguments $xml = undef; $exporter = Catmandu::Exporter::MARC->new(file => \$xml, type => 'XML', collection => 0, xml_declaration => 1); $exporter->add($record); $exporter->commit; $dom = XML::LibXML->load_xml( string => $xml ); ok($dom->version() eq '1.0', 'document version'); ok($dom->encoding() eq 'UTF-8', 'document encoding'); $root = $dom->documentElement(); ok($root->localname eq 'record', 'root record'); ok($root->prefix eq 'marc', 'namespace prefix'); # XML exporter with arguments $xml = undef; $exporter = Catmandu::Exporter::MARC->new(file => \$xml, type => 'XML' , collection => 1, xml_declaration => 0); $exporter->add($record); $exporter->commit; $dom = XML::LibXML->load_xml( string => $xml ); $root = $dom->documentElement(); ok($root->localname eq 'collection', 'root collection'); ok($root->prefix eq 'marc', 'namespace prefix'); done_testing;camel.usmarc100644000765000024 1467712616110204 16744 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t00755cam 22002414a 4500001001300000003000600013005001700019008004100036010001700077020004300094040001800137042000800155050002600163082001700189100003100206245005400237260004200291300007200333500003300405650003700438630002500475630001300500fol05731351 IMchF20000613133448.0000107s2000 nyua 001 0 eng  a 00020737  a0471383147 (paper/cd-rom : alk. paper) aDLCcDLCdDLC apcc00aQA76.73.P22bM33 200000a005.13/32211 aMartinsson, Tobias,d1976-10aActivePerl with ASP and ADO /cTobias Martinsson. aNew York :bJohn Wiley & Sons,c2000. axxi, 289 p. :bill. ;c23 cm. +e1 computer laser disc (4 3/4 in.) a"Wiley Computer Publishing." 0aPerl (Computer program language)00aActive server pages.00aActiveX.00647pam 2200241 a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002600135082001500161100002600176245006700202260003800269263000900307300001100316650003700327650002500364700001600389fol05754809 IMchF20000601115601.0000203s2000 mau 001 0 eng  a 00022023  a1565926994 aDLCcDLCdDLC apcc00aQA76.73.P22bD47 200000a005.742211 aDescartes, Alligator.10aProgramming the Perl DBI /cAlligator Descartes and Tim Bunce. aCmabridge, MA :bO'Reilly,c2000. a1111 ap. cm. 0aPerl (Computer program language) 0aDatabase management.1 aBunce, Tim.00605cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077040001800094042000800112050002700120082001700147100002100164245005500185260004500240300002600285504005100311650003700362fol05843555 IMchF20000525142739.0000318s1999 cau b 001 0 eng  a 00501349  aDLCcDLCdDLC apcc00aQA76.73.P22bB763 199900a005.13/32211 aBrown, Martin C.10aPerl :bprogrammer's reference /cMartin C. Brown. aBerkeley :bOsborne/McGraw-Hill,cc1999. axix, 380 p. ;c22 cm. aIncludes bibliographical references and index. 0aPerl (Computer program language)00579cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002700135082001700162100002100179245005500200260004500255300003600300650003700336fol05843579 IMchF20000525142716.0000318s1999 caua 001 0 eng  a 00502116  a0072120002 aDLCcDLCdDLC apcc00aQA76.73.P22bB762 199900a005.13/32211 aBrown, Martin C.10aPerl :bthe complete reference /cMartin C. Brown. aBerkeley :bOsborne/McGraw-Hill,cc1999. axxxv, 1179 p. :bill. ;c24 cm. 0aPerl (Computer program language)00801nam 22002778a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001800156100002000174245008800194250003200282260004100314263000900355300001100364650003700375650003600412650002600448700002500474700002400499fol05848297 IMchF20000524125727.0000518s2000 mau 001 0 eng  a 00041664  a1565924193 aDLCcDLC apcc00aQA76.73.P22bG84 200000a005.2/7622211 aGuelich, Scott.10aCGI programming with Perl /cScott Guelich, Shishir Gundavaram & Gunther Birznieks. a2nd ed., expanded & updated aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language) 0aCGI (Computer network protocol) 0aInternet programming.1 aGundavaram, Shishir.1 aBirznieks, Gunther.00665nam 22002298a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002700130082001700157111005200174245008600226250001200312260004100324263000900365300001100374650005000385fol05865950 IMchF20000615103017.0000612s2000 mau 100 0 eng  a 00055759  a0596000138 aDLCcDLC apcc00aQA76.73.P22bP475 200000a005.13/32212 aPerl Conference 4.0d(2000 :cMonterey, Calif.)10aProceedings of the Perl Conference 4.0 :bJuly 17-20, 2000, Monterey, California. a1st ed. aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language)vCongresses.00579nam 22002178a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001700156100002800173245006200201260004100263263000900304300001100313650003700324fol05865956 IMchF20000615102948.0000612s2000 mau 000 0 eng  a 00055770  a1565926099 aDLCcDLC apcc00aQA76.73.P22bB43 200000a005.13/32211 aBlank-Edelman, David N.10aPerl for system administration /cDavid N. Blank-Edelman. aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language)00661nam 22002538a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001700156100001700173245006700190250001200257260004100269263000900310300001100319650003700330700002300367700001700390fol05865967 IMchF20000615102611.0000614s2000 mau 000 0 eng  a 00055799  a0596000278 aDLCcDLC apcc00aQA76.73.P22bW35 200000a005.13/32211 aWall, Larry.10aProgramming Perl /cLarry Wall, Tom Christiansen & Jon Orwant. a3rd ed. aCambridge, Mass. :bO'Reilly,c2000. a0007 ap. cm. 0aPerl (Computer program language)1 aChristiansen, Tom.1 aOrwant, Jon.00603cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002600135082001700161100003200178245006000210260005700270300003300327650003700360fol05872355 IMchF20000706095105.0000315s1999 njua 001 0 eng  a 00500678  a013020868X aDLCcDLCdDLC apcc00aQA76.73.P22bL69 199900a005.13/32211 aLowe, Vincentq(Vincent D.)10aPerl programmer's interactive workbook /cVincent Lowe. aUpper Saddle River, NJ :bPrentice Hall PTP,cc1999. axx, 633 p. :bill. ;c23 cm. 0aPerl (Computer program language)00696nam 22002538a 4500001001300000003000600013005001700019008004100036010001700077020002800094040001300122042000800135050002600143082001700169100002600186245004400212260005100256263000900307300001100316500002000327650003700347650001700384650004100401fol05882032 IMchF20000707091904.0000630s2000 cau 001 0 eng  a 00058174  a0764547291 (alk. paper) aDLCcDLC apcc00aQA76.73.P22bF64 200000a005.13/32212 aFoster-Johnson, Eric.10aCross-platform Perl /cEric F. Johnson. aFoster City, CA :bIDG Books Worldwide,c2000. a0009 ap. cm. aIncludes index. 0aPerl (Computer program language) 0aWeb servers. 0aCross-platform software development.old_new.json100644000765000024 401712616110204 16734 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t{"record":[["LDR",null,null,"_","00755cam 22002414a 4500"],["001",null,null,"_","fol05731351 "],["003",null,null,"_","IMchF"],["005",null,null,"_","20000613133448.0"],["008",null,null,"_","000107s2000 nyua 001 0 eng "],["010"," "," ","_","","a"," 00020737 "],["020"," "," ","_","","a","0471383147 (paper/cd-rom : alk. paper)"],["040"," "," ","_","","a","DLC","c","DLC","d","DLC"],["042"," "," ","_","","a","pcc"],["050","0","0","_","","a","QA76.73.P22","b","M33 2000"],["082","0","0","_","","a","005.13/3","2","21"],["100","1"," ","_","","a","Martinsson, Tobias,","d","1976-"],["245","1","0","_","","a","ActivePerl with ASP and ADO /","c","Tobias Martinsson."],["260"," "," ","_","","a","New York :","b","John Wiley & Sons,","c","2000."],["300"," "," ","_","","a","xxi, 289 p. :","b","ill. ;","c","23 cm. +","e","1 computer laser disc (4 3/4 in.)"],["500"," "," ","_",""],["650"," ","0","_","","a","Perl (Computer program language)"],["630","0","0","_","","a","Active server pages."],["630","0","0","_","","a","ActiveX."]],"_id":"fol05731351 "} {"record":[["LDR",null,null,"_","00755cam 22002414a 4500"],["001",null,null,"_","fol05731351 "],["003",null,null,"_","IMchF"],["005",null,null,"_","20000613133448.0"],["008",null,null,"_","000107s2000 nyua 001 0 eng "],["010"," "," ","a"," 00020737 "],["020"," "," ","a","0471383147 (paper/cd-rom : alk. paper)"],["040"," "," ","a","DLC","c","DLC","d","DLC"],["042"," "," ","a","pcc"],["050","0","0","a","QA76.73.P22","b","M33 2000"],["082","0","0","a","005.13/3","2","21"],["100","1"," ","a","Martinsson, Tobias,","d","1976-"],["245","1","0","a","ActivePerl with ASP and ADO /","c","Tobias Martinsson."],["260"," "," ","a","New York :","b","John Wiley & Sons,","c","2000."],["300"," "," ","a","xxi, 289 p. :","b","ill. ;","c","23 cm. +","e","1 computer laser disc (4 3/4 in.)"],["500"," "," ","a","\"Wiley Computer Publishing.\""],["650"," ","0","a","Perl (Computer program language)"],["630","0","0","a","Active server pages."],["630","0","0","a","ActiveX."]],"_id":"fol05731351 "} 01-importer.t100644000765000024 272412616110204 16661 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use Catmandu::Importer::MARC; use MARC::File::USMARC; use Test::Simple tests => 9; my $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); my $records = $importer->to_array(); ok( @$records == 10, 'got all records' ); ok( $records->[0]->{'_id'} eq 'fol05731351 ', 'got _id' ); ok( $records->[0]->{'record'}->[1][-1] eq 'fol05731351 ', 'got subfield' ); ok( $records->[0]->{'_id'} eq $records->[0]->{'record'}->[1][-1], '_id matches record id' ); my $file = MARC::File::USMARC->in('t/camel.usmarc'); my @marc_objects; while ( my $marc = $file->next() ) { push( @marc_objects, $marc ); } $file->close(); undef $file; $importer = Catmandu::Importer::MARC->new( records => \@marc_objects ); $records = $importer->to_array(); ok( @$records == 10, 'got all records' ); ok( $records->[0]->{'_id'} eq 'fol05731351 ', 'got _id' ); ok( $records->[0]->{'record'}->[1][-1] eq 'fol05731351 ', 'got subfield' ); ok( $records->[0]->{'_id'} eq $records->[0]->{'record'}->[1][-1], '_id matches record id' ); # Test that the ID can be formed like '260c' (not a useful field in real life!) $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC", id => '260c', ); $records = $importer->to_array(); ok( $records->[0]->{'_id'} eq '2000.', 'got _id from subfield' ); 03-marc_map.t100644000765000024 250612616110204 16577 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use warnings qw(FATAL utf8); use utf8; use Test::More; use Catmandu::Importer::MARC; use Catmandu::Fix; my $fixer = Catmandu::Fix->new(fixes => ['t/test.fix']); my $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); my $records = $fixer->fix($importer)->to_array; is $records->[0]->{my}{id}, 'fol05731351 ', q|fix: marc_map('001','my.id');|; is $records->[0]->{my}{title}, 'ActivePerl with ASP and ADO /', q|fix: marc_map('245a','my.title');|; is_deeply $records->[0]->{my}{split_title}, [['ActivePerl with ASP and ADO /', 'Tobias Martinsson.']], q|fix: marc_map('245','my.split.title','-split', 1);|; # field 666 does not exist in camel.usmarc # the '$append' fix creates $my->{'references'} hash key with empty array ref as value ok !$records->[0]->{'my'}{'references'}, q|fix: marc_map('666', 'my.references.$append');|; is $records->[0]->{my}{substr_id}, "057"; ok !exists $records->[0]->{my}{failed_substr_id}; ok $records->[0]->{record} =~ /marc:datafield/ , "marcxml"; is $records->[0]->{my}->{found005} , 1 , 'if marc_match'; is $records->[0]->{my}->{found008} , 1 , 'if marc_match'; is $records->[0]->{my}->{pluck} , "M33 2000QA76.73.P22" , 'pluck feature'; is $records->[0]->{my}->{has_title}, 'Y' , 'value feature'; done_testing 11;08-exporter.t100644000765000024 1116212616110204 16713 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use Catmandu::Exporter::MARC; use XML::XPath; use Test::Simple tests => 24; my $xml = undef; my $exporter = Catmandu::Exporter::MARC->new(file => \$xml, type=> 'XML' , collection => 0); ok($exporter, "create exporter RAW"); $exporter->add({ record => [ ['001', undef, undef, undef, 'rec001'], ['100', ' ', ' ', 'a', 'Davis, Miles'], ['245', ' ', ' ', 'a', 'Sketches in Blue' , ], ['500', ' ', ' ', 'a', undef], ['501', ' ', ' ' ], ['502', ' ', ' ', 'a', undef, 'b' , 'ok'], ['503'. ' ', ' ', 'a', ''], ] }); $exporter->commit; my $xp; ok($xp = XML::XPath->new(xml => $xml), "parse XML"); ok($xp->findvalue('/marc:record/marc:controlfield[@tag="001"]') eq 'rec001','test 001'); ok($xp->findvalue('/marc:record/marc:datafield[@tag="245"]/marc:subfield[@code="a"]') eq 'Sketches in Blue','test 245'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="500"]') ,'skipped 500 - only empty subfields'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="501"]') ,'skipped 501 - no subfields'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="502"]/marc:subfield[@code="a"]') ,'skipped 502a - empty subfields'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="503"]/marc:subfield[@code="a"]') ,'skipped 503a - empty subfields'); $xml = undef; $exporter = Catmandu::Exporter::MARC->new(file => \$xml, type=> 'XML', record_format => 'MARC-in-JSON', collection => 0); ok($exporter, "create exporter MARC-in-JSON"); $exporter->add({ fields => [ { '001' => 'rec001' } , { '100' => { 'subfields' => [ { 'a' => 'Davis, Miles'}], 'ind1' => ' ', 'ind2' => ' '}} , { '245' => { 'subfields' => [ { 'a' => 'Sketches in Blue'}], 'ind1' => ' ', 'ind2' => ' '}} , { '500' => { 'subfields' => [ { 'a' => undef }] , 'ind1' => ' ', 'ind2' => ' '}} , { '501' => { 'ind1' => ' ', 'ind2' => ' ' }} , { '502' => { 'subfields' => [ { 'a' => undef} , { 'b' , 'ok' } ] , 'ind1' => ' ', 'ind2' => ' ' } } , { '503' => { 'subfields' => [ { 'a' => '' }] , 'ind1' => ' ', 'ind2' => ' '}} , ] }); ok($xp = XML::XPath->new(xml => $xml), "parse XML"); ok($xp->findvalue('/marc:record/marc:controlfield[@tag="001"]') eq 'rec001','test 001'); ok($xp->findvalue('/marc:record/marc:datafield[@tag="245"]/marc:subfield[@code="a"]') eq 'Sketches in Blue','test 245'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="500"]') ,'skipped 500 - only empty subfields'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="501"]') ,'skipped 501 - no subfields'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="502"]/marc:subfield[@code="a"]') ,'skipped 502a - empty subfields'); ok(! $xp->exists('/marc:record/marc:datafield[@tag="503"]/marc:subfield[@code="a"]') ,'skipped 503a - empty subfields'); $xml = ''; $exporter = Catmandu::Exporter::MARC->new(file => \$xml, type=> 'ALEPHSEQ' , skip_empty_subfields => 1); ok($exporter, "create exporter ALEPHSEQ"); $exporter->add({ _id => '1' , record => [ ['001', undef, undef, '_', 'rec001'], ['100', ' ', ' ', 'a', 'Davis, Miles' , 'c' , 'Test'], ['245', ' ', ' ', 'a', 'Sketches in Blue' , ], ['500', ' ', ' ', 'a', undef], ['501', ' ', ' ' ], ['502', ' ', ' ', 'a', undef, 'b' , 'ok'], ['503'. ' ', ' ', 'a', ''], ] }); ok($xml =~ /^000000001/, 'test id'); ok($xml =~ /000000001 100 L \$\$aDavis, Miles\$\$cTest/, 'test subfields'); ok($xml !~ /000000001 500/, 'test skip empty subfields'); $xml = ''; $exporter = Catmandu::Exporter::MARC->new( file => \$xml, type=> 'ALEPHSEQ', record_format => 'MARC-in-JSON', skip_empty_subfields => 1 ); ok($exporter, "create exporter ALEPHSEQ for MARC-in-JSON"); $exporter->add({ _id => '1', fields => [ { '001' => 'rec001' } , { '100' => { 'subfields' => [ { 'a' => 'Davis, Miles'} , { 'c' => 'Test'}], 'ind1' => ' ', 'ind2' => ' '}} , { '245' => { 'subfields' => [ { 'a' => 'Sketches in Blue'}], 'ind1' => ' ', 'ind2' => ' '}} , { '500' => { 'subfields' => [ { 'a' => undef }] , 'ind1' => ' ', 'ind2' => ' '}} , { '501' => { 'ind1' => ' ', 'ind2' => ' ' }} , { '502' => { 'subfields' => [ { 'a' => undef} , { 'b' , 'ok' } ] , 'ind1' => ' ', 'ind2' => ' ' } } , { '503' => { 'subfields' => [ { 'a' => '' }] , 'ind1' => ' ', 'ind2' => ' '}} , ] }); ok($xml =~ /^000000001/, 'test id'); ok($xml =~ /000000001 100 L \$\$aDavis, Miles\$\$cTest/, 'test subfields'); ok($xml !~ /000000001 500/, 'test skip empty subfields'); 09-marc_add.t100644000765000024 352112616110204 16556 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use warnings qw(FATAL utf8); use utf8; use Test::More; use Catmandu::Importer::MARC; use Catmandu::Fix; my $fixer = Catmandu::Fix->new(fixes => [ q|add_field(my.deep.field,foo)|, q|add_field(my.deep.array.$append,red)|, q|add_field(my.deep.array.$append,green)|, q|add_field(my.deep.array.$append,blue)|, q|marc_add('999', ind1 => 4 , ind2 => 1 , a => 'test')| , q|marc_add('998', ind1 => 4 , ind2 => 1 , a => '$.my.deep.field')| , q|marc_add('997', ind1 => 4 , ind2 => 1 , a => '$.my.deep.array')| , ]); my $record = $fixer->fix({}); ok exists $record->{record}, 'created a marc record'; is $record->{record}->[0]->[0] , '999', 'created 999 tag'; is $record->{record}->[0]->[1] , '4', 'created 999 ind1'; is $record->{record}->[0]->[2] , '1', 'created 999 ind2'; is $record->{record}->[0]->[3] , 'a', 'created 999 subfield a'; is $record->{record}->[0]->[4] , 'test', 'created 999 subfield a value'; is $record->{record}->[1]->[0] , '998', 'created 998 tag'; is $record->{record}->[1]->[1] , '4', 'created 998 ind1'; is $record->{record}->[1]->[2] , '1', 'created 998 ind2'; is $record->{record}->[1]->[3] , 'a', 'created 998 subfield a'; is $record->{record}->[1]->[4] , 'foo', 'created 998 subfield a value'; is $record->{record}->[2]->[0] , '997', 'created 997 tag'; is $record->{record}->[2]->[1] , '4', 'created 997 ind1'; is $record->{record}->[2]->[2] , '1', 'created 997 ind2'; is $record->{record}->[2]->[3] , 'a', 'created 997 subfield a'; is $record->{record}->[2]->[4] , 'red', 'created 997 subfield a value'; is $record->{record}->[2]->[5] , 'a', 'created 997 subfield a'; is $record->{record}->[2]->[6] , 'green', 'created 997 subfield a value'; is $record->{record}->[2]->[7] , 'a', 'created 997 subfield a'; is $record->{record}->[2]->[8] , 'blue', 'created 997 subfield a value'; done_testing 20; 12-marc_set.t100644000765000024 267712616110204 16626 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use warnings qw(FATAL utf8); use utf8; use Test::More; use Catmandu::Importer::MARC; use Catmandu::Fix; my $fixer = Catmandu::Fix->new(fixes => [q|marc_set('LDR/0-3','XXX')|,q|marc_map('LDR','leader')|]); my $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); my $record = $fixer->fix($importer->first); like $record->{leader}, qr/^XXX/, q|fix: marc_set('LDR/0-3','XXX');|; #--- { $fixer = Catmandu::Fix->new(fixes => [q|marc_set('100x','XXX')|,q|marc_map('100x','test')|]); $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); $record = $fixer->fix($importer->first); like $record->{test}, qr/^XXX$/, q|fix: marc_set('100x','XXX');|; } #--- { $fixer = Catmandu::Fix->new(fixes => [q|marc_set('100[1]a','XXX')|,q|marc_map('100a','test')|]); $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); $record = $fixer->fix($importer->first); like $record->{test}, qr/^XXX$/, q|fix: marc_set('100[1]a','XXX');|; } #--- { $fixer = Catmandu::Fix->new(fixes => [ q|add_field(my.deep.field,XXX)|, q|marc_set('100[1]a','$.my.deep.field')|, q|marc_map('100a','test')| ]); $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); $record = $fixer->fix($importer->first); like $record->{test}, qr/^XXX$/, q|fix: marc_set('100[1]a','$.my.deep.field'');|; } done_testing 4; 10-marcmaker.t100644000765000024 60112616110204 16732 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use utf8; use Catmandu::Importer::MARC; use Test::More tests => 3; my $importer = Catmandu::Importer::MARC->new(file => 't/camel.mrk', type => 'MARCMaker'); my $records = $importer->to_array; ok(@$records == 10); is($records->[0]->{record}->[1]->[4] , 'fol05731351 '); is($records->[0]->{record}->[11]->[4] , 'Martinsson, Tobias,'); 1;16-marc-each.t100644000765000024 146612616110204 16650 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use warnings qw(FATAL utf8); use utf8; use Test::More; use Catmandu::Importer::MARC; use Catmandu::Fix; my $pkg; BEGIN { $pkg = 'Catmandu::Fix::Bind::marc_each'; use_ok $pkg; } require_ok $pkg; my $fixer = Catmandu::Fix->new(fixes => [q| do marc_each() if marc_match("***a",'Perl') add_field(has_perl,true) end if marc_match("100",'.*') reject() end end marc_map("100",test) |]); my $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); $fixer->fix($importer)->each(sub { my $record = $_[0]; my $id = $record->{_id}; ok exists $record->{record}, "created a marc record $id"; is $record->{has_perl}, 'true', "created has_dlc tag $id"; ok ! exists $record->{test} , "field 300 deleted $id"; }); done_testing;07-inline-fix.t100644000765000024 370012616110204 17063 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/tuse strict; use warnings; use Test::More tests => 13; use Catmandu::Fix::Inline::marc_map qw(marc_map); use Catmandu::Fix::Inline::marc_add qw(marc_add); use Catmandu::Fix::Inline::marc_set qw(marc_set); use Catmandu::Fix::Inline::marc_remove qw(marc_remove); use Catmandu::Importer::JSON; use Data::Dumper; my $importer = Catmandu::Importer::JSON->new( file => 't/old_new.json' ); my $fixer = Catmandu::Fix->new(fixes => [ q|add_field(my.deep.field,foo)|, q|add_field(my.deep.array.$append,red)|, q|add_field(my.deep.array.$append,green)|, q|add_field(my.deep.array.$append,blue)|, ]); my $records = $fixer->fix($importer)->to_array; ok(@$records == 2 , "Found 2 records"); { is scalar marc_map($records->[0],'245a'), q|ActivePerl with ASP and ADO /|, q|marc_map(245a)|; is scalar marc_map($records->[0],'001') , q|fol05731351 | , q|marc_map(001)|; ok ! defined(scalar marc_map($records->[0],'191')) , q|marc_map(191) not defined|; ok ! defined(scalar marc_map($records->[0],'245x')) , q|marc_map(245x) not defined|; } { my @res = marc_map($records->[0],'630'); ok(@res == 2 , q|marc_map(630)|); } { my $rec = marc_add($records->[0],'900', a => 'test'); is scalar marc_map($rec,'900a'), q|test|, q|marc_add(900)|; } { my $rec = marc_add($records->[0],'901', a => '$.my.deep.field'); is scalar marc_map($rec,'901a'), q|foo|, q|marc_add(901)|; } { my $rec = marc_add($records->[0],'902', a => '$.my.deep.array'); is scalar marc_map($rec,'902a'), q|redgreenblue|, q|marc_add(902)|; } { my $rec = marc_set($records->[0],'010b', 'test'); is scalar marc_map($rec,'010b'), q|test|, q|marc_set(010)|; } { my $rec = marc_set($records->[0],'010b', '$.my.deep.field'); is scalar marc_map($rec,'010b'), q|foo|, q|marc_set(010)|; } { my $rec = marc_remove($records->[0],'900'); ok ! defined scalar marc_map($rec,'900a') , q|marc_map(900) removed|; } { my $f050 = marc_map($records->[0],'050ba',-pluck=>1); is $f050 , "M33 2000QA76.73.P22" , q|pluck test|; }05-marc_remove.t100644000765000024 146612616110204 17325 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use warnings qw(FATAL utf8); use utf8; use Test::More; use Catmandu::Importer::MARC; use Catmandu::Fix; use Catmandu::Fix::Inline::marc_map qw(:all); my $fixer = Catmandu::Fix->new(fixes => [q|marc_remove('245')|,q|marc_remove('100a')|]); my $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); my $record = $importer->first; my $title = marc_map($record,'245'); my $author = marc_map($record,'100'); ok $title, 'got a title'; like $author , qr/^Martinsson, Tobias,1976-$/ , 'got an author'; my $fixed_record = $fixer->fix($record); my $title2 = marc_map($fixed_record,'245'); my $author2 = marc_map($fixed_record,'100'); ok (!defined $title2, 'deleted the title'); like $author2 , qr/^1976-$/ , 'removed 100-a'; done_testing 4; 15-marc_in_json.t100644000765000024 325312616110204 17464 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use warnings qw(FATAL utf8); use utf8; use Test::More; use Test::Deep; use Catmandu::Importer::MARC; use Catmandu::Fix; my $record = { record => [ ['LDR', undef, undef, '_', '00000nas-a2200000z--4500'], ['001', undef, undef, undef, 'rec002'], ['008', undef, undef, '_' , '150519s----------------------000---eng-d'] , ['100', '1', '1', '_', '' , 'a', 'Slayer' ], ['245', ' ', ' ', '_', '' , 'a', 'Reign in Blood' , ], ['999', ' ', ' ', '_', '' , 'x', 'test' , 'x', 'test2' , 'x', 'test3' , ] ] }; my $fixer = Catmandu::Fix->new(fixes => [q|marc_in_json()|]); my $record2 = $fixer->fix($record); is $record2->{leader}, qq|00000nas-a2200000z--4500|; is $record2->{fields}->[0]->{'001'}, qq|rec002|; is $record2->{fields}->[1]->{'008'}, qq|150519s----------------------000---eng-d|; is $record2->{fields}->[2]->{'100'}->{'ind1'} , 1; is $record2->{fields}->[2]->{'100'}->{'ind2'} , 1; is $record2->{fields}->[2]->{'100'}->{'subfields'}->[0]->{a} , 'Slayer'; is $record2->{fields}->[3]->{'245'}->{'subfields'}->[0]->{a} , 'Reign in Blood'; is $record2->{fields}->[4]->{'999'}->{'subfields'}->[0]->{x} , 'test'; is $record2->{fields}->[4]->{'999'}->{'subfields'}->[1]->{x} , 'test2'; is $record2->{fields}->[4]->{'999'}->{'subfields'}->[2]->{x} , 'test3'; my $fixer2 = Catmandu::Fix->new(fixes => [q|marc_in_json(-reverse => 1)|]); my $record3 = $fixer2->fix($record2); cmp_deeply($record,$record3); done_testing 11;Catmandu000755000765000024 012616110204 16307 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/libMARC.pm100644000765000024 632712616110204 17537 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandupackage Catmandu::MARC; =head1 NAME Catmandu::MARC - Catmandu modules for working with MARC data =begin markdown # STATUS [![Build Status](https://travis-ci.org/LibreCat/Catmandu-MARC.svg?branch=master)](https://travis-ci.org/LibreCat/Catmandu-MARC) [![Coverage](https://coveralls.io/repos/LibreCat/Catmandu-MARC/badge.png?branch=master)](https://coveralls.io/r/LibreCat/Catmandu-MARC) [![CPANTS kwalitee](http://cpants.cpanauthors.org/dist/Catmandu-MARC.png)](http://cpants.cpanauthors.org/dist/Catmandu-MARC) =end markdown =cut our $VERSION = '0.214'; =head1 SYNOPSIS # On the command line $ catmandu convert MARC to JSON < data.mrc $ catmandu convert MARC --type MiJ to YAML < data.marc_in_json $ catmandu convert MARC --fix "marc_map(245,title)" < data.mrc $ catmandu convert MARC --fix myfixes.txt < data.mrc myfixes: marc_map("245a", title) marc_map("5**", note.$append) marc_map('710','my.authors.$append') marc_map('008_/35-35','my.language') remove_field(record) add_field(my.funny.field,'test123') $ catmandu import MARC --fix myfixes.txt to ElasticSearch --index_name 'catmandu' < data.marc # In perl use Catmandu; my $importer = Catmandu->importer('MARC', file => 'data.mrc' ); my $fixer = Catmandu->fixer('myfixes.txt'); my $store = Catmandu->store('ElasticSearch', index_name => 'catmandu'); $store->add_many( $fixer->fix($importer) ); =head1 MODULES =over =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =back =head1 DESCRIPTION With Catmandu, LibreCat tools abstract digital library and research services as data warehouse processes. As stores we reuse MongoDB or ElasticSearch providing us with developer friendly APIs. Catmandu works with international library standards such as MARC, MODS and Dublin Core, protocols such as OAI-PMH, SRU and open repositories such as DSpace and Fedora. And, of course, we speak the evolving Semantic Web. Follow us on L and read an introduction into Catmandu data processing at L. =head1 SEE ALSO L, L, L, L =head1 AUTHOR Patrick Hochstenbach, C<< >> =head1 CONTRIBUTORS =over =item * Nicolas Steenlant, C<< >> =item * Nicolas Franck, C<< >> =item * Johann Rolschewski, C<< johann.rolschewski at sbb.spk-berlin.de >> =item * Chris Cormack =item * Robin Sheat =back =head1 LICENSE AND COPYRIGHT This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. =cut 1; dollar_subfields.mrc100644000765000024 463112616110204 20434 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t01101nas1 22001813i 450 0010006000000050017000061000041000231010008000641020007000721060006000791100016000852000264001014630206003657120075005717120086006468010097007328010090008291216220050527101033.0 a20050527c m y0grey50 ga0 aeng aGR ar aayuzad 1yy01 aInternational Conference on Environmental Science and Technology h$f: 3-6 September 2001$e: Ermoupolis, Syros Island, Greece)fUniversity of the Aegean.Department of Environmental StudiesfGlobal Network for Environmental Science and Technology-(Global Nest )_010011216112001 aProceedings of the 7th international conference on environmental science and technology nce and technologyeErmoupolis, Syros Island, Greece, 3-6 September 2001 1fT. D. Lekkas, editor023UA.DES4650aUNIVERSITY OF AEGEANbDEPARTMENT OF ENVIRONMENTAL STUDIES023GNEST4650aGlobal Network for Environmental Science and Technology (Global Nest) 0aGRbΔΗΜΟΣΙΑ ΚΕΝΤΡΙΚΗ ΒΙΒΛΙΟΘΗΚΗ ΜΥΤΙΛΗΝΗΣc20050527gAACR2 1aGRbΔΗΜΟΣΙΑ ΚΕΝΤΡΙΚΗ ΒΙΒΛΙΟΘΗΚΗ ΜΥΤΙΛΗΝΗΣc2005052701356nam 2200277 i 450 0010006000000050017000060100018000231000041000411010008000821020007000901050018000971060006001152000309001212100035004302150041004652250049005064100065005556060033006206060031006536060045006846760018007297000091007477120053008388010097008918010090009881525020010629121549.0 a960-211-082-1 a20080409d1991 |||y0grey50 ga0 agre aGR aa z 000yy ar1 aΨειρολογίαeήτοι, πραγματεία περί των οχληρών ζουζουνίων της πάλαι ποτέ ελληνικής κατοικίας, και, των μέσων καταπολεμήσεως αυτών $f Ηλία ΠετρόπουλουfΗλία Πετρόπουλου aΑθήναcΝεφέληd1991 a165 σ.cεικ. , φωτ.d21 εκ.2 aΗλία Πετρόπουλου Άπαντα_01001602112001 aΗλία Πετρόπουλου Άπαντα1 3__ΕΝΤΟΜΑaΕΝΤΟΜΑ1 3ΨΕΙΡΕΣaΨΕΙΡΕΣ1 3__ΛΑΟΓΡΑΦΙΑaΛαογραφία a398.24 ΠΕΤ 13ΠΕΤΡΟΠΟΥΛΟΣ, ΗΛΙΑΣ4070aΠΕΤΡΟΠΟΥΛΟΣbΗΛΙΑΣf1928-2003023ΝΕΦΕΛΗ4650aΕΚΔΟΣΕΙΣ ΝΕΦΕΛΗ 0aGRbΔΗΜΟΣΙΑ ΚΕΝΤΡΙΚΗ ΒΙΒΛΙΟΘΗΚΗ ΜΥΤΙΛΗΝΗΣc20080409gAACR2 1aGRbΔΗΜΟΣΙΑ ΚΕΝΤΡΙΚΗ ΒΙΒΛΙΟΘΗΚΗ ΜΥΤΙΛΗΝΗΣc20080409release-pod-syntax.t100644000765000024 45612616110204 20306 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Fix000755000765000024 012616110204 17035 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandumarc_add.pm100644000765000024 427112616110204 21271 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixpackage Catmandu::Fix::marc_add; use Catmandu::Sane; use Catmandu::Util qw(:is); use Moo; use Catmandu::Fix::Has; has marc_tag => (fix_arg => 1); has subfields => (fix_arg => 'collect'); sub fix { my ($self, $data) = @_; my $marc_tag = $self->marc_tag; my @subfields = @{$self->subfields}; my %subfields = @subfields; my $record_key = $subfields{'-record'} // 'record'; my $marc = $data->{$record_key} // []; if ($marc_tag =~ /^\w{3}$/) { my @field = (); push @field , $marc_tag; push @field , $subfields{ind1} // ' '; push @field , $subfields{ind2} // ' '; for (my $i = 0 ; $i < @subfields ; $i += 2) { my $code = $subfields[$i]; next unless length $code == 1; my $value = $subfields[$i+1]; if ($value =~ /^\$\.(\S+)$/) { my $path = $1; $value = Catmandu::Util::data_at($path,$data); } if (is_array_ref $value) { for (@$value) { push @field , $code; push @field , $_; } } elsif (is_hash_ref $value) { for (keys %$value) { push @field , $code; push @field , $value->{$_}; } } elsif (is_value($value) && length($value) > 0) { push @field , $code; push @field , $value; } } push @{ $marc } , \@field if @field > 3; } $data->{$record_key} = $marc; $data; } =head1 NAME Catmandu::Fix::marc_add - add new fields to marc =head1 SYNOPSIS # Set literal values marc_add('900', a, 'test' , 'b', test) marc_add('900', ind1 , ' ' , a, 'test' , 'b', test) marc_add('900', ind1 , ' ' , a, 'test' , 'b', test , record:record2) # Copy data from an other field (when the field value is an array, the # subfield will be repeated) marc_add('900', a, '$.my.data.field') =head1 DESCRIPTION Read our Wiki pages at L for a complete overview of the Fix language. =head1 SEE ALSO L =cut 1; marc_map.pm100644000765000024 1505312616110204 21336 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixpackage Catmandu::Fix::marc_map; use Catmandu::Sane; use Carp qw(confess); use Moo; use Catmandu::Fix::Has; has marc_path => (fix_arg => 1); has path => (fix_arg => 1); has record => (fix_opt => 1); has split => (fix_opt => 1); has join => (fix_opt => 1); has value => (fix_opt => 1); has pluck => (fix_opt => 1); sub emit { my ($self,$fixer) = @_; my $path = $fixer->split_path($self->path); my $record_key = $fixer->emit_string($self->record // 'record'); my $join_char = $fixer->emit_string($self->join // ''); my $marc_path = $self->marc_path; my $field_regex; my ($field,$ind1,$ind2,$subfield_regex,$from,$to); if ($marc_path =~ /(\S{3})(\[(.)?,?(.)?\])?([_a-z0-9^]+)?(\/(\d+)(-(\d+))?)?/) { $field = $1; $ind1 = $3; $ind2 = $4; $subfield_regex = defined $5 ? "[$5]" : "[a-z0-9_]"; $from = $7; $to = $9; } else { confess "invalid marc path"; } $field_regex = $field; $field_regex =~ s/\*/./g; my $var = $fixer->var; my $vals = $fixer->generate_var; my $perl = $fixer->emit_declare_vars($vals, '[]'); $perl .= $fixer->emit_foreach("${var}->{${record_key}}", sub { my $var = shift; my $v = $fixer->generate_var; my $perl = ""; $perl .= "next if ${var}->[0] !~ /${field_regex}/;"; if (defined $ind1) { $perl .= "next if (!defined ${var}->[1] || ${var}->[1] ne '${ind1}');"; } if (defined $ind2) { $perl .= "next if (!defined ${var}->[2] || ${var}->[2] ne '${ind2}');"; } if ($self->value) { $perl .= $fixer->emit_declare_vars($v, $fixer->emit_string($self->value)); $perl .= $fixer->emit_create_path($fixer->var, $path, sub { my $var = shift; "${var} = ${v};"; }); } else { my $i = $fixer->generate_var; my $add_subfields = sub { my $start = shift; if ($self->pluck) { # Treat the subfield_regex as a hash index my $pluck = $fixer->generate_var; return "my ${pluck} = {};" . "for (my ${i} = ${start}; ${i} < \@{${var}}; ${i} += 2) {". "push(\@{ ${pluck}->{ ${var}->[${i}] } }, ${var}->[${i} + 1]);" . "}" . "for my ${i} (split('','${subfield_regex}')) { " . "push(\@{${v}}, \@{ ${pluck}->{${i}} }) if exists ${pluck}->{${i}};" . "}"; } else { # Treat the subfield_regex as regex that needs to match the subfields return "for (my ${i} = ${start}; ${i} < \@{${var}}; ${i} += 2) {". "if (${var}->[${i}] =~ /${subfield_regex}/) {". "push(\@{${v}}, ${var}->[${i} + 1]);". "}". "}"; } }; $perl .= $fixer->emit_declare_vars($v, "[]"); $perl .= "if (${var}->[0] =~ /^LDR|^00/) {"; $perl .= $add_subfields->(3); # Old Catmandu::MARC contained a bug/feature to allow # for '_' subfields in non-control elements ..for beackwards # compatibility we ignore them $perl .= "} elsif (defined ${var}->[5] && ${var}->[5] eq '_') {"; $perl .= $add_subfields->(5); $perl .= "} else {"; $perl .= $add_subfields->(3); $perl .= "}"; $perl .= "if (\@{${v}}) {"; if (!$self->split) { $perl .= "${v} = join(${join_char}, \@{${v}});"; if (defined(my $off = $from)) { my $len = defined $to ? $to - $off + 1 : 1; $perl .= "if (eval { ${v} = substr(${v}, ${off}, ${len}); 1 }) {"; } } $perl .= $fixer->emit_create_path($fixer->var, $path, sub { my $var = shift; if ($self->split) { "if (is_array_ref(${var})) {". "push \@{${var}}, ${v};". "} else {". "${var} = [${v}];". "}"; } else { "if (is_string(${var})) {". "${var} = join(${join_char}, ${var}, ${v});". "} else {". "${var} = ${v};". "}"; } }); if (defined($from)) { $perl .= "}"; } $perl .= "}"; } $perl; }); $perl; } 1; =head1 NAME Catmandu::Fix::marc_map - copy marc values of one field to a new field =head1 SYNOPSIS # Append all 245 subfields to my.title marc_map('245','my.title') # Append an array of 245 subfields to the my.title array marc_map('245','my.title', split:1) # Copy the 245-$a$b$c subfields into the my.title hash in the order provided in the record marc_map('245abc','my.title') # Copy the 245-$c$b$a subfields into the my.title hash in the order c,b,a marc_map('245cba','my.title', pluck:1) # Copy the 100 subfields into the my.authors array marc_map('100','my.authors.$append') # Add the 710 subfields into the my.authors array marc_map('710','my.authors.$append') # Copy the 600-$x subfields into the my.subjects array while packing each into a genre.text hash marc_map('600x','my.subjects.$append.genre.text') # Copy the 008 characters 35-35 into the my.language hash marc_map('008_/35-35','my.language') # Copy all the 600 fields into a my.stringy hash joining them by '; ' marc_map('600','my.stringy', join:'; ') # When 024 field exists create the my.has024 hash with value 'found' marc_map('024','my.has024', value:found) # Do the same examples now with the marc fields in 'record2' marc_map('245','my.title', record:record2) # Copy all 100 subfields except the digits to the 'author' field marc_map('100^0123456789','author') # Map all the 500 - 599 fields to my.notes marc_map('5**','my.motes') # Map the 100-a field where indicator-1 is 3 marc_map('100[3]a','name.family') =head1 DESCRIPTION Read our Wiki pages at L for a complete overview of the Fix language. =head1 SEE ALSO L =cut marc_set.pm100644000765000024 1042212616110204 21347 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixpackage Catmandu::Fix::marc_set; use Catmandu::Sane; use Catmandu::Util qw(:is); use Carp qw(confess); use Moo; use Catmandu::Fix::Has; has marc_path => (fix_arg => 1); has value => (fix_arg => 1); has record => (fix_opt => 1); sub emit { my ($self,$fixer) = @_; my $record_key = $fixer->emit_string($self->record // 'record'); my $marc_path = $self->marc_path; my $field_regex; my ($field,$ind1,$ind2,$subfield_regex,$from,$to,$len); if ($marc_path =~ /(\S{3})(\[(.)?,?(.)?\])?([_a-z0-9])?(\/(\d+)(-(\d+))?)?/) { $field = $1; $ind1 = $3; $ind2 = $4; if (defined $5) { $subfield_regex = "$5"; } else { $subfield_regex = ($field =~ /^LDR|^00/) ? "_" : "a"; } $from = $7; $to = $9; $len = defined $to ? $to - $from + 1 : 1; } else { confess "invalid marc path"; } my $perl = ""; # Find out if we need to insert a literal value or a value from a JSON path my $value; if ($self->value =~ /^\$\.(\S+)$/) { my $path = $fixer->split_path($1); my $key = pop @$path; $value = $fixer->generate_var; $perl .= $fixer->emit_declare_vars($value, '""'); $perl .= $fixer->emit_walk_path($fixer->var, $path, sub { my $var = shift; $fixer->emit_get_key($var, $key, sub { my $var = shift; "${value} = ${var};"; }); }); } else { $value = $fixer->emit_string($self->value); } ############## $field_regex = $field; $field_regex =~ s/\*/./g; my $var = $fixer->var; $perl .= $fixer->emit_foreach("${var}->{${record_key}}", sub { my $var = shift; my $perl = ""; $perl .= "next unless is_value ${value};"; $perl .= "next if ${var}->[0] !~ /${field_regex}/;"; if (defined $ind1) { $perl .= "next if (!defined ${var}->[1] || ${var}->[1] ne '${ind1}');"; } if (defined $ind2) { $perl .= "next if (!defined ${var}->[2] || ${var}->[2] ne '${ind2}');"; } my $i = $fixer->generate_var; my $set_subfields = sub { my $start = shift; my $found = $fixer->generate_var; my $perl = "my ${found} = 0;". "for (my ${i} = ${start}; ${i} < \@{${var}}; ${i} += 2) {". "if (${var}->[${i}] eq '${subfield_regex}') {"; if (defined $from) { $perl .= "substr(${var}->[${i}+1],$from,$len) = ${value};"; } else { $perl .= "${var}->[${i}+1] = ${value};"; } $perl .= "${found} = 1;"; $perl .= "}". "}"; $perl .= "if (${found} == 0) {". "push(\@${var},'${subfield_regex}',${value});". "}"; $perl; }; $perl .= "if (${var}->[0] =~ /^LDR|^00/) {"; $perl .= $set_subfields->(3); # Old Catmandu::MARC contained a bug/feature to allow # for '_' subfields in non-control elements ..for backwards # compatibility we ignore them $perl .= "} elsif (defined ${var}->[5] && ${var}->[5] eq '_') {"; $perl .= $set_subfields->(5); $perl .= "} else {"; $perl .= $set_subfields->(3); $perl .= "}"; $perl; }); $perl; } =head1 NAME Catmandu::Fix::marc_set - set a marc value of one (sub)field to a new value =head1 SYNOPSIS # Set a field in the leader if marc_match('LDR/6','c') marc_set('LDR/6','p') end # Set all the 650-p fields to 'test' marc_set('650p','test') # Set the 100-a subfield where indicator-1 is 3 marc_set('100[3]a','Farquhar family.') # Copy data from another field in a subfield marc_set('100a','$.my.deep.field') =head1 DESCRIPTION Read our Wiki pages at L for a complete overview of the Fix language. =head1 SEE ALSO L =cut 1;marc_xml.pm100644000765000024 160512616110204 21337 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixpackage Catmandu::Fix::marc_xml; use Catmandu::Sane; use Moo; use IO::String; use Catmandu::Exporter::MARC::XML; use Catmandu::Util qw(:is :data); use Catmandu::Fix::Has; has path => (fix_arg => 1); # Transform a raw MARC array into MARCXML sub fix { my ($self, $data) = @_; my $path = $self->path; my $xml; my $exporter = Catmandu::Exporter::MARC::XML->new(file => \$xml , xml_declaration => 0 , collection => 0); $exporter->add($data); $exporter->commit; $data->{$path} = $xml; $data; } =head1 NAME Catmandu::Fix::marc_xml - transform a Catmandu MARC record into MARCXML =head1 SYNOPSIS # Transforms the 'record' key into an MARCXML string marc_xml('record') =head1 DESCRIPTION Read our Wiki pages at L for a complete overview of the Fix language. =head1 SEE ALSO L =cut 1; Exporter000755000765000024 012616110204 20117 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/CatmanduMARC.pm100644000765000024 321212616110204 21335 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Exporter=head1 NAME Catmandu::Exporter::MARC - Exporter for MARC records =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type USMARC to MARC --type XML < /foo/bar.mrc # From Perl use Catmandu; my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'USMARC'); my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => "XML" ); $exporter->add($importer); $exporter->commit; =head1 METHODS =head2 new(file => $file, type => $type) Create a new L which serializes MARC records into a $file. Type describes the MARC serializer to be used. Currently we support: =over 2 =item USMARC L =item XML L =item MARCMaker L =item MiJ L =item ALEPHSEQ L =back Read the documentation of the parser modules for extra configuration options. =head1 SEE ALSO L =cut package Catmandu::Exporter::MARC; use Catmandu::Sane; use Moo; has type => (is => 'ro' , default => sub { 'XML' }); has _exporter => (is => 'ro' , lazy => 1 , builder => '_build_exporter' , handles => 'Catmandu::Exporter'); has _exporter_args => (is => 'rwp', writer => '_set_exporter_args'); sub _build_exporter { my ($self) = @_; my $type = $self->type; my $pkg = Catmandu::Util::require_package($type,'Catmandu::Exporter::MARC'); $pkg->new($self->_exporter_args); } sub BUILD { my ($self,$args) = @_; $self->_set_exporter_args($args); } 1; Importer000755000765000024 012616110204 20110 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/CatmanduMARC.pm100644000765000024 645412616110204 21341 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer=head1 NAME Catmandu::Importer::MARC - Package that imports MARC data =head1 SYNOPSIS # From the command line $ catmandu convert MARC --fix "marc_map('245a','title')" < /foo/bar.mrc # From Perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/bar.mrc'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 DESCRIPTION Catmandu::Importer::MARC is a L to import MARC records from an external source. When given an input file an Catmandu::Iterable is create generating items as perl HASH-es containing two keys: '_id' : the system identifier of the record (usually the 001 field) 'record' : an ARRAY of ARRAYs containing the record data Read more about processing data with Catmandu on the wiki: L =head1 EXAMPLE ITEM { 'record' => [ [ '001', undef, undef, '_', 'fol05882032 ' ], [ '245', '1', '0', 'a', 'Cross-platform Perl /', 'c', 'Eric F. Johnson.' ], ], '_id' => 'fol05882032' } =head1 METHODS =head2 new(file => $filename, type => $type) Create a new MARC importer for $filename. Use STDIN when no filename is given. Type describes the MARC parser to be used. Currently we support: =over 2 =item USMARC L =item MicroLIF L =item MARCMaker L =item JSON L =item XML L =item RAW L =item Lint L =item ALEPHSEQ L =back Read the documentation of the parser modules for extra configuration options. =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every L is a L all its methods are inherited. =head1 SEE ALSO L, L, L , L =cut package Catmandu::Importer::MARC; use Catmandu::Sane; use Catmandu::Util; use Moo; has type => (is => 'ro' , default => sub { 'USMARC' }); has _importer => (is => 'ro' , lazy => 1 , builder => '_build_importer' , handles => 'Catmandu::Importer'); has _importer_args => (is => 'rwp', writer => '_set_importer_args'); sub _build_importer { my ($self) = @_; my $type = $self->type; $type = 'Record' if exists $self->_importer_args->{records}; my $pkg = Catmandu::Util::require_package($type,'Catmandu::Importer::MARC'); $pkg->new($self->_importer_args); } sub BUILD { my ($self,$args) = @_; $self->_set_importer_args($args); } 1;06-old-new-internal-syntax.t100644000765000024 277212616110204 21533 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/tuse strict; use warnings; use Catmandu::Importer::JSON; use Catmandu::Importer::MARC; use Test::More tests => 11; my $fixer = Catmandu::Fix->new(fixes => ['marc_map("245a","title"); marc_map("500a","test")']); my $importer = Catmandu::Importer::JSON->new( file => 't/old_new.json' ); my $records = $fixer->fix($importer)->to_array; ok(@$records == 2 , "Found 2 records"); ok(defined($records->[0]->{title}), "0 has title"); ok(defined($records->[1]->{title}), "1 has title"); is($records->[0]->{title},'ActivePerl with ASP and ADO /',"0 has correct title"); is($records->[1]->{title},'ActivePerl with ASP and ADO /',"1 has correct title"); $importer = Catmandu::Importer::MARC->new( file => 't/camel.usmarc', type => "USMARC" ); $records = $fixer->fix($importer)->to_array; ok(defined($records->[0]->{title}), "1 has title"); is($records->[0]->{title},'ActivePerl with ASP and ADO /',"0 has correct title"); ok(&f245_contains_no_underscore($records->[0]),"MARC importer using the new syntax"); $importer = Catmandu::Importer::MARC->new( file => 't/rug01.aleph' , type => "ALEPHSEQ"); $records = $fixer->fix($importer)->to_array; ok(defined($records->[0]->{title}), "1 has title"); is($records->[0]->{title},'Propositional structure and illocutionary force :',"0 has correct title"); ok(&f245_contains_no_underscore($records->[0]),"MARC importer using the new syntax"); sub f245_contains_no_underscore { my $record = shift; for (@{$record->{record}}) { return 0 if ($_->[0] eq '245' && $_->[3] eq '_'); } return 1; }marc_remove.pm100644000765000024 663712616110204 22046 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixpackage Catmandu::Fix::marc_remove; use Catmandu::Sane; use Carp qw(confess); use Moo; use Catmandu::Fix::Has; has marc_path => (fix_arg => 1); has record => (fix_opt => 1); sub emit { my ($self,$fixer) = @_; my $record_key = $fixer->emit_string($self->record // 'record'); my $marc_path = $self->marc_path; my $field_regex; my ($field,$ind1,$ind2,$subfield_regex,$from,$to,$len); if ($marc_path =~ /(\S{3})(\[(.)?,?(.)?\])?([_a-z0-9^]+)?(\/(\d+)(-(\d+))?)?/) { $field = $1; $ind1 = $3; $ind2 = $4; $subfield_regex = defined $5 ? "[$5]" : undef; $from = $7; $to = $9; } else { confess "invalid marc path"; } $field_regex = $field; $field_regex =~ s/\*/./g; my $var = $fixer->var; my $new_record = $fixer->generate_var; my $perl = $fixer->emit_declare_vars($new_record,[]); $perl .= $fixer->emit_foreach("${var}->{${record_key}}", sub { my $var = shift; my $perl = ""; $perl .= "if (${var}->[0] =~ /${field_regex}/) { "; if (defined $ind1) { $perl .= "next if (defined ${var}->[1] && ${var}->[1] eq '${ind1}');"; } if (defined $ind2) { $perl .= "next if (defined ${var}->[2] && ${var}->[2] eq '${ind2}');"; } unless (defined $ind1 || defined $ind2 || defined $subfield_regex) { $perl .= "next;"; } $perl .= "}"; my $i = $fixer->generate_var; my $new_subf = $fixer->generate_var; $perl .= $fixer->emit_declare_vars($new_subf,'[]'); my $del_subfields = sub { my $start = shift; my $perl =<[${i}] =~ /${subfield_regex}/) { push \@{${new_subf}} , ${var}->[${i}]; push \@{${new_subf}} , ${var}->[${i}+1]; } } splice \@{${var}} , ${start} , int(\@{${var}}), \@{${new_subf}}; EOF $perl; }; if (defined $subfield_regex) { $perl .= "if ( ${var}->[0] =~ /${field_regex}/) {"; $perl .= "if (${var}->[0] =~ /^LDR|^00/) {"; $perl .= $del_subfields->(3); # Old Catmandu::MARC contained a bug/feature to allow # for '_' subfields in non-control elements ..for backwards # compatibility we ignore them $perl .= "} elsif (defined ${var}->[5] && ${var}->[5] eq '_') {"; $perl .= $del_subfields->(5); $perl .= "} else {"; $perl .= $del_subfields->(3); $perl .= "}"; $perl .= "}"; } $perl .= "push \@${new_record} , ${var} "; $perl; }); $perl .= "${var}->{${record_key}} = ${new_record};"; $perl; } =head1 NAME Catmandu::Fix::marc_remove - remove marc (sub)fields =head1 SYNOPSIS # remove all marc 600 fields marc_remove('600') # remove the 245-a subfield marc_remove('245a') # the same with the marc fields in 'record2' marc_remove('600', record:record2) =head1 DESCRIPTION Read our Wiki pages at L for a complete overview of the Fix language. =head1 SEE ALSO L =cut 1; marc_in_json.pm100644000765000024 652012616110204 22177 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixpackage Catmandu::Fix::marc_in_json; use Catmandu::Sane; use Catmandu::Util qw(:is); use Moo; use Catmandu::Fix::Has; has record => (fix_opt => 1); has reverse => (fix_opt => 1); # Transform a raw MARC array into MARC-in-JSON # See Ross Singer work at: # http://dilettantes.code4lib.org/blog/2010/09/a-proposal-to-serialize-marc-in-json/ sub fix { my ($self, $data) = @_; $self->reverse ? $self->_json_record($data) : $self->_record_json($data); } sub _json_record { my ($self, $data) = @_; my $marc_pointer = $self->record // 'record'; my $record = []; if (is_string($data->{leader})) { push @$record , [ 'LDR', undef, undef, '_', $data->{leader} ], } if (is_array_ref($data->{fields})) { for my $field (@{$data->{fields}}) { next unless is_hash_ref($field); my ($tag) = keys %$field; my $val = $field->{$tag}; if ($tag eq 'FMT' || substr($tag, 0, 2) eq '00') { push @$record , [ $tag, undef, undef, '_', $val ], } elsif (is_hash_ref($val)) { my $ind1 = $val->{ind1}; my $ind2 = $val->{ind2}; next unless is_array_ref($val->{subfields}); my $sfs = [ '_' , '']; for my $sf (@{ $val->{subfields} }) { next unless is_hash_ref($sf); my ($code) = keys %$sf; my $sval = $sf->{$code}; push @$sfs , [ $code , $sval]; } push @$record , [ $tag , $ind1 , $ind2 , @$sfs]; } } } if (@$record > 0) { delete $data->{fields}; delete $data->{leader}; $data->{$marc_pointer} = $record; } $data; } sub _record_json { my ($self, $data) = @_; my $marc_pointer = $self->record // 'record'; if (my $marc = delete $data->{$marc_pointer}) { for my $field (@$marc) { my ($tag, $ind1, $ind2, @subfields) = @$field; if ($tag eq 'LDR') { shift @subfields; $data->{leader} = join "", @subfields; } elsif ($tag eq 'FMT' || substr($tag, 0, 2) eq '00') { shift @subfields; push @{$data->{fields} ||= []} , { $tag => join "" , @subfields }; } else { my @sf; my $start = !defined($subfields[0]) || $subfields[0] eq '_' ? 2 : 0; for (my $i = $start; $i < @subfields; $i += 2) { push @sf, { $subfields[$i] => $subfields[$i+1] }; } push @{$data->{fields} ||= []} , { $tag => { subfields => \@sf, ind1 => $ind1, ind2 => $ind2 } }; } } } $data; } =head1 NAME Catmandu::Fix::marc_in_json - transform a Catmandu MARC record into MARC-in-JSON =head1 SYNOPSIS # Transform a Catmandu MARC 'record' into a MARC-in-JSON record marc_in_json() # Optionally provide a pointer to the marc record marc_in_json(record:record) # Reverse, transform a MARC-in-JSON record into a Catmandu MARC record marc_in_json(reverse:1) =head1 DESCRIPTION Read our Wiki pages at L for a complete overview of the Fix language. =head1 SEE ALSO L =cut 1; MARC000755000765000024 012616110204 20641 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/ExporterMiJ.pm100644000765000024 343112616110204 22017 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Exporter/MARC=head1 NAME Catmandu::Exporter::MARC::MiJ - Exporter for MARC records to MARC in JSON =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type XML to MARC --type MiJ < /foo/data.mrc # From Perl use Catmandu; my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'XML'); my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => 'MiJ' ); $exporter->add($importer); $exporter->commit; =head1 METHODS =head2 new(file => $file , %opts) Create a new L to serialize MARC record into MiJ. Provide the path of a $file to write exported records to. Optionally the following parameters can be specified: record : the key containing the marc record (default: 'record') record_format : optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON =head1 INHERTED METHODS =head2 count =head2 add($hashref) =head2 add_many($array) =head2 add_many($iterator) =head2 add_many(sub {}) =head2 ... All the L methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Exporter::MARC::MiJ; use Catmandu::Sane; use Catmandu::Util qw(xml_escape is_different :array :is); use Moo; use MARC::Record; use MARC::Field; use MARC::File::MiJ; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; has record => (is => 'ro' , default => sub { 'record'}); has record_format => (is => 'ro' , default => sub { 'raw'} ); sub add { my ($self, $data) = @_; if ($self->record_format eq 'MARC-in-JSON') { $data = $self->_json_to_raw($data); } my $marc = $self->_raw_to_marc_record($data->{$self->record}); $self->fh->print(MARC::File::MiJ::encode($marc) . "\n"); } sub commit { my ($self) = @_; $self->fh->flush; } 1;XML.pm100644000765000024 736212616110204 22007 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Exporter/MARC=head1 NAME Catmandu::Exporter::MARC::XML - Exporter for MARC records to MARCXML =head1 SYNOPSIS # From the command line $ catmandu convert MARC to MARC --type XML < /foo/data.mrc # From Perl use Catmandu; my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'USMARC'); my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => 'XML' ); $exporter->add($importer); $exporter->commit; =head1 METHODS =head2 new(file => $file , %opts) Create a new L to serialize MARC record into XML. Provide the path of a $file to write exported records to. Optionally the following parameters can be specified: record : the key containing the marc record (default: 'record') record_format : optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON collection : add a marc:collection header when true (default: true) xml_declaration : add a xml declaration when true (default: true) skip_empty_subfields : skip fields which don't contain any data (default: false) =head1 INHERTED METHODS =head2 count =head2 add($hashref) =head2 add_many($array) =head2 add_many($iterator) =head2 add_many(sub {}) =head2 ... All the L methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Exporter::MARC::XML; use Catmandu::Sane; use Catmandu::Util qw(xml_escape is_different :array :is); use Moo; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; has record => (is => 'ro' , default => sub { 'record'}); has record_format => (is => 'ro' , default => sub { 'raw'} ); has skip_empty_subfields => (is => 'ro' , default => sub { 1 }); has collection => (is => 'ro' , default => sub { 1 }); has xml_declaration => (is => 'ro' , default => sub { 1 }); has _n => (is => 'rw' , default => sub { 0 }); sub add { my ($self, $data) = @_; if ($self->_n == 0) { if ($self->xml_declaration) { $self->fh->print(Catmandu::Util::xml_declaration); } if ($self->collection) { $self->fh->print(''); } $self->_n(1); } if ($self->record_format eq 'MARC-in-JSON') { $data = $self->_json_to_raw($data); } if ($self->collection) { $self->fh->print(''); } else { $self->fh->print(''); } my $record = $data->{$self->record}; for my $field (@$record) { my ($tag, $ind1, $ind2, @data) = @$field; $ind1 = ' ' unless defined $ind1; $ind2 = ' ' unless defined $ind2; @data = $self->_clean_raw_data($tag,@data) if $self->skip_empty_subfields; next if $tag eq 'FMT'; next if @data == 0; if ($tag eq 'LDR') { $self->fh->print('' . xml_escape($data[1]) . ''); } elsif ($tag =~ /^00/) { $self->fh->print('' . xml_escape($data[1]) . ''); } else { $self->fh->print(''); while (@data) { my ($code, $val) = splice(@data, 0, 2); next unless $code =~ /[A-Za-z0-9]/; $self->fh->print('' . xml_escape($val) . ''); } $self->fh->print(''); } } $self->fh->print(''); } sub commit { my ($self) = @_; if($self->collection){ $self->fh->print(''); } $self->fh->flush; } 1;MARC000755000765000024 012616110204 20632 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/ImporterMiJ.pm100644000765000024 313512616110204 22011 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::MiJ - Package that imports MARC-in-JSON records =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type MiJ --fix "marc_map('245a','title')" < /foo/data.js # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/data.js', type => 'MiJ'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(file => $file , fh => $fh , id => $field) Parse a file or a filehandle into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Importer::MARC::MiJ; use Catmandu::Sane; use Moo; use MARC::Record; use Catmandu::Importer::MARC::Decoder; use MARC::File::MiJ; with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); has decoder => ( is => 'ro', lazy => 1 , builder => sub { Catmandu::Importer::MARC::Decoder->new; } ); sub generator { my ($self) = @_; my $file = MARC::File::MiJ->in($self->file); sub { $self->decoder->decode($file->next(),$self->id); } } 1;RAW.pm100644000765000024 323612616110204 21765 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::RAW - Package that imports ISO 2709 encoded MARC records =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type RAW --fix "marc_map('245a','title')" < /foo/bar.mrc # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/bar.mrc' , type => 'RAW'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(file => $file , fh => $fh , id => $field) Parse a file or a filehandle into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Importer::MARC::RAW; use Catmandu::Sane; use Moo; use MARC::Parser::RAW; with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); sub generator { my $self = shift; my $parser = MARC::Parser::RAW->new($self->fh); sub { my $record = $parser->next(); return undef unless defined $record; my $id; for my $field (@$record) { my ($tag,$ind1,$ind2,$p,$data,@q) = @$field; if ($tag eq $self->id) { $id = $data; last; } } +{ _id => $id , record => $record }; }; } 1;XML.pm100644000765000024 322212616110204 21767 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::XML - Package that imports MARCXML records =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type XML --fix "marc_map('245a','title')" < /foo/data.xml # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/data.xml', type => 'XML'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(file => $file , fh => $fh , id => $field) Parse a file or a filehandle into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Importer::MARC::XML; use Catmandu::Sane; use Moo; use Catmandu::Importer::MARC::Decoder; use MARC::File::XML (BinaryEncoding => 'UTF-8', DefaultEncoding => 'UTF-8', RecordFormat => 'MARC21'); with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); has decoder => ( is => 'ro', lazy => 1 , builder => sub { Catmandu::Importer::MARC::Decoder->new; } ); sub generator { my ($self) = @_; my $file = MARC::File::XML->in($self->fh); sub { $self->decoder->decode($file->next(),$self->id); } } 1;Base.pm100644000765000024 336212616110204 22215 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Exporter/MARCpackage Catmandu::Exporter::MARC::Base; use Moo::Role; use MARC::Record; use MARC::Field; sub _raw_to_marc_record { my ($self,$data) = @_; my $marc = MARC::Record->new(); for my $field (@$data) { my ($tag, $ind1, $ind2, @data) = @$field; if ($tag eq 'LDR') { $marc->leader($data[1]); } elsif ($tag =~ /^00/) { my $field = MARC::Field->new($tag,$data[1]); $marc->append_fields($field); } else { my $field = MARC::Field->new($tag, $ind1, $ind2, @data); $marc->append_fields($field); } } $marc; } sub _json_to_raw { my ($self,$data) = @_; my @record = (); push (@record , [ 'LDR', ' ', ' ', '_' , $data->{leader}] ) if defined $data->{leader}; for my $field (@{$data->{fields}}) { my ($tag) = keys %$field; my $val = $field->{$tag}; if (ref $val) { my $ind1 = $val->{ind1} // ' '; my $ind2 = $val->{ind2} // ' '; my @parts; for my $subfield (@{$val->{subfields}}) { my ($code) = keys %$subfield; my $str = $subfield->{$code}; push @parts , $code, $str; } push @record , [ $tag, $ind1 , $ind2 , @parts]; } else { push @record , [ $tag, ' ' , ' ', '_', $val]; } } { _id => $data->{_id} , record => \@record }; } sub _clean_raw_data { my ($self, $tag, @data) = @_; my @result = (); for (my $i = 0 ; $i < @data ; $i += 2) { if (($tag =~ /^00/ || defined $data[$i]) && defined $data[$i+1] && $data[$i+1] =~ /\S+/) { push(@result, $data[$i], $data[$i+1]); } } @result; } 1;Bind000755000765000024 012616110204 17711 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixmarc_each.pm100644000765000024 350312616110204 22312 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fix/Bindpackage Catmandu::Fix::Bind::marc_each; use Moo; use Catmandu::Util; with 'Catmandu::Fix::Bind'; has done => (is => 'ro'); sub unit { my ($self,$data) = @_; $self->{done} = 0; $data; } sub bind { my ($self,$mvar,$func,$name,$fixer) = @_; return $mvar if $self->done; my $rows = $mvar->{record} // []; my @new = (); for my $row (@{$rows}) { $mvar->{record} = [$row]; my $fixed = $fixer->fix($mvar); push @new , @{$fixed->{record}} if defined($fixed) && exists $fixed->{record}; } $mvar->{record} = \@new if exists $mvar->{record}; $self->{done} = 1; $mvar; } 1; =head1 NAME Catmandu::Fix::Bind::list - a binder that loops over MARC fields =head1 SYNOPSIS # Only add the 720 field to the authors when the $e subfield contains a 'promotor' do marc_each() if marc_match("720e","promotor") marc_map("720ab",authors.$append) end end # Delete all the 500 fields do marc_each() if marc_match("500",".*") reject() end end =head1 DESCRIPTION The marc_each binder will iterate over each individual MARC field and execute the fixes only in context over each individual field. If a MARC record contains: 500 $aTest 500 $aTest2$eskip 500 $aTest3 then the fix do marc_each() marc_map("500",note.$append) end will have the same effect as marc_map("500",note.$append) because C by default loops over all repeated MARC fields. But the C bind has the advantage to process fields in context. E.g. to only map fields where the $e doesn't contain 'skip' you can write: do marc_each() unless marc_match("500e",skip) marc_map("500",note.$append) end end =head1 SEE ALSO L =cut Lint.pm100644000765000024 415712616110204 22245 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::Lint - Package that imports USMARC records validated with MARC::Lint =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type Lint --fix "marc_map('245a','title')" < /foo/data.mrc # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/data.mrc', type => 'Lint'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 DESCRIPTION All items produced with the Catmandu::Importer::MARC::Lint importer contain three keys: '_id' : the system identifier of the record (usually the 001 field) 'record' : an ARRAY of ARRAYs containing the record data 'lint' : the output of MARC::Lint's check_record on the MARC record =head1 METHODS =head2 new(file => $file , fh => $fh , id => $field) Parse a file or a filehandle into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L, L, =cut package Catmandu::Importer::MARC::Lint; use Catmandu::Sane; use Moo; use MARC::File::USMARC; use MARC::Lint; use Catmandu::Importer::MARC::Decoder; with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); has decoder => ( is => 'ro', lazy => 1 , builder => sub { Catmandu::Importer::MARC::Decoder->new; } ); sub generator { my ($self) = @_; my $lint = MARC::Lint->new; my $file = MARC::File::USMARC->in($self->fh); sub { my $marc = $file->next(); my $doc = $self->decoder->decode($marc,$self->id); $lint->check_record( $marc ); $doc->{lint} = [$lint->warnings]; $doc; } } 1;Inline000755000765000024 012616110204 20253 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixmarc_add.pm100644000765000024 360112616110204 22503 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fix/Inlinepackage Catmandu::Fix::Inline::marc_add; use Clone qw(clone); use Carp; use Catmandu::Util qw(:is); require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(marc_add); %EXPORT_TAGS = (all => [qw(marc_add)]); sub marc_add { my ($data,$marc_path,@subfields) = @_; my (%subfields) = @subfields; my $ret = defined $data ? clone($data) : { record => [] }; $ret->{'record'} = [] unless $ret->{'record'}; croak "invalid marc path" unless $marc_path =~ /^\w{3}$/; my @field = (); push @field , $marc_path; push @field , $subfields{ind1} // ' '; push @field , $subfields{ind2} // ' '; for (my $i = 0 ; $i < @subfields ; $i += 2) { my $code = $subfields[$i]; next unless length $code == 1; my $value = $subfields[$i+1]; if ($value =~ /^\$\.(\S+)/) { my $path = $1; $value = Catmandu::Util::data_at($path,$data); } if (is_array_ref $value) { for (@$value) { push @field , $code; push @field , $_; } } elsif (is_hash_ref $value) { for (keys %$value) { push @field , $code; push @field , $value->{$_}; } } elsif (is_value($value) && length($value) > 0) { push @field , $code; push @field , $value; } } push @{ $ret->{record} } , \@field; return $ret; } =head1 NAME Catmandu::Fix::Inline::marc_add- A marc_add-er for Perl scripts =head1 SYNOPSIS use Catmandu::Fix::Inline::marc_add qw(:all); # Set to a literal value my $data = marc_add($data, '245', a => 'value'); # Set to a copy of a deeply nested JSON path my $data = marc_add($data, '245', a => '$.my.deep.field'); =head1 SEE ALSO L , L , L =cut 1;marc_map.pm100644000765000024 775112616110204 22542 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fix/Inline=head1 NAME Catmandu::Fix::Inline::marc_map - A marc_map-er for Perl scripts =head1 SYNOPSIS use Catmandu::Fix::Inline::marc_map qw(:all); my $title = marc_map($data,'245a'); my @authors = marc_map($data,'100ab'); # Get all 245 in an array @arr = marc_map($data,'245'); # Or as a string $str = marc_map($data,'245'); # str joined by a semi-colon $f245 = marc_map($data, '245', -join , ';'); # Get the 245-$a$b$c subfields ordered as given in the record $str = marc_map($data,'245abc'); # Get the 245-$c$b$a subfields orders as given in the mapping $str = marc_map($data,'245cba', -pluck => 1); # Get the 008 characters 35-35 $str = marc_map($data,'008_/35-35'); # Get all 100 subfields except the digits $str = marc_map($data,'100^0123456789'); # The $data should be a Catmandu-style MARC hash { record => [ ['field', 'ind1' , 'ind2' , 'subfieldcode or underscore' , 'data' , 'subfield' , 'data' , ...] , ... ]}; # Example $data = { record => [ ['001' , ' ', ' ' , '_' , 'myrecord-001' ] , ['020' , ' ', ' ' , 'a' , '978-1449303587' ] , ['245' , ' ', ' ' , 'a' , 'Learning Per' , 'c', '/ by Randal L. Schwartz'], ]}; =head1 SEE ALSO L , L , L =cut package Catmandu::Fix::Inline::marc_map; require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(marc_map); %EXPORT_TAGS = (all => [qw(marc_map)]); sub marc_map { my ($data,$marc_path,%opts) = @_; return unless exists $data->{'record'}; my $record = $data->{'record'}; unless (defined $record && ref $record eq 'ARRAY') { return wantarray ? () : undef; } my $split = $opts{'-split'}; my $join_char = $opts{'-join'} // ''; my $pluck = $opts{'-pluck'}; my $attrs = {}; if ($marc_path =~ /(\S{3})(\[(.)?,?(.)?\])?([_a-z0-9^]+)?(\/(\d+)(-(\d+))?)?/) { $attrs->{field} = $1; $attrs->{ind1} = $3; $attrs->{ind2} = $4; $attrs->{subfield_regex} = defined $5 ? "[$5]" : "[a-z0-9_]"; $attrs->{from} = $7; $attrs->{to} = $9; } else { return wantarray ? () : undef; } $attrs->{field_regex} = $attrs->{field}; $attrs->{field_regex} =~ s/\*/./g; my $add_subfields = sub { my $var = shift; my $start = shift; my @v = (); if ($pluck) { # Treat the subfield_regex as a hash index my $_h = {}; for (my $i = $start; $i < @$var; $i += 2) { push @{ $_h->{ $var->[$i] } } , $var->[$i + 1]; } for my $c (split('',$attrs->{subfield_regex})) { push @v , @{ $_h->{$c} } if exists $_h->{$c}; } } else { for (my $i = $start; $i < @$var; $i += 2) { if ($var->[$i] =~ /$attrs->{subfield_regex}/) { push(@v, $var->[$i + 1]); } } } return \@v; }; my @vals = (); for my $var (@$record) { next if $var->[0] !~ /$attrs->{field_regex}/; next if defined $attrs->{ind1} && $var->[1] ne $attrs->{ind1}; next if defined $attrs->{ind2} && $var->[2] ne $attrs->{ind2}; my $v; if ($var->[0] =~ /LDR|00./) { $v = $add_subfields->($var,3); } elsif (defined $var->[5] && $var->[5] eq '_') { $v = $add_subfields->($var,5); } else { $v = $add_subfields->($var,3); } if (@$v) { if (!$split) { $v = join $join_char, @$v; if (defined(my $off = $attrs->{from})) { my $len = defined $attrs->{to} ? $attrs->{to} - $off + 1 : 1; $v = substr($v,$off,$len); } } } push (@vals,$v) if ( (ref $v eq 'ARRAY' && @$v) || (ref $v eq '' && length $v )); } if (wantarray) { return @vals; } elsif (@vals > 0) { return join $join_char , @vals; } else { return undef; } } 1; marc_set.pm100644000765000024 552712616110204 22557 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fix/Inlinepackage Catmandu::Fix::Inline::marc_set; use Clone qw(clone); use Carp; use Catmandu::Util qw(:is); require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(marc_set); %EXPORT_TAGS = (all => [qw(marc_set)]); sub marc_set { my ($data,$marc_path,$value) = @_; my $record = $data->{record}; return $data unless defined $record; if ($value =~ /^\$\.(\S+)/) { my $path = $1; $value = Catmandu::Util::data_at($path,$data); } if (is_array_ref $value) { $value = $value->[-1]; } elsif (is_hash_ref $value) { my $last; for (keys %$value) { $last = $value->{$_}; } $value = $last; } my $field_regex; my ($field,$ind1,$ind2,$subfield_regex,$from,$to,$len); if ($marc_path =~ /(\S{3})(\[(.)?,?(.)?\])?([_a-z0-9])?(\/(\d+)(-(\d+))?)?/) { $field = $1; $ind1 = $3; $ind2 = $4; if (defined $5) { $subfield_regex = "$5"; } else { $subfield_regex = ($field =~ /^LDR|^00/) ? "_" : "a"; } $from = $7; $to = $9; $len = defined $to ? $to - $from + 1 : 1; } else { confess "invalid marc path"; } $field_regex = $field; $field_regex =~ s/\*/./g; for (@$record) { if ($_->[0] !~ /$field_regex/) { next; } if (defined $ind1) { if (!defined $_->[1] || $_->[1] ne $ind1) { next; } } if (defined $ind2) { if (!defined $_->[2] || $_->[2] ne $ind2) { next; } } my $start; if ($_->[0] =~ /^LDR|^00/) { $start = 3; } elsif (defined $_->[5] && $_->[5] eq '_') { $start = 5; } else { $start = 3; } my $found = 0; for (my $i = $start; $i < @$_; $i += 2) { if ($_->[$i] eq $subfield_regex) { if (defined $from) { substr($_->[$i + 1], $from, $len) = $value; } else { $_->[$i + 1] = $value; } $found = 1; } } if ($found == 0) { push(@$_,$subfield_regex,$value); } } $data; } =head1 NAME Catmandu::Fix::Inline::marc_set - A marc_set-er for Perl scripts =head1 SYNOPSIS use Catmandu::Fix::Inline::marc_set qw(:all); # Set to literal value my $data = marc_set($data,'245[1]a', 'value'); # Set to a copy of a deeply nested JSON path my $data = marc_set($data,'245[1]a', '$.my.deep.field'); =head1 SEE ALSO L , L , L =cut 1; 14-marc_decode_dollar_subfields.t100644000765000024 114312616110204 22640 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/t#!/usr/bin/perl use strict; use warnings; use warnings qw(FATAL utf8); use utf8; use Test::More; use Catmandu::Importer::MARC; use Catmandu::Fix; my $fixer = Catmandu::Fix->new(fixes => [ q|marc_decode_dollar_subfields()|, q|marc_map('200e','test')| ]); # t/dollar_subfields.mrc a special prepared marc file containing $subfields als values my $importer = Catmandu::Importer::MARC->new( file => 't/dollar_subfields.mrc', type => "RAW" ); my $record = $fixer->fix($importer->first); like $record->{test}, qr/: Ermoupolis, Syros Island, Greece/, q|fix: marc_decode_dollar_subfields()|; done_testing 1; USMARC.pm100644000765000024 344112616110204 22333 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Exporter/MARC=head1 NAME Catmandu::Exporter::MARC::USMARC - Exporter for MARC records to USMARC =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type XML to MARC --type USMARC < /foo/data.mrc # From Perl use Catmandu; my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'XML'); my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => 'USMARC' ); $exporter->add($importer); $exporter->commit; =head1 METHODS =head2 new(file => $file , %opts) Create a new L to serialize MARC record into USMARC. Provide the path of a $file to write exported records to. Optionally the following parameters can be specified: record : the key containing the marc record (default: 'record') record_format : optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON =head1 INHERTED METHODS =head2 count =head2 add($hashref) =head2 add_many($array) =head2 add_many($iterator) =head2 add_many(sub {}) =head2 ... All the L methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Exporter::MARC::USMARC; use Catmandu::Sane; use Catmandu::Util qw(xml_escape is_different :array :is); use Moo; use MARC::Record; use MARC::Field; use MARC::File::USMARC; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; has record => (is => 'ro' , default => sub { 'record'}); has record_format => (is => 'ro' , default => sub { 'raw'} ); sub add { my ($self, $data) = @_; if ($self->record_format eq 'MARC-in-JSON') { $data = $self->_json_to_raw($data); } my $marc = $self->_raw_to_marc_record($data->{$self->record}); $self->fh->print(MARC::File::USMARC::encode($marc)); } sub commit { my ($self) = @_; $self->fh->flush; } 1;Record.pm100644000765000024 322612616110204 22551 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::Record - Package that imports an array of MARC::Record =head1 SYNOPSIS # From perl use Catmandu; use MARC::Record; my $record = MARC::Record->new(); my $field = MARC::Field->new('245','','','a' => 'My title.'); $record->append_fields($field); # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/data.mrc' , records => [$record]); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(records => [ , ... ] , id => $field) Parse an array of L into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Importer::MARC::Record; use Catmandu::Sane; use Catmandu::Importer::MARC::Decoder; use Moo; with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); has records => (is => 'rw'); has decoder => ( is => 'ro', lazy => 1 , builder => sub { Catmandu::Importer::MARC::Decoder->new; } ); sub generator { my ($self) = @_; my @records = @{$self->records}; sub { $self->decoder->decode(shift @records, $self->id); } } 1;USMARC.pm100644000765000024 475412616110204 22334 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::USMARC - Package that imports USMARC records =head1 SYNOPSIS # From the command line (USMARC is the default importer for MARC) $ catmandu convert MARC --fix "marc_map('245a','title')" < /foo/data.mrc # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/data.mrc'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(file => $file , fh => $fh , id => $field) Parse a file or a filehandle into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Importer::MARC::USMARC; use Catmandu::Sane; use Moo; use MARC::File::USMARC; with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); has records => (is => 'rw'); sub generator { my ($self) = @_; my $file = MARC::File::USMARC->in($self->fh); sub { $self->decode_marc($file->next()); } } sub decode_marc { my ($self, $record) = @_; return unless eval { $record->isa('MARC::Record') }; my @result = (); push @result , [ 'LDR' , undef, undef, '_' , $record->leader ]; for my $field ($record->fields()) { my $tag = $field->tag; my $ind1 = $field->indicator(1); my $ind2 = $field->indicator(2); my @sf = (); if ($field->is_control_field) { push @sf , '_', $field->data; } for my $subfield ($field->subfields) { push @sf , @$subfield; } push @result, [$tag,$ind1,$ind2,@sf]; } my $sysid = undef; my $id = $self->id; if ($id =~ /^00/ && $record->field($id)) { $sysid = $record->field($id)->data(); } elsif ($id =~ /^(\d{3})([\da-zA-Z])$/) { my $field = $record->field($1); $sysid = $field->subfield($2) if ($field); } elsif (defined $id && $record->field($id)) { $sysid = $record->field($id)->subfield("a"); } return { _id => $sysid , record => \@result }; } 1;Decoder.pm100644000765000024 213512616110204 22676 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARCpackage Catmandu::Importer::MARC::Decoder; use Catmandu::Sane; use Moo; sub decode { my ($self, $record, $id) = @_; return unless eval { $record->isa('MARC::Record') }; my @result = (); push @result , [ 'LDR' , undef, undef, '_' , $record->leader ]; for my $field ($record->fields()) { my $tag = $field->tag; my $ind1 = $field->indicator(1); my $ind2 = $field->indicator(2); my @sf = (); if ($field->is_control_field) { push @sf , '_', $field->data; } for my $subfield ($field->subfields) { push @sf , @$subfield; } push @result, [$tag,$ind1,$ind2,@sf]; } my $sysid = undef; if ($id =~ /^00/ && $record->field($id)) { $sysid = $record->field($id)->data(); } elsif ($id =~ /^(\d{3})([\da-zA-Z])$/) { my $field = $record->field($1); $sysid = $field->subfield($2) if ($field); } elsif (defined $id && $record->field($id)) { $sysid = $record->field($id)->subfield("a"); } return { _id => $sysid , record => \@result }; } 1;ALEPHSEQ.pm100644000765000024 605012616110204 22542 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Exporter/MARC=head1 NAME Catmandu::Exporter::MARC::ALEPHSEQ - Exporter for MARC records to Ex Libris' Aleph sequential =head1 SYNOPSIS # From the command line $ catmandu convert MARC to MARC --type ALEPHSEQ < /foo/data.mrc # From Perl use Catmandu; my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'USMARC'); my $exporter = Catmandu->exporter('MARC', file => "marc.txt", type => 'ALEPHSEQ' ); $exporter->add($importer); $exporter->commit; =head1 METHODS =head2 new(file => $file , %opts) Create a new L to serialize MARC record into Aleph sequential. Provide the path of a $file to write exported records to. Optionally the following parameters can be specified: record : the key containing the marc record (default: 'record') record_format : optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON skip_empty_subfields : skip fields which don't contain any data (default: false) =head1 INHERTED METHODS =head2 count =head2 add($hashref) =head2 add_many($array) =head2 add_many($iterator) =head2 add_many(sub {}) =head2 ... All the L methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Exporter::MARC::ALEPHSEQ; use Catmandu::Sane; use Catmandu::Util qw(xml_escape is_different :array :is); use List::Util; use Moo; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; has record => (is => 'ro' , default => sub { 'record'}); has record_format => (is => 'ro', default => sub { 'raw'} ); has skip_empty_subfields => (is => 'ro' , default => sub { 0 }); sub add { my ($self,$data) = @_; if ($self->record_format eq 'MARC-in-JSON') { $data = $self->_json_to_raw($data); } my $_id = sprintf("%-9.9d", $data->{_id} // 0); my $record = $data->{$self->record}; my @lines = (); for my $field (@$record) { my ($tag,$ind1,$ind2,@data) = @$field; $ind1 = ' ' unless defined $ind1; $ind2 = ' ' unless defined $ind2; @data = $self->_clean_raw_data($tag,@data) if $self->skip_empty_subfields; next if $#data == -1; # Joins are faster than perl string concatenation if (index($tag,'FMT') == 0 || index($tag,'00') == 0) { push @lines , join('', $_id , ' ' , $tag , $ind1 , $ind2 , ' L ', $data[1] ); } elsif (index($tag,'LDR') == 0) { my $ldr = $data[1]; $ldr =~ s/ /^/og; push @lines , join('', $_id , ' ' , $tag , $ind1 , $ind2 , ' L ', $ldr ); } else { my @line = ('', $_id , ' ' , $tag , $ind1 , $ind2 , ' L '); while (@data) { my ($code,$val) = splice(@data, 0, 2); next unless $code =~ /[A-Za-z0-9]/o; next unless is_string($val); push @line , '$$' , $code , $val; } push @lines , join('', @line); } } $self->fh->print(join("\n",@lines) , "\n"); } sub commit { my $self = shift; $self->fh->flush; } 1;marc_remove.pm100644000765000024 164412616110204 23255 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fix/Inlinepackage Catmandu::Fix::Inline::marc_remove; use Clone qw(clone); use Carp; require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(marc_remove); %EXPORT_TAGS = (all => [qw(marc_remove)]); sub marc_remove { my ($data,$marc_path) = @_; my $ret = defined $data ? clone($data) : { record => [] }; $ret->{'record'} = [] unless $ret->{'record'}; croak "invalid marc path" unless $marc_path =~ /^\w{3}$/; my @fields = (); for my $field (@{$ret->{record}}) { unless ($field->[0] eq $marc_path) { push @fields , $field; } } $ret->{record} = \@fields; return $ret; } =head1 NAME Catmandu::Fix::Inline::marc_remove - remove marc fields =head1 SYNOPSIS use Catmandu::Fix::Inline::marc_remove qw(:all); my $data = marc_remove($data,'CAT'); =head1 SEE ALSO L , L , L =cut 1;ALEPHSEQ.pm100644000765000024 557412616110204 22545 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::ALEPHSEQ - Package that imports Ex Libris' Aleph sequential MARC records =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type ALEPHSEQ --fix "marc_map('245a','title')" < /foo/usm01.txt # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/usm01.txt' , type => 'ALEPHSEQ'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(file => $file , fh => $fh) Parse a file or a filehandle into a L. =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =cut package Catmandu::Importer::MARC::ALEPHSEQ; use Catmandu::Sane; use Moo; with 'Catmandu::Importer'; sub generator { my $self = shift; sub { state $fh = $self->fh; state $prev_id; state $record = []; while(<$fh>) { chop; next unless (length $_ >= 18); my ($sysid,$s1,$tag,$ind1,$ind2,$s2,$char,$s3,$data) = unpack("A9A1A3A1A1A1A1A1U0A*",$_); unless ($tag =~ m{^[0-9A-Z]+}o) { warn "skipping $sysid $tag unknown tag"; next; } unless ($ind1 =~ m{^[A-Za-z0-9-]$}o) { $ind1 = " "; } unless ($ind2 =~ m{^[A-Za-z0-9-]$}o) { $ind2 = " "; } unless (utf8::decode($data)) { warn "skipping $sysid $tag unknown data"; next; } if ($tag eq 'LDR') { $data =~ s/\^/ /g; } my @parts = ('_' , split(/\$\$(.)/, $data) ); # All control-fields contain an underscore field containing the data # all other fields not. unless ($tag =~ /^FMT|LDR|00.$/o) { shift @parts; shift @parts; } # If we have an empty subfield at the end, then we need to add a implicit empty value push(@parts,'') unless int(@parts) % 2 == 0; if (@$record > 0 && $tag eq 'FMT') { my $result = { _id => $prev_id , record => [ @$record ] }; $record = [[$tag, $ind1, $ind2, @parts]]; $prev_id = $sysid; return $result; } push @$record, [$tag, $ind1, $ind2, @parts]; $prev_id = $sysid; } if (@$record > 0) { my $result = { _id => $prev_id , record => [ @$record ] }; $record = []; return $result; } else { return; } }; } 1;MicroLIF.pm100644000765000024 314012616110204 22732 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::MicroLIF - Package that imports MicroLIF records =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type MicroLIF --fix "marc_map('245a','title')" < /foo/data.lif # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/data.lif', type => 'MicroLIF'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(file => $file , fh => $fh , id => $field) Parse a file or a filehandle into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Importer::MARC::MicroLIF; use Catmandu::Sane; use Moo; use MARC::File::MicroLIF; use Catmandu::Importer::MARC::Decoder; with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); has decoder => ( is => 'ro', lazy => 1 , builder => sub { Catmandu::Importer::MARC::Decoder->new; } ); sub generator { my ($self) = @_; my $file = MARC::File::MicroLIF->in($self->fh); sub { $self->decode_marc($file->next(),$self->id); } } 1;MARCMaker.pm100644000765000024 346612616110204 23052 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Exporter/MARC=head1 NAME Catmandu::Exporter::MARC::MARCMaker - Exporter for MARC records to USMARC =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type XML to MARC --type MARCMaker < /foo/data.mrc # From Perl use Catmandu; my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'XML'); my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => 'MARCMaker' ); $exporter->add($importer); $exporter->commit; =head1 METHODS =head2 new(file => $file , %opts) Create a new L to serialize MARC record into MARCMaker. Provide the path of a $file to write exported records to. Optionally the following parameters can be specified: record : the key containing the marc record (default: 'record') record_format : optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON =head1 INHERTED METHODS =head2 count =head2 add($hashref) =head2 add_many($array) =head2 add_many($iterator) =head2 add_many(sub {}) =head2 ... All the L methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Exporter::MARC::MARCMaker; use Catmandu::Sane; use Catmandu::Util qw(xml_escape is_different :array :is); use Moo; use MARC::Record; use MARC::Field; use MARC::File::MARCMaker; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; has record => (is => 'ro' , default => sub { 'record'}); has record_format => (is => 'ro' , default => sub { 'raw'} ); sub add { my ($self, $data) = @_; if ($self->record_format eq 'MARC-in-JSON') { $data = $self->_json_to_raw($data); } my $marc = $self->_raw_to_marc_record($data->{$self->record}); $self->fh->print(MARC::File::MARCMaker::encode($marc)); } sub commit { my ($self) = @_; $self->fh->flush; } 1;MARCMaker.pm100644000765000024 315412616110204 23035 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Importer/MARC=head1 NAME Catmandu::Importer::MARC::MARCMaker - Package that imports MARCMaker records =head1 SYNOPSIS # From the command line $ catmandu convert MARC --type MARCMaker --fix "marc_map('245a','title')" < /foo/data.mrk # From perl use Catmandu; # import records from file my $importer = Catmandu->importer('MARC',file => '/foo/data.mrk', type => 'MARCMaker'); my $fixer = Catmandu->fixer("marc_map('245a','title')"); $importer->each(sub { my $item = shift; ... }); # or using the fixer $fixer->fix($importer)->each(sub { my $item = shift; printf "title: %s\n" , $item->{title}; }); =head1 METHODS =head2 new(file => $file , fh => $fh , id => $field) Parse a file or a filehandle into a L. Optionally provide an id attribute specifying the source of the system identifer '_id' field (e.g. '001'). =head1 INHERTED METHODS =head2 count =head2 each(&callback) =head2 ... Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. =head1 SEE ALSO L =cut package Catmandu::Importer::MARC::MARCMaker; use Catmandu::Sane; use Moo; use MARC::File::MARCMaker; use Catmandu::Importer::MARC::Decoder; with 'Catmandu::Importer'; has id => (is => 'ro' , default => sub { '001' }); has decoder => ( is => 'ro', lazy => 1 , builder => sub { Catmandu::Importer::MARC::Decoder->new; } ); sub generator { my ($self) = @_; my $file = MARC::File::MARCMaker->in($self->fh); sub { $self->decoder->decode($file->next(),$self->id); } } 1;Condition000755000765000024 012616110204 20763 5ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixmarc_match.pm100644000765000024 260412616110204 23561 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fix/Conditionpackage Catmandu::Fix::Condition::marc_match; use Catmandu::Sane; use Catmandu::Fix::marc_map; use Catmandu::Fix::Condition::all_match; use Catmandu::Fix::set_field; use Catmandu::Fix::remove_field; use Moo; use Catmandu::Fix::Has; with 'Catmandu::Fix::Condition'; has marc_path => (fix_arg => 1); has value => (fix_arg => 1); sub emit { my ($self,$fixer,$label) = @_; my $perl; my $tmp_var = '_tmp_' . int(rand(9999)); my $marc_map = Catmandu::Fix::marc_map->new($self->marc_path , "$tmp_var.\$append"); $perl .= $marc_map->emit($fixer,$label); my $all_match = Catmandu::Fix::Condition::all_match->new("$tmp_var.*",$self->value); my $remove_field = Catmandu::Fix::remove_field->new($tmp_var); my $pass_fixes = $self->pass_fixes; my $fail_fixes = $self->fail_fixes; $all_match->pass_fixes([ $remove_field , @$pass_fixes ]); $all_match->fail_fixes([ $remove_field , @$fail_fixes ]); $perl .= $all_match->emit($fixer,$label); $perl; } =head1 NAME Catmandu::Fix::Condition::marc_match - Conditionals on MARC fields =head1 SYNOPSIS # marc_match(MARC_PATH,REGEX) if marc_match('245','My funny title') add_field('my.funny.title','true') end =head1 DESCRIPTION Read our Wiki pages at L for a complete overview of the Fix language. =head1 SEE ALSO L =cut 1;marc_decode_dollar_subfields.pm100644000765000024 273512616110204 25364 0ustar00hochstenstaff000000000000Catmandu-MARC-0.214/lib/Catmandu/Fixpackage Catmandu::Fix::marc_decode_dollar_subfields; use Moo; use Data::Dumper; sub fix { my ($self,$data) = @_; my $old_record = $data->{record}; my $new_record = []; for my $field (@$old_record) { my ($field,$ind1,$ind2,@subfields) = @$field; my $fixed_field = [$field,$ind1,$ind2]; for (my $i = 0 ; $i < @subfields ; $i += 2) { my $code = $subfields[$i]; my $value = $subfields[$i+1]; # If a subfield contains fields coded like: data$xmore$yevenmore # chunks = (data,x,y,evenmore) my @chunks = split( /\$([a-z])/, $value ); my $real_value = shift @chunks; push @$fixed_field , ( $code, $real_value); while (@chunks) { push @$fixed_field , ( splice @chunks, 0, 2 ); } } push @$new_record , $fixed_field; } $data->{record} = $new_record; $data; } =head1 NAME Catmandu::Fix::marc_decode_dollar_subfields - decode double encoded dollar subfields =head1 SYNOPSIS marc_decode_dollar_subfields() =head1 DESCRIPTION In some environments MARC subfields can contain data values that can be interpreted as subfields itself. E.g. when the 245-$a subfield contains the data: My Title $h subsubfield then the $h = subsubfield will not be accessible with normal MARC processing tools. Use the 'marc_decode_dollar_subfields()' fix to re-evaluate all the MARC subfields for these hidden data. =head1 USAGE catmandu convert MARC --type RAW --fix 'marc_decode_dollar_subfields()' < data.mrc =head1 SEE ALSO L =cut 1;