Improve HGNC export - #486
Merged
Merged
Conversation
cthoyt
marked this pull request as ready for review
February 20, 2026 09:41
cthoyt
added a commit
that referenced
this pull request
Feb 22, 2026
Motivated by biopragmatics/bioregistry#1811, follow-up to #486. This PR adds a function that can be used to search all terms in an ontology, identify external references that weren't explicitly declared as a class in the ontology, and add a declaration. All terms declared this way get put under an ontology-wide _ad hoc_ grouping term, which in turn has children corresponding to each prefix for which undeclared classes were found. For example, in HGNC, the ontology-wide grouping term is http://purl.obolibrary.org/obo/hgnc#aux, under which are terms like http://purl.obolibrary.org/obo/hgnc#aux-ec (fo Here's how it looks for HGNC: <img width="1019" height="961" alt="Screenshot 2026-02-22 at 17 30 02" src="https://github.com/user-attachments/assets/77592273-eb81-45ca-bd73-951ddb471d1c" /> There are a few caveats to this approach: 1. Axiom injection (馃し) 2. Doesn't get nice metadata like labels 3. Weird looking labels because there are no labels (will be improved with protegeproject/protege#1322)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivated by biopragmatics/bioregistry#1811
This PR does the following:
This does not solve the more generic issue that PyOBO exports OFN and OWL products using IRIs instead of stringified CURIEs in annotations. This means that if the IRI isn't defined, then Protege tries its best to guess a label, and which pollutes the class list when exploring.