Skip to content

Commit

Permalink
Merge pull request #3510 from solgenomics/topic/fix_variables_bug
Browse files Browse the repository at this point in the history
fix brapi GET /variables bug
  • Loading branch information
lukasmueller authored May 6, 2021
2 parents d35bfef + f1d801e commit b4d1a04
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions lib/CXGN/BrAPI/v2/ObservationVariables.pm
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,20 @@ sub search {
my $trait = CXGN::Trait->new({bcs_schema=>$self->bcs_schema, cvterm_id=>$cvterm_id});
my $categories = $trait->categories;
my @brapi_categories = split '/', $categories;

my @references;
push @references, {
referenceID => "http://www.cropontology.org/terms/".$db_name.":".$accession . "/",
referenceSource => "Crop Ontology"
};

push @data, {
additionalInfo => {},
commonCropName => $supported_crop,
contextOfUse => undef,
defaultValue => $trait->default_value,
documentationURL => $trait->uri,
externalReferences => $db_name.":".$accession,
externalReferences => \@references,
growthStage => undef,
institution => undef,
language => 'eng',
Expand Down Expand Up @@ -191,7 +198,7 @@ sub search {
additionalInfo => {},
datatype => $trait->format,
decimalPlaces => undef,
externalReferences => '',
externalReferences => [],
ontologyReference => {},
# documentationLinks
# ontologyDbId
Expand All @@ -215,7 +222,7 @@ sub search {
alternativeAbbreviations => undef,
attribute => $cvterm_name,
entity => undef,
externalReferences => $db_name.":".$accession,
externalReferences => [],
mainAbbreviation => undef,
ontologyReference => {
documentationLinks => $trait->uri ? $trait->uri : undef,
Expand Down Expand Up @@ -279,13 +286,20 @@ sub detail {
my $trait = CXGN::Trait->new({bcs_schema=>$self->bcs_schema, cvterm_id=>$cvterm_id});
my $categories = $trait->categories;
my @brapi_categories = split '/', $categories;

my @references;
push @references, {
referenceID => "http://www.cropontology.org/terms/".$db_name.":".$accession . "/",
referenceSource => "Crop Ontology"
};

%result = (
additionalInfo => undef,
commonCropName => $supported_crop,
contextOfUse => undef,
defaultValue => $trait->default_value,
documentationURL => $trait->uri,
externalReferences => $db_name.":".$accession,
externalReferences => \@references,
growthStage => undef,
institution => undef,
language => 'eng',
Expand Down Expand Up @@ -316,7 +330,7 @@ sub detail {
scale => {
datatype => $trait->format,
decimalPlaces => undef,
externalReferences => '',
externalReferences => [],
ontologyReference => {
# documentationLinks
# ontologyDbId
Expand All @@ -340,7 +354,7 @@ sub detail {
alternativeAbbreviations => undef,
attribute => $cvterm_name,
entity => undef,
externalReferences => $db_name.":".$accession,
externalReferences => [],
mainAbbreviation => undef,
ontologyReference => {
documentationLinks => $trait->uri ? $trait->uri : undef,
Expand Down

0 comments on commit b4d1a04

Please sign in to comment.