Webservice::InterMine::Simple::Query
my $query = $service->new_query; $query->add_view("Organism.shortName", "Organism.taxonId"); $query->add_constraint({path => "Organism.genus", op => "=", value => "Rattus"}); @rows = $query2->results_table; for my $row (@rows) { print "name: $row->[0], id: $row->[1]\n"; }
This is a basic representation of a query. It can handle straight-forward requests and result sets, but for anything more complicated, we recommend you look as the more fully featured Webservice::InterMine. This is especially true of large data sets, as this implementation has the potential to use lots of memory when receiving and processing results.
Create a new blank query.
Read in an existing query from a string or a file.
Parameters:
source_file => $file_name
The name of the file to read in.
source_string => $xml
The xml that represents the query.
Add one or more output columns to the query. These must be fully qualified, legal path-strings. No validation will be performed.
Add a constraint to the query. The constraint may be represented either as a hash-reference, or as a list of parameters.
$query->add_constraint(path => "Organism.species", op => "=", value => "melanogaster")
Add a join to the query. The join may be represented either as a hash-reference, or as a list of parameters.
$query->add_join(path => "Gene.proteins", style => "OUTER")
Set the constraint logic of the query. The logic must be represented as a legal logic string. No validation will be done.
Set the sort order for the query. The sort order should be composed of pairs of paths and directions:
$query->set_sort_order("Organism.genus asc Organism.species desc");
This is either the same value passed in to new_from_xml, or a very naïve XML serialisation. No thorough XML escaping will be performed.
Returns the string representation of the query's results.
as => $format
Specifies the result format.
size => int
Specifies the maximum number of rows to return. A query can return up to 10,000,000 rows in a single page.
start => int
Specifies the index of the first result to return.
columnheaders => bool
Whether or not you want the first row to be the names of the output columns.
Performs very naïve parsing of returned tabular data and splits rows into array references based using a failure-prone "tab" split.
Returns a number representing the total number of rows in the result set.
Webservice::InterMine For a more powerful alternative
Alex Kalderimis <dev@intermine.org>
<dev@intermine.org>
Please report any bugs or feature requests to dev@intermine.org.
dev@intermine.org
You can find documentation for this module with the perldoc command.
perldoc Webservice::InterMine
You can also look for information at:
InterMine
http://www.intermine.org
Documentation
http://www.intermine.org/perlapi
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.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'naïve'. Assuming UTF-8
To install Webservice::InterMine::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Webservice::InterMine::Simple
CPAN shell
perl -MCPAN -e shell install Webservice::InterMine::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.