Skip to content

Add parents for implicitly declared classes - #488

Merged
cthoyt merged 4 commits into
mainfrom
aux-group
Feb 22, 2026
Merged

Add parents for implicitly declared classes#488
cthoyt merged 4 commits into
mainfrom
aux-group

Conversation

@cthoyt

@cthoyt cthoyt commented Feb 21, 2026

Copy link
Copy Markdown
Member

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:

Screenshot 2026-02-22 at 17 30 02

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 Improve guessing of names聽protegeproject/protege#1322)

@cthoyt
cthoyt marked this pull request as ready for review February 21, 2026 14:36
@cthoyt cthoyt changed the title Group undefined classes Add parents for implicitly declared classes Feb 22, 2026
@cthoyt
cthoyt merged commit 5e0f443 into main Feb 22, 2026
10 checks passed
@cthoyt
cthoyt deleted the aux-group branch February 22, 2026 16:34
cthoyt added a commit to biopragmatics/obo-db-ingest that referenced this pull request Feb 22, 2026
cthoyt added a commit to biopragmatics/obo-db-ingest that referenced this pull request Feb 22, 2026
@matentzn

Copy link
Copy Markdown

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.

From a UI perspective this sounds sane for now, but the problem is that this will fold these metaclasses (they are not real domain classes!) into our ontologies downstream. So when we extract a module we will get these injected classes through the pyobo ingests, and they will end up in our imports unless we explicitly exclude them. I think this is probably not wise, but probably not a desaster especially if these could be materialised by default only in the non-default release product..

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.

2 participants