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 gmail.com
Mon Apr 2 07:04:49 PDT 2007


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

import java.util.*;
import java.io.*;
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();
        System.out.println(uri);

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

        System.out.println(uri);

        Collection classes = owlModel.getUserDefinedOWLNamedClasses();
        for (Iterator it = classes.iterator(); it.hasNext();) {
            OWLNamedClass cls = (OWLNamedClass) it.next();
            Collection instances = cls.getInstances(false);
            System.out.println("Class " + cls.getBrowserText() + " (" +
instances.size() + ")");
            for (Iterator jt = instances.iterator(); jt.hasNext();) {
                OWLIndividual individual = (OWLIndividual) jt.next();
                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
http://www.w3.org/2003/11/swrl

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: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070402/6293b2e5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thesis.owl
Type: application/octet-stream
Size: 123016 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070402/6293b2e5/attachment.owl>


More information about the protege-owl mailing list