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 can I read an OWL file

thanh b inh thanh_binhbk at yahoo.com
Tue Apr 17 06:01:46 PDT 2007


Hello, everybody!
I have tried many time the code here to read an OWL
file, but it hasn't worked. Here is the code :

public class Test 
{
	public static void main(String[] args) 
	{
		JenaOWLModel owlModel;
	    try {
	    	File  f =  new File(
"C:\\setup\\DoAn\\owl\\pizza.owl");
	    	System.out.println(f.exists());
	    	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) {
			e.printStackTrace();
		}
	}

and here is the errors on console screen : 

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.createJenaOWLModelFromInputStream(Unknown
Source)
	at Test.main(Test.java:35)

I have tried some other ways, but it has not worked,
too. I really need your help ! Thank you very much
Best regards


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the protege-owl mailing list