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] How to read an OWL file nade by protege

Timothy Redmond tredmond at stanford.edu
Tue Apr 17 11:19:10 PDT 2007


This code works so you need to tell us something more about how you  
are trying to run this.  The recommended setting would be a classpath  
that includes protege.jar and the protege owl jars and setting the  
protege.dir system variable to the home directory of Protege.  I ran  
this with the unix shell script

#!/bin/sh

CP=.:${PROTEGE_HOME}/protege.jar
for i in ${PROTEGE_HOME}/plugins/edu.stanford.smi.protegex.owl/*.jar
do
   CP=${CP}:$i
done
java -cp ${CP} -Dprotege.dir=${PROTEGE_HOME} owl.Test06


-Timothy


On Apr 17, 2007, at 3:50 AM, Samuel Owen wrote:

> I am trying to read an OWL file, here is the code :
> public class Test
> {
> public static void main(String[] args)
> {
> JenaOWLModel owlModel;
> String uri = "http://www.co-ode.org/ontologies/pizza/2005/10/18/ 
> pizza.owl#";
> try {
> File f = new File( "C:\\setup\\Do An\\owl\\pizza.owl");
> FileInputStream fin = new FileInputStream(f);
> owlModel = ProtegeOWL.createJenaOWLModelFromInputStream(fin);
> java.util.Iterator it = owlModel.getUserDefinedOWLNamedClasses 
> ().iterator();
> while(it.hasNext())
> {
> System.out.println(((OWLNamedClass)it.next()).getBrowserText());
> }
> } catch (Exception e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
> }
>
> But I received the following errors :
> INFO: Loading triples
> Exception in thread "main" java.lang.NoSuchMethodError:  
> org.apache.xerces.parsers.SAXParser.<init>(Lorg/apache/xerces/xni/ 
> parser/XMLParserConfiguration;)V
> at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser$MySAXParser.<init> 
> (RDFXMLParser.java:55)
> at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.create 
> (RDFXMLParser.java:82)
> at com.hp.hpl.jena.rdf.arp.ARP.<init>(ARP.java:101)
> at  
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.createARP 
> (Unknown Source)
> at  
> edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples 
> (Unknown Source)
> at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run 
> (Unknown Source)
> at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run 
> (Unknown Source)
> at edu.stanford.smi.protegex.owl.jena.JenaOWLModel.load(Unknown  
> Source)
> at  
> edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromInputSt 
> ream(Unknown Source)
> at Test.main(Test.java:34)
>
> I can't understand why? Could you explaint to me, please ? How can  
> you read such an OWL file?
> Thank you very much !
>
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos.
> _______________________________________________
> 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/20070417/cffda85f/attachment.html>


More information about the protege-owl mailing list