Biblio::Citation::Parser 1.10 Documentation - ParaCite Web Service |
The Biblio::Citation::Parser package includes several examples that demonstrate the ParaCite web service, as well as the WSDL definition file. This section explains the web service, and gives an introduction to using it.
As ParaCite is written entirely in Perl, there are obvious issues if you wish to use Java, PHP, or another language. The ParaCite web services provides an interface into the reference parsing features of ParaCite, while remaining language agnostic.
To access the web service from Perl requires the SOAP::Lite module (see Required Software). Once this is present, this is all that is required to connect to the web service:
my $service = SOAP::Lite -> service("http://paracite.eprints.org/paracite.wsdl");
Three functions are now available from the $service
variable:
The following code parses a reference, and stores the metadata in $metadata
and the OpenURL in $openurl
:
use SOAP::Lite; my $service = SOAP::Lite -> service("http://paracite.eprints.org/paracite.wsdl"); my $base_url = "http://paracite.eprints.org/cgi-bin/openurl.cgi?"; my $result = $service -> doReferenceParse("Jewell, M (2002) Example", $base_url); my $metadata = $result->{metadata}; my $openurl = $result->{openURL};
If you do not want the metadata, and just want a link to an OpenURL resolver, the following will do that:
use SOAP::Lite; my $service = SOAP::Lite -> service("http://paracite.eprints.org/paracite.wsdl"); my $base_url = "http://paracite.eprints.org/cgi-bin/openurl.cgi?"; my $open_url = $service -> doOpenURLConstruct("Jewell, M (2002) Example", $base_url); Finally, this example uses the doParaciteSearch method to get the first match on a reference:
use SOAP::Lite; my $service = SOAP::Lite -> service("http://paracite.eprints.org/paracite.wsdl"); my $base_url = "http://paracite.eprints.org/cgi-bin/openurl.cgi?"; my $query = "Harnad, Stevan (1995) The PostGutenberg Galaxy."; my $result = $service -> doParaciteSearch($query, $base_url); my $first_result = $result->{resultElements}->[0]; print "First result is: ".$first_result->{URL}."\n";
The web service automatically adds Google, Scirus, and Vivissimo as resources to the search request, so if no resources match the publication or subject these will be used as fall-backs.
Most of the Paracite structures have been modelled very closely on the Google web service structures to allow some degree of standardisation. Some additions have been made, and some fields are not yet used, but these may change in future versions.
All of the fields in Metadata are valid fields in OpenURL metadata. See Table 1 at http://www.sfxit.com/openurl/openurl.html for a complete list.
Biblio::Citation::Parser 1.10 Documentation - ParaCite Web Service |