robot: StackOverflowError with "robot remove"
I tried to remove a BFO class from PATO with robot remove --input pato.owl --term BFO:0000023 --select 'self descendants' --signature true --output pato_removed.owl
but this fails with:
Exception in thread "main" java.lang.StackOverflowError
at java.base/java.util.HashMap.putVal(HashMap.java:624)
at java.base/java.util.HashMap.put(HashMap.java:607)
at java.base/java.util.HashSet.add(HashSet.java:220)
at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:352)
at com.google.common.collect.Iterables.addAll(Iterables.java:352)
at uk.ac.manchester.cs.owl.owlapi.OWLImmutableOntologyImpl.asSet(OWLImmutableOntologyImpl.java:805)
at uk.ac.manchester.cs.owl.owlapi.OWLImmutableOntologyImpl.getAxioms(OWLImmutableOntologyImpl.java:1325)
at uk.ac.manchester.cs.owl.owlapi.OWLAxiomIndexImpl.getSubClassAxiomsForSuperClass(OWLAxiomIndexImpl.java:142)
at uk.ac.manchester.cs.owl.owlapi.concurrent.ConcurrentOWLOntologyImpl.getSubClassAxiomsForSuperClass(ConcurrentOWLOntologyImpl.java:1779)
at org.semanticweb.owlapi.search.EntitySearcher.getSubClasses(EntitySearcher.java:839)
at org.obolibrary.robot.RelatedObjectsHelper.selectClassDescendants(RelatedObjectsHelper.java:2055)
at org.obolibrary.robot.RelatedObjectsHelper.selectClassDescendants(RelatedObjectsHelper.java:2060)
ROBOT version 1.8.3
My assumption is that there are recursive axioms between ChEBI:50906 and BFO:0000023 (equivalence and subclass)
It works when I first remove the chebi role
robot remove --input pato.owl --term CHEBI:50906 --select "self" --signature true --output pato_removed1.owl And afterwards remove all the other things from the result of the first step:
robot remove --input pato_removed1.owl --term BFO:0000023 --select "self descendants" --signature true --output pato_removed.owl
Structure around “role” in PATO:

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (15 by maintainers)
We added
removeandfilterin ROBOT 1.2.0, released December 6, 2018. Only experts should use them, because you need to understand a wide range of OWL concepts. This is the first report of a stack overflow withremove. The “correct” behaviour for “descendants” with named equivalents is not at all clear. I think failing with a warning and documentation is reasonable.I’m open to better suggestions. I don’t particularly want to take a performance hit for checking the graph structure every time, but maybe it’s small?