فهرست منبع

Merge branch '7.x-3.x' of github.com:tripal/tripal into 7.x-3.x

Chun-Huai Cheng 7 سال پیش
والد
کامیت
b14de6e98d
53فایلهای تغییر یافته به همراه473 افزوده شده و 192 حذف شده
  1. 1 1
      legacy/tripal_analysis/tripal_analysis.info
  2. 1 1
      legacy/tripal_contact/tripal_contact.info
  3. 5 2
      legacy/tripal_core/api/tripal_core.chado_nodes.api.inc
  4. 1 1
      legacy/tripal_core/tripal_core.info
  5. 0 68
      legacy/tripal_cv/includes/tripal_cv.cvtermpath_form.inc
  6. 1 1
      legacy/tripal_cv/tripal_cv.info
  7. 0 10
      legacy/tripal_cv/tripal_cv.module
  8. 1 1
      legacy/tripal_db/tripal_db.info
  9. 1 1
      legacy/tripal_feature/tripal_feature.info
  10. 1 1
      legacy/tripal_featuremap/tripal_featuremap.info
  11. 1 1
      legacy/tripal_genetic/tripal_genetic.info
  12. 1 1
      legacy/tripal_library/tripal_library.info
  13. 1 1
      legacy/tripal_natural_diversity/tripal_natural_diversity.info
  14. 1 1
      legacy/tripal_organism/tripal_organism.info
  15. 1 1
      legacy/tripal_phenotype/tripal_phenotype.info
  16. 1 1
      legacy/tripal_phylogeny/tripal_phylogeny.info
  17. 1 1
      legacy/tripal_project/tripal_project.info
  18. 1 1
      legacy/tripal_pub/tripal_pub.info
  19. 1 1
      legacy/tripal_stock/tripal_stock.info
  20. 1 1
      legacy/tripal_views/tripal_views.info
  21. 4 2
      tripal/includes/tripal.fields.inc
  22. 1 1
      tripal/tripal.info
  23. 1 1
      tripal_bulk_loader/tripal_bulk_loader.info
  24. 2 3
      tripal_chado/api/modules/tripal_chado.cv.api.inc
  25. 16 0
      tripal_chado/api/tripal_chado.schema_v1.3.api.inc
  26. 4 1
      tripal_chado/api/tripal_chado.semweb.api.inc
  27. 9 0
      tripal_chado/includes/TripalFields/data__accession/data__accession.inc
  28. 11 8
      tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc
  29. 155 23
      tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc
  30. 11 2
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc
  31. 3 0
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc
  32. 10 0
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc
  33. 6 1
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc
  34. 1 0
      tripal_chado/includes/TripalFields/schema__additional_type/schema__additional_type_widget.inc
  35. 1 0
      tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_widget.inc
  36. 1 0
      tripal_chado/includes/TripalFields/schema__publication/schema__publication_widget.inc
  37. 12 0
      tripal_chado/includes/TripalFields/sio__annotation/sio__annotation.inc
  38. 9 0
      tripal_chado/includes/TripalFields/sio__vocabulary/sio__vocabulary.inc
  39. 4 6
      tripal_chado/includes/TripalImporter/OBOImporter.inc
  40. 63 0
      tripal_chado/includes/tripal_chado.cv.inc
  41. 3 2
      tripal_chado/includes/tripal_chado.field_storage.inc
  42. 8 2
      tripal_chado/includes/tripal_chado.fields.inc
  43. 6 6
      tripal_chado/includes/tripal_chado.migrate.inc
  44. 22 4
      tripal_chado/includes/tripal_chado.semweb.inc
  45. 1 1
      tripal_chado/tripal_chado.info
  46. 38 0
      tripal_chado/tripal_chado.install
  47. 10 0
      tripal_chado/tripal_chado.module
  48. 1 1
      tripal_chado_views/tripal_chado_views.info
  49. 22 16
      tripal_ds/includes/tripal_ds.ds.inc
  50. 13 12
      tripal_ds/includes/tripal_ds.field_group.inc
  51. 1 1
      tripal_ds/tripal_ds.info
  52. 1 1
      tripal_ws/includes/TripalWebService/TripalEntityService_v0_1.inc
  53. 1 1
      tripal_ws/tripal_ws.info

+ 1 - 1
legacy/tripal_analysis/tripal_analysis.info

@@ -3,7 +3,7 @@ description = Supports the companalyses tables of Chado by providing pages for v
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal/legacy/tripal_analysis/configuration
 
 dependencies[] = tripal_core

+ 1 - 1
legacy/tripal_contact/tripal_contact.info

@@ -3,7 +3,7 @@ description = Supports the contact tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 5 - 2
legacy/tripal_core/api/tripal_core.chado_nodes.api.inc

@@ -1000,7 +1000,9 @@ function chado_node_sync_records($base_table, $max_sync = FALSE,
  *
  * @ingroup tripal_chado_node_api
  */
-function chado_cleanup_orphaned_nodes($table, $nentries = 25000, $linking_table = NULL, $node_type = NULL, $job_id = NULL) {
+function chado_cleanup_orphaned_nodes($table, $nentries = 25000,
+    $linking_table = NULL, $node_type = NULL, $job_id = NULL) {
+
   // The max number of records either as nodes or linked records.
   $count = 0;
   // Will hold the number of nodes of this type.
@@ -1038,7 +1040,8 @@ function chado_cleanup_orphaned_nodes($table, $nentries = 25000, $linking_table
     $m = ceil($count / $nentries);
     for ($i = 0; $i < $m; $i++) {
       $offset = ($nentries * $i);
-      chado_cleanup_orphaned_nodes_part($table, $job_id, $nentries, $offset, $linking_table, $node_type);
+      chado_cleanup_orphaned_nodes_part($table, $job_id, $nentries, $offset,
+          $linking_table, $node_type);
     }
   }
   catch (Exception $e) {

+ 1 - 1
legacy/tripal_core/tripal_core.info

@@ -3,7 +3,7 @@ description = Provides support for all Tripal modules and includes the Tripal AP
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal
 
 stylesheets[all][] = theme/css/tripal_core.css

+ 0 - 68
legacy/tripal_cv/includes/tripal_cv.cvtermpath_form.inc

@@ -1,68 +0,0 @@
-<?php
-/**
- * @file
- * Provides a form for updating controlled vocabularies path
- */
-
-/**
- * Form for re-doing the cvterm path
- *
- * @ingroup tripal_cv
- */
-function tripal_cv_cvtermpath_form() {
-
-  // get a list of db from chado for user to choose
-  $sql = "SELECT * FROM {cv} WHERE NOT name = 'tripal' ORDER BY name ";
-  $results = chado_query($sql);
-
-  $cvs = array();
-  $cvs[] = '';
-  foreach ($results as $cv) {
-    $cvs[$cv->cv_id] = $cv->name;
-  }
-
-  $form['cvid'] = array(
-    '#title' => t('Controlled Vocabulary/Ontology Name'),
-    '#type' => 'select',
-    '#options' => $cvs,
-    '#description' => t('The Chado cvtermpath is a database table that provides lineage for ontology terms
-      and is useful for quickly finding any ancestor parent of a term.  This table must be populated for each
-      ontology.  Select a controlled vocabulary for which you would like to upate the cvtermpath.'),
-  );
-
-  $form['description'] = array(
-    '#type' => 'item',
-    '#value' => t("Submit a job to update chado cvtermpath table."),
-    '#weight' => 1,
-  );
-
-  $form['button'] = array(
-    '#type' => 'submit',
-    '#value' => t('Update cvtermpath'),
-    '#weight' => 2,
-  );
-
-  return $form;
-}
-
-/**
- * Cvterm path form submit
- *
- * @ingroup tripal_cv
- */
-function tripal_cv_cvtermpath_form_submit($form, &$form_state) {
-  global $user;
-
-  $cvid =  $form_state['values']['cvid'];
-
-  // first get the controlled vocabulary name:
-  $sql = "SELECT * FROM {cv} WHERE cv_id = :cv_id";
-  $cv = chado_query($sql, array(':cv_id' => $cvid))->fetchObject();
-
-  // Submit a job to update cvtermpath
-  $job_args = array($cvid);
-  if ($form_state['values']['op'] == t('Update cvtermpath')) {
-    tripal_add_job("Update cvtermpath: $cv->name", 'tripal_cv',
-       'tripal_cv_update_cvtermpath', $job_args, $user->uid);
-  }
-}

+ 1 - 1
legacy/tripal_cv/tripal_cv.info

@@ -3,7 +3,7 @@ description = Supports the Controlled Vocabulary (CV) tables of Chado by providi
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal/vocab
 
 dependencies[] = tripal_core

+ 0 - 10
legacy/tripal_cv/tripal_cv.module

@@ -20,7 +20,6 @@ require_once 'includes/tripal_cv.admin.inc';
 require_once 'includes/tripal_cv.cv_form.inc';
 require_once 'includes/tripal_cv.cv_defaults.inc';
 require_once 'includes/tripal_cv.cvterm_form.inc';
-require_once 'includes/tripal_cv.cvtermpath_form.inc';
 
 /**
  * Implements hook_init().
@@ -61,15 +60,6 @@ function tripal_cv_menu() {
     'weight' => 10
   );
 
-  $items['admin/tripal/legacy/vocab/cvtermpath'] = array(
-    'title' => 'Update Chado cvtermpath table',
-    'description' => 'The Chado cvtermpath table provides lineage for terms and is useful for quickly finding any ancestor parent of a term.  However, this table must be populated.  This page allows for populating of this table one vocabulary at a time',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_cv_cvtermpath_form'),
-    'access arguments' => array('administer controlled vocabularies'),
-    'type' => MENU_CALLBACK,
-  );
-
   $items['admin/tripal/legacy/vocab/cv/edit/%'] = array(
     'title' => 'Edit a Controlled Vocabulary',
     'description' => 'Edit the details such as name and description for an existing controlled vocabulary.',

+ 1 - 1
legacy/tripal_db/tripal_db.info

@@ -3,7 +3,7 @@ description = Supports the database cross-reference tables of Chado by providing
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal/legacy/tripal_db
 
 dependencies[] = tripal_core

+ 1 - 1
legacy/tripal_feature/tripal_feature.info

@@ -3,7 +3,7 @@ description = Supports the sequence (feature) tables of Chado by providing pages
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 stylesheets[all][] = theme/css/tripal_feature.css
 scripts[]          = theme/js/tripal_feature.js

+ 1 - 1
legacy/tripal_featuremap/tripal_featuremap.info

@@ -3,7 +3,7 @@ description = Supports the map tables of Chado by providing pages for viewing an
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_genetic/tripal_genetic.info

@@ -3,7 +3,7 @@ description = Supports the genetic tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_library/tripal_library.info

@@ -3,7 +3,7 @@ description = Supports the library tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_natural_diversity/tripal_natural_diversity.info

@@ -3,7 +3,7 @@ description = Supports the natural diversity (ND) tables of Chado by providing p
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_organism/tripal_organism.info

@@ -3,7 +3,7 @@ description = Supports the organism tables of Chado by providing pages for viewi
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal/legacy/tripal_organism
 
 stylesheets[all][] = theme/css/tripal_organism.css

+ 1 - 1
legacy/tripal_phenotype/tripal_phenotype.info

@@ -3,7 +3,7 @@ description = Supports the phenotype tables of Chado by providing pages for view
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_phylogeny/tripal_phylogeny.info

@@ -3,7 +3,7 @@ description = Supports the phylogeny tables of Chado by providing pages for view
 core = 7.x
 project = tripal_phylogeny
 package = Tripal Extensions
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 dependencies[] = tripal_core
 dependencies[] = tripal_cv
 dependencies[] = tripal_db

+ 1 - 1
legacy/tripal_project/tripal_project.info

@@ -3,7 +3,7 @@ description = Supports the project tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal/legacy/tripal_project
 
 dependencies[] = tripal_core

+ 1 - 1
legacy/tripal_pub/tripal_pub.info

@@ -3,7 +3,7 @@ description = Supports the pub (publication) tables of Chado by providing pages
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 stylesheets[all][] = theme/css/tripal_pub.css
 

+ 1 - 1
legacy/tripal_stock/tripal_stock.info

@@ -3,7 +3,7 @@ description = Supports the stock tables of Chado by providing pages for viewing,
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 1 - 1
legacy/tripal_views/tripal_views.info

@@ -3,4 +3,4 @@ description = Deprecated-- no longer provides any functionality. See Tripal Chad
 core = 7.x
 project = tripal
 package = Tripal v2 Legacy
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1

+ 4 - 2
tripal/includes/tripal.fields.inc

@@ -731,7 +731,8 @@ function tripal_field_settings_form_validate($element, &$form_state, $form) {
  * Implements hook_field_formatter_settings_summary().
  */
 function tripal_field_formatter_settings_summary($field, $instance, $view_mode) {
-  $formatter_class = $field['type'] . '_formatter';
+
+  $formatter_class = $instance['display']['default']['type'];
   if (tripal_load_include_field_class($formatter_class)) {
     $formatter = new $formatter_class($field, $instance);
     return $formatter->settingsSummary($view_mode);
@@ -743,8 +744,9 @@ function tripal_field_formatter_settings_summary($field, $instance, $view_mode)
  */
 function tripal_field_formatter_settings_form($field, $instance,
     $view_mode, $form, &$form_state) {
-  if (tripal_load_include_field_class($formatter_class)) {
 
+  $formatter_class = $instance['display']['default']['type'];
+  if (tripal_load_include_field_class($formatter_class)) {
     $formatter = new $formatter_class($field, $instance);
     $elements = $formatter->settingsForm($view_mode, $form, $form_state);
   }

+ 1 - 1
tripal/tripal.info

@@ -3,7 +3,7 @@ description = Tripal is an toolkit to facilitate construction of online genomic,
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal
 
 stylesheets[all][] = theme/css/tripal.css

+ 1 - 1
tripal_bulk_loader/tripal_bulk_loader.info

@@ -3,7 +3,7 @@ description = Supports the construction of templates for customizable uploading
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal_core
 dependencies[] = tripal_chado_views

+ 2 - 3
tripal_chado/api/modules/tripal_chado.cv.api.inc

@@ -338,7 +338,7 @@ function tripal_get_cvterm_select_options($cv_id, $rel_type = FALSE) {
  *
  * @ingroup tripal_chado_api
  */
-function tripal_update_cvtermpath($cv_id, $job_id = NULL) {
+function tripal_update_cvtermpath_old($cv_id, $job_id = NULL) {
   // TODO: need better error checking in this function
 
   // first get the controlled vocabulary name:
@@ -376,7 +376,7 @@ function tripal_update_cvtermpath($cv_id, $job_id = NULL) {
  *   The controlled vocabulary ID from the cv table of Chado (i.e. cv.cv_id).
  * @param $job_id
  */
-function tripal_update_cvtermpath_bak($cv_id, $job_id = NULL){
+function tripal_update_cvtermpath($cv_id, $job_id = NULL){
   // TODO: there's a function to determine the current Chado instance.
   // we should use that.
   $prev_db = chado_set_active('chado');
@@ -1655,4 +1655,3 @@ function tripal_set_default_cv($table, $field, $cv_name, $cv_id = FALSE) {
   }
 }
 
-

+ 16 - 0
tripal_chado/api/tripal_chado.schema_v1.3.api.inc

@@ -7019,6 +7019,14 @@ function tripal_chado_chado_schema_v1_3_featuremap_dbxref() {
         'default' => 'true',
       ),
     ),
+    // TODO: this unique constraint is missing from the actual Chado schema.
+    // It should be included.
+    'unique keys' => array(
+      'feature_dbxref_c1' => array(
+        0 => 'featuremap_id',
+        1 => 'dbxref_id',
+      ),
+    ),
     'indexes' => array(
       'featuremap_dbxref_idx1' => array(
         0 => 'featuremap_id',
@@ -7244,6 +7252,14 @@ function tripal_chado_chado_schema_v1_3_featuremap_pub() {
         'not null' => TRUE,
       ),
     ),
+    // TODO: this unique constraint is missing from the actual Chado schema.
+    // It should be included.
+    'unique keys' => array(
+      'feature_pub_c1' => array(
+        0 => 'featuremap_id',
+        1 => 'pub_id',
+      ),
+    ),
     'indexes' => array(
       'featuremap_pub_idx1' => array(
         0 => 'featuremap_id',

+ 4 - 1
tripal_chado/api/tripal_chado.semweb.api.inc

@@ -202,7 +202,10 @@ function tripal_get_chado_semweb_term($chado_table, $chado_column, $options = ar
  *   The semantic web name for the term.
  */
 function tripal_format_chado_semweb_term($cvterm) {
-  return $cvterm->dbxref_id->db_id->name . ':' . $cvterm->dbxref_id->accession;
+  if ($cvterm) {
+    return $cvterm->dbxref_id->db_id->name . ':' . $cvterm->dbxref_id->accession;
+  }
+  return '';
 }
 /**
  * Retreive the column name in a Chado table that matches a given term.

+ 9 - 0
tripal_chado/includes/TripalFields/data__accession/data__accession.inc

@@ -120,6 +120,15 @@ class data__accession extends ChadoField {
    */
   public function validate($entity_type, $entity, $langcode, $items, &$errors) {
 
+    // If we don't have an entity then we don't want to validate.  The case
+    // where this could happen is when a user is editing the field settings
+    // and trying to set a default value. In that case there's no entity and
+    // we don't want to validate.  There will always be an entity for creation
+    // and update operations of a content type.
+    if (!$entity) {
+      return;
+    }
+
     $field_name = $this->field['field_name'];
     $settings = $this->field['settings'];
     $field_type = $this->field['type'];

+ 11 - 8
tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc

@@ -42,6 +42,14 @@ class obi__organism extends ChadoField {
    */
   public function validate($entity_type, $entity, $langcode, $items, &$errors) {
 
+    // If we don't have an entity then we don't want to validate.  The case
+    // where this could happen is when a user is editing the field settings
+    // and trying to set a default value. In that case there's no entity and
+    // we don't want to validate.  There will always be an entity for creation
+    // and update operations of a content type.
+    if (!$entity) {
+      return;
+    }
     $settings = $this->field['settings'];
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];
@@ -116,11 +124,10 @@ class obi__organism extends ChadoField {
   /**
    * @see TripalField::globalSettingsForm()
    */
-  public function settingsForm($has_data) {
-    $element = parent::globalSettingsForm($has_data);
-
-    $settings = $this->field['settings'];
+  public function instanceSettingsForm() {
+    $element = parent::instanceSettingsForm();
 
+    $settings = $this->instance['settings'];
     $element['instructions'] = array(
       '#type' => 'item',
       '#markup' => 'You may rewrite the way this field is presented to the end-user.
@@ -173,10 +180,6 @@ class obi__organism extends ChadoField {
       '#markup' => theme_table($table_vars),
     );
 
-    // Add in the semantic web fields.
-    $parent_elements = parent::settings_form($field, $instance, $has_data);
-    $element = array_merge($element, $parent_elements);
-
     return $element;
   }
 

+ 155 - 23
tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc

@@ -60,54 +60,172 @@ class ogi__location_on_map extends ChadoField {
   public function elementInfo() {
     $field_term = $this->getFieldTermID();
 
+    $map_term = 'data:1274';
     $name_term = tripal_get_chado_semweb_term('featuremap', 'name');
     $description_term = tripal_get_chado_semweb_term('featuremap', 'description');
     $mappos_term = tripal_get_chado_semweb_term('featurepos', 'mappos');
+    $ref_feature_term = tripal_get_chado_semweb_term('featurepos', 'map_feature_id');
+    $ref_feature_name = tripal_get_chado_semweb_term('feature', 'name');
+    $ref_feature_id = tripal_get_chado_semweb_term('feature', 'uniquename');
+    $ref_feature_type = 'rdfs:type';
 
     return array(
       $field_term => array(
         'sortable' => FALSE,
         'searchable' => FALSE,
         'elements' => array(
-          'data:1274' => array(
-            'name' => 'Map',
+          $map_term => array(
             'searchable' => FALSE,
             'sortable' => FALSE,
             'elements' => array(
               $name_term => array(
-                'name' => 'map_name',
                 'label' => 'Map Name',
                 'help' => 'The name of the map.',
                 'searchable' => TRUE,
-                'operations' => array('eq', 'ne', 'contains', 'starts'),
-                'sortable' => FALSE,
+                'sortable' => TRUE,
               ),
               $description_term => array(
-                'name' => 'map_description',
                 'label' => 'Map Description',
                 'help' => 'A description of the map.',
                 'searchable' => TRUE,
-                'operations' => array('eq', 'ne', 'contains', 'starts'),
                 'sortable' => FALSE,
               ),
+              'entity' => array(
+                'searchable' => FALSE,
+                'sortable' => FALSE,
+              ),
+            ),
+          ),
+          $ref_feature_term => array(
+            'searchable' => FALSE,
+            'sortable' => FALSE,
+            'elements' => array(
+              $ref_feature_name => array(
+                'label' => 'Map Reference Feature Name',
+                'help' => 'The genomic or genetic feature Nameof the map on which this feature is mapped.',
+                'searchable' => TRUE,
+                'sortable' => TRUE,
+              ),
+              $ref_feature_id=> array(
+                'label' => 'Map Reference Feature Identifier',
+                'help' => 'The genomic or genetic feature of the map on which this feature is mapped.',
+                'searchable' => TRUE,
+                'sortable' => TRUE,
+              ),
+              $ref_feature_type=> array(
+                'label' => 'Map Reference Feature Type',
+                'help' => 'The type of genomic or genetic feature of the map on which this feature is mapped.',
+                'searchable' => TRUE,
+                'sortable' => TRUE,
+              ),
             ),
           ),
           $mappos_term => array(
-            'name' => 'map_position_type',
-            'label' => 'Map Position Type',
+            'label' => 'Map Reference Position',
             'help' => 'Maps may use different coordinate systems. This indicates the type of coordinate.',
             'searchable' => TRUE,
-            'operations' => array('eq', 'ne', 'contains', 'starts'),
-            'sortable' => FALSE,
-          ),
-          'entity' => array(
-            'searchable' => FALSE,
-            'sortable' => FALSE,
+            'sortable' => TRUE,
           ),
         ),
       ),
     );
   }
+
+  /**
+   * @see ChadoField::query()
+   */
+  public function query($query, $condition) {
+    $alias = $this->field['field_name'];
+    $operator = $condition['operator'];
+
+    // Map details.
+    $field_term_id = $this->getFieldTermID();
+    $map_term = 'data:1274';
+    $name_term = $field_term_id . ',' . $map_term . ',' . tripal_get_chado_semweb_term('featuremap', 'name');
+    $description_term = $field_term_id . ',' . $map_term . ',' . tripal_get_chado_semweb_term('featuremap', 'description');
+    $mappos_term = $field_term_id . ',' . tripal_get_chado_semweb_term('featurepos', 'mappos');
+
+    // Reference sequence details.
+    $ref_feature_term = tripal_get_chado_semweb_term('featurepos', 'map_feature_id');
+    $ref_feature_name = $field_term_id . ',' . $ref_feature_term . ',' .tripal_get_chado_semweb_term('feature', 'name');
+    $ref_feature_id = $field_term_id . ',' . $ref_feature_term . ',' .tripal_get_chado_semweb_term('feature', 'uniquename');
+    $ref_feature_type = $field_term_id . ',' . $ref_feature_term . ',' .'rdfs:type';
+
+    $this->queryJoinOnce($query, 'featurepos', $alias, "base.feature_id = $alias.feature_id");
+
+    if ($condition['column'] == $name_term) {
+      $this->queryJoinOnce($query, 'featuremap', $alias . '_map', $alias . '_map.featuremap_id = ' . $alias . '.featuremap_id');
+      $query->condition($alias . '_map.name', $condition['value'], $operator);
+    }
+    if ($condition['column'] == $description_term) {
+      $this->queryJoinOnce($query, 'featuremap', $alias . '_map', $alias . '_map.featuremap_id = ' . $alias . '.featuremap_id');
+      $query->condition($alias . '_map.description', $condition['value'], $operator);
+    }
+    if ($condition['column'] == $mappos_term) {
+      $query->condition($alias . '.mappos', $condition['value'], $operator);
+    }
+
+    if ($condition['column'] == $ref_feature_name) {
+      $this->queryJoinOnce($query, 'feature', $alias . '_mapref', $alias . '_mapref.feature_id = ' . $alias . '.map_feature_id');
+      $query->condition($alias . '_mapref.name', $condition['value'], $operator);
+    }
+    if ($condition['column'] == $ref_feature_id) {
+      $this->queryJoinOnce($query, 'feature', $alias . '_mapref', $alias . '_mapref.feature_id = ' . $alias . '.map_feature_id');
+      $query->condition($alias . '_mapref.uniquename', $condition['value'], $operator);
+    }
+    if ($condition['column'] == $ref_feature_type) {
+      $this->queryJoinOnce($query, 'feature', $alias . '_mapref', $alias . '_mapref.feature_id = ' . $alias . '.map_feature_id');
+      $this->queryJoinOnce($query, 'cvterm', $alias . '_mapref_cvterm', $alias . '_mapref_cvterm.cvterm_id = ' . $alias . '_mapref.type_id');
+      $query->condition($alias . '_mapref_cvterm.name', $condition['value'], $operator);
+    }
+  }
+  /**
+   * @see ChadoField::queryOrder()
+   */
+  public function queryOrder($query, $order) {
+    $alias = $this->field['field_name'];
+
+    // Map details.
+    $field_term_id = $this->getFieldTermID();
+    $map_term = 'data:1274';
+    $name_term = $field_term_id . ',' . $map_term . ',' . tripal_get_chado_semweb_term('featuremap', 'name');
+    $description_term = $field_term_id . ',' . $map_term . ',' . tripal_get_chado_semweb_term('featuremap', 'description');
+    $mappos_term = $field_term_id . ',' . tripal_get_chado_semweb_term('featurepos', 'mappos');
+
+    // Reference sequence details.
+    $ref_feature_term = tripal_get_chado_semweb_term('featurepos', 'map_feature_id');
+    $ref_feature_name = $field_term_id . ',' . $ref_feature_term . ',' .tripal_get_chado_semweb_term('feature', 'name');
+    $ref_feature_id = $field_term_id . ',' . $ref_feature_term . ',' .tripal_get_chado_semweb_term('feature', 'uniquename');
+    $ref_feature_type = $field_term_id . ',' . $ref_feature_term . ',' .'rdfs:type';
+
+    $this->queryJoinOnce($query, 'featurepos', $alias, "base.feature_id = $alias.feature_id", 'LEFT OUTER');
+
+    if ($order['column'] == $name_term) {
+      $this->queryJoinOnce($query, 'featuremap', $alias . '_map', $alias . '_map.featuremap_id = ' . $alias . '.featuremap_id', 'LEFT OUTER');
+      $query->orderBy($alias . '_map.name', $order['direction']);
+    }
+    if ($order['column'] == $description_term) {
+      $this->queryJoinOnce($query, 'featuremap', $alias . '_map', $alias . '_map.featuremap_id = ' . $alias . '.featuremap_id', 'LEFT OUTER');
+      $query->orderBy($alias . '_map.description', $order['direction']);
+    }
+    if ($order['column'] == $mappos_term) {
+      $query->orderBy($alias . '.mappos', $order['direction']);
+    }
+
+    if ($order['column'] == $ref_feature_name) {
+      $this->queryJoinOnce($query, 'feature', $alias . '_mapref', $alias . '_mapref.feature_id = ' . $alias . '.map_feature_id', 'LEFT OUTER');
+      $query->orderBy($alias . '_mapref.name', $order['direction']);
+    }
+    if ($order['column'] == $ref_feature_id) {
+      $this->queryJoinOnce($query, 'feature', $alias . '_mapref', $alias . '_mapref.feature_id = ' . $alias . '.map_feature_id', 'LEFT OUTER');
+      $query->orderBy($alias . '_mapref.uniquename', $order['direction']);
+    }
+    if ($order['column'] == $ref_feature_type) {
+      $this->queryJoinOnce($query, 'feature', $alias . '_mapref', $alias . '_mapref.feature_id = ' . $alias . '.map_feature_id', 'LEFT OUTER');
+      $this->queryJoinOnce($query, 'cvterm', $alias . '_mapref_cvterm', $alias . '_mapref_cvterm.cvterm_id = ' . $alias . '_mapref.type_id', 'LEFT OUTER');
+      $query->orderBy($alias . '_mapref_cvterm.name', $order['direction']);
+    }
+  }
   /**
    *
    * @see TripalField::load()
@@ -119,26 +237,33 @@ class ogi__location_on_map extends ChadoField {
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];
 
+    // Map details
+    $map_term = 'data:1274';
     $name_term = tripal_get_chado_semweb_term('featuremap', 'name');
     $description_term = tripal_get_chado_semweb_term('featuremap', 'description');
     $mappos_term = tripal_get_chado_semweb_term('featurepos', 'mappos');
 
+    // Reference sequence details.
+    $ref_feature_term = tripal_get_chado_semweb_term('featurepos', 'map_feature_id');
+    $ref_feature_name = tripal_get_chado_semweb_term('feature', 'name');
+    $ref_feature_id = tripal_get_chado_semweb_term('feature', 'uniquename');
+    $ref_feature_type = 'rdfs:type';
+
     // Set some defaults for the empty record.
     $entity->{$field_name}['und'][0] = array(
       'value' => array(),
     );
 
     // Add the featurepos records to our $record.
-    $options = array(
-      'return_array' => TRUE,
+    $options = array('return_array' => TRUE,
       'include_fk' => array(
-        'srcfeature_id' => array(
+        'map_feature_id' => array(
           'type_id' => 1,
         ),
         'feature_id' => array(
           'type_id' => 1
         ),
-      )
+      ),
     );
     $feature = chado_expand_var($record, 'table', 'featurepos', $options);
 
@@ -148,18 +273,25 @@ class ogi__location_on_map extends ChadoField {
       foreach ($feature->featurepos->feature_id AS $featurepos) {
         // Get details about the map
         $featuremap = chado_generate_var('featuremap', array('featuremap_id' => $featurepos->featuremap_id));
-        $value = array (
+        $entity->{$field_name}['und'][$i]['value'] = array (
           // Map.
-          'data:1274' => array(
+          $map_term => array(
             $name_term => $featuremap->name,
             $description_term => $featuremap->description,
           ),
+          $ref_feature_term => array(
+            $ref_feature_name => $featurepos->map_feature_id->name,
+            $ref_feature_id => $featurepos->map_feature_id->uniquename,
+            $ref_feature_type => $featurepos->map_feature_id->type_id->name,
+          ),
           $mappos_term => $featurepos->mappos
         );
         if (property_exists($featuremap, 'entity_id')) {
-          $value['data:1274']['entity'] = 'TripalEntity:' . $featuremap->entity_id;
+          $entity->{$field_name}['und'][$i]['value'][$map_term]['entity'] = 'TripalEntity:' . $featuremap->entity_id;
+        }
+        if (property_exists($featurepos->map_feature_id, 'entity_id')) {
+          $entity->{$field_name}['und'][$i]['value'][$map_term]['entity'] = 'TripalEntity:' . $featurepos->map_feature_id->entity_id;
         }
-        $entity->{$field_name}['und'][$i]['value'] = $value;
         $i++;
       }
     }

+ 11 - 2
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc

@@ -226,6 +226,15 @@ class sbo__database_cross_reference extends ChadoField {
    */
   public function validate($entity_type, $entity, $langcode, $items, &$errors) {
 
+    // If we don't have an entity then we don't want to validate.  The case
+    // where this could happen is when a user is editing the field settings
+    // and trying to set a default value. In that case there's no entity and
+    // we don't want to validate.  There will always be an entity for creation
+    // and update operations of a content type.
+    if (!$entity) {
+      return;
+    }
+
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];
     $table_name = $this->instance['settings']['chado_table'];
@@ -253,9 +262,9 @@ class sbo__database_cross_reference extends ChadoField {
       // clear to the user what field is required and which isn't. Therefore,
       // we borrow the code from the 'form_error' function and append the field
       // so that the proper field is highlighted on error.
-      if (!$db_id and $accession) {
+      if (!$db_id) {
         $errors[$field_name][$delta]['und'][] = array(
-          'message' => t("A database and the accession must both be provided."),
+          'message' => t("A database must be provided for the cross reference."),
           'error' => 'sbo__database_cross_reference',
         );
       }

+ 3 - 0
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc

@@ -100,6 +100,9 @@ class sbo__database_cross_reference_widget extends ChadoFieldWidget {
     );
   }
 
+  /**
+   * @see TripalFieldWidget::validate()
+   */
   public function validate($element, $form, &$form_state, $langcode, $delta) {
 
     $field_name = $this->field['field_name'];

+ 10 - 0
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc

@@ -769,6 +769,16 @@ class sbo__relationship extends ChadoField {
    * @see TripalField::validate()
    */
   public function validate($entity_type, $entity, $langcode, $items, &$errors) {
+
+    // If we don't have an entity then we don't want to validate.  The case
+    // where this could happen is when a user is editing the field settings
+    // and trying to set a default value. In that case there's no entity and
+    // we don't want to validate.  There will always be an entity for creation
+    // and update operations of a content type.
+    if (!$entity) {
+      return;
+    }
+
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];
     $field_table = $this->instance['settings']['chado_table'];

+ 6 - 1
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc

@@ -18,6 +18,7 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
    * @see TripalFieldFormatter::settingsForm()
    */
   public function settingsForm($view_mode, $form, &$form_state) {
+
     $display = $this->instance['display'][$view_mode];
     $settings = $display['settings'];
     $element = array();
@@ -42,7 +43,11 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
     $display = $this->instance['display'][$view_mode];
     $settings = $display['settings'];
 
-    $summary = t('Title: @title<br>Empty: @empty', array('@title' => $settings['title'], '@empty' => $settings['empty']));
+    $summary = t('Title: @title<br>Empty: @empty',
+        array(
+          '@title' => $settings['title'],
+          '@empty' => $settings['empty'])
+        );
 
     return $summary;
   }

+ 1 - 0
tripal_chado/includes/TripalFields/schema__additional_type/schema__additional_type_widget.inc

@@ -88,6 +88,7 @@ class schema__additional_type_widget extends ChadoFieldWidget {
    * @see TripalFieldWidget::submit()
    */
   public function validate($element, $form, &$form_state, $langcode, $delta) {
+
     $settings = $this->field['settings'];
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];

+ 1 - 0
tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name_widget.inc

@@ -127,6 +127,7 @@ class schema__alternate_name_widget extends ChadoFieldWidget {
    * @see TripalFieldWidget::validate()
    */
   public function validate($element, $form, &$form_state, $langcode, $delta) {
+
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];
     $table_name = $this->instance['settings']['chado_table'];

+ 1 - 0
tripal_chado/includes/TripalFields/schema__publication/schema__publication_widget.inc

@@ -89,6 +89,7 @@ class schema__publication_widget extends ChadoFieldWidget {
    * @see TripalFieldWidget::submit()
    */
   public function validate($element, $form, &$form_state, $langcode, $delta) {
+
     // Get the FK column that links to the base table.
     $table_name = $this->instance['settings']['chado_table'];
     $base_table = $this->instance['settings']['base_table'];

+ 12 - 0
tripal_chado/includes/TripalFields/sio__annotation/sio__annotation.inc

@@ -50,8 +50,20 @@ class sio__annotation extends ChadoField {
   public static $no_ui = FALSE;
 
 
+  /**
+   * @see TripalField::validate()
+   */
   public function validate($entity_type, $entity, $langcode, $items, &$errors) {
 
+    // If we don't have an entity then we don't want to validate.  The case
+    // where this could happen is when a user is editing the field settings
+    // and trying to set a default value. In that case there's no entity and
+    // we don't want to validate.  There will always be an entity for creation
+    // and update operations of a content type.
+    if (!$entity) {
+      return;
+    }
+
     $field_name = $this->field['field_name'];
 
     foreach ($items as $delta => $item) {

+ 9 - 0
tripal_chado/includes/TripalFields/sio__vocabulary/sio__vocabulary.inc

@@ -40,6 +40,15 @@ class sio__vocabulary extends ChadoField {
    */
   public function validate($entity_type, $entity, $langcode, $items, &$errors) {
 
+    // If we don't have an entity then we don't want to validate.  The case
+    // where this could happen is when a user is editing the field settings
+    // and trying to set a default value. In that case there's no entity and
+    // we don't want to validate.  There will always be an entity for creation
+    // and update operations of a content type.
+    if (!$entity) {
+      return;
+    }
+
     $settings = $this->field['settings'];
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];

+ 4 - 6
tripal_chado/includes/TripalImporter/OBOImporter.inc

@@ -503,13 +503,11 @@ class OBOImporter extends TripalImporter {
     }
 
     // second, parse the OBO
-    $success = $this->loadOBO_v1_2($temp, $newcvs);
-    if ($success) {
+    $this->loadOBO_v1_2($temp, $newcvs);
+
+    // update the cvtermpath table
+    $this->load_cvtermpath($newcvs);
 
-      // update the cvtermpath table
-      $this->load_cvtermpath($newcvs);
-      print "Done\n";
-    }
     // now remove the temp file
     unlink($temp);
   }

+ 63 - 0
tripal_chado/includes/tripal_chado.cv.inc

@@ -775,3 +775,66 @@ function tripal_cv_cvterm_edit_form_ajax($form, $form_state) {
 
   return $elements;
 }
+
+/**
+ * Form for re-doing the cvterm path
+ *
+ * @ingroup tripal_cv
+ */
+function tripal_cv_cvtermpath_form() {
+
+  // get a list of db from chado for user to choose
+  $sql = "SELECT * FROM {cv} WHERE NOT name = 'tripal' ORDER BY name ";
+  $results = chado_query($sql);
+
+  $cvs = array();
+  $cvs[] = '';
+  foreach ($results as $cv) {
+    $cvs[$cv->cv_id] = $cv->name;
+  }
+
+  $form['cvid'] = array(
+    '#title' => t('Controlled Vocabulary/Ontology Name'),
+    '#type' => 'select',
+    '#options' => $cvs,
+    '#description' => t('The Chado cvtermpath is a database table that provides lineage for ontology terms
+      and is useful for quickly finding any ancestor parent of a term.  This table must be populated for each
+      ontology.  Select a controlled vocabulary for which you would like to upate the cvtermpath.'),
+  );
+
+  $form['description'] = array(
+    '#type' => 'item',
+    '#value' => t("Submit a job to update chado cvtermpath table."),
+    '#weight' => 1,
+  );
+
+  $form['button'] = array(
+    '#type' => 'submit',
+    '#value' => t('Update cvtermpath'),
+    '#weight' => 2,
+  );
+
+  return $form;
+}
+
+/**
+ * Cvterm path form submit
+ *
+ * @ingroup tripal_cv
+ */
+function tripal_cv_cvtermpath_form_submit($form, &$form_state) {
+  global $user;
+
+  $cvid =  $form_state['values']['cvid'];
+
+  // first get the controlled vocabulary name:
+  $sql = "SELECT * FROM {cv} WHERE cv_id = :cv_id";
+  $cv = chado_query($sql, array(':cv_id' => $cvid))->fetchObject();
+
+  // Submit a job to update cvtermpath
+  $job_args = array($cvid);
+  if ($form_state['values']['op'] == t('Update cvtermpath')) {
+    tripal_add_job("Update cvtermpath: $cv->name", 'tripal_cv',
+        'tripal_update_cvtermpath', $job_args, $user->uid, 10);
+  }
+}

+ 3 - 2
tripal_chado/includes/tripal_chado.field_storage.inc

@@ -146,6 +146,7 @@ function tripal_chado_field_storage_write_table($table_name, $values, $base_tabl
 
   // If the primary key column does not have a value then this is an insert.
   if (!array_key_exists($pkey, $values) or !$values[$pkey] or !isset($values[$pkey])) {
+
     // Before inserting, we want to make sure the record does not
     // already exist.  Using the unique constraint check for a matching record.
     $options = array('is_duplicate' => TRUE);
@@ -628,8 +629,8 @@ function tripal_chado_field_storage_query($query) {
     } // end if ($sort['type'] == 'field') {
   } // end foreach ($query->order as $index => $sort) {
 
-//        dpm($cquery->__toString());
-//        dpm($cquery->getArguments());
+// dpm($cquery->__toString());
+// dpm($cquery->getArguments());
 
   $records = $cquery->execute();
 

+ 8 - 2
tripal_chado/includes/tripal_chado.fields.inc

@@ -870,6 +870,12 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
       $base_info['label'] = 'Description';
     }
     //
+    // FEATUREMAP TABLE
+    //
+    if ($table_name == 'featuremap' and $column_name == 'name') {
+      $base_info['required'] = TRUE;
+    }
+    //
     // PUB TABLE
     //
     if ($table_name == 'pub') {
@@ -928,7 +934,7 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
       $base_info['label'] = 'Program, Pipeline, Workflow or Method Name';
     }
     if ($table_name == 'analysis' and $column_name == 'algorithm') {
-      $base_info['label'] = 'Source Version';
+      $base_info['label'] = 'Algorithm';
       $base_info['description'] = 'The name of the algorithm used to produce the dataset if different from the program.';
     }
     if ($table_name == 'analysis' and $column_name == 'programversion') {
@@ -1349,7 +1355,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
   }
 
 
-  // FEATURE SEQLEN
+  // FEATURE MAP UNITS
   if ($table_name == 'featuremap') {
     $field_name = 'uo__unit';
     $info[$field_name] = array(

+ 6 - 6
tripal_chado/includes/tripal_chado.migrate.inc

@@ -740,11 +740,11 @@ function tripal_chado_migrate_selected_types($tv3_content_types) {
  *
  * @param unknown $tv2_content_types
  */
-function tripal_chado_delete_selected_types($tv2_content_types = array()) {
+function tripal_chado_delete_selected_types($tv2_content_types = array(), $job_id) {
   foreach ($tv2_content_types AS $type) {
     $sql = "DELETE FROM $type";
     db_query($sql);
-    chado_cleanup_orphaned_nodes(str_replace('chado_', '', $type));
+    chado_cleanup_orphaned_nodes(str_replace('chado_', '', $type), $job_id);
   }
 }
 
@@ -755,7 +755,7 @@ function tripal_chado_delete_selected_types($tv2_content_types = array()) {
  *
  * @param unknown $tv2_content_types
  */
-function tripal_chado_unpublish_selected_types($tv2_content_types = array()) {
+function tripal_chado_unpublish_selected_types($tv2_content_types = array(), $job_id) {
   foreach ($tv2_content_types AS $type) {
     $sql = "UPDATE node SET status = 0 WHERE nid IN (SELECT nid FROM $type)";
     db_query($sql);
@@ -771,7 +771,7 @@ function tripal_chado_unpublish_selected_types($tv2_content_types = array()) {
  *
  * @param unknown $tv2_content_types
  */
-function tripal_chado_copy_title_for_selected_types($tv2_content_types = array()) {
+function tripal_chado_copy_title_for_selected_types($tv2_content_types = array(), $job_id) {
   foreach ($tv2_content_types AS $type) {
     $chado_table = str_replace('chado_', '', $type);
     $bio_data_tables = tripal_chado_migrate_get_biodata_tables($chado_table);
@@ -799,7 +799,7 @@ function tripal_chado_copy_title_for_selected_types($tv2_content_types = array()
  *
  * @param unknown $tv2_content_types
  */
-function tripal_chado_migrate_url_alias_for_selected_types($tv2_content_types = array()) {
+function tripal_chado_migrate_url_alias_for_selected_types($tv2_content_types = array(), $job_id) {
   foreach ($tv2_content_types AS $type) {
     $chado_table = str_replace('chado_', '', $type);
     $bio_data_tables = tripal_chado_migrate_get_biodata_tables($chado_table);
@@ -1201,4 +1201,4 @@ function tripal_chado_migrate_resource_links($bundle_name) {
       }
     }
   }
-}
+}

+ 22 - 4
tripal_chado/includes/tripal_chado.semweb.inc

@@ -213,8 +213,8 @@ function tripal_chado_populate_vocab_SCHEMA() {
   $term = tripal_insert_cvterm(array(
     'id' => 'schema:additionalType',
     'name' => 'additionalType',
-    'cv_name' => 'An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in.',
-    'definition' => 'URL of the item.',
+    'cv_name' => 'schema',
+    'definition' => 'An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in.',
   ));
   $tables = chado_get_table_names(TRUE);
   foreach ($tables as $table) {
@@ -530,8 +530,8 @@ function tripal_chado_populate_vocab_ERO() {
     'urlprefix' => 'http://purl.bioontology.org/ontology/ERO/{db}:{accession}',
   ));
   tripal_insert_cv(
-      'ero',
-      'The Eagle-I Research Resource Ontology models research resources such instruments. protocols, reagents, animal models and biospecimens. It has been developed in the context of the eagle-i project (http://eagle-i.net/).'
+    'ero',
+    'The Eagle-I Research Resource Ontology models research resources such instruments. protocols, reagents, animal models and biospecimens. It has been developed in the context of the eagle-i project (http://eagle-i.net/).'
   );
 
   $term = tripal_insert_cvterm(array(
@@ -1232,6 +1232,24 @@ function tripal_chado_populate_vocab_LOCAL() {
     'db_name' => 'local'
   ));
 
+  tripal_insert_cvterm(array(
+    'name' => 'Software',
+    'definition' => 'The software used to construct the map.',
+    'cv_name' => 'featuremap_property',
+    'is_relationship' => 0,
+    'db_name' => 'local'
+  ));
+
+  $term = tripal_insert_cvterm(array(
+    'name' => 'Reference Feature',
+    'definition' => 'A genomic or genetic feature on which other features are mapped.',
+    'cv_name' => 'local',
+    'is_relationship' => 0,
+    'db_name' => 'local'
+  ));
+  tripal_associate_chado_semweb_term('featurepos', 'map_feature_id', $term);
+
+
   //--------------
   // Featureloc Terms
   //--------------

+ 1 - 1
tripal_chado/tripal_chado.info

@@ -3,7 +3,7 @@ description = Provides a set of Chado-based fields for the Tripal Entities.
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 files[] = views_handlers/chado_views_handler_field.inc
 files[] = views_handlers/chado_views_handler_filter.inc

+ 38 - 0
tripal_chado/tripal_chado.install

@@ -1201,4 +1201,42 @@ function tripal_chado_update_7313() {
     $error = $e->getMessage();
     throw new DrupalUpdateException('Could not perform update: '. $error);
   }
+}
+
+/**
+ * Adds a local term for the featuremap.feature_id column.
+ */
+function tripal_chado_update_7314() {
+  try {
+    $term = tripal_insert_cvterm(array(
+      'name' => 'Reference Feature',
+      'definition' => 'A genomic or genetic feature on which other features are mapped.',
+      'cv_name' => 'local',
+      'is_relationship' => 0,
+      'db_name' => 'local'
+    ));
+    tripal_associate_chado_semweb_term('featurepos', 'map_feature_id', $term);
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Could not perform update: '. $error);
+  }
+}
+/**
+ * Fixes a mistake with the schema:additionalType term.
+ */
+function tripal_chado_update_7315() {
+  try {
+    $term = tripal_insert_cvterm(array(
+      'id' => 'schema:additionalType',
+      'name' => 'additionalType',
+      'cv_name' => 'schema',
+      'definition' => 'An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in.',
+    ));
+    chado_delete_record('cv', array('name' => 'An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in.'));
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Could not perform update: '. $error);
+  }
 }

+ 10 - 0
tripal_chado/tripal_chado.module

@@ -628,6 +628,16 @@ function tripal_chado_menu() {
     'type' => MENU_CALLBACK,
   );
 
+  $items['admin/tripal/storage/chado/cvtermpath'] = array(
+    'title' => 'Update Chado cvtermpath table',
+    'description' => 'The Chado cvtermpath table provides lineage for terms and is useful for quickly finding any ancestor parent of a term.  However, this table must be populated.  This page allows for populating of this table one vocabulary at a time',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_cv_cvtermpath_form'),
+    'access arguments' => array('administer controlled vocabularies'),
+    'file' => 'includes/tripal_chado.cv.inc',
+    'file path' => drupal_get_path('module', 'tripal_chado'),
+    'type' => MENU_NORMAL_ITEM,
+  );
   //////////////////////////////////////////////////////////////////////////////
   //                           Databases
   //////////////////////////////////////////////////////////////////////////////

+ 1 - 1
tripal_chado_views/tripal_chado_views.info

@@ -3,7 +3,7 @@ description = Integrates all Chado tables with Drupal Views and provides basic s
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 configure = admin/tripal/storage/chado/views-integration
 
 files[] = views/handlers/tripal_views_handler_filter_textarea.inc

+ 22 - 16
tripal_ds/includes/tripal_ds.ds.inc

@@ -46,6 +46,9 @@ function _ds_layout_settings_info($bundle_name, $instances) {
   $fields_with_regions = array();
   $i = 0;
   $all_fields = array();
+  watchdog('debug', '<pre>$bundle_name: '. print_r($bundle_name, TRUE) .'</pre>');
+
+  watchdog('debug', '<pre>$instances: '. print_r($instances, TRUE) .'</pre>');
 
   try {
     // Get the bundle and term objects.
@@ -142,14 +145,17 @@ function _ds_layout_settings_info($bundle_name, $instances) {
     // order to display fields in label alpha order.
     $right_fields = array();
     $all_field_groups = field_group_info_groups('TripalEntity', $bundle_name);
-    if (is_array($all_field_groups)) {
-      if (!isset($all_field_groups['default'])) {
-        $all_field_groups['default'] = array();
-      }
-      foreach ($all_field_groups['default'] as $key => $field_name) {
-        $right_fields[$key] = $field_name;
+
+    if(!empty($all_field_groups)){
+      if (is_array($all_field_groups)) {
+        if (!isset($all_field_groups['default'])) {
+          $all_field_groups['default'] = array();
+        }
+        foreach ($all_field_groups['default'] as $key => $field_name) {
+          $right_fields[$key] = $field_name;
+        }
+        usort($right_fields, tripal_ds_sort_object('label'));
       }
-      usort($right_fields, tripal_ds_sort_object('label'));
     }
     elseif(empty($all_field_groups)) {
       //Add the original instances that were passed and the field_groups that
@@ -250,9 +256,10 @@ function _ds_layout_settings_info($bundle_name, $instances) {
       'layout_disable_css' => 0,
     );
     $record->settings = $settings;
+
     drupal_write_record('ds_layout_settings', $record);
     // Clear the Drupal cache.
-    cache_clear_all();
+    drupal_flush_all_caches();
   }
   catch (Exception $e) {
     watchdog_exception('tripal_ds', $e);
@@ -278,7 +285,6 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
   $all_fields = array();
   $instances_for_field_groups = array();
   $disabled_instances = array();
-  watchdog('debug', '<pre>$instances: '. print_r($instances, TRUE) .'</pre>');
   try {
     // Add Abstract, Citation, DB Cross Reference, Properties.
     $all_fields['tpub__abstract']= 'right';
@@ -293,15 +299,16 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
     foreach ($instances as $key => $instance) {
       $instance_name = $instance['field_name'];
 
-      if($instance_name == 'tpub__abstract' || $instance_name == 'tpub__citation'
-        || $instance_name == 'sbo__database_cross_reference'
+      if($instance_name == 'sbo__database_cross_reference'
         || $instance_name == 'sio__references'){
         array_push($instances_for_field_groups, $instance);
         // Update the display settings so that the title is hidden.
         $instance['display']['default']['label'] = 'hidden';
         field_update_instance($instance);
       }
-      elseif($instance_name == 'schema__additional_type' || $instance_name == 'tpub__doi' || $instance_name == 'tpub__publication_date') {
+      elseif($instance_name == 'schema__additional_type' || $instance_name == 'tpub__doi'
+        || $instance_name == 'tpub__publication_date' || 'tpub__abstract' ||
+        $instance_name == 'tpub__citation') {
         array_push($properties, $instance_name);
       }
       else {
@@ -335,9 +342,9 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
     //Properties table fields.
     if(!empty($properties)){
       _publication_prop_field_group_info($bundle_name, $properties);
-      array_unshift($properties, 'group_prop_tripalpane', 'group_prop_table');
+      array_unshift($properties, 'group_summary_tripalpane', 'group_summary_table');
       $region_right = array_merge($region_right, $properties);
-      $all_fields+= [ 'group_prop_tripalpane' => 'right', 'group_prop_table' => 'right' ];
+      $all_fields+= [ 'group_summary_tripalpane' => 'right', 'group_summary_table' => 'right' ];
     }
     if(!empty($all_fields)){
       foreach ($disabled_instances as $disabled_field) {
@@ -380,8 +387,7 @@ function _ds_layout_pub_settings_info($bundle_name, $instances) {
     $record->settings = $settings;
     drupal_write_record('ds_layout_settings', $record);
     // Clear the Drpual chace
-    cache_clear_all();
-    watchdog('debug', '<pre>$record: '. print_r($record, TRUE) .'</pre>');
+    drupal_flush_all_caches();
   }
   catch (Exception $e) {
     watchdog_exception('tripal_ds', $e);

+ 13 - 12
tripal_ds/includes/tripal_ds.field_group.inc

@@ -261,7 +261,6 @@ function _additional_fields_field_group_info($bundle_name, $field_label, $group_
       ),
     ),
   );
-  watchdog('debug', '<pre>$field_group_fieldset: '. print_r($field_group_fieldset, TRUE) .'</pre>');
   drupal_write_record('field_group', $field_group_fieldset);
 }
 
@@ -278,17 +277,17 @@ function _publication_prop_field_group_info($bundle_name, $fields){
   $field_group_tripalpane = new stdClass();
   $field_group_tripalpane->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
   $field_group_tripalpane->api_version = 1;
-  $field_group_tripalpane->identifier = 'group_prop_tripalpane|TripalEntity|'.$bundle_name.'|default';
-  $field_group_tripalpane->group_name = 'group_prop_tripalpane';
+  $field_group_tripalpane->identifier = 'group_summary_tripalpane|TripalEntity|'.$bundle_name.'|default';
+  $field_group_tripalpane->group_name = 'group_summary_tripalpane';
   $field_group_tripalpane->entity_type = 'TripalEntity';
   $field_group_tripalpane->bundle = $bundle_name;
   $field_group_tripalpane->mode = 'default';
   $field_group_tripalpane->parent_name = '';
   $field_group_tripalpane->data = array(
-    'label' => 'Properties',
+    'label' => 'Summary',
     'weight' => '1',
     'children' => array(
-      0 => 'group_prop_table',
+      0 => 'group_summary_table',
     ),
     'format_type' => 'tripalpane',
     'format_settings' => array(
@@ -297,35 +296,37 @@ function _publication_prop_field_group_info($bundle_name, $fields){
         'id' => 'tripal_ds-fieldset-group_prop_tripalpane',
         'classes' => 'group-prop-tripalpane field-group-tripalpane',
         'description' => '',
-        'hide' => 1,
+        'hide' => 0,
       ),
     ),
   );
   drupal_write_record('field_group', $field_group_tripalpane);
   //Write to the tripal_ds table to record the new tripal pane.
-  tripal_ds_bundle_menu_item($bundle_name, 'Properties', 'group_prop_tripalpane', 'TripalEntity');
+  tripal_ds_bundle_menu_item($bundle_name, 'Summary', 'group_summary_tripalpane', 'TripalEntity');
 
   //Table of fields.
   $field_group = new stdClass();
   $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially*/
   $field_group->api_version = 1;
-  $field_group->identifier = 'group_prop_table|TripalEntity|'.$bundle_name.'|default';
-  $field_group->group_name = 'group_prop_table';
+  $field_group->identifier = 'group_summary_table|TripalEntity|'.$bundle_name.'|default';
+  $field_group->group_name = 'group_summary_table';
   $field_group->entity_type = 'TripalEntity';
   $field_group->bundle = $bundle_name;
   $field_group->mode = 'default';
-  $field_group->parent_name = 'group_prop_tripalpane';
+  $field_group->parent_name = 'group_summary_tripalpane';
   $field_group->data = array(
-    'label' => 'Properties Table',
+    'label' => 'Summary Table',
     'weight' => '1',
     'children' =>  array(
       0 => 'tpub__doi',
       1 => 'tpub__publication_date',
       2 => 'schema__additional_type',
+      3 => 'tpub__abstract',
+      4 => 'tpub__citation'
     ),
     'format_type' => 'table',
     'format_settings' => array(
-      'label' => 'Properties Table',
+      'label' => 'Summary Table',
       'instance_settings' => array(
         'label_visibility' => '1',
         'desc' => '',

+ 1 - 1
tripal_ds/tripal_ds.info

@@ -3,7 +3,7 @@ description = Provides display options for Tripal Entities through extending Dis
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 stylesheets[all][] = theme/css/tripal_ds.css
 

+ 1 - 1
tripal_ws/includes/TripalWebService/TripalEntityService_v0_1.inc

@@ -63,7 +63,7 @@ class TripalEntityService_v0_1 extends TripalWebService {
    */
   private function doExpandedField($ctype, $entity_id, $expfield) {
     $service_path = $this->getServicePath() . '/' . urlencode($ctype) . '/' . $entity_id;
-    $this->resource = new TripalWebServiceResource($service_path, $this->doc_path);
+    $this->resource = new TripalWebServiceResource($service_path);
 
     // Get the TripalBundle, TripalTerm and TripalVocab for this type.
     $bundle = tripal_load_bundle_entity(array('label' => $ctype));

+ 1 - 1
tripal_ws/tripal_ws.info

@@ -3,6 +3,6 @@ description = Exposes Tripal Entites as RESTful web services.
 core = 7.x
 project = tripal
 package = Tripal
-version = 7.x-3.0-beta3
+version = 7.x-3.0-rc1
 
 dependencies[] = tripal