Browse Source

Cleanup of Chado install

Stephen Ficklin 9 years ago
parent
commit
e9cdee4135

+ 19 - 12
tripal_chado/api/modules/tripal_chado.cv.api.inc

@@ -222,6 +222,7 @@ function tripal_get_cvterm($identifiers, $options = array()) {
   }
 
   // If one of the identifiers is property then use chado_get_record_with_property()
+  $cvterm = NULL;
   if (isset($identifiers['property'])) {
     $property = $identifiers['property'];
     unset($identifiers['property']);
@@ -231,12 +232,13 @@ function tripal_get_cvterm($identifiers, $options = array()) {
       $options
     );
   }
-
   // Else we have a simple case and we can just use chado_generate_var to get the cvterm
   else {
     // Try to get the cvterm
     $cvterm = chado_generate_var('cvterm', $identifiers, $options);
-    $cvterm = chado_expand_var($cvterm, 'field', 'cvterm.definition');
+    if ($cvterm) {
+      $cvterm = chado_expand_var($cvterm, 'field', 'cvterm.definition');
+    }
   }
 
   // Ensure the cvterm is singular. If it's an array then it is not singular
@@ -400,7 +402,7 @@ function tripal_insert_cv($name, $definition) {
  *  that too is added to the CV table.  If the cvterm is a relationship term
  *  then the $is_relationship argument should be set.  The function will try
  *  to first find the relationship in the relationship ontology for updating and
- *  if it can't be found will add the relationship to the __global CV.  All terms
+ *  if it can't be found will add the relationship to the "local" CV.  All terms
  *  must also have a corresponding database.  This is specified in the term's
  *  ID just before the colon (e.g. GO:003824).  If the database does not exist
  *  in the DB table then it will be added automatically.  The accession (the
@@ -418,10 +420,11 @@ function tripal_insert_cv($name, $definition) {
  *    - namespace: the CV name for the term. DEPRECATED. Please use cv_name instead.
  *    - is_obsolete: is present and set to 1 if the term is defunct
  *    - definition: the definition of the term
- *    - cv_name: The CV name to which the term belongs.  If this arugment is null or not
- *        provided then the function tries to find a record in the CV table with the same
- *        name provided in the $term[namespace].  If this field is provided then it
- *        overrides what the value in $term[namespace]
+ *    - cv_name: The CV name to which the term belongs.  If this arugment is
+ *        null or not provided then the function tries to find a record in the
+ *        CV table with the same name provided in the $term[namespace].  If
+ *        this field is provided then it overrides what the value in
+ *        $term[namespace]
  *    - is_relationship: If this term is a relationship term then this value should be 1.
  *    - db_name: In some cases the database name will not be part of the $term['id'] and it
  *        needs to be explicitly set.  Use this argument only if the database name
@@ -442,7 +445,7 @@ function tripal_insert_cvterm($term, $options = array()) {
     $defaultcv = $term['cv_name'];
   }
   else {
-    $defaultcv = '_global';
+    $defaultcv = 'local';
   }
 
   if (isset($term['is_relationship'])) {
@@ -456,7 +459,7 @@ function tripal_insert_cvterm($term, $options = array()) {
     $dbname = $term['db_name'];
   }
   else {
-    $dbname = 'internal';
+    $dbname = 'local';
   }
 
   if (isset($options['update_existing'])) {
@@ -794,24 +797,28 @@ function tripal_submit_obo_job($obo) {
   $obo['url']    = (isset($obo['url']))    ? $obo['url']    : NULL;
   $obo['file']   = (isset($obo['file']))   ? $obo['file']   : NULL;
 
+  $includes = array(
+    module_load_include('inc', 'tripal_chado', 'includes/loaders/tripal_chado.obo_loader'),
+  );
+
   if ($obo['obo_id']) {
     $sql = "SELECT * FROM {tripal_cv_obo} WHERE obo_id = :obo_id";
     $result = db_query($sql, array(':obo_id' => $obo['obo_id']))->fetchObject();
 
     $args = array($result->obo_id);
     return tripal_add_job("Load OBO " . $result->name, 'tripal_chado',
-       "tripal_chado_load_obo_v1_2_id", $args, $user->uid);
+       "tripal_chado_load_obo_v1_2_id", $args, $user->uid, 10, $includes);
   }
   else {
     if ($obo['url']) {
       $args = array($obo['name'], $obo['url']);
       return tripal_add_job("Load OBO " . $obo['name'], 'tripal_chado',
-        "tripal_chado_load_obo_v1_2_url", $args, $user->uid);
+        "tripal_chado_load_obo_v1_2_url", $args, $user->uid, 10, $includes);
     }
     elseif ($obo['file']) {
       $args = array($obo['name'], $obo['file']);
       return tripal_add_job("Load OBO " . $obo['name'], 'tripal_chado',
-        "tripal_chado_load_obo_v1_2_file", $args, $user->uid);
+        "tripal_chado_load_obo_v1_2_file", $args, $user->uid, 10, $includes);
     }
   }
   return FALSE;

+ 1 - 2
tripal_chado/api/modules/tripal_chado.db.api.inc

@@ -321,8 +321,7 @@ function tripal_insert_db($values, $options = array()) {
 
   // get the database record if it already exists
   $sel_values = array('name' => $dbname);
-  $sel_options = array('statement_name' => 'sel_db_na');
-  $result = chado_select_record('db', array('*'), $sel_values, $sel_options);
+  $result = chado_select_record('db', array('*'), $sel_values);
 
   // if it does not exists then add it
   if (count($result) == 0) {

+ 5 - 2
tripal_chado/api/tripal_chado.variables.api.inc

@@ -494,8 +494,11 @@ function chado_expand_var($object, $type, $to_expand, $table_options = array())
 
   // make sure we have a value
   if (!$object) {
-    tripal_report_error('tripal_chado', TRIPAL_ERROR,
-      'Cannot pass non array as argument, $object, to chado_expand_var function.', array());
+    tripal_report_error('tripal_chado',
+      TRIPAL_ERROR,
+      'Cannot pass non array as argument, $object, to chado_expand_var function.',
+      array());
+    print_r(debug_backtrace());
     return $object;
   }
 

+ 3 - 207
tripal_chado/chado_schema/initialize-1.2.sql

@@ -1,218 +1,15 @@
 /* For load_gff3.pl */
-insert into organism (abbreviation, genus, species, common_name)
-       values ('H.sapiens', 'Homo','sapiens','human');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('D.melanogaster', 'Drosophila','melanogaster','fruitfly');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('M.musculus', 'Mus','musculus','mouse');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('A.gambiae', 'Anopheles','gambiae','mosquito');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('R.norvegicus', 'Rattus','norvegicus','rat');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('A.thaliana', 'Arabidopsis','thaliana','mouse-ear cress');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('C.elegans', 'Caenorhabditis','elegans','worm');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('D.rerio', 'Danio','rerio','zebrafish');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('O.sativa', 'Oryza','sativa','rice');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('S.cerevisiae', 'Saccharomyces','cerevisiae','yeast');
-insert into organism (abbreviation, genus, species, common_name)
-       values ('X.laevis', 'Xenopus','laevis','frog');
-insert into organism (abbreviation, genus, species,common_name) 
-       values ('D.discoideum','Dictyostelium','discoideum','dicty');
-insert into contact (name) values ('Affymetrix');
+
 insert into contact (name,description) values ('null','null');
 insert into cv (name) values ('null');
 insert into cv (name,definition) values ('local','Locally created terms');
 insert into cv (name,definition) values ('Statistical Terms','Locally created terms for statistics');
-insert into db (name, description) values ('null','a fake database for local items');
+insert into db (name, description) values ('null', 'Use when a database is not available.');
 
 insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:null');
 insert into cvterm (name,cv_id,dbxref_id) values ('null',(select cv_id from cv where name = 'null'),(select dbxref_id from dbxref where accession='local:null'));
 
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:computer file');
-insert into cvterm (name,cv_id,dbxref_id) values ('computer file', (select cv_id from cv where name = 'null'),(select dbxref_id from dbxref where accession='local:computer file'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:glass');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('glass','glass array',(select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='local:glass'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:photochemical_oligo');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('photochemical_oligo','in-situ photochemically synthesized oligoes',(select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='local:photochemical_oligo'));
-
 insert into pub (miniref,uniquename,type_id) values ('null','null',(select cvterm_id from cvterm where name = 'null'));
-insert into db (name, description) values ('GFF_source', 'A collection of sources (ie, column 2) from GFF files');
-
-insert into db (name) values ('ATCC');
-
-insert into db (name) values ('refseq');
-insert into db (name) values ('genbank');
-insert into db (name) values ('EMBL');
-insert into db (name) values ('TIGR');
-insert into db (name) values ('ucsc');
-insert into db (name) values ('ucla');
-insert into db (name) values ('SGD');
-
-insert into db (name) values ('PFAM');
-insert into db (name) values ('SUPERFAMILY');
-insert into db (name) values ('PROFILE');
-insert into db (name) values ('PRODOM');
-insert into db (name) values ('PRINTS');
-insert into db (name) values ('SMART');
-insert into db (name) values ('TIGRFAMs');
-insert into db (name) values ('PIR');
-
-insert into db (name) values ('Affymetrix_U133');
-insert into db (name) values ('Affymetrix_U133PLUS');
-insert into db (name) values ('Affymetrix_U95');
-insert into db (name) values ('LocusLink');
-insert into db (name) values ('RefSeq_protein');
-insert into db (name) values ('GenBank_protein');
-insert into db (name) values ('OMIM');
-insert into db (name) values ('Swiss');
-insert into db (name) values ('RefSNP');
-insert into db (name) values ('TSC');
---insert into db (name, contact_id, description, urlprefix) values ('affy:U133',(select contact_id from contact where name = 'null'),'Affymetrix U133','http://https://www.affymetrix.com/analysis/netaffx/fullrecord.affx?pk=HG-U133_PLUS_2:');
---insert into db (name, contact_id, description, urlprefix) values ('affy:U95',(select contact_id from contact where name = 'null'),'Affymetrix U95','http://https://www.affymetrix.com/analysis/netaffx/fullrecord.affx?pk=HG-U95AV2:');
-
-insert into db (name, description) values ('GR','Gramene');
-insert into db (name, description, urlprefix) values ('uniprot','UniProt/TrEMBL','http://us.expasy.org/cgi-bin/niceprot.pl?');
-insert into db (name, description, urlprefix) values ('refseq:mrna','RefSeq mRNA','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=nucleotide&dopt=GenBank&term=');
-insert into db (name, description, urlprefix) values ('refseq:protein','RefSeq Protein','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=protein&dopt=GenBank&term=');
-insert into db (name, description, urlprefix) values ('unigene','Unigene','http://www.ncbi.nih.gov/entrez/query.fcgi?db=unigene&cmd=search&term=');
-insert into db (name, description, urlprefix) values ('omim','OMIM','http://www.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=');
-insert into db (name, description, urlprefix) values ('locuslink','LocusLink','http://www.ncbi.nlm.nih.gov/LocusLink/LocRpt.cgi?l=');
-insert into db (name, description, urlprefix) values ('genbank:mrna','GenBank mRNA','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=nucleotide&dopt=GenBank&term=');
-insert into db (name, description, urlprefix) values ('genbank:protein','GenBank Protein','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=protein&dopt=GenBank&term=');
-insert into db (name, description, urlprefix) values ('swissprot:display','SwissProt','http://us.expasy.org/cgi-bin/niceprot.pl?');
-insert into db (name, description, urlprefix) values ('pfam','Pfam','http://www.sanger.ac.uk/cgi-bin/Pfam/dql.pl?query=');
-
-insert into analysis (name,program,programversion) values ('dabg' ,'dabg' ,'dabg' );
-insert into analysis (name,program,programversion) values ('dchip','dchip','dchip');
-insert into analysis (name,program,programversion) values ('gcrma','gcrma','gcrma');
-insert into analysis (name,program,programversion) values ('mas5' ,'mas5' ,'mas5' );
-insert into analysis (name,program,programversion) values ('mpam' ,'mpam' ,'mpam' );
-insert into analysis (name,program,programversion) values ('plier','plier','plier');
-insert into analysis (name,program,programversion) values ('rma'  ,'rma'  ,'rma'  );
-insert into analysis (name,program,programversion) values ('sea'  ,'sea'  ,'sea'  );
-insert into analysis (name,program,programversion) values ('vsn'  ,'vsn'  ,'vsn'  );
-
-insert into arraydesign (name,manufacturer_id,platformtype_id) values ('unknown'                                    , (select contact_id from contact where name = 'null'),(select cvterm_id from cvterm where name = 'null'));
-insert into arraydesign (name,manufacturer_id,platformtype_id) values ('virtual array'                              , (select contact_id from contact where name = 'null'),(select cvterm_id from cvterm where name = 'null'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133_Plus_2' , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133A'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133A_2'     , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133B'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95Av2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95C'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95D'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95E'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HuExon1'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HuGeneFL'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_U74Av2'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MG-U74Av2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MG-U74Bv2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MG-U74Cv2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RG-U34A'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RG-U34B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RG-U34C'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RT-U34'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RN-U34'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_YG-S98'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Yeast_2'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RAE230A'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RAE230B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Rat230_2'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MOE430A'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MOE430B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mouse430_2'     , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mouse430A_2'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_ATH1-121501'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping100K_Hind240' , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping100K_Xba240'  , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping10K_Xba131'   , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping10K_Xba142'   , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping500K_NspI'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping500K_StyI'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
-
-insert into cv (name) values ('developmental stages');
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:fetus');
-insert into cvterm (name,cv_id,dbxref_id) values ('fetus',      (select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='developmental stages:fetus'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:neonate');
-insert into cvterm (name,cv_id,dbxref_id) values ('neonate',    (select cv_id from cv where name = 'developmental stages'), (select dbxref_id from dbxref where accession='developmental stages:neonate'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:child');
-insert into cvterm (name,cv_id,dbxref_id) values ('child',      (select cv_id from cv where name = 'developmental stages'), (select dbxref_id from dbxref where accession='developmental stages:child'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:adult_young');
-insert into cvterm (name,cv_id,dbxref_id) values ('adult_young',(select cv_id from cv where name = 'developmental stages'),(select dbxref_id from dbxref where accession='developmental stages:adult_young'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:adult');
-insert into cvterm (name,cv_id,dbxref_id) values ('adult',      (select cv_id from cv where name = 'developmental stages'),(select dbxref_id from dbxref where accession='developmental stages:adult'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:adult_old');
-insert into cvterm (name,cv_id,dbxref_id) values ('adult_old',  (select cv_id from cv where name = 'developmental stages'), (select dbxref_id from dbxref where accession='developmental stages:adult_old'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:survival_time');
-insert into cvterm (name,cv_id,dbxref_id) values ('survival_time',(select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='local:survival_time'));
-
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:n');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('n','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:n'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:minimum');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('minimum','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:minimum'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:maximum');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('maximum','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:maximum'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:modality');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('modality','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:modality'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:modality p');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('modality p','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:modality p'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:mean');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('mean','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:mean'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:median');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('median','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:median'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:mode');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('mode','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:mode'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:quartile 1');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('quartile 1','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:quartile 1'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:quartile 3');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('quartile 3','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:quartile 3'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:skewness');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('skewness','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:skewness'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:kurtosis');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('kurtosis','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:kurtosis'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:chi square p');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('chi square p','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:chi square p'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:standard deviation');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('standard deviation','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:standard deviation'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:expectation maximization gaussian mean');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('expectation maximization gaussian mean','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:expectation maximization gaussian mean'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:expectation maximization p');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('expectation maximization p','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:expectation maximization p'));
-
-insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:histogram');
-insert into cvterm (name,definition,cv_id,dbxref_id) values ('histogram','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:histogram'));
-
-insert into cv (name,definition) values ('autocreated','Terms that are automatically inserted by loading software');
 
 insert into cv (name,definition) values ('chado_properties','Terms that are used in the chadoprop table to describe the state of the database');
 
@@ -232,5 +29,4 @@ insert into cvterm (name,definition,cv_id,dbxref_id) values ('version','Chado sc
                                 indexed TEXT,
                                 query TEXT,
                                 special_index TEXT
-                                );
-
+                                );

+ 2 - 2
tripal_chado/includes/loaders/tripal_chado.gff_loader.inc

@@ -1461,7 +1461,7 @@ function tripal_feature_load_gff3_alias($feature, $aliases) {
     // insert the 'synonym_type' vocabulary
     $values = array(
       'name' => 'synonym_type',
-      'definition' => 'vocabulary for synonym types',
+      'definition' => 'A local vocabulary added for synonym types.',
     );
     $success = chado_insert_record('cv', $values);
     if (!$success) {
@@ -1489,7 +1489,7 @@ function tripal_feature_load_gff3_alias($feature, $aliases) {
   if (count($result) == 0) {
     $term = array(
       'name' => 'exact',
-      'id' => "internal:exact",
+      'id' => "synonym_type:exact",
       'definition' => '',
       'is_obsolete' => 0,
       'cv_name' => $syncv->name,

+ 12 - 15
tripal_chado/includes/loaders/tripal_chado.obo_loader.inc

@@ -341,6 +341,7 @@ function tripal_cv_obo_form_submit($form, &$form_state) {
  *   An obo_id from the tripal_cv_obo file that specifies which OBO file to import
  * @param $job_id
  *   The job_id of the job from the Tripal jobs management system.
+
  *
  * @ingroup tripal_obo_loader
  */
@@ -358,7 +359,9 @@ function tripal_chado_load_obo_v1_2_id($obo_id, $jobid = NULL) {
   }
 
   // if the reference is for a remote URL then run the URL processing function
-  if (preg_match("/^http:\/\//", $obo->path) or preg_match("/^ftp:\/\//", $obo->path)) {
+  if (preg_match("/^https:\/\//", $obo->path) or
+      preg_match("/^http:\/\//", $obo->path) or
+      preg_match("/^ftp:\/\//", $obo->path)) {
     tripal_chado_load_obo_v1_2_url($obo->name, $obo->path, $jobid, 0);
   }
   // if the reference is for a local file then run the file processing function
@@ -375,7 +378,7 @@ function tripal_chado_load_obo_v1_2_id($obo_id, $jobid = NULL) {
         tripal_chado_load_obo_v1_2_file($obo->name, $obo->path, $jobid, 0);
       }
       else {
-        print "ERROR: counld not find OBO file: '$obo->path'\n";
+        print "ERROR: could not find OBO file: '$obo->path'\n";
       }
     }
   }
@@ -527,14 +530,6 @@ function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
 
     print "Step 1: Preloading File $file\n";
 
-    // make sure we have an 'internal' and a '_global' database
-    if (!tripal_insert_db(array('name' => 'internal'))) {
-      tripal_cv_obo_quiterror("Cannot add 'internal' database");
-    }
-    if (!tripal_insert_db(array('name' => '_global'))) {
-      tripal_cv_obo_quiterror("Cannot add '_global' database");
-    }
-
     // parse the obo file
     $default_db = tripal_cv_obo_parse($file, $header, $jobid);
 
@@ -562,8 +557,7 @@ function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
         $newcvs[strtoupper(strtoupper($header['ontology'][0]))] = $defaultcv->cv_id;
       }
       else {
-        $defaultcv = tripal_insert_cv('_global', '');
-        $newcvs['_global'] = $defaultcv->cv_id;
+        tripal_cv_obo_quiterror("Could not find a namespace for this OBO file.");
       }
       watchdog('t_obo_loader', "This OBO is missing the 'default-namespace' header. It is not possible to determine which vocabulary terms without a 'namespace' key should go.  Instead, those terms will be placed in the '%vocab' vocabulary.",
         array('%vocab' => $defaultcv->name), WATCHDOG_WARNING);
@@ -1054,7 +1048,10 @@ function tripal_cv_obo_get_term($id) {
 function tripal_cv_obo_add_synonyms($term, $cvterm) {
 
   // make sure we have a 'synonym_type' vocabulary
-  $syncv = tripal_insert_cv('synonym_type', 'A vocabulary added by the Tripal CV module OBO loader for storing synonym types.');
+  $syncv = tripal_insert_cv(
+    'synonym_type',
+    'A local vocabulary added for synonym types.'
+  );
 
   // now add the synonyms
   if (array_key_exists('synonym', $term)) {
@@ -1082,7 +1079,7 @@ function tripal_cv_obo_add_synonyms($term, $cvterm) {
         // build a 'term' object so we can add the missing term
         $term = array(
            'name' => $scope,
-           'id' => "internal:$scope",
+           'id' => "synonym_type:$scope",
            'definition' => '',
            'is_obsolete' => 0,
            'cv_name' => $syncv->name,
@@ -1149,7 +1146,7 @@ function tripal_cv_obo_add_synonyms($term, $cvterm) {
 function tripal_cv_obo_parse($obo_file, &$header, $jobid) {
   $in_header = 1;
   $stanza = array();
-  $default_db = '_global';
+  $default_db = '';
   $line_num = 0;
   $num_read = 0;
   $intv_read = 0;

+ 70 - 41
tripal_chado/includes/tripal_chado.setup.inc

@@ -247,6 +247,8 @@ function tripal_chado_install_chado($action) {
     }
   }
 
+  tripal_chado_set_globals();
+  tripal_chado_init();
   tripal_chado_prepare_chado();
 }
 
@@ -263,9 +265,21 @@ function tripal_chado_prepare_chado() {
     // to warn the user if the current version is not compatible
     $version = chado_get_version(FALSE, FALSE);
 
-    /////////////////////////////////////////////////////////////////////////////
+    ///////////////////////////////////////////////////////////////////////////
+    //                          Chado DB Module
+    ///////////////////////////////////////////////////////////////////////////
+    tripal_insert_db(array(
+      'name' => 'null',
+      'description' => 'No online database.'
+    ));
+    tripal_insert_db(array(
+      'name' => 'local',
+      'description' => variable_get('site_name', 'This site.'),
+    ));
+
+    ///////////////////////////////////////////////////////////////////////////
     //                          Chado CV Module
-    /////////////////////////////////////////////////////////////////////////////
+    ///////////////////////////////////////////////////////////////////////////
     // Add the cv_root_mview.
     tripal_cv_add_cv_root_mview();
 
@@ -276,10 +290,16 @@ function tripal_chado_prepare_chado() {
     // Create the temp table we will use for loading OBO files.
     tripal_cv_create_tripal_obo_temp();
 
+    // Add the synonym_type vocabulary.
+    tripal_insert_cv(
+      'synonym_type',
+      'A local vocabulary added for synonym types.'
+    );
+
     // Add the Chado ontology CV.
-    $obo_path = '{tripal_chado}/files/cv_property.obo';
-    $obo_id = tripal_insert_obo('Chado CV Properties', $obo_path);
-    tripal_chado_load_obo_v1_2_id($obo_id);
+    //$obo_path = '{tripal_chado}/files/cv_property.obo';
+    //$obo_id = tripal_insert_obo('Chado CV Properties', $obo_path);
+    //tripal_chado_load_obo_v1_2_id($obo_id);
     //tripal_submit_obo_job(array('obo_id' => $obo_id));
 
 
@@ -317,6 +337,15 @@ function tripal_chado_prepare_chado() {
     // Add the contactprop table to Chado.
     tripal_contact_add_custom_tables();
 
+    tripal_insert_db(array(
+      'name' => 'TContact',
+      'description' => 'The Tripal Contact controlled vocabulary.',
+    ));
+    tripal_insert_db(array(
+      'name' => 'TPUB',
+      'description' => 'The Tripal Publication controlled vocabulary.',
+    ));
+
     // Add loading of the the tripal contact ontology to the job queue.
     $obo_path = '{tripal_chado}/files/tcontact.obo';
     $obo_id = tripal_insert_obo('Tripal Contacts', $obo_path);
@@ -329,7 +358,7 @@ function tripal_chado_prepare_chado() {
     // Set the default vocabularies.
     tripal_set_default_cv('contact', 'type_id', 'tripal_contact');
     tripal_set_default_cv('contactprop', 'type_id', 'tripal_contact');
-        tripal_set_default_cv('contact_relationship', 'type_id', 'contact_relationship');
+    tripal_set_default_cv('contact_relationship', 'type_id', 'contact_relationship');
 
     /////////////////////////////////////////////////////////////////////////////
     //                        Chado Feature Module
@@ -960,7 +989,7 @@ function tripal_project_add_cvterms() {
         'definition'  => 'Description of a project',
         'cv_name' => 'project_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -979,7 +1008,7 @@ function tripal_natural_diversity_add_cvterms(){
         'definition' => 'An experiment where genotypes of individuals are identified.',
         'cv_name' => 'nd_experiment_types',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -990,7 +1019,7 @@ function tripal_natural_diversity_add_cvterms(){
         'definition' => 'An experiment where phenotypes of individuals are identified.',
         'cv_name' => 'nd_experiment_types',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1001,7 +1030,7 @@ function tripal_natural_diversity_add_cvterms(){
         'definition' => 'The name of the location.',
         'cv_name' => 'nd_geolocation_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1073,7 +1102,7 @@ function tripal_library_add_cvterms() {
         'definition' => 'Description of a library',
         'cv_name' => 'library_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1085,7 +1114,7 @@ function tripal_library_add_cvterms() {
         'definition' => 'cDNA library',
         'cv_name' => 'library_type',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1095,7 +1124,7 @@ function tripal_library_add_cvterms() {
         'definition' => 'Bacterial Artifical Chromsome (BAC) library',
         'cv_name' => 'library_type',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1105,7 +1134,7 @@ function tripal_library_add_cvterms() {
         'definition' => 'Fosmid library',
         'cv_name' => 'library_type',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1115,7 +1144,7 @@ function tripal_library_add_cvterms() {
         'definition' => 'Cosmid library',
         'cv_name' => 'library_type',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1125,7 +1154,7 @@ function tripal_library_add_cvterms() {
         'definition' => 'Yeast Artificial Chromosome (YAC) library',
         'cv_name' => 'library_type',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1135,7 +1164,7 @@ function tripal_library_add_cvterms() {
         'definition' => 'Genomic Library',
         'cv_name' => 'library_type',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1351,7 +1380,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'Centimorgan units',
         'cv_name' => 'featuremap_units',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1361,7 +1390,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'Base pairs units',
         'cv_name' => 'featuremap_units',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1371,7 +1400,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'The bin unit',
         'cv_name' => 'featuremap_units',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1381,7 +1410,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'Units simply to define marker order.',
         'cv_name' => 'featuremap_units',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1391,7 +1420,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'A catch-all for an undefined unit type',
         'cv_name' => 'featuremap_units',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1403,7 +1432,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'The start coordinate for a map feature.',
         'cv_name' => 'featurepos_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1413,7 +1442,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'The end coordinate for a map feature',
         'cv_name' => 'featurepos_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1427,7 +1456,7 @@ function tripal_featuremap_add_cvterms() {
         . 'by a colon.  (e.g. Gramene:tsh1996a)',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1437,7 +1466,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'The type of Map (e.g. QTL, Physical, etc.)',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1447,7 +1476,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => '',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1459,7 +1488,7 @@ function tripal_featuremap_add_cvterms() {
         . 'the web address for the map.',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1470,7 +1499,7 @@ function tripal_featuremap_add_cvterms() {
         . 'the map (e.g. RIL, F2, BC1, etc).',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1480,7 +1509,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'The size of the population used to construct the map.',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1490,7 +1519,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'A brief description of the methods used to construct the map.',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1500,7 +1529,7 @@ function tripal_featuremap_add_cvterms() {
         'definition' => 'The software used to construct the map.',
         'cv_name' => 'featuremap_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1936,9 +1965,9 @@ function tripal_analysis_add_cvterms() {
       array(
         'name' => 'analysis_date',
         'definition' => 'The date that an analysis was performed.',
-        'cv_name' => 'tripal',
+        'cv_name' => 'tripal_analysis',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1950,9 +1979,9 @@ function tripal_analysis_add_cvterms() {
         'name' => 'analysis_short_name',
         'definition' => 'A computer legible (no spaces or special characters) '
         . 'abbreviation for the analysis.',
-        'cv_name' => 'tripal',
+        'cv_name' => 'tripal_analysis',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1966,7 +1995,7 @@ function tripal_analysis_add_cvterms() {
         'definition' => 'The type of analysis that was performed.',
         'cv_name' => 'analysis_property',
         'is_relationship' => 0,
-        'db_name' => 'tripal'
+        'db_name' => 'local'
       ),
       array('update_existing' => TRUE)
   );
@@ -1980,10 +2009,10 @@ function tripal_cv_add_obo_defaults() {
 
   // Insert commonly used ontologies into the tables.
   $ontologies = array(
-    array('Relationship Ontology', 'http://purl.obolibrary.org/obo/ro.obo'),
-    //    array('Relationship Ontology (older deprecated version)', 'http://www.obofoundry.org/ro/ro.obo'),
-    array('Sequence Ontology', 'https://github.com/The-Sequence-Ontology/SO-Ontologies/blob/master/so-xp-simple.obo'),
-    array('Gene Ontology', 'http://www.geneontology.org/ontology/gene_ontology.obo'),
+    // array('Relationship Ontology', 'http://purl.obolibrary.org/obo/ro.obo'),
+    // array('Relationship Ontology (older deprecated version)', 'http://www.obofoundry.org/ro/ro.obo'),
+    array('Sequence Ontology', 'https://raw.githubusercontent.com/The-Sequence-Ontology/SO-Ontologies/master/so-xp-simple.obo'),
+    array('Gene Ontology', 'http://geneontology.org/ontology/go.obo'),
     //    array('Cell Ontology', 'https://raw.githubusercontent.com/obophenotype/cell-ontology/master/cl.obo'),
     //    array('Plant Structure Ontology', 'http://palea.cgrb.oregonstate.edu/viewsvn/Poc/trunk/ontology/OBO_format/po_anatomy.obo?view=co'),
     //    array('Plant Growth and Development Stages Ontology', 'http://palea.cgrb.oregonstate.edu/viewsvn/Poc/trunk/ontology/OBO_format/po_temporal.obo?view=co')

+ 0 - 22
tripal_chado/tripal_chado.module

@@ -55,30 +55,8 @@ function tripal_chado_set_globals() {
  */
 function tripal_chado_init() {
 
-  // create the 'tripal' controlled volcabulary in chado but only if it doesn't already exist, and
-  // only if the chado database is present.
   if ($GLOBALS["chado_is_installed"]) {
 
-    // if the Tripal cv is missing then add
-    $results = chado_query("SELECT * FROM {cv} WHERE name = 'tripal'");
-    $cv = $results->fetchObject();
-    if (!$cv) {
-      $results = chado_query(
-          "INSERT INTO {cv} (name,definition) " .
-          "VALUES ('tripal', 'Terms used by Tripal for modules to manage data such as that stored in property tables like featureprop, analysisprop, etc')"
-      );
-    }
-
-    // if the Tripal db is missing then add it
-    $results = chado_query("SELECT * FROM {db} WHERE name = 'tripal'");
-    $db = $results->fetchObject();
-    if (!$db) {
-      $results = chado_query(
-          "INSERT INTO {db} (name,description) " .
-          "VALUES ('tripal', 'Used as a database placeholder for tripal defined objects such as tripal cvterms')"
-      );
-    }
-
     // Check to see if the Chado and Drupal have been prepared
     if (!variable_get('tripal_chado_is_prepared', FALSE)) {
       drupal_set_message('Chado is installed but Tripal has not yet prepared Drupal and Chado. Please ' .