-
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
Add exclude-tautologies
option for reason command.
#560
Conversation
My two cents. I strongly suggest making true tautologies filtering a possibility but to also make it possible to stick to the faster syntactic heuristics you have already implemented. I lean towards this: --exclude-tautologies all: do the syntactic filter first, and if they dont apply, do the proper check Note on syntactic filter: we should at least add A equivalentTo A, I think.
|
I also lean toward fast by default I might give it a more informative name, |
+1 on structural |
… checked in structural option.
I added the I beefed up the robot/robot-core/src/main/java/org/obolibrary/robot/ReasonOperation.java Lines 443 to 473 in 07e67fb
I've left the default as |
Awesome Jim, i am cool with the solution. I would add though that the syntactic check you currently have is guaranteed to be sound, so keeping it for the ‘all’ case is safe and may radically improve performance (think of all the crap that will be loaded in a reasoner constructor even if the input is zero; data structures allocated with memory etc; this means that doing this for 100K+ axioms can be very costly). Else: I am excited to have this awesome feature! Thanks! |
Btw your structural code is very good and I have no problems. Smart thinking on equivalent classes test :P |
Sorry correction: since you are reusing one empty reasoner: it’s not the many reasoner problem; problem is that the reasoner is likely to cache some trace of the axiom you are testing; that will grow in memory. I would definitely suggest to do the structural pass first no matter what. And in any case: only do the test for subclass equivalent class, and the three assertion axiom types; ignore all other axiom types! |
My argument against this is that the subclass axioms that get filtered out in the structural pass would be a small percentage of all those checked. All the rest would get sent to HermiT anyway. I can also imagine some tautologies for other axiom types. I value the simplicity and consistency of the HermiT mode simply asking HermiT if the axiom is entailed. :-) |
Well, I like the simplicity as well :) since stacking arguments against one another is futile, I recommend taking monarch.owl as a huge benchmark Ontology and try with or without structural pre-check; that should give us a good sense which of the two is right. My main argument is: the outcome of with or without structural check leads to the exact same answer in all cases; but the syntactic pre check consumes less memory and is faster than the simple is entailed by call. Any chance we can just make a test? |
One last thing: I would really like this operation to be a filter as well, to weed out asserted tautologies; are there any arguments against having the exact same option on remove of filter? |
I just timed it on a file I had convenient ( |
Convinced. Thanks @balhoff for bearing with me here! |
I agree this could be handy, but let's open another ticket if you want to request it. Whoever implements could refactor what I've done here in order to share code. |
Thanks @balhoff. I've just skimmed this so far but it looks good. Let me know when you want me to review in detail. One question at this point: Why hardcode HermiT for the |
Various reasoners don't support the Please go ahead and review—I won't be making any more changes unless you conclude that you want to change the default mode from |
I think the Elk version will just fail if you try to use it (isEntaileBy method not implemented), and since you check against the empty ontology it makes sense to use the complete approach anyways.. so if you wanted to classify with elk and use hermit for tautology removal, it would make it quite complicated I think ! |
Whoops Jim beat me. |
robot-command/src/main/java/org/obolibrary/robot/ReasonCommand.java
Outdated
Show resolved
Hide resolved
@balhoff We're hoping to make a point release soonish. Other than the minor changes requested, is this ready to merge? |
@jamesaoverton I addressed the change requests, so this is ready for you and @beckyjackson to check. |
Ok, all @beckyjackson and my comments have been addressed. I'll merge this and we'll make a point release soon. Thanks @balhoff ! |
@jamesaoverton @balhoff I just bumped up ROBOT to 1.4.2 for DO in the Makefile. It seems like these changes now logs errors for all axioms with a deprecated subject (including annotation assertion axioms), of which DO has many. The Travis build fails with:
I resolved this by using a custom I'm sorry I didn't catch this sooner. |
When using this new option or not? I tested 1.4.2 on OBI and MRO and didn’t notice extra log noise. |
Is this a confirmed issue? I am itching to upgrade, but I want to be sure my travis jobs wont be failing because of this.. Many release pipelines rely on travis+robot now and I cant test them all :/ |
Now I do see the problem with OBI, so it's a confirmed issue. |
I don't think the problem is caused by this PR. I've opened a new issue: #567 |
This fixes #173. Two things to maybe discuss before merging:
false
. This is just to maintain current behavior. However I think most people consider the current behavior to be a bug. I would prefer to maketrue
the default, but this is less conservative.X SubClassOf owl:Thing
,owl:Nothing SubClassOf X
,X SubClassOf X
). @matentzn had proposed a more principled approach where any axiom that is not a subclass axiom is checked by seeing if it is entailed by a reasoner on an empty ontology. I left this out for now, but it could be easily added. It occurred to me that we can always use HermiT for this, since it is reasoning on the empty ontology, not the input ontology. But I don't know how much of a performance hit it would be to run axioms through that query.