Observations (phenotypic data) were missing from exports when BreedBase was the backing service. The cause was that the Observations search endpoint wasn't returning any data. BreedBase was interpreting the trialDbIds sent in the search POST body as both Trial and Study DbIds. This is likely due to conflicting terminology between BrAPI and BreedBase: https://gist.github.com/mlm483/b5e1590fdedd0c3dcd116bd29ef19423.
Testing
Upload an experiment with Observations (phenotypic data) to a BreedBase-backed program.
Download the experiment's Observation dataset.
Check that downloaded file has Observations (phenotypic data).
Alternatively:
Use this query to find valid folder and program DbIds:
SELECT germplasm_uniquename, trial_id, trial_name, breeding_program_id, breeding_program_name, folder_id, folder_name, observations
FROM materialized_phenotype_jsonb_table
LEFT JOIN (
select stock.stock_id, array_agg(db.name)::text[] as xref_sources, array_agg(dbxref.accession)::text[] as xref_ids
from stock
join stock_dbxref sd on stock.stock_id = sd.stock_id
join dbxref on sd.dbxref_id = dbxref.dbxref_id
join db on dbxref.db_id = db.db_id
group by stock.stock_id
) xref on xref.stock_id = materialized_phenotype_jsonb_table.observationunit_stock_id
;
POST to the search endpoint with the folder and program DbIds from step 1.
The benefit of this approach is that you can try adding "studyDbIds": ["{studyDbId}"], to the POST call, to ensure the endpoint works as expected for search by Study as well.
Checklist
[ ] Refactoring only
[ ] Documentation only
[ ] Fixture update only
[x] Bug fix
[ ] The relevant issue has been closed.
[ ] Further work is required.
[ ] New feature
[ ] Relevant tests have been created and run.
[ ] Data was added to the fixture
[ ] Data was added via a patch in /t/data/fixture/patches/.
[ ] User-Facing Change
[ ] The user manual in /docs has been updated.
[ ] Any new Perl has been documented using perldoc.
[ ] Any new JavaScript has been documented using JSDoc.
[ ] Any new legacy JavaScript has been moved from /js to /js/source/legacy.
Description
Jira bug: https://breedinginsight.atlassian.net/browse/BI-1843
Observations (phenotypic data) were missing from exports when BreedBase was the backing service. The cause was that the Observations search endpoint wasn't returning any data. BreedBase was interpreting the
trialDbIds
sent in the search POST body as both Trial and Study DbIds. This is likely due to conflicting terminology between BrAPI and BreedBase: https://gist.github.com/mlm483/b5e1590fdedd0c3dcd116bd29ef19423.Testing
Alternatively:
Use this query to find valid folder and program DbIds:
POST to the search endpoint with the folder and program DbIds from step 1.
GET the search result endpoint with the
searchResultDbId
returned in step 2.The benefit of this approach is that you can try adding
"studyDbIds": ["{studyDbId}"],
to the POST call, to ensure the endpoint works as expected for search by Study as well.Checklist
/t/data/fixture/patches/
./docs
has been updated./js
to/js/source/legacy
.