:SELECT 
  *
:FROM
  cvterm 
  INNER JOIN dbxref                 USING (dbxref_id)
  INNER JOIN db                     USING (db_id)
  INNER JOIN cv                     USING (cv_id)
  LEFT OUTER JOIN cvtermsynonym     USING (cvterm_id)
  LEFT OUTER JOIN cvtermprop        USING (cvterm_id)
:WHERE
    [dbxref.accession =>  &accession&]
    [db.name          =>  &dbname&]
    [cvterm.name =>       &name&]
    [cv.cvname =>         &cvname&]
    [cvterm.definition => &definition&]
:ORDER BY cvterm.name
:USE NESTING (set(cvterm(dbxref(db))(cvterm_synonym)(cvterm_prop)))

//
schema: chado
desc: 

  Fetches a metadata about a cvterm - synonyms, comments, definition,
  dbxref links to analogous cvterms in other ontologies.

  Does not fetch graph/relationship data

  REQUIRES: modules/sequence/bdgp/bdgp-views.sql

example_input: cvterm_name => SELECT DISTINCT cvterm.name FROM cvterm WHERE cvterm_id IN (SELECT object_id FROM cvterm_relationship)

