java - Protege OWL API loading ontologies with URI -


i'm working protege owl api in java program , having problem loading ontologies. when try uri, works. however, when try use local path on computer, doesn't work.

 package test;   import edu.stanford.smi.protegex.owl.protegeowl;  import edu.stanford.smi.protegex.owl.jena.jenaowlmodel;   public class  testload {     public static jenaowlmodel model =null;     public static string uri="http://protege.cim3.net/file/pub/ontologies/travel/travel.owl";               // change uri "c:/users/sara/desktop/travel.owl";       public static void main(string[] args)      {         try         {             model=protegeowl.createjenaowlmodelfromuri(uri);             system.out.println("success");         }         catch (exception exception)         {                system.out.println("error");         }      }  } 

the string you're using not complete uri because c: not protocol. prefix string file:///and should better results.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -