Tripal
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed Class Reference
Inheritance diagram for Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed:
Collaboration graph
[legend]

Public Member Functions

 formSubmit (array $form, \Drupal\Core\Form\FormStateInterface &$form_state)
 
 form_submit (array $form, \Drupal\Core\Form\FormStateInterface $form_state, array &$criteria)
 
 form (array $form, \Drupal\Core\Form\FormStateInterface &$form_state)
 
 formValidate (array $form, \Drupal\Core\Form\FormStateInterface &$form_state)
 
 run (array $query)
 
 retrieve (array $query, int $limit=10, int $page=0)
 
 remoteSearchPMID ($search_array, $num_to_retrieve, $page, $row_mode=1)
 
 parse_xml (string $pub_xml)
 
- Public Member Functions inherited from Drupal\tripal\TripalPubLibrary\TripalPubLibraryBase
 __construct (array $configuration, $plugin_id, $plugin_definition, Connection $public, \Drupal\tripal\Services\TripalLogger $logger, \Drupal\tripal\Services\TripalCitationManager $citation_manager, TripalFileRetriever $fileretriever)
 

Protected Attributes

array $webquery = []
 
array $retrieval_options
 
- Protected Attributes inherited from Drupal\tripal\TripalPubLibrary\TripalPubLibraryBase
 $public
 
 $logger
 
 $fileretriever = NULL
 
 $citation_manager = NULL
 
 $plugin_id
 
 $plugin_definition
 

Additional Inherited Members

- Static Public Member Functions inherited from Drupal\tripal\TripalPubLibrary\TripalPubLibraryBase
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
- Protected Member Functions inherited from Drupal\tripal\TripalPubLibrary\TripalPubLibraryBase
 xmlIsValid (string $xml)
 

Member Function Documentation

◆ form()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::form ( array  $form,
\Drupal\Core\Form\FormStateInterface &  $form_state 
)

Adds plugin specific form items and returns the $form array

Implements Drupal\tripal\TripalPubLibrary\Interfaces\TripalPubLibraryInterface.

◆ form_submit()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::form_submit ( array  $form,
\Drupal\Core\Form\FormStateInterface  $form_state,
array &  $criteria 
)

Plugin specific form submit to add form values to the criteria array. The criteria array eventually gets serialized and stored in the tripal_pub_import database table. (This code gets called from ChadoNewPublicationForm)

◆ formSubmit()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::formSubmit ( array  $form,
\Drupal\Core\Form\FormStateInterface &  $form_state 
)

Handles submission of the form elements.

The form elements provided in the implementation of the form() function can be used for special submit if needed.

Parameters
array$formThe form array definition.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
Returns
void

Implements Drupal\tripal\TripalPubLibrary\Interfaces\TripalPubLibraryInterface.

◆ formValidate()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::formValidate ( array  $form,
\Drupal\Core\Form\FormStateInterface &  $form_state 
)
See also
TripalImporter::formValidate()

Implements Drupal\tripal\TripalPubLibrary\Interfaces\TripalPubLibraryInterface.

◆ parse_xml()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::parse_xml ( string  $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
string$pub_xmlAn XML string describing a single publication
Returns
array An array describing the publication

Implements Drupal\tripal\TripalPubLibrary\Interfaces\TripalPubLibraryInterface.

◆ remoteSearchPMID()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::remoteSearchPMID (   $search_array,
  $num_to_retrieve,
  $page,
  $row_mode = 1 
)

A function 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
array|NULL
  • 'total_records' = The number of records available for retrieval
  • 'skipped_records' = The number of records where download failed
  • 'search_str' = The query string used for the search
  • 'pubs' = The uniform publication information array. or NULL if query failed and an exception was caught

◆ retrieve()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::retrieve ( array  $query,
int  $limit = 10,
int  $page = 0 
)

More documentation can be found in TripalPubLibraryInterface

Implements Drupal\tripal\TripalPubLibrary\Interfaces\TripalPubLibraryInterface.

◆ run()

Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::run ( array  $query)

Retrieves one or more publications from PubMed based on a search query specification

Parameters
array$queryAn associative array defining a publication query, specifying the database and query parameters for a particular publication repository.
Returns
array|NULL
  • 'total_records' = The number of records available for retrieval
  • 'skipped_records' = The number of records where download failed
  • 'search_str' = The query string used for the search
  • 'pubs' = The uniform publication information array. or NULL if query failed and an exception was caught

Implements Drupal\tripal\TripalPubLibrary\Interfaces\TripalPubLibraryInterface.

Member Data Documentation

◆ $retrieval_options

array Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::$retrieval_options
protected
Initial value:
= [
'rate_limit' => 0.334,
'retry_delay' => 1.0,
]

◆ $webquery

array Drupal\tripal\Plugin\TripalPubLibrary\TripalPubLibraryPubMed::$webquery = []
protected

Stores information of an initialized search. Array keys are 'Count', 'WebEnv', and 'QueryKey' with values as returned by PubMed's esearch utility


The documentation for this class was generated from the following file: