NAME

Catmandu::Validator::PICA - Validate PICA+ records with an Avram Schema

SYNOPSIS

In Perl code:

use Catmandu::Validator::PICA;
use Catmandu qw(importer);

my $validator = Catmandu::Validator::PICA->new( schema => 'schema.json' );

importer('PICA', file => 'pica.xml')->each( sub {
    my $record = shift;
    unless($validator->validate($record)){
        say "$_" for @{$validator->last_errors()};
    }
});

In Catmandu Fix language:

# reject all items not conforming to the schema
select valid('', PICA, schema: 'schema.json')

DESCRIPTION

This Catmandu::Validator can be used to check PICA+ records against an Avram Schema language.

See also Catmandu::Fix::validate, and Catmandu::Fix::Condition::valid for usage of validators in Catmandu Fix language.

CONFIGURATION

schema

Avram Schema given as hash reference, filename (JSON or YAML), or instance of PICA::Schema.

ignore_unknown_fields

Don't report fields not included in the schema.

ignore_unknown_subfields

Don't report subfields not included in the schema.

ignore_unknown

Don't report fields and subfields not included in the schema.

allow_deprecated_fields

Don't report deprecated fields.

allow_deprecated_subfields

Don't report deprecated subfields.

allow_deprecated_codes

Don't report deprecated codes.

allow_deprecated

Don't report deprecated fields, subfields, and codes.

ignore_subfield_order

Don't report errors resulting on wrong subfield order.

ignore_subfields

Don't check subfields at all.