The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catmandu::Fix::pica_add - add new subfields to record

SYNOPSIS

    # Copy value of dc.identifier to PICA field 003A as subfield 0
    pica_add('dc.identifier', '003A0');
    
    # Same as above, but use another record path ('pica')
    pica_add('dc.identifier', '003A0', record:'pica');
    
    # force the creation of a new field 003A
    pica_add('dc.identifier', '003A0', force_new:1);
    
    # Add multiple subfields
    # "dc": {"subjects": ["foo", "bar"]}
    pica_add('dc.subjects', '004Faf')

DESCRIPTION

This fix adds subfields with value of PATH to the PICA field. The value of PATH must be either a scalar or an array.

If PICA field does not exist, it will be created.

FUNCTIONS

pica_add(PATH, PICA_PATH, [OPTIONS])

Options

  • record - alternative record key (default is 'record')

  • force_new - force the creation of a new field

SEE ALSO

See Catmandu::Fix::pica_set for setting a new value to an existing subfield.

See Catmandu::Fix::pica_map if you want to copy values from a PICA record.

See PICA::Path for a definition of PICA path expressions and PICA::Data for more methods to process parsed PICA+ records.