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

Last change on this file since 398 was 398, checked in by keesvb, 9 years ago

added Ontology/Term? and Subject integration tests

  • Property svn:keywords set to Date Author Rev
File size: 1.0 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: 398 $
13 * $Author: keesvb $
14 * $Date: 2010-05-10 14:29:04 +0000 (ma, 10 mei 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        }
27
28        def String toString() {
29                return name
30        }
31
32}
Note: See TracBrowser for help on using the repository browser.