Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] problem with the creation of jena model

chandu mohan.kodali at
Mon Apr 2 07:04:49 PDT 2007

To create a model and print the instances created by user-->

import java.util.*;
import edu.stanford.smi.protegex.owl.*;
import edu.stanford.smi.protegex.owl.model.*;
//import edu.stanford.smi.protegex.owl.jena.*;

class First
    public static void main(String[] args) throws Exception
        File file = new File("thesis.owl");

        String uri = (file.toURI()).toString();

        OWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);
        //JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModel();


        Collection classes = owlModel.getUserDefinedOWLNamedClasses();
        for (Iterator it = classes.iterator(); it.hasNext();) {
            OWLNamedClass cls = (OWLNamedClass);
            Collection instances = cls.getInstances(false);
            System.out.println("Class " + cls.getBrowserText() + " (" +
instances.size() + ")");
            for (Iterator jt = instances.iterator(); jt.hasNext();) {
                OWLIndividual individual = (OWLIndividual);
                System.out.println(" - " + individual.getBrowserText());



This code when run using pizaa.owl or family.swrl.owl files is working
giving me the model output. But when i use the thesis.owl created by a
fellow student over here, i am not finding any output.
And the warning goes like this : the system cannot find the ontology

and the same for swrlb import also.
It is asking to create the repository but its just a warning and if ignored
the rest of the code works fine with other OWL files but when I use the
thesis.owl file which i attached with this mail, i am unable to get any
output. I cannot make head or tail out of anything right now. Is there any
problem with the creation of OWL file I wonder?

I am working on eclipse. I am trying to create a browser so that users can
browse through the ontologies. (not an editor)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thesis.owl
Type: application/octet-stream
Size: 123016 bytes
Desc: not available
URL: <>

More information about the protege-owl mailing list