Protege code generation and OWL API issues

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Protege code generation and OWL API issues


I'm trying to work with protege generated Java code in eclipse with OWL API.
I've used this approach last year in another project. So I'm reusing that code with newly created ontology and its corresponding protege generated Factory.
I'm facing strange issues. The same code is working with previous ontology but not with new one. I've compared the codes generated by protege for both but they are also same.

So for example,  when I'm trying to display all individuals of a class "Chapter" I'm getting empty results. The output shows "chapter()" as much time as number of chapter individuals are present in my ontology.
While this same code is getting all the instances of a required class correctly in my previous ontology.

Here's my code.

public static void BookEngine() {
String inFile = "BookMin.owl";
try {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology owlOntology = manager.loadOntologyFromOntologyDocument(new FileInputStream(inFile));
BookFactory bookFactory = new BookFactory(owlOntology);

Collection Instances=bookFactory.getAllChapterInstances();
//*********** getAllChapterInstances() is a member function of and it is extending Chapter class*********//
Iterator itr=Instances.iterator();


Can anyone help me sorting the issue? Is there anyone who is working with protege generated code, lately?

protege-user mailing list
[hidden email]