Hi Léonard,
On 23/04/13 07:20, Léonard PETNGA wrote:
Hi Jena Community,

  I have the following questions for you:

*Q1:* How to “convert” OntoFileA.java below into an .OWL file?
Specifically, I would like to extract and store the ontology assembled in
“buildOntology()” in a separate OWL file that I can call/load, access,
modify and reuse in various applications.
Um, why would you? If I understand your question, you want to convert a custom encoding of an ontology, that you have created yourself, into a standard form so that common tools, like Jena, can process it. My question is: why do it this way round? Why not start with an Owl file, and then automatically generate the Java code - if you need it - with Jena's schemagen tool?

*Q2*: I have another ontology “OntoFileB.java” with similar structure as
“OntoFileA.java” (jut replace A by B) that I want to merge with
“OntoFileA.java” into a unique file “OntoMergedFile.java” while preserving
the integrity of initial ontologies. The 2 ontologies do not share any
property or class.  I have imported all 2 java OntoFiles in “OntoMergeFile”
and I would like to be able to access and modify the imported
ontologies(add/delete
classes, properties, individuals, etc.). I’ve done this before in
Protege4.2 by simply importing the 2 ontologies in the merged one and would
like to do it with Jena. I’ve tried to make use of “get” methods in
original ontologies to “import” classes and properties in the merged
ontology (as shown below) but it doesn.t work (see excerpt below of error
at step 02). Moreover, this approach obliges me to create duplicated copies
of initial ontologies classes and dataproperties in the merged ontology. Does
anyone know about an efficient way to merge these ontologies? Any code
accompaning your explanation will be welcome.
I don't think I really understand what you are trying to achieve here. You seem to have created an encoding for your ontologies - directly as Java - that has made it much harder to do common operations like merging ontologies. I can't see what you're gaining from this approach - maybe you need to rethink your objectives.

Ian

Reply via email to