I want to create a class hierarchy of the classes in an ontology using OWL API, similar to what you might see if you loaded an ontology in a tool such as Protege.
An example of how to do this may be found here: http://sourceforge.net/p/owlapi/mailman/message/27600103/.
As you can see, it seems difficult to reproduce the Protege hierarchy precisely using OWL API, and I am wondering if there is an example which will reproduce Protege's behaviour or if the fundamental reasons for not being able to do so may be clarified so an alternative approach may be found. I have had similar problems to the author of the post above, in that I can't seem to consistently reproduce the hierarchy shown by Protege by recursively going through the classes and subclasses, starting at owl:Thing, in order to create the full class hierarchy.
I need to:
- Create not only the class hierarchy structure of the top level ontology being parsed, but also show the hierarchical relationships with classes in dependent ontologies, as Protege does. Protege shows the classes in the top level ('active') ontology in bold, with classes taken from dependent ontologies in normal print.
- Create the hierarchy consistent with that shown by Protege for the same active ontology. I am assuming the hierarchy shown by Protege is correct?
I am happy to post code snippets and examples if desired, please do ask.