Patrick Hochstenbach > Catmandu-OAI-0.06 > Catmandu::Importer::OAI

Download:
Catmandu-OAI-0.06.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source  

NAME ^

Catmandu::Importer::OAI - Package that imports OAI-PMH feeds

SYNOPSIS ^

    # From the command line
    $ catmandu convert OAI --url http://myrepo.org/oai

    $ catmandu convert OAI --url http://myrepo.org/oai --metadataPrefix didl --handler RAW

    # In perl
    use Catmandu::Importer::OAI;

    my $importer = Catmandu::Importer::OAI->new(
                    url => "...",
                    metadataPrefix => "..." ,
                    from => "..." ,
                    until => "..." ,
                    set => "...",
                    handler => "..." );

    my $n = $importer->each(sub {
        my $hashref = $_[0];
        # ...
    });

CONFIGURATION ^

url
metadataPrefix
handler(sub {})
handler(My::Handler->new)
handler('NAME' | '+NAME')

To parse metadata records optionally a handler can be provided which transforms a DOM object into a Perl hash.

Handlers can be provided as function reference, an instance of a Perl package that implements 'parse', or by a package NAME. Package names should be prepended by + or prefixed with Catmandu::Importer::OAI::Parser. E.g foobar will create a Catmandu::Importer::OAI::Parser::foobar instance.

Supported handles: oai_dc : Catmandu::Importer::OAI::Parser::oai_dc marcxml : Catmandu::Importer::OAI::Parser::marcxml raw : Catmandu::Importer::OAI::Parser::raw (dont parse return the xml as is)

By all other responses, XML::Struct is used to transform the XML fragment into record field _metadata.

set
from
until
listIdentifiers

Harvest identifiers instead of full records.

dry

Don't do any HTTP requests but return URLs that data would be queried from.

DESCRIPTION ^

Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. The Catmandu::Importer::OAI methods are not idempotent: OAI-PMH feeds can only be read once.

syntax highlighting: