function tripal_get_remote_pub

2.x tripal_pub.pub_importers.inc tripal_get_remote_pub($dbxref)
3.x tripal_chado.pub_importers.inc tripal_get_remote_pub($dbxref)

This function is used to perfom a query using one of the supported databases and return the raw query results. This may be XML or some other format as provided by the database.

Parameters

$dbxref: The unique database ID for the record to retrieve. This value must be of the format DB_NAME:ACCESSION where DB_NAME is the name of the database (e.g. PMID or AGL) and the ACCESSION is the unique identifier for the record in the database.

Return value

Returns the publication array or FALSE if a problem occurs

Related topics

2 calls to tripal_get_remote_pub()
tripal_get_remote_pub_raw_page in tripal_pub/tripal_pub.module
A simple wrapper function to put <pre> tags around the raw results returned by the
tripal_pub_get_raw_data in tripal_pub/api/tripal_pub.DEPRECATED.inc

File

tripal_pub/includes/tripal_pub.pub_importers.inc, line 1643
Management of importers

Code

function tripal_get_remote_pub($dbxref) {

  if (preg_match('/^(.*?):(.*?)$/', $dbxref, $matches)) {
    $remote_db = $matches[1];
    $accession = $matches[2];

    // check that the database is supported
    $supported_dbs = variable_get('tripal_pub_supported_dbs', array());
    if (!in_array($remote_db, $supported_dbs)) {
      return FALSE;
    }

    $search = array(
      'num_criteria' => 1,
      'remote_db' => $remote_db,
      'criteria' => array(
        '1' => array(
          'search_terms' => "$remote_db:$accession",
          'scope' => 'id',
          'operation' => '',
          'is_phrase' => 0,
        ),
      ),
    );
    $pubs = tripal_get_remote_pubs($remote_db, $search, 1, 0);

    return $pubs['pubs'][0];
  }
  return FALSE;
}