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 withCatmandu::Importer::OAI::
. E.gfoobar
will create aCatmandu::Importer::OAI::foobar
instance.Be default, Catmandu::Importer::OAI::DC is used for
oai_dc
type of responses. For 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.