[ENH] Support AND queries for categorical variables other than sex - #594
Open
alyssadai wants to merge 19 commits into
Open
[ENH] Support AND queries for categorical variables other than sex#594alyssadai wants to merge 19 commits into
alyssadai wants to merge 19 commits into
Conversation
Reviewer's GuideAdds AND filtering for categorical diagnosis, assessment, imaging modality, and pipeline criteria by introducing list-based request fields, structured pipeline validation, instance-aware SPARQL generation, and all-term catalog matching, with comprehensive validation and query-generation coverage. Sequence diagram for multi-value categorical query generationsequenceDiagram
participant Client
participant API as post_subjects
participant Model as DatasetsQueryModel
participant Utility as create_query
participant SPARQL
Client->>API: POST query with list filters
API->>Model: Validate diagnosis, assessment, image_modal, pipeline
Model-->>API: Validated query
API->>Utility: create_query(..., pipeline)
Utility->>SPARQL: Generate one triple per categorical value
Utility->>SPARQL: Generate distinct pipeline instances
SPARQL-->>API: AND-constrained query
API-->>Client: Matching subjects
Flow diagram for catalog AND matchingflowchart LR
Query[Query categorical list filters] --> Match[catalog_dataset_matches_categorical_filter]
Dataset[Dataset metadata terms] --> Match
Match --> All{all requested terms present?}
All -->|Yes| Include[Include dataset]
All -->|No| Exclude[Exclude dataset]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #594 +/- ##
==========================================
+ Coverage 95.20% 96.09% +0.89%
==========================================
Files 29 29
Lines 1355 1435 +80
Branches 90 97 +7
==========================================
+ Hits 1290 1379 +89
+ Misses 36 31 -5
+ Partials 29 25 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alyssadai
marked this pull request as ready for review
September 2, 2026 15:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
pipeline_nameandpipeline_versionwith singlepipelinefield that accepts a list of{"name": ..., "version": ...}objectsNote
The default SPARQL query is not expected to change since this PR only updates the logic when a filter is applied
Checklist
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 #XXXXFor new features:
For bug fixes:
Summary by Sourcery
Enable validated multi-value categorical filtering with AND semantics across subject and dataset queries.
New Features:
Bug Fixes:
Enhancements:
Tests: