1
votes

owlapi provides us a class merger, which allow us to load ontology from multiple files/sources and then merge them together. Now I have my ontology split into two disjoint parts, i.e., a part for TBox axioms and the other for ABox assertions. So I just use merger as the following code,

OWLOntology TBox= m.loadOntologyFromOntologyDocument(new File(("XXXXXXXX/UOBM.owl")));

OWLOntology ABox = m.loadOntologyFromOntologyDocument(new File("XXXX/test.nt"));

OWLOntologyMerger merger = new OWLOntologyMerger(m);
OWLOntology o = merger.createMergedOntology(m, null);

However, I found that only class assertions in ABox are included in the mergerd ontology o, which means all role assertions are not included. I have done a lot of attempts, and finally I solved the problem by add the type assertions of properties to my ABox file, e.g., <http://semantics.crl.ibm.com/univ-bench-dl.owl#takesCourse> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#ObjectProperty> .

It's really weird since such assertions have already been included in the TBox file, and I have merged TBox and ABox with merger. So why do I have to manually add them again? Is that a design issue of owlapi? Or is there a better and more common way for me to address this problem?

P.S:
My ABox file, namely, test.nt is fairly simple, which only contains several triples, without anything else. I didn't import TBox in my ABox either, since it only includes triples.
For example, the content of original test.nt can be:

<http://semantics.crl.ibm.com/univ-bench-dl.owl#a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://semantics.crl.ibm.com/univ-bench-dl.owl#LeisureStudent> .
<http://semantics.crl.ibm.com/univ-bench-dl.owl#a> <http://semantics.crl.ibm.com/univ-bench-dl.owl#takesCourse> <http://semantics.crl.ibm.com/univ-bench-dl.owl#c0> .

The second triple cannot be recognized as an object property assertion. While by adding another triple stating that takesCourse is an object property to test.nt, the object property can then be recognized.
However, there has already been a declaration in TBox that declares takesCourse is an object property, not anything else. So why do I have to add it to ABox again since I've already merged the TBox with my ABox?

1
I don't think that it's correct what you're saying. Simply all axioms will be merged, the axiom type doesn't matter. What's contained in the file test.nt? Note, the OWL API parser needs to know the type of the properties in advance, otherwise they're getting parsed as annotation properties.UninformedUser
And ideally, the abox file would import the tbox file - this simplifies parsing and is also recommended for OWLUninformedUser
An ABox without TBox doesn't even have a consistent existence.Gilles-Antoine Nys
@AKSW At the beginning, in test.nt I only included triples concerning individuals, i.e, the class assertions and role assertions. However, the object role assertions cannot be recognized. While after adding a triple which states a object property has a type object property, it works fine. So my concern is, since the declaration of object property already existed in the TBox being merged, why should I declare it again in the ABox? Since I would combine TBox and ABox with a merger.Yu Gu
@YuGu the type of the schema entities like properties and classes has to be known in advance for the parser. it has nothing to do with the merger, each ontology is parsed separately and if the type of the property isn't declared, the parser would have to guess sometimes, thus, it will be handled as annotation property.UninformedUser

1 Answers

3
votes

Your abox file must use owl:imports to include the tbox. Without property declarations, the abox cannot be parsed correctly otherwise.