Hi Ahsish,

On 06/11/12 11:47, ashish nijhara wrote:
I am a novice to the Jena API. I would like to read an ontology as depicted
in the code below:

The problem is the following:
1.   the ontology is not hosted on the web currently and have a local copy.
    I added the alt entry as depicted in the code below to address this.
This is A.owl in the below code.
2.  Ontology "A" has a direct import to Ontology "B". I also added the alt
entry for that.

* OntModelSpec spec = OntModelSpec.OWL_DL_MEM;*
* spec.getDocumentManager().addAltEntry("www.example.com/A.owl",*
* "file:D:/ontology/A.owl");*
* spec.getDocumentManager().addAltEntry("www.example.com/B.owl",
"file:D:/ontology/B.owl");*

This should be the full URI, *exactly* as it appears in the source code that you are reading. So I would have expected:

  .addAltEntry( "http://www.example.com/B.owl";,
                "file:D:/ontology/B.owl");

assuming that you have in your source code:

  <>
    a owl:Ontology ;
    owl:imports "http://www.example.com/B.owl"; .


By the way, I don't use Windows, but I think you'll find that the alternate file URL will be more robust if you make it an absolute URL, not relative. So:

  "file://D:/ontology/B.owl"

Ian

Reply via email to