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. Only available for SRU and unAPI at the moment. If both are specified, unAPI is used. You should check whether the returned object is empty or not.

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

Perform a CQL query (SRU) 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.

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.

url_unicode_encode

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

TODO

Better error handling is needed, for instance of the server is "System temporarily unavailable". PICA::SRUSearchParser should only be created once.

AUTHOR

Jakob Voss <jakob.voss@gbv.de>

LICENSE

Copyright (C) 2007-2009 by Verbundzentrale Göttingen (VZG) and Jakob Voß

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 291:

Non-ASCII character seen before =encoding in 'Göttingen'. Assuming UTF-8