Bio::Phylo::PhyloWS::Service::UbioNameBank(3)

NAME
Bio::Phylo::PhyloWS::Service::UbioNameBank - PhyloWS service wrapper for uBio NameBank records

SYNOPSIS
 # inside a CGI script:
 use CGI;
 use Bio::Phylo::PhyloWS::Service::UbioNameBank;

 # obtain a key code from http://www.ubio.org/index.php?pagename=form
 # and define it as an environment variable:
 $ENV{'UBIO_KEYCODE'} = '******';
 my $cgi = CGI->new;
 my $service = Bio::Phylo::PhyloWS::Service::UbioNameBank->new( '-base_uri' => $url );
 $service->handle_request($cgi);

DESCRIPTION
This is an example implementation of a PhyloWS service. The service wraps around some of the uBio XML services described at <http://www.ubio.org/index.php?pagename=xml_services>.

Record lookups for this service return project objects that capture the RDF metadata for a single NameBank record as semantic annotations to a taxon object. An example of the sort of metadata that can be expected is shown here: <http://www.ubio.org/authority/metadata.php?lsid=urn:lsid:ubio.org:namebank:2481730>

Queries on this service run namebank searches and return project objects that capture the NameBank search XML (an example is shown here: <http://www.ubio.org/webservices/examples/namebank_search.xml>) as semantic annotations to taxon objects.

URLs to this service that specify format=html in the query string redirect to web pages on the uBio site at <http://www.ubio.org>. The redirect URLs either point to search result listings or to NameBank record pages, depending on whether the redirect is for a record query or a record lookup, respectively.

UBIO KEY CODES
Some functionality of this service requires a key code to the uBio API. Such key codes can be obtained from <http://www.ubio.org/index.php?pagename=form>. When deploying this service on a web server (e.g. as shown in the SYNOPSIS) this code must be provided in an environment variable called "UBIO_KEYCODE".

METHODS

  ACCESSORS

get_record()
    Gets a uBio namebank record by its id

     Type    : Accessor
     Title   : get_record
     Usage   : my $record = $obj->get_record( -guid => $guid );
     Function: Gets a uBio namebank record by its id
     Returns : Bio::Phylo::Project
     Args    : Required: -guid => $guid
     Comments: For the $guid argument, this method only cares
               whether the last part of the argument is a series
               of integers, which are understood to be namebank
               identifiers

get_authority()
    Gets the authority prefix (e.g. TB2) for the implementing service

     Type    : Authority
     Title   : get_authority
     Usage   : my $auth = $obj->get_authority;
     Function: Gets authority prefix
     Returns : 'uBioNB'
     Args    : None

get_supported_formats()
    Gets an array ref of supported formats

     Type    : Accessor
     Title   : get_supported_formats
     Usage   : my @formats = @{ $obj->get_supported_formats };
     Function: Gets an array ref of supported formats
     Returns : [ qw(nexml nexus html json) ]
     Args    : NONE

get_redirect()
    Gets a redirect URL if relevant

     Type    : Accessor
     Title   : get_redirect
     Usage   : my $url = $obj->get_redirect;
     Function: Gets a redirect URL if relevant
     Returns : String
     Args    : $cgi
     Comments: This method is called by handle_request so that
               services can 303 redirect a record lookup to
               another URL. By default, this method returns
               undef (i.e. no redirect), but if this implementation
               is called to handle a request that specifies
               'format=html' the request is forwarded to the
               appropriate page on the http://www.ubio.org website

get_query_result()
    Gets a query result and returns it as a project object

     Type    : Accessor
     Title   : get_query_result
     Usage   : my $proj = $obj->get_query_result($query);
     Function: Gets a query result
     Returns : Bio::Phylo::Project
     Args    : A simple query string for a namebank search
     Comments: The $query is a simple CQL level 0 term-only query

SEE ALSO
There is a mailing list at <https://groups.google.com/forum/#!forum/bio-phylo> for any user or developer questions and discussions.

Also see the manual: Bio::Phylo::Manual and <http://rutgervos.blogspot.com>

CITATION
If you use Bio::Phylo in published research, please cite it:

Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. <http://dx.doi.org/10.1186/1471-2105-12-63>