On 16/01/13 10:05, iman paryudi wrote:
I create ontology using Protege. This ontology is then saved at the same folder 
as the application. And to import the ontology, I use the following code:

m.getDocumentManager().addAltEntry( "http://www.myproject.com/ontologies/myproject.owl";, 
"file:C:/Application/myproject.owl");

Aside:   Use "file:///C:/..." to be strictly accurate.


As you can see, I use full path to indicate the location of the ontology file. 
This is of course become a problem if I save the application at different 
location. My question is how I can write a relative path so that the 
application still working wherever I save the application.
Thanks.

Using "file:myproject.owl" should work.

Jena resolve file: URL relative to the current working directory. This is outside of the "file:" URL spec but quite common.

        Andy


Iman Paryudi


Reply via email to