I find the new INDIRECT_ prefix to obtain indirect relations very useful and exciting.
From the documentation I understand I cannot perform the inverse where I would query for all subjects which satisfy a certain property value. That is to say, the INDIRECT_ prefix allows me to perform something of the like of the following SPARQL query:
For individuals, you can use inverse properties. If the inverse property does not exist, you can create it in a separated temporary ontology, to avoid polluting the main one.
For classes (as your example suggests), it is more complicated. For a formal and logical point of view, one cannot infer restriction on inverse properties from restrictions on a property. For example, "nucleus is part of some cell" does not imply that "cell has part some nucleus": in fact, all cells do not have a nucleus, while all nucleus belong to a cell.
However, it is still interesting in some situations, I agree. Owlready has the Class.inverse_restriction(property) class method that follows restriction in reverse direction. But it does not support indirect relations. Maybe what you would need is a "indirect_inverse_restriction()" method ?
Indeed going for inverse properties makes seldom sense.
In this very case I only want to obtain all cells which are positive for some marker (obo:RO_0002104) and obviously the properties are spread a bit throughout the whole taxonomy, though looking at the parent classes is probably enough in most cases.
The Sparql query I gave does the work (at least partly) but it is notable that it runs very slowly when using the internal rdflib parser. A proper graph server (virtuoso, jena, etc) is able to handle the query in a much more efficient manner (sub-second) so there is some space there.
Thanks for your help and the nice library once again!