Inferencing with Protégé

From OSF Wiki
Jump to: navigation, search


Protégé 4 offers a number of reasoning engines in its standard distribution, and other third-party plug-ins can introduce more. This brief guide tells you how to invoke these reasoning engines for inferencing and other purposes.

There are also some reasoner Preferences settings you may want to check; see the Reasoner tab in the Preferences popup (see further the basic editing guide).

Invoking a Reasoner

To invoke a reasoner, you must turn it on via the Reasoner main menu option in Protégé. Choosing this menu option presents a listing of all reasoners currently available to your installation:

P reasoner menu.png

For Pellet, you may want to choose the Pellet (incremental) option, which will then automatically check the consistency of the ontology each time a entity change is made to the ontology.

Alternatively, you need to invoke the Classify ... option on the Reasoner main menu to run the reasoner each time you check the system.

Using the Reasoner

Besides invoking the reasoner and telling it to classify, you must also turn on showing inferencing, which is done via this lower right checkbox on the Protégé interface:

P reasoner.png

When done, the inferred classes and other aspects are also now shown on the interface. Note these inferred items, as shown above, also have a different background than what you have specifically entered (asserted) in the ontology.

Interpreting and Correcting Results

A reasoner checks for hierarchies (subsumption), domains, ranges, conflicting disjoint assertions, and the like. In addition to these checks, the reasoner also calculates the resulting inferred hierarchy and other properties.

A simple example is when a property also has an inverse property. You need only assert the first property; the reasoner will add an inferred assertion for the inverse. It is in this manner that a relatively few specific assertions in the ontology can "spread out" to infer connections throughout the entire ontology structure.

If, in making these inferences the reasoner finds consistency errors, a red triangle error flag is put on the interface in the upper right corner:

P reasoner error.png

Double-clicking on this icon will cause an error reporting popup to appear, with the initiating error shown at the top of the listing:

P reasoner error popup.png

Unfortunately, this error message is not too informative (see next). You must also manually clear the errors via that button (see highlight) to remove the red triangle error icon from the Protégé interface.

Doing More with the Reasoner

For more interpretation about what these errors are and how to correct them, you will unfortunately need to go outside of the Protégé environment. One way to do so is via Pellet, one of Protégé's built in reasoners.

First, you need to download and install Pellet on your local machine. Go to: http://clarkparsia.com/pellet/download/pellet-2.2.2.

Then, from within the directory where Pellet is now installed, you need to run a command line check (substituting your actual ontology file name and subdirectory location):

pellet consistency "C:\...\MyOntology.owl"

You will then get a results set that looks something like:

P reasoner error dos.png

You will need to have some basic OWL 2 background in order to properly interpret these results.

Once interpreted, you will need to correct your ontology, clear the errors (and icon), and re-run the reasoner again until the error icon no longer appears.

For More Information

For more information about the invoking and use of reasoners and inferencing, see Section 4.9 in the Protégé manual. There is also much general information throughout the manual on how to properly specify entities to best leverage reasoning. This manual is really an essential basis to understand inferencing and reasoning with your ontologies.

You may also want to check out the general Protégé category for other use guides on this wiki.