Skip to content

Prune non-relevant taxa from taxon-specific subsets. - #3751

Merged
gouttegd merged 1 commit into
masterfrom
prune-ncbitaxon-from-taxon-specific-subsets
Aug 13, 2026
Merged

Prune non-relevant taxa from taxon-specific subsets.#3751
gouttegd merged 1 commit into
masterfrom
prune-ncbitaxon-from-taxon-specific-subsets

Conversation

@gouttegd

@gouttegd gouttegd commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

The method that generates the taxon-specific subsets (or "views") leaves the entire NCBITaxon:* tree untouched. For example, a taxon-specific subset still contains the same NCBITaxon:* tree than the entire Uberon ontology.

As a result, general class axioms (GCAs) that are completely irrelevant to the taxon for which the subset is generated are still present in the subset.

This PR updates the pipeline that creates the taxon-specific subsets so that the NCBITaxon:* is pruned of all the non-relevant taxa (all the taxa that are neither ancestors nor descendants of the taxon for which the subset is generated).

Partially fixes #3748

The method that generates the taxon-specific subsets (or "views") leaves
the entire NCBITaxon:* tree untouched. For example, a taxon-specific
subset still contains the same NCBITaxon:* tree than the entire Uberon
ontology.

As a result, general class axioms (GCAs) that are completely irrelevant
to the taxon for which the subset is generated are still present in the
subset.

This commit updates the pipeline that creates the taxon-specific subsets
so that the NCBITaxon:* is pruned of all the non-relevant taxa (all the
taxa that are neither ancestors nor descendants of the taxon for which
the subset is generated).

Partially fixes #3748
@gouttegd
gouttegd requested a review from matentzn as a code owner August 9, 2026 11:25
@gouttegd gouttegd self-assigned this Aug 9, 2026
@ai4c-reviewer

ai4c-reviewer Bot commented Aug 9, 2026

Copy link
Copy Markdown

Claude finished @gouttegd's task in 2m 0s —— View job


Claude's Review Progress

  • Gather context (diff, related files, issue Taxon-specific ontology generation #3748)
  • Understand the request (review PR)
  • Review Makefile / uberon.Makefile / uberon-odk.yaml changes
  • Check OBO/ODK conventions preserved
  • Post review summary and inline comments
  • Submit PR review status

Review checklist

  • Hierarchy and parents are consistent (N/A — no ontology terms touched)
  • Definitions and supporting references look adequate (N/A — no term edits)
  • Obsolete or replacement handling is safe (N/A — no obsoletions)
  • OBO and ODK conventions appear preserved
  • No obvious CI, auth, or workflow regression

Summary

This is a small, mechanical, well-targeted change that directly fixes the problem reported in #3748 (taxon-specific "views" retaining GCAs for irrelevant taxa, e.g. rodent-specific part_of GCAs leaking into the human-view subset).

Changes:

  • src/ontology/uberon.Makefile:892 — adds --prune-taxa to the create-species-subset invocation used to build subsets/%-view.owl.
  • src/ontology/uberon-odk.yaml:140 and src/ontology/Makefile:13,186 — bump the uberon-robot-plugin dependency from 0.5.00.5.1 and update the corresponding CONFIG_HASH, consistent with a normal ODK-managed config regeneration.

I verified against the upstream obophenotype/uberon-robot-plugin repository that:

  • Release 0.5.1 was published today and its changelog states exactly: "New option --prune-taxa in the create-species-subset command to remove from a taxon-specific subset all the NCBITaxon:* classes that are not relevant for the subset."
  • The implementation (SpeciesSubsetCommand.java, merged via obophenotype/uberon-robot-plugin#1) computes the set of NCBITaxon:* classes under the "cellular organisms" root (NCBITaxon:131567) that are neither ancestors nor descendants of the target taxon, and removes them from the subset. This logic is sound and matches the stated intent (it also correctly excludes the reasoner's top/bottom entities from removal).
  • The new flag is correctly threaded into the Makefile recipe at the same indentation/continuation style as the other options, so the generated subsets/%-view.owl / %-tags.ofn rule remains syntactically valid.

This is only a partial fix for #3748, as noted in the PR description (it addresses the leftover NCBITaxon:* classes/GCAs, not necessarily every aspect of taxon-specific generation), which is reasonable scope for a single PR.

No ontology terms (uberon-edit.obo) are touched, and no .github/.claude workflow files are touched, so there is no CI/auth regression risk. I don't see any issues to flag.

Recommendation: Approve.

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Small, well-targeted fix for #3748 (taxon-specific subsets retaining GCAs for irrelevant NCBITaxon classes). The --prune-taxa flag and plugin version bump (0.5.0 -> 0.5.1) are correctly wired into the Makefile, and I verified against the upstream uberon-robot-plugin release/PR that the new option's implementation correctly restricts pruning to non-ancestor/non-descendant NCBITaxon classes. No ontology terms or workflow files are touched. Approving.

@gouttegd

gouttegd commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

No obvious CI, auth, or workflow regression

You have to love the confidence of the large crap generator that can say that even before the CI workflow has finished to run…

@matentzn matentzn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume you checked the diff on subsets/human-view.owl for example manually to convince yourself the change works :)

--taxon $(TAXON_ID_$*) \
--strategy $(TAXON_SUBSET_STRATEGY) \
--reasoner ELK \
--prune-taxa \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are never_in_taxon axioms pointing at removed taxa dropped as well?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No. This is because the axioms involving never_in_taxon are annotation assertion axioms, not logical axioms (remember that never_in_taxon is an annotation property, not an object property), so the OWLAPI’s OWLEntityRemover will not remove any such axiom even if it happens to point to an entity to remove (the annotation will remain, with a IRI value pointing to something that exists outside of the ontology).

I could add code behind the --prune-taxa option to explicitly also remove the annotation assertion axioms, but I think keeping those annotations is in fact a good thing.

@gouttegd
gouttegd merged commit 1d91869 into master Aug 13, 2026
13 checks passed
@gouttegd
gouttegd deleted the prune-ncbitaxon-from-taxon-specific-subsets branch August 13, 2026 10:53
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.

Taxon-specific ontology generation

2 participants