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 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_subfield_order

Don't report subfields in wrong order.