From: Chris M. <cmu...@us...> - 2004-11-30 21:56:44
|
Update of /cvsroot/gmod/schema/chado/modules/cv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14652 Modified Files: Tag: bdgp-dev cv.sql Log Message: 2004-11-30 - added comments (COMMENT ON syntax) - changed unique constraint to include is_obsolete - removed INSERTs - now taken care of by XSL loader - dbxref_id not nullable, and is also a unique key Index: cv.sql =================================================================== RCS file: /cvsroot/gmod/schema/chado/modules/cv/cv.sql,v retrieving revision 1.19.2.1 retrieving revision 1.19.2.2 diff -C2 -d -r1.19.2.1 -r1.19.2.2 *** cv.sql 12 Mar 2004 16:33:42 -0000 1.19.2.1 --- cv.sql 30 Nov 2004 21:56:32 -0000 1.19.2.2 *************** *** 35,55 **** name varchar(255) not null, definition text, ! dbxref_id int, foreign key (dbxref_id) references dbxref (dbxref_id) on delete set null, is_obsolete int not null default 0, is_relationshiptype int not null default 0, ! unique(name, cv_id) ); create index cvterm_idx1 on cvterm (cv_id); - -- the primary dbxref for this term. Other dbxrefs may be cvterm_dbxref - -- The unique key on termname, cv_id ensures that all terms are - -- unique within a given cv ! -- all relationship types are extensible, and have user-defined semantics. ! -- the exception is the 'is_a' (subtyping or subclassing) relationship, ! -- which MUST be present, and has fixed semantics) ! INSERT INTO cv (name) VALUES ('__axiomatic'); ! INSERT INTO cvterm (name, is_relationshiptype, cv_id) SELECT 'is_a', 1, cv_id FROM cv WHERE name = '__internal'; -- ================================================ --- 35,83 ---- name varchar(255) not null, definition text, ! dbxref_id int not null, foreign key (dbxref_id) references dbxref (dbxref_id) on delete set null, is_obsolete int not null default 0, is_relationshiptype int not null default 0, ! constraint cvterm_c1 unique (dbxref_id), ! constraint cvterm_c2 unique (name, cv_id, is_obsolete) ); create index cvterm_idx1 on cvterm (cv_id); ! COMMENT ON TABLE cvterm IS ! 'A term, class or concept within an ontology or controlled vocabulary. ! Also used for relationship types. A cvterm can also be thought of ! as a node in a graph'; ! COMMENT ON COLUMN cvterm.cv_id IS ! 'The cv/ontology/namespace to which this cvterm belongs'; ! COMMENT ON COLUMN cvterm.name IS ! 'A concise human-readable name describing the meaning of the cvterm'; ! COMMENT ON COLUMN cvterm.definition IS ! 'A human-readable text definition'; ! COMMENT ON COLUMN cvterm.dbxref_id IS ! 'Primary dbxref - The unique global OBO identifier for this cvterm. ! Note that a cvterm may have multiple secondary dbxrefs - see also ! table: cvterm_dbxref'; ! COMMENT ON COLUMN cvterm.is_obsolete IS ! 'Boolean 0=false,1=true; see GO documentation for details of obsoletion. ! note that two terms with different primary dbxrefs may exist if one ! is obsolete'; ! COMMENT ON COLUMN cvterm.is_relationshiptype IS ! 'Boolean 0=false,1=true ! Relationship types (also known as Typedefs in OBO format, or as ! properties or slots) form a cv/ontology in themselves. We use this ! flag to indicate whether this cvterm is an actual term/concept or ! a relationship type'; ! COMMENT ON INDEX cvterm_c1 IS ! 'the OBO identifier is globally unique'; ! COMMENT ON INDEX cvterm_c2 IS ! 'a name can mean different things in different contexts; ! for example "chromosome" in SO and GO. A name should be unique ! within an ontology/cv. A name may exist twice in a cv, in both ! obsolete and non-obsolete forms - these will be for different ! cvterms with different OBO identifiers; so GO documentation for ! more details on obsoletion'; ! ! -- ================================================ *************** *** 73,76 **** --- 101,109 ---- create index cvterm_relationship_idx3 on cvterm_relationship (object_id); + COMMENT ON TABLE cvterm_relationship IS + 'A relationship linking two cvterms. A relationship can be thought of + as an edge in a graph, or as a natural language statement about + two cvterms. The statement is of the form SUBJECT PREDICATE OBJECT; + for example "wing part_of body"'; -- ================================================ |