The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Astro::ADS::Query - Object definining an prospective ADS query.

SYNOPSIS

  $query = new Astro::ADS::Query( Authors     => \@authors,
                                  AuthorLogic => $aut_logic,
                                  Objects     => \@objects,
                                  ObjectLogic => $obj_logic, 
                                  Bibcode     => $bibcode,
                                  Proxy       => $proxy,
                                  Timeout     => $timeout,
                                  URL         => $url );

  my $results = $query->querydb();

DESCRIPTION

Stores information about an prospective ADS query and allows the query to be made, returning an Astro::ADS::Result object.

The object will by default pick up the proxy information from the HTTP_PROXY and NO_PROXY environment variables, see the LWP::UserAgent documentation for details.

REVISION

$Id: Query.pm,v 1.25 2013/08/06 bjd Exp $ $Id: Query.pm,v 1.24 2009/07/01 bjd Exp $ $Id: Query.pm,v 1.22 2009/05/01 bjd Exp $ $Id: Query.pm,v 1.21 2002/09/23 21:07:49 aa Exp $

METHODS

Constructor

new

Create a new instance from a hash of options

  $query = new Astro::ADS::Query( Authors     => \@authors,
                                  AuthorLogic => $aut_logic,
                                  Objects     => \@objects,
                                  ObjectLogic => $obj_logic, 
                                  Bibcode     => $bibcode,
                                  Proxy       => $proxy,
                                  Timeout     => $timeout,
                                  URL         => $url );

returns a reference to an ADS query object.

Accessor Methods

querydb

Returns an Astro::ADS::Result object for an inital ADS query

   $results = $query->querydb();
followup

Returns an Astro::ADS::Result object for a followup query, e.g. CITATIONS, normally called using accessor methods from an Astro::ADS::Paper object, but can be called directly.

   $results = $query->followup( $bibcode, $link_type );

returns undef if no arguements passed. Possible $link_type values are AR, CITATIONS, REFERENCES and TOC.

proxy

Return (or set) the current proxy for the ADS request.

   $query->proxy( 'http://wwwcache.ex.ac.uk:8080/' );
   $proxy_url = $query->proxy();
timeout

Return (or set) the current timeout in seconds for the ADS request.

   $query->timeout( 30 );
   $proxy_timeout = $query->timeout();
url

Return (or set) the current base URL for the ADS query.

   $url = $query->url();
   $query->url( "adsabs.harvard.edu" );

if not defined the default URL is cdsads.u-strasbg.fr

As of v1.24, this method sets a class attribute to keep it consistant across all objects. Not terribly thread safe, but at least you know where your query is going.

agent

Returns the user agent tag sent by the module to the ADS server.

   $agent_tag = $query->agent();
Authors

Return (or set) the current authors defined for the ADS query.

   @authors = $query->authors();
   $first_author = $query->authors();
   $query->authors( \@authors );

if called in a scalar context it will return the first author.

AuthorLogic

Return (or set) the logic when dealing with multiple authors for a search, possible values for this parameter are OR, AND, SIMPLE, BOOL and FULLMATCH.

   $author_logic = $query->authorlogic();
   $query->authorlogic( "AND" );

if called with no arguements, or invalid arguements, then the method will return the current logic.

Objects

Return (or set) the current objects defined for the ADS query.

   @objects = $query->objects();
   $query->objects( \@objects );
ObjectLogic

Return (or set) the logic when dealing with multiple objects in a search, possible values for this parameter are OR, AND, SIMPLE, BOOL and FULLMATCH.

   $obj_logic = $query->objectlogic();
   $query->objectlogic( "AND" );

if called with no arguements, or invalid arguements, then the method will return the current logic.

Bibcode

Return (or set) the current bibcode used for the ADS query.

   $bibcode = $query->bibcode();
   $query->bibcode( "1996PhDT........42J" );
startmonth

Return (or set) the current starting month of the ADS query.

   $start_month = $query->startmonth();
   $query->startmonth( "01" );
endmonth

Return (or set) the current end month of the ADS query.

   $end_month = $query->endmonth();
   $query->endmonth( "12" );
startyear

Return (or set) the current starting year of the ADS query.

   $start_year = $query->startyear();
   $query->start_year( "2001" );
endyear

Return (or set) the current end year of the ADS query.

   $end_year = $query->endyear();
   $query->end_year( "2002" );
journal

Return (or set) whether refereed, non-refereed (OTHER) or all bibilographic sources (ALL) are returned.

   $query->journal( "REFEREED" );
   $query->journal( "OTHER" );
   $query->journal( "ALL" );
   
   $journals = $query->journal();

the default is ALL bibilographic sources

General Methods

configure

Configures the object, takes an options hash as an argument

  $query->configure( %options );

Does nothing if the array is not supplied.

BUGS

#35645 filed at rt.cpan.org (Ampersands)

Older versions can't handle ampersands in the bibcode, such as A&A for Astronomy & Astrophysics. Fixed for queries in 1.22 - 5/2009. Fixed for references in 1.23 - Boyd Duffee <b dot duffee at isc dot keele dot ac dot uk>, 7/2011.

COPYRIGHT

Copyright (C) 2001 University of Exeter. All Rights Reserved.

This program was written as part of the eSTAR project and is free software; you can redistribute it and/or modify it under the terms of the GNU Public License.

AUTHORS

Alasdair Allan <aa@astro.ex.ac.uk>,