- 2.x tripal_core/api/tripal_core.chado_general.api.inc tripal_chado_api
- 1.x tripal_core/api/tripal_core_chado.api.inc tripal_chado_api
@file The Tripal Core API
This file provides the API needed for all other Tripal and Tripal dependent modules.
Provides an application programming interface (API) to manage data withing the Chado database. This includes functions for selecting, inserting, updating and deleting records in Chado tables. The functions will ensure proper integrity contraints are met for inserts and updates.
Also, a set of functions is provided for creating template variables. First, is the tripal_core_generate_chado_vars which is used to select one ore more records from a table and return an array with foreign key relationships fully populated. For example, if selecting a feature, the organism_id and type_id would be present in the returned array as a nested array with their respective foreign keys also nested. The only fields that are not included are text fields (which may be very large) or many-to-many foreign key relationships. However, these fields and relationships can be expanded using the tripal_core_expand_chado_vars.
When a row from a chado table is selected using these two functions, it provides a way for users who want to cutomize Drupal template files to access all data associate with a specific record.
Finally, the property tables in Chado generally follow the same format. Therefore there is a set of functions for inserting, updating and deleting properties for any table. This provides quick lookup of properties (provided the CV term is known).
api/ tripal_core_chado.api.inc, line 6
- The Tripal Core API
||Get chado id for a node. E.g, if you want to get 'analysis_id' from the 'analysis' table for a synced 'chado_analysis' node, use: $analysis_id = chado_get_id_for_node ('analysis', $node) Likewise, $organism_id =…|
||Get node id for a chado feature/organism/analysis. E.g, if you want to get the node id for an analysis, use: $nid = chado_get_node_id ('analysis', $analysis_id) Likewise, $nid = chado_get_node_id ('organism', $organism_id) $nid =…|
||Use this function instead of pager_query() when selecting a subset of records from a Chado table.|
||Use this function instead of db_query() to avoid switching databases when making query to the chado database|
||Use this function instead of db_query_range().|
||Provides a generic function for deleting a record(s) from any chado table|
||Gets the value of a foreign key relationship|
||Provides a generic routine for inserting into any Chado table|
||Provides a generic routine for selecting data from a Chado table|
||Provides a generic routine for updating into any Chado table|
||Deletes a property for a given base table record using the property name|
||Deletes a property using the property ID|
||Retrieves fields/tables/nodes that were excluded by default from a variable and adds them|
||Generates an object containing the full details of a record(s) in chado.|
||Retrieve a property for a given base table record|
||Insert a property for a given base table. By default if the property already exists a new property is added with the next available rank. If $update_if_present argument is specified then the record will be updated if it exists rather than adding a…|
||Check whether chado is installed (either in the same or a different database)|
||Check whether chado is installed local to the Drupal database in its own Chado schema.|
||Check that any given schema exists|
||Update a property for a given base table record and property name. This function should be used only if one record of the property will be present. If the property name can have multiple entries (with increasing rank) then use the function named…|
||Update a property for a given base table record. This function should be used if multiple records of the same property will be present. Also, use this function to change the property name of an existing property.|
||Gets the current search_path for PostgreSQL|
||Set the Tripal Database|
||Set the chado search_path for PostgreSQL|
||Set the default search_path for PostgreSQL|
||Purpose: Get max rank for a given set of criteria This function was developed with the many property tables in chado in mind|