Tripal
Functions
tripal_chado.pub_importer_PMID.inc File Reference

Functions

 tripal_pub_remote_alter_form_PMID ($form, $form_state, $num_criteria=1)
 
 tripal_pub_remote_validate_form_PMID ($form, $form_state)
 
 tripal_pub_remote_search_PMID ($search_array, $num_to_retrieve, $page)
 
 tripal_pub_PMID_search_init ($search_str, $retmax)
 
 tripal_pub_PMID_fetch ($query_key, $web_env, $rettype='null', $retmod='null', $start=0, $limit=10, $args=[])
 
 tripal_pub_PMID_parse_pubxml ($pub_xml)
 
 tripal_pub_PMID_parse_medline_journal_info ($xml, &$pub)
 
 tripal_pub_PMID_parse_article ($xml, &$pub)
 
 tripal_pub_PMID_parse_publication_type ($xml, &$pub)
 
 tripal_pub_PMID_parse_abstract ($xml, &$pub)
 
 tripal_pub_PMID_parse_pagination ($xml, &$pub)
 
 tripal_pub_PMID_parse_journal ($xml, &$pub)
 
 tripal_pub_PMID_parse_journal_issue ($xml, &$pub)
 
 tripal_pub_PMID_parse_date ($xml, $element_name)
 
 tripal_pub_PMID_parse_authorlist ($xml, &$pub)
 
 tripal_pub_remote_search_get_language ($lang_abbr)
 

Detailed Description

This file provides support for importing and parsing of results from the NCBI PubMed database. The functions here are used by both the publication importer setup form and the publication importer.

Function Documentation

◆ tripal_pub_PMID_fetch()

tripal_pub_PMID_fetch (   $query_key,
  $web_env,
  $rettype = 'null',
  $retmod = 'null',
  $start = 0,
  $limit = 10,
  $args = [] 
)

Retrieves from PubMed a set of publications from the previously initiated query.

Parameters
$query_keyThe esearch QueryKey
$web_envThe esearch WebEnv
$rettypeThe efetch return type
$retmodThe efetch return mode
$startThe start of the range to retrieve
$limitThe number of publications to retrieve
$argsAny additional arguments to add the efetch query URL
Returns
An array containing the total_records in the dataset, the search string and an array of the publications that were retrieved.

◆ tripal_pub_PMID_parse_abstract()

tripal_pub_PMID_parse_abstract (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about the abstract

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_article()

tripal_pub_PMID_parse_article (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about an article.

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_authorlist()

tripal_pub_PMID_parse_authorlist (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about the author list for a publication

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_date()

tripal_pub_PMID_parse_date (   $xml,
  $element_name 
)

Parses the section from the XML returned from PubMed that contains information regarding to dates

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_journal()

tripal_pub_PMID_parse_journal (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about a journal

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_journal_issue()

tripal_pub_PMID_parse_journal_issue (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about a journal issue

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_medline_journal_info()

tripal_pub_PMID_parse_medline_journal_info (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about the Journal

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_pagination()

tripal_pub_PMID_parse_pagination (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about pagination

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_publication_type()

tripal_pub_PMID_parse_publication_type (   $xml,
$pub 
)

Parses the section from the XML returned from PubMed that contains information about a publication

A full list of publication types can be found here: http://www.nlm.nih.gov/mesh/pubtypes.html.

The Tripal Pub ontology doesn't yet have terms for all of the publication types so we store the value in the 'publication_type' term.

Parameters
$xmlThe XML to parse
$pubThe publication object to which additional details will be added

◆ tripal_pub_PMID_parse_pubxml()

tripal_pub_PMID_parse_pubxml (   $pub_xml)

This function parses the XML containing details of a publication and converts it into an associative array of where keys are Tripal Pub ontology terms and the values are extracted from the XML. The XML should contain only a single publication record.

Information about the valid elements in the PubMed XML can be found here: https://www.nlm.nih.gov/bsd/licensee/elements_descriptions.html

Information about PubMed's citation format can be found here https://www.nlm.nih.gov/bsd/policy/cit_format.html

Parameters
$pub_xmlAn XML string describing a single publication
Returns
An array describing the publication

◆ tripal_pub_PMID_search_init()

tripal_pub_PMID_search_init (   $search_str,
  $retmax 
)

Initailizes a PubMed Search using a given search string

Parameters
$search_strThe PubMed Search string
$retmaxThe maximum number of records to return
Returns
An array containing the Count, WebEnv and QueryKey as return by PubMed's esearch utility

◆ tripal_pub_remote_alter_form_PMID()

tripal_pub_remote_alter_form_PMID (   $form,
  $form_state,
  $num_criteria = 1 
)

A hook for altering the publication importer form. It Changes the 'Abstract' filter to be 'Abstract/Title'.

Parameters
$formThe Drupal form array
$form_stateThe form state array
$num_criteriaThe number of criteria the user currently has added to the form
Returns
The form (drupal form api)

◆ tripal_pub_remote_search_get_language()

tripal_pub_remote_search_get_language (   $lang_abbr)

Get the name of the language based on an abbreviation

Language abbreviations were obtained here: http://www.nlm.nih.gov/bsd/language_table.html

Parameters
$lang_abbrThe abbreviation of the language to return
Returns
The full name of the language

◆ tripal_pub_remote_search_PMID()

tripal_pub_remote_search_PMID (   $search_array,
  $num_to_retrieve,
  $page 
)

A hook for performing the search on the PubMed database.

Parameters
$search_arrayAn array containing the search criteria for the search
$num_to_retrieveIndicates the maximum number of publications to retrieve from the remote database
$pageIndicates the page to retrieve. This corresponds to a paged table, where each page has $num_to_retrieve publications.
Returns
An array of publications.

◆ tripal_pub_remote_validate_form_PMID()

tripal_pub_remote_validate_form_PMID (   $form,
  $form_state 
)

A hook for providing additional validation of importer setup form.

Parameters
$formThe Drupal form array
$form_stateThe form state array
Returns
The form (drupal form api)