@Override public void visit(OWLEquivalentClassesAxiom axiom) { if (axiom.getClassExpressions().size() > 2) { Set<Set<OWLClassExpression>> rendered = new HashSet<Set<OWLClassExpression>>(); for (OWLClassExpression left : axiom.getClassExpressions()) { for (OWLClassExpression right : axiom.getClassExpressions()) { if (left != right) { Set<OWLClassExpression> cur = CollectionFactory.createSet(left, right); if (!rendered.contains(cur)) { rendered.add(cur); left.accept(this); writeSpace(); write(EQUIV); writeSpace(); right.accept(this); } } } } } else if (axiom.getClassExpressions().size() == 2) { Iterator<OWLClassExpression> it = axiom.getClassExpressions().iterator(); OWLClassExpression descA = it.next(); OWLClassExpression descB = it.next(); OWLClassExpression lhs; OWLClassExpression rhs; if (subject.equals(descA)) { lhs = descA; rhs = descB; } else { lhs = descB; rhs = descA; } lhs.accept(this); writeSpace(); write(EQUIV); writeSpace(); rhs.accept(this); } }
/** * @param object the object to duplicate * @return the duplicate */ @SuppressWarnings("unchecked") public <O extends OWLObject> O duplicateObject(OWLObject object) { object.accept(this); return (O) obj; }
public int getTypeIndex(OWLObject object) { object.accept(this); return type; }
private void writeNested(OWLObject expression) { expression.accept(this); }