Hi Ian! Thank you for your prompt response to my email. I didn't mention it but, as far as my objectives are concerned, my 2 questions are not related. These are some clarifications to my initial post. Q1: I just wanted to know whether it's possible to create the the owl file from the java version of the ontology since I was programatically creating it in jAVA. Thank you for letting me know about Jena's schemagen tool. I'll keep that in mind. Q2: I have decided to encode the ontologies in Java because I wasn't able to programatically access and modify the owl file after being loaded. Specifically, i wanted to be able to create individuals, delete/add classes, statements and properties to the loaded owl ontology model directly from the java file. Jena and Eclipse were unable to recognize ontology's entities and wanted them to be declared as local variable, thus the duplicate elements i mentioned previously. Being able to merge those ontologies from the Java encoding directly would also save me a lot of time and energy as I've already put a lot of effort in coding the ontology in java. So there is no way to merge my java encoding ontologies as I mentioned in my initial post?
Note: I have developed several built-ins that are being used by my reasoner for inferencing applied to the base ontology created in java. The java encoding allows me to test those built-ins separately before integrating them in with rule engine something I can't do if the original ontologies are in owl (I mean I don't know how to do it - any idea will be welcome though). Thank again, Leonard 2013/4/23 Ian Dickinson <[email protected]> > 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 > >
