source: trunk/grails-app/domain/dbnp/data/Term.groovy @ 540

Last change on this file since 540 was 540, checked in by duh, 11 years ago
  • fixed indentation shite!!!
  • samples dev commit
  • Property svn:keywords set to Date Rev Author
File size: 1.1 KB
Line 
1package dbnp.data
2
3import dbnp.data.Ontology
4
5/**
6 * The Term object describes a term in the ontology that is referred to in other entities such as events.
7 * The Term object should point to an existing term in an online ontology, therefore instances of this class can also
8 * be seen as a cache of elements of the external ontology.
9 * BioPortal example: Mus musculus: http://rest.bioontology.org/bioportal/concepts/38802/NCBITaxon:10090
10 *
11 * Revision information:
12 * $Rev: 540 $
13 * $Author: duh $
14 * $Date: 2010-06-08 11:04:08 +0000 (di, 08 jun 2010) $
15 */
16class Term implements Serializable {
17        static searchable = true
18
19        String name             // BioPortal: label (preferred name)
20        Ontology ontology       // Parent ontology. To enable the unique constraints, we describe the Ontology-Term relation here
21        String accession        // BioPortal: conceptId
22
23        static constraints = {
24                accession(unique: 'ontology')   // Accession should be unique within an ontology
25                name(unique: 'ontology')        // Preferred name should be unique within an ontology
26        name(size: 1..255)              // Name should be a non-empty string
27        }
28
29        def String toString() {
30                return name
31        }
32}
Note: See TracBrowser for help on using the repository browser.