biolink / biolink-model-toolkit

A collection of useful python functions for looking up information and working with the Biolink Model
https://biolink.github.io/biolink-model-toolkit/
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

Are mixins ancestors? #27

Closed cbizon closed 3 years ago

cbizon commented 3 years ago

Given a predicate like "precedes" I want to know what classes can be used for domain and range.

In this case, the domain and range are "occurrent", which is a mixin.

If I call bmt.get_decendants('occurrent'), I don't get e.g. Molecular Activity, which uses "occurrent" as a mixin.

So since sometimes domain will be a mixin and sometimes it won't, it's kind of annoying to handle this generically.

Should bmt.get_descendants('occurrent') return Molecular Activity?

cbizon commented 3 years ago

More proscriptively: inheritance between mixins and non-mixins should be used in get_descendants. One case where this is useful is when a query comes in as a mixin class, and the KP has to work out which of its non-mixin data is a valid response.

sierra-moxon commented 3 years ago

37 and #27 are basically the same issue. Adding comments from #37 here and closing #37.

Now that 'gene or gene product' has become a mixin, our documentation is out of date. Brett Smith noticed that t.get_descendants('gene or gene product') now returns: ['gene or gene product', 'gene product mixin', 'gene product isoform mixin']

It might be helpful to add functionality to the toolkit methods, get_descendents and get_anscestors to allow the user to specify if they want mixins returned as well as parents in the is_a hierarchy.