NAME

PICA::Source - Data source that can be queried for PICA+ records

SYNOPSIS

my $server = PICA::Source->new(
    SRU => "http://my.server.org/sru-interface.cgi"
);
my $record = $server->getPPN('1234567890');
$server->cqlQuery("pica.tit=Hamster")->count();

$result = $server->cqlQuery("pica.tit=Hamster", Limit => 15 );
$result = $server->z3950Query('@attr 1=4 microformats');

$record = $server->getPPN("1234567890");

Instead or in addition to SRU you can use Z39.50, PSI, and unAPI (experimental).

METHODS

new ( [ %params ] )

Create a new Server. You can specify an SRU interface with SRU, a Z39.50 server with Z3950, an unAPI base url with unAPI or a raw PICA PSI interface with c<PSI>. Optional parameters include user and password for authentification.

getPPN ( $ppn )

Get a record specified by its PPN. Returns a PICA::Record object or undef. This method may croak. Only available for source APIs SRU, unAPI, and PSI. You should check whether the returned object is empty or not.

cqlQuery ( $cql [ $parser | %params | ] )

Perform a CQL query and return the PICA::XMLParser object that was used to parse the resulting records. You can pass an existing Parser or parser parameters as listed at PICA::Parser. Only available for API type SRU.

z3950Query ( $query [, $plainparser | %params ] )

Perform a Z39.50 query via ZOOM. The resulting records are read with a PICA::PlainParser that is returned.

baseURL

Return the base URL (if specified) or the empty string.

UTILITY FUNCTIONS

The following methods are based on CGI::Utils by Don Owens.

url_encode

Returns the fully URL-encoded version of the given string. It does not convert space characters to '+' characters.

url_decode

Returns the fully URL-decoded version of the given string.

AUTHOR

Jakob Voss <jakob.voss@gbv.de>

LICENSE

Copyright (C) 2007-2009 by Verbundzentrale Goettingen (VZG) and Jakob Voss

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.