| BAT::Session - session creation and retrieval |
BAT::Session - session creation and retrieval
require BAT::Session; my $session_id = BAT::Session::new(%session_data); my $session_data = BAT::Session::session_data($session_id);
Sessions within BAT enable concurrent analysis operations to avoid producing corrupted results. A session in BAT is the combination of a data source (DiGIR provider and resource) and an analysis layer (or analysis grid). It is possible to run different types of analysis against the same session, although the current implementation of BAT creates a new session for each analysis. This effectively adds analysis type as a component of a session, although it is not stored with session data.
BAT::Session Stores and retrieves session data for BAT. The module relies on
BAT::Database for creating session ids and storing sessions
in between script invocations.
new()my $session_id = BAT::Session::new(%session_data);
Creates a new session, returning the new session id. new() accepts the
following arguments in its session_data hash:
data_source_id grid_size field_name field_value
data_source_id must correspond to an entry in the data_sources
table. grid_size must exactly match an entry in the
analysis_layers table with a link to the same data_sources record.
field_name must be a valid taxon level, eg 'Class', 'Order', or
'Family'. field_value is the value for the given field_name.
From these arguments a session is created. The data stored for a session
is described with the session_data() function.
session_data()my $session_data = BAT::Session::session_data($session_id);
Retrieves a hashref containing data for the given session id. Session data returned includes:
session_id region - eg 'Australia' analysis_layer - eg 'AUSTRALIA_1_DEGREE_GRID' provider_url - eg 'http://www.deh.gov.au:80/biodiversity/digir/www/DiGIR.php' resource_code - eg 'ANIC' data_source_name - eg 'Insects - Australian National Insect Collection - ANIC' field_name - eg 'Family' field_value - eg 'Libellulidae' west east south north grid_cell_size - eg '1' grid_size - eg '1 Degree' date_created - eg '10:31:32 28-06-2005'
The analysis_layer is the spatial layer containing the grid of
analysis units and their bounding boxes. west, east, south,
and north are derived from a query of the analysis_layer. They
describe the edges of the analysis layer's bounding box.
grid_cell_size is a decimal value of the edge of an analysis unit,
while grid_size is the text to display for the decimal value.
Bryn Honeyman 2005
| BAT::Session - session creation and retrieval |