[Pellet-users] how to load a owl file from the local computer system?

lijiang river607 at hotmail.com
Tue Feb 17 12:04:00 UTC 2009


hallo, everyone ,

I have a problem when I load a owl file from my local computer system.Why?

 

Code is like so:

 

public final static void main(String[] args) throws Exception  {
  String file = "I:/person.owl";
  
  System.out.print("Reading file " + file + "...");
  OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  OWLOntology ontology = manager.loadOntology(URI.create(file));

  Reasoner reasoner = new Reasoner( manager );
  System.out.println("done.");
  
  reasoner.loadOntology(ontology);
  
  reasoner.getKB().realize();
  reasoner.getKB().printClassTree();

.......}

 

 

Exception in thread "main" org.semanticweb.owl.model.OWLOntologyFactoryNotFoundException: Could not find an appropriate factory to load ontology from I:/person.owl
 at uk.ac.manchester.cs.owl.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:263)
 at uk.ac.manchester.cs.owl.OWLOntologyManagerImpl.loadOntologyFromPhysicalURI(OWLOntologyManagerImpl.java:238)
 at uk.ac.manchester.cs.owl.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:227)
 at OWLAPIExample.main(OWLAPIExample.java:29)

 

 

Is there any problem with my code?

 

Thanks

 

Jiang Li

 

 

_________________________________________________________________
MSN 中文网,最新时尚生活资讯,白领聚集门户。
http://cn.msn.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20090217/1c977d67/attachment.htm 


More information about the Pellet-users mailing list