Skip to content

Support self-declared ontology roots#1332

Merged
gouttegd merged 3 commits intomasterfrom
support-ontology-roots-2
Mar 3, 2026
Merged

Support self-declared ontology roots#1332
gouttegd merged 3 commits intomasterfrom
support-ontology-roots-2

Conversation

@gouttegd
Copy link
Copy Markdown
Collaborator

@gouttegd gouttegd commented Mar 3, 2026

This PR adds support for ”self-declared” ontology roots: when an ontology contains http://purl.obolibrary.org/obo/IAO_0000700 annotations, the classes pointed by these annotations are used as the roots of the class hierarchy, instead of owl:Thing.

closes #1184
supersedes #1330 (with a cleaner history)

gouttegd and others added 3 commits March 3, 2026 15:50
Add a menu item, along with the corresponding support in the
ClassHierarchyPreferences, to display only the classes below the
ontology roots (if any) in the class hierarchy.
Even though the AssertedClassHierarchyProvider has a public `getRoots()`
method returning a set of OWL classes (suggesting there can be several
roots), the private code of the provider assumes that there can be only
one root (`owl:Thing`).

This will no longer always be the case when the "display from ontology
roots" option will be enabled, because an ontology may very well declare
more than one root (Uberon, for example, declares two roots). So we must
update the hierarchy provider so that it is ready to deal with a _set_
of roots instead of a single root.
Add a `setDisplayFromOntologyRoots(boolean)` method to the class
hierarchy provider. If called with true, it will attempt to find
self-declared roots in the ontology sets (declared with the IAO:0000700
annotation) and, in the presence of such roots, will use them as the
roots of the hierarchy.

All the DisplayHierarchyFromOntologyRootsAction then has to do is to
call this method whenever the action is performed.
@gouttegd gouttegd self-assigned this Mar 3, 2026
Copy link
Copy Markdown

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, looks good to me!

@gouttegd gouttegd merged commit f829ad9 into master Mar 3, 2026
6 checks passed
@gouttegd gouttegd deleted the support-ontology-roots-2 branch March 3, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for ontology hierarchy roots. (IAO:0000700)

2 participants