Add systematic script to find ALL redundant SubClassOf axioms#3551
Add systematic script to find ALL redundant SubClassOf axioms#3551
Conversation
- Creates find-redundant-subclass-axioms.pl to identify terms with redundant SubClassOf axioms that duplicate intersection_of definitions - Detects two types of redundancy: 1. intersection_of: CLASS + is_a: CLASS (same class) 2. intersection_of: RELATION TARGET + relationship: RELATION TARGET (same relation+target) - Found 303 terms with 375 total redundant axioms in current ontology - This addresses the systematic detection requested in issue #3548 @dragon-ai-agent
|
HI @cmungall - looks like you've turned the agent into a Perl Hacker. |
… definitions This systematic edit removes redundant is_a and relationship statements that duplicate what is already expressed in intersection_of definitions across 303 UBERON terms. The redundancy patterns removed are: 1. intersection_of: CLASS + is_a: CLASS (same class redundancy) 2. intersection_of: RELATION TARGET + relationship: RELATION TARGET (same relation+target redundancy) Scripts added: - src/scripts/find-redundant-subclass-axioms.pl: identifies redundant axioms - src/scripts/remove-redundant-subclass-axioms.pl: removes redundant axioms Total redundant axioms removed: 375 Terms affected: 303 Fixes #3548 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
#gogoeditdiff |
Here's a diff of how these changes impact the classified ontology (on -base file):Ontology comparisonLeft
Right
Ontology importsOntology annotationsanterior communicating artery
|
Here's a diff of your edit file (unreasoned)Ontology comparisonLeft
Right
Ontology importsOntology annotations1st arch mesenchyme from neural crest
|
|
Looking at edits diffs - ideally we would see not difference in the reasoned diff and lots in the unreasoned. There are a large number of changes in the unreasoned. However, there are a few differences in the reasoned one that need to be investigated. All changes should be checked in raw file diffs too. |
There was a problem hiding this comment.
Need to work out why this is no longer inferred:

As far as I can tell - all elements are there, but the inference is lost in the edited branch!
One term referenced that is affected by edit:
intervertebral cartilage http://purl.obolibrary.org/obo/UBERON_0011135
Removed
intervertebral cartilage SubClassOf cartilage element
But edit looks harmless
|
Leaving for now as hard to debug |
|
@dragon-ai-agent please "relax" all axioms that use cardinality restrictions. The reason is that even though the is_a is strictly redundant, the reasoners we use simply ignore the axiom rather than rewriting to a simpler form. So for example, originally we had you rewrote as Which is technically correct, but as noted above, we need to preserve all edges when cardinality constraints are used. I suggest one of the following
|
- Removed 60 cardinality restrictions from intersection_of and relationship statements - Types removed: exact cardinality (49), min cardinality (7), min_cardinality underscore variant (2), exactly constraints (2) - Affects anatomical connections, organ membership, structural composition, and spatial adjacency relationships - Added systematic script src/scripts/relax-cardinality-restrictions.pl for future use - Reasoners will now process these axioms instead of ignoring them due to cardinality constraints Addresses issue #3551 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ Cardinality Restrictions RelaxedI've successfully relaxed all cardinality restrictions in the UBERON ontology as requested. Here's what was accomplished: 📊 Results Summary
🔧 Changes MadeAll cardinality restrictions have been systematically removed from:
🛠️ Tool CreatedAdded 📋 Pull RequestCreated PR #3557 with all changes: #3557 ✅ VerificationConfirmed that all targeted cardinality restrictions have been removed. The remaining 3 "cardinality" references in the file are only in comments and use different constraint types ( The reasoners should now properly process these axioms instead of ignoring them due to cardinality constraints. |
|
This PR has not seen any activity in the past month; if nobody comments or reviews it in the next week, the PR creator will be allowed to proceed with merging without explicit approval, should they wish to do so. |
|
#gogoeditdiff |
|
This PR has not seen any activity in the past month; if nobody comments or reviews it in the next week, the PR creator will be allowed to proceed with merging without explicit approval, should they wish to do so. |
|
This PR has not seen any activity in the past month; if nobody comments or reviews it in the next week, the PR creator will be allowed to proceed with merging without explicit approval, should they wish to do so. |

Summary
• Developed a systematic Perl script to find ALL terms with redundant SubClassOf axioms that duplicate intersection_of definitions
• Script identifies 303 terms with 375 total redundant axioms in the current UBERON ontology
• This addresses the systematic detection capability requested in issue #3548
Script Capabilities
The script
src/scripts/find-redundant-subclass-axioms.pldetects two types of redundancy:1. Class Redundancy
intersection_of: CLASS+is_a: CLASS(same class redundancy)2. Relationship Redundancy
intersection_of: RELATION TARGET+relationship: RELATION TARGET(same relation+target redundancy)Key Findings
Total scope of redundancy in UBERON:
This confirms that the redundancy pattern is much more widespread than the initial 5 terms identified in PR #3549.
Usage
Sample Output
Next Steps
This script provides the systematic detection capability requested. The next phase would be to:
Addresses #3548
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com