NAL-i5K / tripal_eutils

ncbi loader via the eutils interface
GNU General Public License v3.0
4 stars 3 forks source link

Error if CV term does not exist #243

Closed dsenalik closed 1 year ago

dsenalik commented 1 year ago

If the required cv term for the property being loaded does not exist, errors like the following can occur, where the cvterm_id was returned as NULL because it did not exist, that is the value that is used for type_id in the lookup:

[site http://default] [TRIPAL ERROR] [TRIPAL_CHADO] chado_get_property: Multiple terms found. Cannot add the property. Property was described by: Array(    [type_id] =>     [value] => not collected).
[site http://default] [TRIPAL ERROR] [TRIPAL_CHADO] chado_insert_property: Multiple terms found. Cannot add the property. Property was described by: Array(    [type_id] =>     [value] => not collected).
[site http://default] [TRIPAL ERROR] [TRIPAL_CHADO] chado_get_property: Multiple terms found. Cannot add the property. Property was described by: Array(    [type_id] =>     [value] => China:Qingdao).
[site http://default] [TRIPAL ERROR] [TRIPAL_CHADO] chado_insert_property: Multiple terms found. Cannot add the property. Property was described by: Array(    [type_id] =>     [value] => China:Qingdao).

Let's fix that by creating the missing CV terms automatically.

dsenalik commented 1 year ago

After this change the output is

INFO (TRIPAL_EUTILS): Adding new cvterm NCBI_BioSample_Attributes:dev_stage
INFO (TRIPAL_EUTILS): Adding new cvterm NCBI_BioSample_Attributes:geo_loc_name
dsenalik commented 1 year ago

Resolved with #244