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
Post a Comment