-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackOverflowError with "robot remove" #976
Comments
Just to make @drseb excellent analysis a bit shorter:
Has nothing to do with this! While this is a legitimate bug here, it reminds me again why we should not include equivalent classes in our ontology releases.. ever! |
That's a very radical statement. Definitely needs discussion given that some downstream resources that may expect these to be present. Obviously this is not the right place to discuss. Can you find a place where we can discuss this? |
@beckyjackson Please see if you can reproduce, and if there's any smallish change we can make to break such a loop. |
@jamesaoverton do we expect If I fix the stack overflow error, ChEBI "role" gets removed as well, which might be what the user wants, but I'm not sure if it's technically the correct behaviour. |
Hm both ways are justifiable but my feeling is that the cleaner way is if descendants does not include equivalents.. |
So |
I dont want to answer this question as I feel like an ontology traitor, but no, my guess is that since ROBOT remove is supposed to operate on assertions, I would not walk down the CHEBI tree.. but.. Its.. odd, I agree. |
@matentzn I agree. I think it makes sense to only remove those if we had run the reasoner first to assert that they are also descendants of BFO role. I'd like to get @jamesaoverton's opinion on this, as it might not be what users expect. Is there anybody else who might have a stake in this? |
What if ROBOT just fails with a warning, telling the user to merge the named equivalents or something? |
@jamesaoverton I'm worried that might confuse some users, if they don't know how to merge terms. Then they're stuck unable to use the file. Maybe I'm overthinking it though, and our non-power-users wouldn't be doing this sort of stuff anyway. |
This is exactly why we have defined profiles of OBO format. These profiles are useful outside the scope of OBO format https://owlcollab.github.io/oboformat/doc/obo-syntax.html#6.2 if the structure conforms to OBO-Basic, then naive graph walking is guaranteed to terminate. If the structure doesn't conform then naive walking is not guaranteed to terminate. Furthermore, certain operations can be more simply defined if the input is constrained to certain profiles. |
We added 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? |
I have used Tarjan's algorithm in the past for cycle detection Tarjan is O(V+E), here's a java implementation: https://github.com/asad/GraphMST/blob/master/src/algorithm/Tarjan.java but this suggests a nested DFS approach may be faster: There are other cases where cycle detection over the full existential graph would be useful for QC, e.g. obophenotype/uberon#1829 |
I may be in the minority here, but I think ROBOT should follow OWL semantics and not worry about graph crawling. The default behaviour should be to remove subclasses of both. The onus should be on users to understand this behaviour - which they should if they know enough to use equivalence between named classes in their ontology. At most, the command should emit a warning. Suggesting that users should always merge makes no sense to me. How could PATO merge BFO role and CHEBI role? But these kind of named equivalence bridges can be very useful in reasoning. Arguments about producing release products that lack named equivalence or general OBO policy about named equivalence are separate issues, independent of ROBOT. |
I am not a power-user and I think it is a quite normal to try to make a huge ontology such as UBERON more digestible by removing everything that is unnecessary in a particular context or a particular task. Regarding what to include: I wanted to get rid of everything about role and I would have included ChEBI and BFO role in the deletion. |
Looking at the
In this case user asks ROBOT to remove BFO:0000023 "self descendants". By (3), CHEBI:50906 is a descendant, and so CHEBI:50906 and all its descendants should be selected and then removed. @beckyjackson can you make a PR with this behaviour, please? Then we can discuss the implications. If only axiom (1) and not (2) and (3) were asserted, then I would expect "self descendants" would not select CHEBI:50906. I would expect "equivalents" to include CHEBI:50906, so "self equivalents descendants" would remove CHEBI:50906 and its descendants. I guess (1) implies (2) and (3), but ROBOT remove/filter do not run a reasoner, they just work with the asserted axioms. |
@drseb Does #979 work for you? You can download a JAR for testing here: https://build.obolibrary.io/job/ontodev/job/robot/job/976-fix/lastSuccessfulBuild/artifact/bin/robot.jar |
I just tested it as well and it does what it should with the PATO. |
@jamesaoverton it ran with no errors and I see the role-branch gone. thanks. |
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:
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:
The text was updated successfully, but these errors were encountered: