:SELECT 
  gene.*,
  mrna.*,
  protein.*,
  proteinprop.*,
  pptype.name AS proteinprop__type
:FROM
  feature AS gene 
    INNER JOIN 
  feature_relationship AS gene2mrna ON (gene.feature_id = gene2mrna.object_id)
    INNER JOIN 
  feature AS mrna ON (mrna.feature_id = gene2mrna.subject_id)
    INNER JOIN 
  feature_relationship AS mrna2protein ON (mrna.feature_id = mrna2protein.object_id)
    INNER JOIN
  feature AS protein ON (protein.feature_id = mrna2protein.subject_id)
    LEFT OUTER JOIN
  featureprop AS proteinprop ON (protein.feature_id = proteinprop.feature_id)
    LEFT OUTER JOIN
  cvterm AS pptype ON (proteinprop.type_id = pptype.cvterm_id)
    INNER JOIN
  cvterm AS proteintype ON (protein.type_id = proteintype.cvterm_id)
:WHERE 
  [proteintype.name = 'protein']
  [protein.name => &protein_name&]
  [mrna.name => &mrna_name&]
  [gene.name => &gene_name&]

:USE NESTING (set(protein(proteinprop)(mrna(gene)(exon))))

//
schema: chado
desc: protein details: proteins and propertioes, plus
      the containing mRNA and gene

example_input: protein_name => SELECT name FROM protein
