Tripal
Functions
tripal_chado.schema.api.php File Reference

Functions

 chado_table_exists ($table, $chado_schema=NULL)
 
 chado_column_exists ($table, $column, $chado_schema=NULL)
 
 chado_sequence_exists ($sequence, $chado_schema=NULL)
 
 chado_index_exists ($table, $name, $no_suffix=FALSE, $chado_schema=NULL)
 
 chado_add_index ($table, $name, $fields, $chado_schema=NULL)
 
 chado_dbschema_exists ($chado_schema)
 
 chado_get_schema_name ($schema='chado')
 
 chado_get_installed_schemas ()
 
 chado_is_local ($force_recheck=FALSE, $chado_schema=NULL)
 
 chado_is_installed ($chado_schema=NULL)
 
 chado_get_version ($exact=FALSE, $warn_if_unsupported=FALSE, $chado_schema=NULL)
 
 chado_get_table_names ($include_custom=NULL, $chado_schema=NULL)
 
 chado_get_schema ($table, $chado_schema=NULL)
 
 chado_get_custom_table_schema ($table, $chado_schema=NULL)
 
 chado_get_base_tables ($chado_schema=NULL)
 
 chado_get_cvterm_mapping ($params)
 

Detailed Description

Provides an application programming interface (API) for describing Chado tables.

Function Documentation

◆ chado_get_cvterm_mapping()

chado_get_cvterm_mapping (   $params)

Get information about which Chado base table a cvterm is mapped to.

Vocabulary terms that represent content types in Tripal must be mapped to Chado tables. A cvterm can only be mapped to one base table in Chado. This function will return an object that contains the chado table and foreign key field to which the cvterm is mapped. The 'chado_table' property of the returned object contains the name of the table, and the 'chado_field' property contains the name of the foreign key field (e.g. type_id), and the 'cvterm' property contains a cvterm object.

Parameters
array$paramsAn associative array that contains the following keys:
  • cvterm_id: the cvterm ID value for the term.
  • vocabulary: the short name for the vocabulary (e.g. SO, GO, PATO)
  • accession: the accession for the term.
  • bundle_id: the ID for the bundle to which a term is associated. The 'vocabulary' and 'accession' must be used together, the 'cvterm_id' can be used on its own.
Returns
object An object containing the chado_table and chado_field properties or NULL if if no mapping was found for the term.

@upgrade

◆ chado_get_installed_schemas()

chado_get_installed_schemas ( )

List all installed chado schema.

Returns
array An array of objects where each object describes an installed schema and includes install_id, schema_name, version, created, updated.