MARC-File-MiJ-0.04000755001750001750 012173536346 12222 5ustar00gmcgmc000000000000MARC-File-MiJ-0.04/META.yml000444001750001750 126612173536346 13635 0ustar00gmcgmc000000000000--- abstract: 'Read newline-delimited marc-in-json files' author: - 'Bill Dueber ' build_requires: Test::More: 0 configure_requires: Module::Build: 0 dynamic_config: 1 generated_by: 'Module::Build version 0.4001, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: MARC-File-MiJ provides: MARC::File::MiJ: file: lib/MARC/File/MiJ.pm version: 0.04 MARC::Record::MiJ: file: lib/MARC/Record/MiJ.pm version: 0.04 requires: JSON: 0 MARC::File: 0 MARC::Record: 0 ex::monkeypatched: 0 resources: license: http://dev.perl.org/licenses/ version: 0.04 MARC-File-MiJ-0.04/Changes000444001750001750 72212173536346 13633 0ustar00gmcgmc000000000000Revision history for MARC-MiJ 0.04 2013/07/23 - fix test failure noise on some *BSD platforms 0.03 2013/07/18 - list all dependencies to make automated testers happy 0.02 2013/07/15 - Switch license to Perl license - Add monkey patches (and tests) for ->to_mij, MARC::Record->new_from_mij - Fix license and CPAN-links in documentation 0.01 2013/07/11 First version, released on an unsuspecting world. MARC-File-MiJ-0.04/MANIFEST000444001750001750 30212173536346 13463 0ustar00gmcgmc000000000000Build.PL Changes lib/MARC/File/MiJ.pm lib/MARC/Record/MiJ.pm MANIFEST This list of files README t/00-load.t t/boilerplate.t t/camel.usmarc t/test.mrc t/test.ndj Makefile.PL META.yml META.json MARC-File-MiJ-0.04/META.json000444001750001750 230512173536346 14000 0ustar00gmcgmc000000000000{ "abstract" : "Read newline-delimited marc-in-json files", "author" : [ "Bill Dueber " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.4001, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "MARC-File-MiJ", "prereqs" : { "build" : { "requires" : { "Test::More" : "0" } }, "configure" : { "requires" : { "Module::Build" : "0" } }, "runtime" : { "requires" : { "JSON" : "0", "MARC::File" : "0", "MARC::Record" : "0", "ex::monkeypatched" : "0" } } }, "provides" : { "MARC::File::MiJ" : { "file" : "lib/MARC/File/MiJ.pm", "version" : "0.04" }, "MARC::Record::MiJ" : { "file" : "lib/MARC/Record/MiJ.pm", "version" : "0.04" } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ] }, "version" : "0.04" } MARC-File-MiJ-0.04/Makefile.PL000444001750001750 75712173536346 14322 0ustar00gmcgmc000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.4001 use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'MARC::File::MiJ', 'VERSION_FROM' => 'lib/MARC/File/MiJ.pm', 'PREREQ_PM' => { 'JSON' => 0, 'MARC::File' => 0, 'MARC::Record' => 0, 'Test::More' => 0, 'ex::monkeypatched' => 0 }, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [], 'PL_FILES' => {} ) ; MARC-File-MiJ-0.04/Build.PL000444001750001750 135012173536346 13652 0ustar00gmcgmc000000000000use 5.006; use strict; use warnings FATAL => 'all'; use Module::Build; my $builder = Module::Build->new( module_name => 'MARC::File::MiJ', license => 'perl', dist_author => q{Bill Dueber }, dist_version_from => 'lib/MARC/File/MiJ.pm', release_status => 'stable', configure_requires => { 'Module::Build' => 0, }, build_requires => { 'Test::More' => 0, }, requires => { 'ex::monkeypatched' => 0, 'JSON' => 0, 'MARC::File' => 0, 'MARC::Record' => 0, }, add_to_cleanup => [ 'MARC-MiJ-*' ], create_makefile_pl => 'traditional', ); $builder->create_build_script(); MARC-File-MiJ-0.04/README000444001750001750 172712173536346 13246 0ustar00gmcgmc000000000000MARC-MiJ Allow perl's MARC::Record and MARC::File/MARC::Batch to deal with marc-in-json, a MARC serialization described at http://dilettantes.code4lib.org/blog/2010/09/a-proposal-to-serialize-marc-in-json/. EXAMPLES # Read in from newline-delimieted JSON file use MARC::Batch; use MARC::File::MiJ; my $reader = new MARC::Batch('MiJ', $jsonfilename); while (my $r = $batch->next) { ... } # Convert binary to marc-in-json use MARC::Record::MiJ; my $batch = MARC::Batch->new('USMARC', 'file.mrc'); open(my $jsonfile, '>', 'file.ndj' ); while (my $r = $batch->next) { print $jsonfile MARC::Record::MiJ->to_mij($r), "\n"; } close $jsonfile; INSTALLATION To install this module, run the following commands: perl Build.PL ./Build ./Build test ./Build install LICENSE AND COPYRIGHT This software is free software and may be distributed under the same terms as Perl itself. Copyright (C) 2013 Bill Dueber MARC-File-MiJ-0.04/t000755001750001750 012173536346 12465 5ustar00gmcgmc000000000000MARC-File-MiJ-0.04/t/boilerplate.t000555001750001750 257212173536346 15322 0ustar00gmcgmc000000000000#!perl -T use 5.006; use strict; use warnings FATAL => 'all'; use Test::More; plan tests => 4; sub not_in_file_ok { my ($filename, %regex) = @_; open( my $fh, '<', $filename ) or die "couldn't open $filename for reading: $!"; my %violated; while (my $line = <$fh>) { while (my ($desc, $regex) = each %regex) { if ($line =~ $regex) { push @{$violated{$desc}||=[]}, $.; } } } if (%violated) { fail("$filename contains boilerplate text"); diag "$_ appears on lines @{$violated{$_}}" for keys %violated; } else { pass("$filename contains no boilerplate text"); } } sub module_boilerplate_ok { my ($module) = @_; not_in_file_ok($module => 'the great new $MODULENAME' => qr/ - The great new /, 'boilerplate description' => qr/Quick summary of what the module/, 'stub function definition' => qr/function[12]/, ); } TODO: { local $TODO = "Need to replace the boilerplate text"; not_in_file_ok(README => "The README is used..." => qr/The README is used/, "'version information here'" => qr/to provide version information/, ); not_in_file_ok(Changes => "placeholder date/time" => qr(Date/time) ); module_boilerplate_ok('lib/MARC/File/MiJ.pm'); module_boilerplate_ok('lib/MARC/Record/MiJ.pm'); } MARC-File-MiJ-0.04/t/test.ndj000444001750001750 6316312173536346 14327 0ustar00gmcgmc000000000000{"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"}]}}]} MARC-File-MiJ-0.04/t/00-load.t000555001750001750 547612173536346 14162 0ustar00gmcgmc000000000000#!perl -T use 5.006; use strict; use warnings FATAL => 'all'; use Test::More; BEGIN { use_ok( 'MARC::File::MiJ' ) || print "Bail out!\n"; use_ok( 'MARC::Record::MiJ' ) || print "Bail out!\n"; } diag( "Testing MARC::File::MiJ $MARC::File::MiJ::VERSION, Perl $], $^X" ); use MARC::Record; use MARC::Batch; use File::Spec; use Data::Dumper; $Data::Dumper::Sortkeys = 1; my $filename = File::Spec->catfile( 't', 'camel.usmarc' ); my $batch = new MARC::Batch( 'USMARC', $filename ); my $r = $batch->next; my $mij_structure = MARC::Record::MiJ->to_mij_structure($r); my $mij_string = Dumper($mij_structure); # Now make a new one and compare my $r2 = MARC::Record::MiJ->new_from_mij_structure($mij_structure); my $mij_structure2 = MARC::Record::MiJ->to_mij_structure($r2); my $mij_string2 = Dumper($mij_structure2); is_deeply($r, $r2, "Records are identical"); is_deeply($mij_structure, $mij_structure2, "Intermediate structure is identical"); is($mij_string, $mij_string2, "Dumper output is identical"); # Test monkey patching is_deeply($r->to_mij_structure, $r2->to_mij_structure, "Monkey patch \$r->to_mij_structure"); is_deeply(MARC::Record->new_from_mij_structure($mij_structure), MARC::Record->new_from_mij_structure($mij_structure2), "Monkey patch MARC::Record->new_from_mij_structure"); is_deeply($r, MARC::Record->new_from_mij($r->to_mij), "Round trip via MARC::Record monkey patches"); # memoized json thing working? my $json1 = MARC::Record::MiJ->json; my $json2 = MARC::Record::MiJ->json; is($json1, $json2, 'Memoized json object working'); # Read in a file produced by ruby-marc # File has nine records my $binfile = File::Spec->catfile( 't', 'test.mrc' ); my $jsonfile = File::Spec->catfile( 't', 'test.ndj' ); my @binrecords; my @rubyjsonrecords; $batch = new MARC::Batch('USMARC', $binfile); while (my $r = $batch->next) { push @binrecords, $r; } $batch = new MARC::Batch('MiJ', $jsonfile); while (my $r = $batch->next) { push @rubyjsonrecords, $r; } foreach my $i (0..8) { is($binrecords[$i]->as_formatted, $rubyjsonrecords[$i]->as_formatted, "Record $i matches"); } # check to make sure we can call #in directly $r = MARC::File::MiJ->in($jsonfile)->next; is_deeply($r, $rubyjsonrecords[0], "Both MARC::Batch and MARC::File::MiJ work"); # Check to make sure created records are identical by getting the raw ruby json # and decoding it to a hashref, and using perl to turn the (already verified # to be identical) records into json and then decoding my @perljsonstructure = map {$json1->decode(MARC::Record::MiJ->to_mij($_))} @binrecords; my @rubyjsonstructure; open(RJ, $jsonfile) or die "Can't re-open jsonfile: $!"; while () { push @rubyjsonstructure, $json1->decode($_); } foreach my $i (0..8) { is_deeply($rubyjsonstructure[$i], $perljsonstructure[$i], "Perl/Ruby identical for record $i"); } done_testing(); MARC-File-MiJ-0.04/t/camel.usmarc000444001750001750 1467712173536346 15156 0ustar00gmcgmc00000000000000755cam 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.MARC-File-MiJ-0.04/t/test.mrc000444001750001750 3324412173536346 14332 0ustar00gmcgmc00000000000001470nam^a22004451^^450000100100000000500170001000600190002700700150004600800410006101000130010203500240011503500240013903500230016304000320018605000210021808200110023910000350025024500460028526000300033130000330036150400410039450500690043553800300050465000170053485200380055185200370058997000130062697000280063997100080066797200130067597200130068897300170070197300190071897400320073797400320076997400420080197400420084399800140088599501250089900000004019880715000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1968^^^^nyuae^^^^b^^^|00100^eng^^ a68027371 a(RLIN)MIUG0001728-B a(CaOTULAS)159818044 a(OCoLC)ocm00001728 aDLCcDLCdMiUdCStRLINdMiU0 aN6350b.P4 1968b a709.031 aPevsner, Nikolaus,d1902-1983.10aStudies in art, architecture, and design. aNew York,bWalkerc[1968] a2 v.billus., plans.c30 cm. aIncludes bibliographical references.0 av. 1. From mannerism to romanticism.--v. 2. Victorian and after. aMode of access: Internet. 0aArtxHistory0 aMiUbBUHRcAAELhN 5303 .P52 19680 aMiUbAAELcBKShN 5303 .P52 1968 aBKbBook aCEbElectronic Resource aMiU c20040625 c20040625 aHTbavail_ht aACbavail_circ zv.1umdp.39015005817484ric zv.1umdp.39015006324134ric zv.2umdp.39015006324142ricd20090907 zv.2umdp.39015007230850ricd20091119 cGACs9125 aformbform character life trend modern merely self world romantic attitude nature expression element mean principlec76101593nam^a22004451^^450000100100000000500170001000600190002700700150004600800410006101000130010203500240011503500240013903500230016304000180018605000170020408200130022110000250023424501000025926000290035930000350038850001680042350400410059153800300063260000400066271000210070271000420072385200340076585200570079997000130085697000280086997100080089797200130090597200130091897300170093197300190094897400270096797400270099499800090102199501170103000000021220031119000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1969^^^^mauae^^^^bc^^|00100^eng^^ a79089648 a(RLIN)MIUG0020036-B a(CaOTULAS)159818260 a(OCoLC)ocm00020036 aDLCcDLCdMiU0 aNA737.E4bZ3 a720/.9241 aZaitzevsky, Cynthia.14aThe architecture of William Ralph Emerson, 1833-1917;bcatalogue.cPhotography by Myron Miller. a[Cambridge? Mass.c1969] a100 p.billus., plans.c26 cm. aCatalog 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. aIncludes bibliographical references. aMode of access: Internet.10aEmerson, William Ralph,d1833-1917.2 aFogg Art Museum.2 aCarpenter Center for the Visual Arts.0 aMiUbAAELcSTOhNA737.E53 Z220 aMiUbAAELcSTOhNA 737 .E53 Z22xacq. Gift. 510-1086 aBKbBook aCEbElectronic Resource aMiU c20040625 c20040625 aHTbavail_ht aACbavail_circ umdp.39015006349636ric umdp.39015013176907ric s9665 aarchitecturebroof front gable porch bay corner cornice entrance rear brick window chimney wing dormer doorc47401426nam^a22003971^^450000100100000000500170001000600190002700700150004600800410006101000130010203500240011503500240013903500230016304000180018605000170020408200100022110000310023124500920026226000490035430000380040350400280044153800300046965000100049985200320050997000130054197000280055497100080058297200130059097300170060397300190062097400270063999800090066699501010067599501320077699501200090800000025020060630100341.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1969^^^^nyua^^^^^b^^^|00000^eng^^ a69015895 a(RLIN)MIUG0023127-B a(CaOTULAS)159818301 a(OCoLC)ocm00023127 aDLCcDLCdMiU0 aND1283b.B47 a751.41 aBirren, Faber,d1900-1988.10aPrinciples of color;ba review of past traditions and modern theories of color harmony. aNew York,bVan Nostrand Reinhold Co.c[1969] a96 p.billus. (part col.)c21 cm. aBibliography: p. 79-80. aMode of access: Internet. 0aColor0 aMiUbAAELcBKShND1283 .B62 aBKbBook aCEbElectronic Resource aMiU c20040625 aHTbavail_ht aACbavail_circ umdp.39015012235738ric s9665 acolorbblue red green yellow brown white dark pink orange pale purple grey deep bright rosec282 acolorbcolor colored gray coloring colorful modeling colorist ocher favorite tan colorless ored modeled practiced centeredc573 acolorbred yellow blue green hue hues light orange violet pigment contrast complementary eye intensity mixturec72701440nam^a22004451^^450000100100000000500170001000600190002700700150004600800410006101000130010202000150011503500240013003500240015403500230017804000180020105000190021908200140023810000260025224500270027826000450030530000440035050400250039453800300041965000220044965000140047185200360048585200370052197000130055897000280057197100080059997200130060797200130062097300170063397300190065097400370066997400370070699800090074399501290075299501130088100000031019981110000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1969^^^^gh^abe^^^b^^^|00000^eng^^ a75005747 a0197138098 a(RLIN)MIUG0030116-B a(CaOTULAS)159818386 a(OCoLC)ocm00030116 aDLCcDLCdMiU0 aNA6097.A8bS95 a726/.1/961 aSwithenbank, Michael.10aAshanti fetish houses. aAccra,bGhana Universities Press,c1969. a68 p.billus., map, plans.c19 x 23 cm. aBibliography: p. 68. aMode of access: Internet. 0aTempleszAshanti. 0aFetishism0 aMiUbAAELcBKShNA 6097 .A8 S970 aMiUbBUHRcGRADhNA 6097 .A8 S97 aBKbBook aCEbElectronic Resource aMiU c20040625 c20040625 aHTbavail_ht aACbavail_circ umdp.39015006744604ricd20090621 umdp.39015023466272ricd20090711 s9665 aentrywaysbentrance stair courtyard wall front door staircase corridor corner level court upper stairway balcony leadingc44 afiguresbmask figure head spirit object cloth chief female power people male ancestor bead human regionc41101597nam^a22004811^^450000100100000000500170001000600190002700700150004600800410006101000180010203500240012003500240014403500230016804000180019105000190020908200100022810000220023824500140026026000310027430000390030550001740034450400410051853800300055960000330058971000350062271000180065785200280067585200360070385200310073985200310077097000130080197000280081497100080084297200130085097200130086397200130087697200130088997300170090297300190091997400270093899800090096599501410097400000033819880715000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1969^^^^nyua^^^^^b^^^|00000^eng^^ a77084094//r71 a(RLIN)MIUG0032478-B a(CaOTULAS)159818417 a(OCoLC)ocm00032478 aDLCcDLCdMiU0 aND673.M35bS92 a759.41 aSylvester, David.00aMagritte. aNew York,bPraegerc[1969] a126 p.billus. (part col.)c24 cm. 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." aIncludes bibliographical references. aMode of access: Internet.10aMagritte, René,d1898-1967.2 aArts Council of Great Britain.2 aTate Gallery.0 aMiUbUGLhND673.M33 S990 aMiUbAAELcBKShND 673 .M33 S990 aMiUbFINEhND 673 .M33 S990 aMiUbFINEhND 673 .M33 S99 aBKbBook aCEbElectronic Resource aMiU c20040625 c20040625 c20040625 c20040809 aHTbavail_ht aACbavail_circ umdp.39015009416986ric s9665 acollagebcollage cardboard assemblage cut version newspaper bottle photograph mine mounted pasted gouache fragment readymade woodenc11001531nam^a22004331^^450000100100000000500170001000600190002700700150004600800410006101000130010201500140011503500240012903500240015303500230017704000180020005000210021808200110023911000190025024500240026925000310029326000300032430000510035453800300040565000300043565000400046565000260050585200370053197000130056897000280058197100080060997200130061797300170063097300190064797400270066699800090069399501430070299501180084599501340096300000038519880715000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715r1967^^^^enkaf^^^^^^^^|00000^eng^^ a70371182 aB68-22096 a(RLIN)MIUG0037351-B a(CaOTULAS)159818471 a(OCoLC)ocm00037351 aDLCcDLCdMiU0 aNK928b.L57 1967 a913.362 aLondon Museum.10aMedieval catalogue. a[1st ed., 4th impression]. aLondon,bH.M.S.O.,c1975. a319 p.b99 plates, illus. (some col.).c26 cm. aMode of access: Internet. 0aDecorative artszEngland. 0aDecorative arts, MedievalzEngland. 0aArchaeology, Medieval0 aMiUbBUHRcGRADhNK928 .L85 1975 aBKbBook aCEbElectronic Resource aMiU c20040625 aHTbavail_ht aACbavail_circ umdp.39015010558024ric s9665 aarchaeologybvessel excavation type pottery fragment excavated grave burial archaeological evidence figurine period date fabric sherdc595 ametalworkbgilt engraved diam oval chased ring head bezel handle hoop circular mount shaped ornament piercedc731 atime periodsbcentury centuries cen tury quarter beginning dating llth turies import ury l7th centur progenitor craftmanshipc77101318nam^a22004331^^450000100100000000500170001000600190002700700150004600800410006101000130010201500140011502000210012903500240015003500240017403500230019804000180022105000200023908200130025910000270027224500330029926000360033230000490036849000360041753800300045365000300048365000200051385200350053385200350056897000130060397000280061697100080064497200130065297200130066597300170067897300190069597400270071499800140074199501290075500000039619880715000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1968^^^^enka^^^^^^^^^^00000^eng^^ a74366090 aB68-24743 a0289277884c25/- a(RLIN)MIUG0040363-B a(CaOTULAS)159818483 a(OCoLC)ocm00040363 aDLCcDLCdMiU0 aN6493 1920b.H5 a709.04/21 aHillier, Bevis,d1940-10aArt Deco of the 20s and 30s. a[London]bStudio Vista,c[1968] a168 p. (chiefly illus. (some col.)).c19 cm.0 aStudio Vista/Dutton pictureback aMode of access: Internet. 0aArt, Moderny20th century 0aDecorative arts0 aMiUbAAELcBKShN 6494 .A7 H650 aMiUbAAELcBKShN 6494 .A7 H65 aBKbBook aCEbElectronic Resource aMiU c20040625 c20040625 aHTbavail_ht aACbavail_circ umdp.39015033751887ric cGACs9125 aerasbtime sixties thirties twenties fifties decade seventies forties eighties own world generation late period examplec28701921nam^a22004931^^450000100100000000500170001000600190002700700150004600800410006101000130010203500240011503500240013903500230016304000180018605000200020408200150022410000350023924500900027425000130036426000310037730000550040850000450046350400640050853800300057265000240060265000190062665000210064585200360066685200390070297000130074197000280075497100080078297200130079097200130080397300170081697300190083397400370085297400370088999800090092699501160093599501060105199501410115799501290129800000049919880715000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1969^^^^nyuabe^^^b^^^^00110^eng^^ a69015754 a(RLIN)MIUG0051006-B a(CaOTULAS)159818600 a(OCoLC)ocm00051006 aDLCcDLCdMiU0 aNA275b.S3 1969 a726.1/2/081 aScully, Vincent Joseph,d1920-14aThe earth, the temple, and the gods;bGreek sacred architecturec[by] Vincent Scully. aRev. ed. aNew York,bPraegerc[1969] axxxii, 271, [192] p.billus., maps, plans.c26 cm. a"Illustrations": p. [1]-[192] (3d group) aBibliographical references included in "Notes" (p. 227-251) aMode of access: Internet. 0aArchitecture, Greek 0aTemples, Greek 0aMythology, Greek0 aMiUbAAELcBKShNA275 .S44 19690 aMiUbHATCHcGRADhNA 275 .S44 1969 aBKbBook aCEbElectronic Resource aMiU c20040625 c20040625 aHTbavail_ht aACbavail_circ umdp.39015004888684ricd20090702 umdp.39015006345766ricd20091105 s9665 adeitiesbgod ancient goddess sacred cult ritual power sun legend priest myth king animal sacrifice worshipc417 anaturebmountain river valley mile rock road lake stream bank near slope plain peak beyond cliffc618 aancient architecturebtemple wall tomb pyramid court palace chamber colonnade capital sanctuary built plan cella stone architecturec683 aspacebeffect space colorplate heavy weight contrast strong powerful power detail force entire structural solid massivec77601692nam^a22004931^^450000100100000000500170001000600190002700700150004600800410006101000130010202000220011503500240013703500240016103500230018504000180020804100110022605000150023710000270025224000240027924502130030326000390051630000590055550000300061450400270064453800300067165000110070170000180071285200360073085200410076685200430080785200420085097000130089297000280090597100080093397200130094197200130095497200130096797200130098097300170099397300190101097400270102999800090105699501330106500000071920010330000000.0m^^^^^^^^d^^^^^^^^cr^bn^---auaua880715s1969^^^^nyuac^^^^^^^^|00100^eng^^ a78093950 a0876631065c10.00 a(RLIN)MIUG0063058-B a(CaOTULAS)159818857 a(OCoLC)ocm00063058 aDLCcDLCdMiU1 aengita0 aNX210b.D61 aDorfles, Gillo,d1910-03aIl Kitsch.lEnglish00aKitsch; the world of bad taste.cWith 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. a[New York]bUniverse Booksc[1969] a313 p.billus. (part col.), ports. (part col.)c25 cm. aTranslation of Il Kitsch. aIncludes bibliography. aMode of access: Internet. 0aKitsch1 aMcHale, John.0 aMiUbFINEhNX 600 .K5 D693 19690 aMiUbAAELcBKShNX 600 .K5 D693 19690 aMiUbHATCHcGRADhNX 600 .K5 D693 19690 aMiUbFINEhNX 600 .K5 D693 1969xGift aBKbBook aCEbElectronic Resource aMiU c20040625 c20040625 c20040625 c20040625 aHTbavail_ht aACbavail_circ umdp.39015012241918ric s9665 amythologybmyth reality own language anti sense condition situation history context past attempt kitsch truth contradictionc200MARC-File-MiJ-0.04/lib000755001750001750 012173536346 12770 5ustar00gmcgmc000000000000MARC-File-MiJ-0.04/lib/MARC000755001750001750 012173536346 13512 5ustar00gmcgmc000000000000MARC-File-MiJ-0.04/lib/MARC/File000755001750001750 012173536346 14371 5ustar00gmcgmc000000000000MARC-File-MiJ-0.04/lib/MARC/File/MiJ.pm000444001750001750 460512173536346 15550 0ustar00gmcgmc000000000000package MARC::File::MiJ; use 5.006; use strict; use warnings FATAL => 'all'; use MARC::Record::MiJ; use base qw(MARC::File); =head1 NAME MARC::File::MiJ - Read newline-delimited marc-in-json files =head1 VERSION Version 0.04 =cut our $VERSION = '0.04'; =head1 SYNOPSIS Use by itself or with MARC::Batch use MARC::Batch; use MARC::File::MiJ; my $reader = new MARC::Batch('MiJ', $jsonfilename); while (my $r = $batch->next) { ... } # or, use it without MARC::Batch my $reader = MARC::File::MiJ->in($jsonfilename); =head1 DESCRIPTION A subclass of MARC::File for reading MARC records encoded as newline-delimited marc-in-json, as supported by pymarc/ruby-marc/marc4j and described at http://dilettantes.code4lib.org/blog/2010/09/a-proposal-to-serialize-marc-in-json/. =head1 SUBROUTINES/METHODS =head2 _next() The underlying "next" that pulls the next line from the filehandle; =cut sub _next { my $self = shift; my $fh = $self->{fh}; return if eof($fh); local $/ = "\n"; my $rec = <$fh>; return $rec; } =head2 decode(json) =cut sub decode { my $self = shift; my $str = shift; return MARC::Record::MiJ->new($str); } =head2 encode =cut sub encode { my $marc = shift; $marc = shift if (ref($marc)||$marc) =~ /^MARC::File/; return MARC::Record::MiJ->to_mij($marc); } =head1 AUTHOR Bill Dueber, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc MARC::File::MiJ You can also look for information at: =over 4 =item * RT: CPAN's request tracker (report bugs here) L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =back =head1 ACKNOWLEDGEMENTS =head1 LICENSE AND COPYRIGHT Copyright 2013 Bill Dueber. This software is free software and may be distributed under the same terms as Perl itself. =cut 1; # End of MARC::File::MiJ MARC-File-MiJ-0.04/lib/MARC/Record000755001750001750 012173536346 14730 5ustar00gmcgmc000000000000MARC-File-MiJ-0.04/lib/MARC/Record/MiJ.pm000444001750001750 1617212173536346 16131 0ustar00gmcgmc000000000000package MARC::Record::MiJ; use ex::monkeypatched; use JSON; use 5.006; use strict; use warnings FATAL => 'all'; =head1 NAME MARC::Record::MiJ - Convert MARC::Record to/from marc-in-json structure =head1 VERSION Version 0.04 =cut our $VERSION = '0.04'; =head1 SYNOPSIS use MARC::Record; use MARC::Record::MIJ my $str = get_marc_in_json_from_somewhere; # The most common use will be to use methods monkeypatched into MARC::Record my $r = MARC::Record->new_from_mij($str); my $json = $r->to_mij; # You can also work with the underlying hash/array structure if you're dealing with # json serialization/deserialization on your own my $mij_structure = $r->to_mij_structure; my $r = MARC::Record->new_from_mij_structure($mij_structure); # You can also call things on MARC::Record::MiJ my $r = MARC::Record::MiJ->new($str); my $json = MARC::Record::MiJ->to_mij($r); my $mij_structure = MARC::Record::MiJ->to_mij_structure($r); my $r = MARC::Record::MiJ->new_from_mij_structure($mij_structure); =head1 DESCRIPTION Reads and writes MARC-in-JSON structures and strings as supported by pymarc/ruby-marc/marc4j and described at http://dilettantes.code4lib.org/blog/2010/09/a-proposal-to-serialize-marc-in-json/ Don't confuse with another (incompatible) JSON encoding in the module C, which to the best of my knowledge isn't supported by other readers/writers. For reading, you probably don't need to use this directly; take a look at C for reading in newline-delimited marc-in-json files by itself or in conjunction with C. The MARC::Record distribution doesn't so much do do writing out files. You can do something like this: # convert file from marc binary to marc-in-json use MARC::Batch; use MARC::Record::MiJ; my $batch = MARC::Batch->new('USMARC', 'file.mrc'); open(my $jsonfile, '>', 'file.ndj' ); while (my $r = $batch->next) { print $jsonfile MARC::Record::MiJ->to_mij($r), "\n"; } close $jsonfile; ...to produce newline-delimited marc-in-json from a binary file. =head1 SUBROUTINES/METHODS =head2 json Get a json object to work with (memoized). We want to control it so we make sure it's not doing anything pretty (like, say, putting newlines in, which woudl make it harder to produce newline-delimited json file). =cut my $json; sub json { return $json if ($json); my $self = shift; $json = JSON->new->utf8; $json->pretty(0); return $json; } =head2 new($str) Take a JSON string and turn it into a MARC::Record object =cut sub new { my $self = shift; my $str = shift; return $self->new_from_mij_structure($self->json->decode($str)); } =head2 to_mij($r) Take a record; return a JSON string =cut sub to_mij { my $self = shift; my $r = shift; return $self->json->encode($self->to_mij_structure($r)); } =head2 MARC::Record::JSON->to_mij_structure($r) Turn a record into a marc-in-json compatible hash; return the hash pointer =cut sub to_mij_structure { my $class = shift; my $r = shift; my $h = {}; my @fields; $h->{leader} = $r->leader; foreach my $f ($r->fields) { if ($f->is_control_field) { push @fields, controlfield_to_mij_structure($f); } else { push @fields, valuefield_to_mij_structure($f); } } $h->{fields} = \@fields; return $h; } =head2 controlfield_to_mij_structure($field) Turn a MARC::Record controlfield into an appropriate hash =cut sub controlfield_to_mij_structure { my $cf = shift; return {$cf->tag => $cf->data }; } =head2 valuefield_to_mij_structure($field) Turn a MARC::Record valuefield into an appropriate hash =cut sub valuefield_to_mij_structure { my $vf = shift; my @subfields; my $h = {ind1=>$vf->indicator(1), ind2=>$vf->indicator(2)}; foreach my $sf ($vf->subfields) { push @subfields, subfield_to_mij_structure($sf); } $h->{subfields} = \@subfields; return {$vf->tag => $h}; } =head2 subfield_to_mij_structure($sf) Turn a MARC::Record subfield pair (arrayref duple of code/value) into an appropriate hash =cut sub subfield_to_mij_structure { my $sf = shift; return {$sf->[0]=> $sf->[1]}; } =head2 my $r = MARC::Record::JSON->new_from_mij_structure($mij_structure) Given a marc-in-json structure, return a MARC::Record object =cut sub new_from_mij_structure { my $self = shift; my $h = shift; my $r = new MARC::Record; $r->leader($h->{leader}); my @fields; foreach my $f (@{$h->{fields}}) { push @fields, new_field_from_mij_structure($f); } $r->append_fields(@fields); return $r; } =head2 new_field_from_mij_structure($f) Given a field structure, create an appropriate (control or variable) field =cut sub new_field_from_mij_structure { my $mijf = shift; my ($tag, $h); while (my ($k, $v) = each(%$mijf)) { $tag = $k; $h = $v; } if (ref($h)) { # if it's a hashref return new_datafield_from_mij_structure($tag, $h); } else { # create and return a control field return MARC::Field->new($tag, $h); } } =head2 new_datafield_from_mij_structure Support for new_field_from_mij_structure; do the more complex work of creating a datafield =cut sub new_datafield_from_mij_structure { my ($tag, $h) = @_; my @subfields; foreach my $sf (@{$h->{subfields}}) { while (my ($code, $data) = each %$sf) { push @subfields, $code, $data } } return MARC::Field->new($tag, $h->{ind1}, $h->{ind2}, @subfields); } =head1 Monkeypatching MARC::Record Add C to MARC::Record my $r = MARC::Record->new_from_mij_structure($mij_structure); $mij_structure = $r->to_mij_structure; =cut ex::monkeypatched->inject('MARC::Record' => new_from_mij_structure => sub { my $class = shift; my $mij = shift; return MARC::Record::MiJ->new_from_mij_structure($mij)}, to_mij_structure => sub { my $self = shift; return MARC::Record::MiJ->to_mij_structure($self) }, new_from_mij => sub { my $class = shift; my $mij = shift; return MARC::Record::MiJ->new($mij) }, to_mij => sub { my $self = shift; return MARC::Record::MiJ->to_mij($self) } ); =head1 AUTHOR Bill Dueber, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc MARC::Record::MiJ You can also look for information at: =over 4 =item * RT: CPAN's request tracker (report bugs here) L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =back =head1 ACKNOWLEDGEMENTS =head1 LICENSE AND COPYRIGHT Copyright 2013 Bill Dueber. This software is free software and may be distributed under the same terms as Perl itself. =cut 1; # End of MARC::Record::MiJ