no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | owl_reasoners_via_owlapi [2014/06/05 11:38] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Integration of OWL reasoners via OWLAPI ====== | ||
+ | Conventional OWL reasoners like Pellet or HermiT are interfaced via the OWL API. The interface currently supports reasoning about the class ontology, especially the computation of inferred subclasses. The interface code is contained in the package knowrob_common in the module knowrob_owlapi | ||
+ | |||
+ | There is a convenience predicate for calling the subclass-of relation which initializes the OWLAPI interface, copies the current class taxonomy from KnowRob, instantiates the reasoners and returns the inferred subclasses: | ||
+ | |||
+ | ?- owlapi_subclass_of(Sub, | ||
+ | |||
+ | For other inference tasks or more fine-grained control over the interface, one can also call the interface predicates directly | ||
+ | |||
+ | % initialize, load test data | ||
+ | owl_parse(' | ||
+ | | ||
+ | % create OWLAPI interfaces: ontology manager, data factory, create empty ontology | ||
+ | owlapi_manager(OWLManager), | ||
+ | owlapi_datafactory(OWLManager, | ||
+ | owlapi_new_ontology(' | ||
+ | |||
+ | % copy class taxonomy to the OWLAPI ontology | ||
+ | findall(Res, | ||
+ | |||
+ | % create a reasoner based on the current ontology | ||
+ | owlapi_reasoner_hermit($OWLOntology, | ||
+ | | ||
+ | % compute subclasses using the reasoner | ||
+ | owlapi_subClassOf(Sub, | ||
+ | |||
+ | |||
+ | owl_parse(' | ||
+ | |||
+ | owlapi_manager(OWLManager), | ||
+ | owlapi_datafactory(OWLManager, | ||
+ | owlapi_new_ontology(' | ||
+ | | ||
+ | findall(Res, | ||
+ | | ||
+ | owlapi_reasoner_hermit($OWLOntology, | ||
+ | | ||
+ | owlapi_subClassOf(Sub, |