InterMine > Webservice-InterMine-1.0405 > Webservice::InterMine::Query::Saved

Download:
Webservice-InterMine-1.0405.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

Webservice::InterMine::Query::Saved - an object representation of a query on an InterMine database that has been saved for later re-use

SYNOPSIS ^

  # Queries should be created by their webservices, or through
  # the Webservice::InterMine factory module

  use Webservice::InterMine "www.flymine.org/query';

  my $query = Webservice::InterMine->load_query(file => "my/saved-query.xml");

  my $results = $query->results(as => 'arrayrefs');

DESCRIPTION ^

This module is used when queries are loaded in from a saved representation, usually as an xml file somewhere. It has all the same functionality of Webservice::InterMine::Query.

METHODS ^

add_view( [@paths] | [$comma_sep_paths] | [$space_sep_paths])

Adds the paths to the view (result columns). If the argument to add_view is a comma or space separated string, it will be split automatically. All paths must be valid for the model being used, or an exception will be thrown.

set_sort_order( $path, [$direction] )

Defines the sort order for the results to be a particular column in the view (this column must already be in the view, or an exception will be thrown). You do not have to set the sort order manually, the default column is the first column of the view, and the default direction is 'asc'.

constraint methods:

add_join(%args or $path)

Adds a join description to the query (see Webservice::InterMine::Cookbook::Recipe4).

add_pathdescription(%args)

Adds a path description to the query (see Webservice::InterMine::Cookbook::Recipe4).

logic([EXPR or $str])

Gets or sets the current logic for the query as an object (calling code on the logic object gets a human readable string version). Illegal logic expressions or strings will cause exceptions to be thrown.

results([as => $format], [json => $jsonhandler])

Gets the results for this query in a variety of formats. (see Webservice::InterMine::Cookbook::Recipe5) The four default formats are:

results_iterator

returns a results object that allows you to iterate through the results row by row, in whatever format you choose. Please see Webservice::InterMine::Cookbook::Recipe6 and Webservice::InterMine::Cookbook::Recipe7.

suspend_validation | resume_validation | validate

Queries will by default check for errors in construction as they are being defined. You can choose to turn this off, which might be useful if you don't want to care about the order you add elements to the query (ie. you might call set_sort_order before add_view), or if you are concerned about speed. In most cases the recommendation is to not turn validation off, unless of course, you really know what you are doing. Calling validate at any point will always perform the validation checks, even if you have suspended validation.

to_xml

Returns an xml string representation of the query. This is suitable for serialisation of queries.

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::Saved

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: