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:
as => $format
Possible values: (string|tsv|csv|arrayrefs|hashrefs|jsonobjects|jsonrows|count)
The format to request results in. The default is
arrayrefs
size => $size
The number of results to return. Leave undefined for "all" (default).
start => $start
The first result to return (starting at 0). The default is 0.
columnheaders => 0/1/friendly/path
Whether to return the column headers at the top of TSV/CSV results. The default is false. There are two styles - friendly: "Gene > pathways > name" and path: "Gene.pathways.name". The default style is friendly if a true value is entered and it is not "path".
json => $json_processor
Possible values: (inflate|instantiate|raw|perl)
What to do with JSON results. The results can be returned as inflated objects, full instantiated Moose objects, a raw json string, or as a perl data structure. (default is
perl
).
results( %options )
returns the results from a query in the result format specified.
The following options are available:
as => $format
Possible values: (tsv|csv|arrayrefs|hashrefs|jsonobjects|jsonrows|count)
The format to request results in. The default is
arrayrefs
size => $size
The number of results to return. Leave undefined for "all" (default).
start => $start
The first result to return (starting at 0). The default is 0.
addheaders => 0/1/friendly/path
Whether to return the column headers at the top of TSV/CSV results. The default is false. There are two styles - friendly: "Gene > pathways > name" and path: "Gene.pathways.name". The default style is friendly if a true value is entered and it is not "path".
json => $json_processor
Possible values: (inflate|instantiate|perl)
What to do with JSON results. The results can be returned as inflated objects, full instantiated Moose objects, a raw json string, or as a perl data structure. (default is
perl
).
all(%options)
Return all rows of results. This method takes the same options as results
, but any start and size arguments given are ignored.
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
Webservice::InterMine::Cookbook for guide on how to use these modules.
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:
Webservice::InterMine
Documentation
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.