Search Mailing List Archives
[protege-owl] Loading ontology with imports in java with Protege 3.4.4
Ana Rossello Busquet
aros at fotonik.dtu.dk
Thu Jul 29 07:13:14 PDT 2010
I have been working with designing a java application where I load, access and modify my ontology using Protege 3.4.4. Until now I had an ontology containing my OWL Classes and my OWL individuals. I have been loading my ontology into my java program doing this:
FileReader owlFile = new FileReader("M:/MyJessTest/simple-ontology.owl");
JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModelFromReader(owlFile);
Now I decided to separate my OWL Classes and my OWL individuals itno two different ontologies:simple-repository.owl and simple-individuals.owl. simple-individuals.owl imports simple-repository.owl.
So now I want to be able to load these two ontologies in my java program as one JenaOWLModel. How do I do it? I have seen that in OWLAPI they use OWLOntologyManager. However I am not using OWLAPI. Is there an equivalent to this OWLOntologyManager in Protege 3.4.4?
In addition, I would like to be able to save my ontology from my java program. Until now I have been using the following:
File filesave = new File(pathsave);
JenaOWLModel.save(filesave,owlModel.getOntModel(), FileUtils.langXMLAbbrev, myBaseUri , myUri);
But now I want to only save my individuals not classes+individuals. How do I do that?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the protege-owl