Catmandu::Importer::OAI - Package that imports OAI-PMH feeds
# 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]; # ... });
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.
+
Catmandu::Importer::OAI::Parser
foobar
Catmandu::Importer::OAI::Parser::foobar
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.
_metadata
Harvest identifiers instead of full records.
Don't do any HTTP requests but return URLs that data would be queried from.
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.
To install Catmandu::OAI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::OAI
CPAN shell
perl -MCPAN -e shell install Catmandu::OAI
For more information on module installation, please visit the detailed CPAN module installation guide.