Commit e822f37
committed
get_instances: resolve subclass closure via Owlery, not direct INSTANCEOF
The previous Cypher used a single-step
(i:Individual:has_image)-[:INSTANCEOF]->(p:Class {short_form: $id})
which only sees individuals *directly* typed as the queried class. For
any parent class (e.g. FBbt_00007484 'mushroom body intrinsic neuron',
whose individuals are typed as Kenyon cell, gamma Kenyon cell, etc.)
the query returned 0 rows even though SOLR has dozens of image entries
on file. v2 (and tester) reported ListAllAvailableImages empty for
mushroom body intrinsic neuron, larval Kenyon cell, neuron root, etc.
Switch to the canonical VFBquery idiom: ask Owlery for instance IDs
matching the OWL class expression first, then fetch image metadata
from Neo4j for those specific IDs. Owlery's reasoner handles the
subclass closure with proper OWL semantics (equivalence classes,
defined classes, etc.) — matching how the Neurons*Here family,
ImagesThatDevelopFrom, and TractsNervesInnervatingHere already work
via _owlery_query_to_results(query_instances=True).
Side benefit: the per-row 'parent' column now reports the actual
class each instance is typed as (often a subclass of the queried
class) rather than the queried class itself — better for v2 display.
No test changes needed; existing tests on FBbt_00003748 (medulla)
still pass — count may go up because subclasses are now included.1 parent b521a0b commit e822f37
1 file changed
Lines changed: 45 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2051 | 2051 | | |
2052 | 2052 | | |
2053 | 2053 | | |
2054 | | - | |
2055 | | - | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
2056 | 2065 | | |
| 2066 | + | |
2057 | 2067 | | |
2058 | 2068 | | |
2059 | 2069 | | |
2060 | 2070 | | |
2061 | 2071 | | |
2062 | | - | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
2066 | | - | |
2067 | | - | |
2068 | | - | |
2069 | | - | |
2070 | | - | |
2071 | | - | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
2072 | 2097 | | |
2073 | | - | |
| 2098 | + | |
2074 | 2099 | | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
2075 | 2105 | | |
2076 | | - | |
| 2106 | + | |
2077 | 2107 | | |
2078 | 2108 | | |
| 2109 | + | |
2079 | 2110 | | |
2080 | 2111 | | |
2081 | 2112 | | |
| |||
0 commit comments