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

Samuel Owen tin2_k47_dhbkhn at yahoo.com
Tue Apr 17 03:50:31 PDT 2007


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.createJenaOWLModelFromInputStream(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 outnew cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070417/9a6354d5/attachment.html>


More information about the protege-owl mailing list