InterMine
and 1 contributors

NAME

Webservice::InterMine::Role::Listable - Trait for things that can be made into lists

SYNOPSIS

  my $query = get_service->select("Gene.*");
  my $list = $service->new_list(content => $query);

DESCRIPTION

This role provides the common behaviour for things that can be passed to the new_list method of service objects, and automatically coerced into lists, as well as treated as lists for the purposes of list operations.

REQUIREMENTS

Classes that consume this role must provide implementations of the following methods:

  • service_root: The root url of the service.

  • list_upload_path: The path to append to the service root when creating a new list.

  • to_query: The query to be run to generate a list.

  • get_request_parameters: The parameters to be passed to the service.

  • service: The service object

  • list_append_path: The path to append to the service root when adding items.

OVERLOADING

This role provides the following overloaded operations.

|,+: Unions

  $a | $b

create a union of two Listables

&: Intersections

  $a & $b

Create a list of the intersection of two listables.

^: Symmetric Difference

  $a ^ $b

Create a list from the symmetric difference of two listables (the inverse of their intersection).

-: Asymmetric Difference (subtraction)

  $a - $b

Create a list of all the elements in $a less the elements in $b.

METHODS

This role provides the following functions:

get_list_upload_uri

Get a uri to upload a list to.

get_list_append_uri

Get a uri to post to when appending items to the list.