Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Importing one ontology to another in a java API

samane abdi samane.abdi at
Tue Feb 21 07:15:08 PST 2012

Dear Experts,

I built two ontologies A and B. I want to import ontology B to ontology A
and add "class b" and all its relations and individuals from Ontology B as
a subclass of "class a" from Ontology A. How can I encode this in a java
API(such as Eclipse).

Here is a fragment of my code which does not give me the desired result.

"public static void main(String[] args) throws OntologyLoadException,
URISyntaxException {
 JenaOWLModel owlModel;
//JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModel();
    String DAL2Ontology = "file:///home/A.owl";
owlModel = ProtegeOWL.createJenaOWLModelFromURI(DAL2Ontology);
 //String medicalOntology =
//if you want to use a custom prefix for the namespace of the imported
ontology, uncomment the following line
 owlModel.getNamespaceManager().setPrefix(new URI("file:///home/B.owl#"),

//create the ImportHelper
 ImportHelper importHelper = new ImportHelper((JenaOWLModel)owlModel);

//this is the URI from where your ontology is created
 //URI importUri =
URI importUri2 = URIUtilities.createURI("file:///home/B.owl");
 //add the import (multiple imports can be added here)

try {
    //do the actual import
 } catch (Exception e) {

Can you suggest me a solution or a tutorial for this?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-owl mailing list