tripal / tripal

The Tripal package is a suite of Drupal modules for creating biological (genomic, genetic, breeding) websites. Visit the Tripal homepage at http://tripal.info for documentation, support, and other information. The Drupal project page is at http://drupal.org/project/tripal.
GNU General Public License v2.0
65 stars 49 forks source link

CV Term vs. its alias #1894

Open dsenalik opened 1 month ago

dsenalik commented 1 month ago

Tripal Version

4.x

Drupal Version

any

PostgreSQL Version

any

PHP Version

any

Branch

tv4g7-issue1894-cv-term-alias-autocomplete

General Description

Create a new contact. For the "Contact Type" select empire (TAXRANK:0000037) save and it appears as 2024-06-11_empire edit and it appears as domain (TAXRANK:0000037)

This is because the empire term is an alias for domain.

I propose that the autocomplete, when it is presenting an alias, includes the "real" term, so a site admin knows this will happen. For example empire (TAXRANK:0000037) [alias for domain]

Here is how this example is stored in Chado:

sitedb=> select * from cvterm where name='empire';
 cvterm_id | cv_id | name | definition | dbxref_id | is_obsolete | is_relationshiptype 
-----------+-------+------+------------+-----------+-------------+---------------------
(0 rows)

sitedb=> select * from cvtermsynonym where synonym='empire';
 cvtermsynonym_id | cvterm_id | synonym | type_id 
------------------+-----------+---------+---------
             4554 |      2923 | empire  |        
(1 row)

sitedb=> select * from cvterm where cvterm_id=2923;
 cvterm_id | cv_id |  name  | definition | dbxref_id | is_obsolete | is_relationshiptype 
-----------+-------+--------+------------+-----------+-------------+---------------------
      2923 |    25 | domain |            |      3230 |           0 |                   0
(1 row)

Steps to reproduce

.

Error messages

.

Screenshots

.

dsenalik commented 3 weeks ago

We will need to modify the sql in tripal_chado/src/Controller/ChadoCVTermAutocompleteController.php to determine if this is an alias, and probably alter just the label to include something like [alias for xxx]