Commit 3ac5787
committed
anatScRNAseqQuery: walk SUBCLASSOF so parent classes match subclass Clusters
v1.13.2's get_anatomy_scrnaseq matched
(primary {short_form: $id})<-[:composed_primarily_of]-(c:Cluster)
which only catches Clusters bound to the exact class. But the indexer
sets `hasScRNAseq` on a parent class whenever ANY subclass has a
Cluster, so any class queried through anatScRNAseqQuery whose own
Clusters all live on subclasses returns 0 - even though the v2
frontend correctly offers the query because the supertype constraint
(Class + Anatomy + hasScRNAseq) matches.
Canonical case (the one Robbie spotted on v2-dev):
pacemaker neuron (FBbt_00006048) -> 0 direct Clusters
-> 3 via subclasses:
adult pacemaker neuron, LNv neuron,
DN1 neuron
Fix: walk (primary)<-[:SUBCLASSOF*0..]-(sub:Class) before binding the
Cluster match, with a `WITH DISTINCT primary, c, ds` step before the
pub gather so DAG-multi-path doesn't duplicate pubs across rows.
Same shape as v1.12.8's ListAllAvailableImages fix; the
INSTANCEOF-needs-Owlery caveat ([[vfb_neo4j_instanceof_semantics]])
doesn't apply here because Clusters bind to Classes via
composed_primarily_of, not the leaf-only INSTANCEOF path.
Verified against pdb for six test cases:
FBbt_00006048 pacemaker neuron was 0 -> 3 clusters, 1 dataset
FBbt_00100163 adult pacemaker neuron 3 clusters, 1 dataset
FBbt_00004046 LNv neuron leaf 1 cluster (no regression)
FBbt_00003629 DN1 neuron leaf 1 cluster (no regression)
FBbt_00003748 medulla 0 (no false hits)
FBbt_00003624 adult brain (root) 0 (big walk safe)
All sub-0.4s cold. No __version__ bump.1 parent 6cdba4f commit 3ac5787
1 file changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4182 | 4182 | | |
4183 | 4183 | | |
4184 | 4184 | | |
4185 | | - | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
4186 | 4196 | | |
4187 | 4197 | | |
4188 | 4198 | | |
4189 | 4199 | | |
4190 | | - | |
4191 | | - | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
4192 | 4203 | | |
4193 | | - | |
| 4204 | + | |
4194 | 4205 | | |
4195 | 4206 | | |
4196 | 4207 | | |
4197 | | - | |
| 4208 | + | |
4198 | 4209 | | |
4199 | 4210 | | |
4200 | 4211 | | |
4201 | 4212 | | |
4202 | 4213 | | |
4203 | | - | |
| 4214 | + | |
| 4215 | + | |
| 4216 | + | |
4204 | 4217 | | |
4205 | 4218 | | |
4206 | 4219 | | |
| |||
0 commit comments