This content has been marked as final. Show 9 replies
Did you use owl:imports?
Please see section 7.2 of http://www.w3.org/TR/owl-ref/
Yes of course. It is an owl import, as done by protege.
Hi,1 person found this helpful
Let's see if this example helps.
InputStream in = FileManager.get().open("./test.owl" );
OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null);
Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
Model model = ModelOracleSem.createOracleSemModel(oracle, szModelName);
OutputStream os = new FileOutputStream("./test.nt");
In the following test.owl file, owl:imports is used to import a remote owl ontology on the web.
% cat test.owl
After running the above code snippet, the output file has 500+ triples.
% wc -l test.nt
NOTE that if there are many triples in the remote ontology, you need to use addInBulk method.
Thanks zhe wu!
I will try it first thing in the morning. And yes the imported file is over 20mb in size. Can you please detail on the addinbulk method?
Please search for addInBulk in
thanks for the code example. The importing works fine, the written files contains the imported tripples! I will now try to mend my code using snippets from your code :)
Thanks again, I'll keep you updated.
I have spent quite some time trying the import of the ontology. Unfortunately, it will just not work...
As soon as I switch the import statement to a ontology which is only found in a local file (using the mapping in ont-policy), all I get in the "test.nt" is this import statement, NOT the imported statements.
"<http://www.demo.org/ont1.owl> <http://www.w3.org/2002/07/owl#imports> <http://www.demo.org/importedOnt.owl> ."
Does anyone know how I can make Jena resolve the import and include the statements?
If the ontology is stored in a local file (say /tmp/hello.owl), then you can use something like
<http://www.demo.org/ont1.owl> <http://www.w3.org/2002/07/owl#imports> <file:///tmp/hello.owl>
Does this help?
first: Sorry for the late reply, I somehow thought that I had already given feedback.
I got it working. To keep a long story short: It looks like something has gone wrong during the last update/patching of our 11g instance. Turned out, that something was strangely wrong with it (Our dba said - I am not so firm with DB administration).
I only found out, because I had the possibility to test with another 11g instance by chance - and everything worked fine.
So, problem solved. Thanks again for every helpful comment!!!!