neurobagel / api

https://api.neurobagel.org/
MIT License
4 stars 3 forks source link

[BUG] Aggregate API responses always contain empty dict for `available_pipelines` #348

Closed alyssadai closed 1 month ago

alyssadai commented 1 month ago

Is there an existing issue for this?

Expected Behavior

When subject data in the graph contains pipeline metadata, an aggregate mode query response for the dataset should include a non-empty dictionary for available_pipelines.

Current Behavior

available_pipelines is always an empty dictionary {}.

This is because the aggregation statement in the SPARQL query template has not yet been updated to return pipeline variables, and similarly, the API-side handling of the graph response for an aggregate query currently does not consider these variables. https://github.com/neurobagel/api/blob/c150b37c659ffd16fe3d38d982f09ccd5edf996c/app/api/utility.py#L306-L315

At the same time, the value of available_pipelines is always initialized as an empty dict: https://github.com/neurobagel/api/blob/c150b37c659ffd16fe3d38d982f09ccd5edf996c/app/api/crud.py#L171 https://github.com/neurobagel/api/blob/c150b37c659ffd16fe3d38d982f09ccd5edf996c/app/api/crud.py#L290

And so this is what is currently always returned in aggregate mode.

Error message

No response

Environment

How to reproduce

Install and launch the API from source, in aggregate mode, and point it to a graph containing data from fhttps://github.com/neurobagel/neurobagel_examples/tree/main/data-upload/pheno-bids-derivatives-output.

Anything else?

No response

neurobagel-bot[bot] commented 4 weeks ago

:rocket: Issue was released in v0.4.0 :rocket: