NAME

MARC::Moose::Record - MARC::Moose bibliographic record

VERSION

version 0.017

DESCRIPTION

MARC::Moose::Record is an object, Moose based object, representing a MARC::Moose bibliographic record. It can be a MARC21, UNIMARC, or whatever biblio record.

ATTRIBUTES

leader

Read-only string. The leader is fixed by set_leader_length method.

fields

ArrayRef on MARC::Moose::Field objects: MARC::Moose:Fields::Control and MARC::Moose::Field::Std.

METHODS

append( field )

Append a MARC::Moose::Field in the record. The record is appended at the end of numerical section, ie if you append for example a 710 field, it will be placed at the end of the 7xx fields section, just before 8xx section or at the end of fields list.

 $record->append(
   MARC::Moose::Field::Std->new(
    tag  => '100',
    subf => [ [ a => 'Poe, Edgar Allan' ],
              [ u => 'Translation' ] ]
 ) );

You can also append an array of MARC::Moose::Field. In this case, the array will be appended as for a unique field at the position of the first field of the array.

field( tag )

Returns a list of tags that match the field specifier, or an empty list if nothing matched. In scalar context, returns the first matching tag, or undef if nothing matched.

The field specifier can be a simple number (i.e. "245"), or use the "." notation of wildcarding (i.e. subject tags are "6.."). All fields are returned if "..." is specified.

as( format )

Returns a formated version of the record as defined by format. Format are standard formater provided by the MARC::Moose::Record package: Iso2709, Text, Marcxml, Json, Yaml, Legacy.

set_leader_length( length, offset )

This method is called to reset leader length of record and offset of data section. This means something only for ISO2709 formated records. So this method is exlusively called by any formater which has to build a valid ISO2709 data stream. It also forces leader position 10 and 20-23 since this variable values aren't variable at all for any ordinary MARC record.

Called by MARC::Moose::Formater::Iso2709.

 $record->set_leader_length( $length, $offset );

SYNOPSYS

 use MARC::Moose::Record;
 use MARC::Moose::Field::Control;
 use MARC::Moose::Field::Std;
 use MARC::Moose::Formater::Text;
 
 my $record = MARC::Moose::Record->new(
     fields => [
         MARC::Moose::Field::Control->new(
             tag => '001',
             value => '1234' ),
         MARC::Moose::Field::Std->new(
             tag => '245',
             subf => [ [ a => 'MARC is dying for ever:' ], [ b => 'will it ever happen?' ] ] ),
         MARC::Moose::Field::Std->new(
             tag => '260',
             subf => [
                 [ a => 'Paris:' ],
                 [ b => 'Usefull Press,' ],
                 [ c => '2010.' ],
             ] ),
         MARC::Moose::Field::Std->new(
             tag => '600',
             subf => [ [ a => 'Library' ], [ b => 'Standards' ] ] ),
         MARC::Moose::Field::Std->new(
             tag => '900',
             subf => [ [ a => 'My local field 1' ] ] ),
         MARC::Moose::Field::Std->new(
             tag => '901',
             subf => [ [ a => 'My local field 1' ] ] ),
     ]
 );
   
 my $formater = MARC::Moose::Formater::Text->new();
 print $formater->format( $record );
 
 $record->fields( [ grep { $_->tag < 900 } @{$record->fields} ] );
 print "After local fields removing:\n", $formater->format($record);

SEE ALSO

AUTHOR

Frederic Demians <f.demians@tamil.fr>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Frederic Demians.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
https://metacpan.org/pod/release/FREDERICD/marc-moose-0.017/lib/MARC/Moose/Record.pm
metacpan.org
crawl=CC-MAIN-2019-09
55342
application/http; msgtype=response
sha1:ZE7MNNRIB66KIK6WCWXZ7TJRJRVWK5O3
<urn:uuid:c6bc9529-f681-4b0a-a2b9-f8da8b6c5248>
2019-02-21T22:48:05Z
151.101.2.217
text/html
sha1:KKD5SPXRANTUEGXW5CR27AZBODFBRVDH
<urn:uuid:5eef1db8-e726-43ce-ab11-9ebc855fac75>
https://metacpan.org/pod/release/FREDERICD/marc-moose-0.017/lib/MARC/Moose/Record.pm
response
<urn:uuid:2b366278-b0bf-4b23-8063-5e9c9017008f>
isPartOf: CC-MAIN-2019-09
publisher: Common Crawl
description: Wide crawl of the web for February 2019
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-166-118-163.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/