for(IntIterator it = ontologyNF1.keyIterator(); it.hasNext(); ) {
int a = it.next();
MonotonicCollection<IConjunctionQueueEntry> mc = ontologyNF1.get(a);
for(Iterator<IConjunctionQueueEntry> it2 = mc.iterator();
it2.hasNext(); ) {
IConjunctionQueueEntry nf1 = it2.next();
int bi = nf1.getBi();
int b = nf1.getB();
// Build the axiom
Object oa = factory.lookupConceptId(a);
Object ob = factory.lookupConceptId(b);
if(bi == IFactory.TOP_CONCEPT) {
res.add(new ConceptInclusion(transform(oa), transform(ob)));
} else {
Object obi = factory.lookupConceptId(bi);
res.add(new ConceptInclusion(
new au.csiro.ontology.model.Conjunction(
new Concept[] {transform(oa), transform(obi)}), transform(ob)
));
}
}
}
// These terms are of the form A [ r.B and are indexed by A.
for(IntIterator it = ontologyNF2.keyIterator(); it.hasNext(); ) {
int a = it.next();
MonotonicCollection<NF2> mc = ontologyNF2.get(a);
for(Iterator<NF2> it2 = mc.iterator(); it2.hasNext(); ) {
NF2 nf2 = it2.next();
Object oa = factory.lookupConceptId(nf2.lhsA);
String r = factory.lookupRoleId(nf2.rhsR).toString();
Object ob = factory.lookupConceptId(nf2.rhsB);
res.add(new ConceptInclusion(
transform(oa),
new au.csiro.ontology.model.Existential(new NamedRole(r), transform(ob))
));
}
}
// These terms are of the form r.A [ b and indexed by A.
for(IntIterator it = ontologyNF3.keyIterator(); it.hasNext(); ) {
int a = it.next();
ConcurrentMap<Integer, Collection<IConjunctionQueueEntry>> mc =
ontologyNF3.get(a);
Set<Integer> keys = mc.keySet();
for (int i : keys) {
Collection<IConjunctionQueueEntry> cc = mc.get(i);
for(Iterator<IConjunctionQueueEntry> it2 = cc.iterator();
it2.hasNext(); ) {
IConjunctionQueueEntry nf3 = it2.next();
Object oa = factory.lookupConceptId(a);
String r = factory.lookupRoleId(i).toString();
Object ob = factory.lookupConceptId(nf3.getB());
res.add(new ConceptInclusion(
new au.csiro.ontology.model.Existential(new NamedRole(r), transform(ob)),
transform(oa)
));
}