Use left join approach for imaging session subquery to ensure that subjects without an imaging session are still included in the results (with a count of 0 imaging sessions)
otherwise, due to the aggregation used in the subquery (GROUP BY ?subject), when the results are joined back to the main query, subjects without imaging sessions may be excluded b/c there are no rows for them in the subquery results
Note that this is not needed for the phenotypic session subquery, because all subjects must have >=1 phenotypic session
[x] PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
[x] PR has a label for the release changelog or skip-release (to be applied by maintainers only)
[x] PR links to GitHub issue with mention Closes #XXXX
[x] Tests pass
[x] Checks pass
For new features:
[ ] Tests have been added
For bug fixes:
[ ] There is at least one test that would fail under the original bug conditions.
Closes #331
This PR reverts a change to the query template introduced as part of https://github.com/neurobagel/api/pull/326
Changes proposed in this pull request:
GROUP BY ?subject
), when the results are joined back to the main query, subjects without imaging sessions may be excluded b/c there are no rows for them in the subquery resultsChecklist
This section is for the PR reviewer
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see our Contributing Guidelines for more info)skip-release
(to be applied by maintainers only)Closes #XXXX
For new features:
For bug fixes: