Skip to content
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

Throw exception on reasoner errs, and test RBox for incoherency #133

Merged
merged 2 commits into from
Jan 6, 2017

Conversation

cmungall
Copy link
Contributor

@cmungall cmungall commented Jan 6, 2017

Note that the output is somewhat unfriendly, e.g.

$ robot materialize -i ./robot-core/src/test/resources/incoherent-rbox.owl 
ERROR There are 1 unsatisfiable properties in the ontology.
ERROR     unsatisfiable property: http://x.org/Q
org.obolibrary.robot.exceptions.IncoherentRBoxException
        at org.obolibrary.robot.ReasonerHelper.validate(ReasonerHelper.java:98)
        at org.obolibrary.robot.MaterializeOperation.materialize(MaterializeOperation.java:132)
        at org.obolibrary.robot.MaterializeOperation.materialize(MaterializeOperation.java:85)
        at org.obolibrary.robot.MaterializeCommand.execute(MaterializeCommand.java:168)
        at org.obolibrary.robot.CommandManager.executeCommand(CommandManager.java:242)
        at org.obolibrary.robot.CommandManager.execute(CommandManager.java:177)
        at org.obolibrary.robot.CommandManager.main(CommandManager.java:135)
        at org.obolibrary.robot.CommandLineInterface.main(CommandLineInterface.java:54)
usage: robot [command] [options] <arguments>
 -h,--help                  print usage information
 -noprefixes                do not use default prefixes
 -p,--prefix <arg>          add a prefix 'foo: http://bar'
 -P,--prefixes <arg>        use prefixes from JSON-LD file
 -V,--version               print version information
 -v,--verbose               increased logging
 -vv,--very-verbose         high logging
 -vvv,--very-very-verbose   maximum logging
 -x,--xml-entities          use entity substitution with ontology XML
                            output
commands:
 help             print help for command
 annotate         annotate ontology
 convert          convert ontology
 diff             find the differences between two ontologies
 export-prefixes  export prefixes to a file
 extract          extract terms from an ontology
 filter           filter ontology axioms
 materialize      materialize ontology
 merge            merge ontologies
 query            query an ontology
 reason           reason ontology
 reduce           reduce ontology
 relax            relax ontology
 template         build an ontology from a template
 unmerge          unmerge ontologies
 validate-profile validate ontology against an OWL profile

but being unfriendly is better than silently progressing with an incoherent ontology

Includes incoherent OPs in logical tests, fixes #104

Note these two tickets are coupled, so were tackled together.

To handle validation checks a new ReasonerHelper class was created.

This implements

 - inconsistency
 - incoherent TBox (ie unsat classes)
 - incoherent RBox (using probe classes)

Exceptions are thrown on encountering any of these.

Currently there is no way to allow the user to ignore exceptions;
this could in theory be added but would likely be a very bady idea
@cmungall
Copy link
Contributor Author

cmungall commented Jan 6, 2017

@jamesaoverton, @balhoff - does this look OK?

@balhoff
Copy link
Contributor

balhoff commented Jan 6, 2017

+1

1 similar comment
@jamesaoverton
Copy link
Member

+1

@cmungall cmungall merged commit ba27fc4 into master Jan 6, 2017
@balhoff
Copy link
Contributor

balhoff commented Feb 17, 2017

I said it looks okay, but now it's getting in my way. :-) I'm trying to use the expression-materializing-reasoner to materialize the go-graphstore tbox, but getting:

ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_16665
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_17996
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_16664
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_17995
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_16663
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_17994
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_28637
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_30946
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_30948
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_30942
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_30944
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/GO_0031088
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/GO_0031089
ERROR     unsatisfiable: http://purl.obolibrary.org/obo/EMAPA_28631
org.obolibrary.robot.exceptions.IncoherentTBoxException

I feel like this should be ignorable, and we should let the user proceed if they want. The output would still be useful even though I'm not in a position to fix these right now.

@cmungall
Copy link
Contributor Author

cmungall commented Feb 17, 2017 via email

@balhoff
Copy link
Contributor

balhoff commented Feb 17, 2017

Right, I think 2 is better. I looked for it in ROBOT but I guess it's not available. Is this general enough to have in ROBOT?

@jamesaoverton
Copy link
Member

(If I'm understanding correctly) I think that an operation (or option on an operation) to remove disjointness axioms would be a good addition to ROBOT.

@cmungall
Copy link
Contributor Author

cmungall commented Feb 17, 2017 via email

@jamesaoverton
Copy link
Member

Naming is hard, and ROBOT's filter command is not as general as its name implies. Still, I think thatfilter should be positive, as in "these are the things I want to keep". For the proposed operation I'd suggest remove, which would be negative: "these are the things that I don't want to keep". At least that matches the usage in functional programming language, such as Clojure.

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.

test for unsatisfiable ObjectProperties Signaling of fatal/blocking errors
3 participants