How to use OWL import with relative paths?

In my OWL file, I import many other files, for example:

<owl:imports rdf:resource="file:/home/noor/Downloads/bbc/Anatidae.rdf"/> <owl:imports rdf:resource="file:/home/noor/Downloads/bbc/Animal.rdf"/> <owl:imports rdf:resource="file:/home/noor/Downloads/bbc/Bird.rdf"/> <owl:imports rdf:resource="file:/home/noor/Downloads/bbc/Chordate.rdf"/> <owl:imports rdf:resource="file:/home/noor/Downloads/bbc/kingdom.rdf"/> <owl:imports rdf:resource="file:/home/noor/Downloads/bbc/Mammal.rdf"/> 

But I cannot control relative paths; all this does not work:

 <owl:imports rdf:resource="file:Anatidae.rdf"/> <owl:imports rdf:resource="file:./Anatidae.rdf"/> 

How to do this with relative paths?

+4
source share
1 answer

Import must point to a URI, not local files, so some tools do not yet support importing from local assets. To process local files, you have the following solutions:

  • A quick fix would be to expose your RDF through a local web server and access them like this (for example, <owl:imports rdf:resource="http://localhost/Chordate.rdf"/> ).

  • If you use Protege to open your OWL file, you can configure the mapping between the actual files and the IRI import in the Active OntologyImport ontology tab.

  • The last solution, if you work with Brain , you can easily upload files one by one without dealing with owl:imports , for example:

    Brain brain = new Brain();

    brain.learn("/home/noor/Downloads/bbc/Bird.rdf");

+3
source

All Articles