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
Tue Apr 3 07:34:52 PDT 2007


Ok.Will add the repositories part to the code.

If the Ontology is large, the triples are around 2 Lakhs, then the protege
is unable to create the Owlmodel. It is giving the Java virtual memory
error. How do we traverse such large ontologies without creating the model
beforehand?

On 4/2/07, Timothy Redmond <tredmond at stanford.edu> wrote:
>
>
>
> I think that the problem is that Protege OWL is not finding some of its
> initialization files.  When I ran your code with the jvm option
>
>     -Dprotege.dir=`path to protege installation`
>
> your code ran fine except for a class cast exception at the line
>
>         OWLIndividual individual = (OWLIndividual) jt.next();
>
> When I ran it without this option I got lots of errors related to the
> fact that Protege could not find its default repository files and was
> thus unable to lookup with swrl import.
>
> -Timothy
>
>
> chandu wrote:
> > 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)
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > protege-owl mailing list
> > protege-owl at lists.stanford.edu
> > https://mailman.stanford.edu/mailman/listinfo/protege-owl
> >
> > Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
> >
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070403/267d471b/attachment.html>


More information about the protege-owl mailing list