Monday, May 25, 2015

Bioclipse 2.6.2 with recent hacks #3: using functionality from the OWLAPI

Update: if you had problems installing this feature, please try again. Two annoying issues have been fixed now.

Third in this series is this post about the Bioclipse plugin I wrote for the OWLAPI library. This manager I wrote to learn how the OWLAPI is working. The OWLAPI feature is available from the same update site as the Linked Data Fragments, so you can just follow the steps outlined here (if you had not already).

Using the manager
The manager has various methods, for example, for loading an OWL ontology:

ontology = owlapi.load(
  "/eNanoMapper/enanomapper.owl", null

If your ontology imports other ontologies, you may need to tell the OWLAPI first where to find those, by defining mappings. For example, I could do before making the above call:

mapper = null; // initially no mapper
mapper = owlapi.addMapping(mapper,
mapper = owlapi.addMapping(mapper,
  "" + 

I can list which ontologies have been imported with:

imported = owlapi.getImportedOntologies(ontology)
for (var i = 0; i < imported.size(); i++) {

When the ontology is successfully loaded, I can list the classes and various types of properties:

classes = owlapi.getClasses(ontology)
annotProps = owlapi.getAnnotationProperties(ontology)
declaredProps = owlapi.getPropertyDeclarationAxioms(ontology)

There likely needs some further functionality that needs adding, and I love to hear about what methods you like to see added.