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

NAME

Datahub::Factory::Importer::OAI - Import data from an OAI-PMH endpoint

SYNOPSIS

    use Datahub::Factory::Importer::OAI;
    use Data::Dumper qw(Dumper);

    my $oai = Datahub::Factory::Importer::OAI->new(
        url            => 'https://biblio.ugent.be/oai',
        metadataPrefix => 'oai_dc',
        set            => '2011'
    );

    $oai->importer->each(sub {
        my $item = shift;
        print Dumper($item);
    });

DESCRIPTION

Datahub::Factory::Importer::OAI imports data from an OAI-PMH endpoint. By default it uses the ListRecords verb to return all records using the oai_lido format. It is possible to only return records from a single Set or those created, modified or deleted between two dates (from and until).

It automatically deals with resumptionTokens, so client code does not have to implement paging.

PARAMETERS

Only the endpoint parameter is required.

endpoint

URL of the OAI endpoint.

metadata_prefix

Any metadata prefix the endpoint supports. Defaults to oai_lido.

set

Optionally, a set to get records from.

from

Optionally, a must_be_older_than date.

until

Optionally, a must_be_younger_than date.

ATTRIBUTES

importer

A Importer that can be used in your script.

AUTHOR

Pieter De Praetere <pieter at packed.be >

COPYRIGHT

Copyright 2017- PACKED vzw

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Datahub::Factory Catmandu