InterMine > Webservice-InterMine-1.0102 > Webservice::InterMine::Query::Roles::Runnable

Download:
Webservice-InterMine-1.0102.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Webservice-InterMine-1.0405

NAME ^

Webservice::InterMine::Query::Roles::Runnable - Composable behaviour for runnable queries

DESCRIPTION ^

This module provides composable behaviour for running a query against a webservice and getting the results.

METHODS ^

results_iterator

Returns a results iterator for use with a query.

The following options are available:

summarise($path, <%opts>) / summarize($path, <%opts>)

Get a column summary for a path in the query. For numerical values this returns a hash reference with four keys: average , stdev , min , and max . These may be accessed as so:

  my $average = $query->summarise("length")->{average};

For non-numerical paths, the summary provides a hash from item => count, so the number of occurrences of an item may be accessed as so:

  my $no_on_chr2 = $query->summarise("chromosome.primaryIdentifier")->{2};

Obviously you can sort the hash yourself, but if you want this information in order, or just a particular subset (the top 100 perhaps), then you should use results() instead.

Any further options will be passed along to the result-iterator as is, although the one that makes the most sense is size, when you don't want all the results from a very large result set.

iterator

A synonym for results_iterator. See Webservice::InterMine::Query::Roles::Runnable::results_iterator.

results( %options )

returns the results from a query in the result format specified.

This method supports all the options of results_iterator, but returns a list (in list context) or an array-reference (in scalar context) of results instead.

all(%options)

Return all rows of results. This method takes the same options as results, but any start and size arguments given are ignored. Note that the server code limits result-sets to 10,000,000 rows in size, no matter what.

first(%options)

Return the first result (row or object). This method takes the same options as results, but any size arguments given are ignored. May return undef if there are no results.

one(%options)

Return one result (row or result object), throwing an error if more than one is received.

get_count

A convenience method that returns the number of result rows a query returns.

count

Alias for get_count

url

Get the url for a webservice resource.

get_upload_url

get the url to use to upload queries to the webservice.

save

Save this query in the user's history in the connected webservice. For queries this will be saved into query history, and templates will be saved into your personal collection of private templates.

SEE ALSO ^

AUTHOR ^

Alex Kalderimis <dev@intermine.org>

BUGS ^

Please report any bugs or feature requests to dev@intermine.org.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Webservice::InterMine::Query::Roles::Runnable

You can also look for information at:

COPYRIGHT AND LICENSE ^

Copyright 2006 - 2011 FlyMine, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: