public Boolean visit(OWLEquivalentClassesAxiom axiom) { if (!axiom.containsNamedEquivalentClass()) { return false; } for (OWLClassExpression ce : axiom.getClassExpressions()) { if (!isOBOClassExpression(ce)) { return false; } } return true; }
public void visit(OWLEquivalentClassesAxiom axiom) { Set<OWLClassExpression> added = new HashSet<OWLClassExpression>(); for (OWLClassExpression descA : axiom.getClassExpressions()) { descA.accept(this); for (OWLClassExpression descB : axiom.getClassExpressions()) { if (!descA.equals(descB) && !added.contains(descA) && !added.contains(descB)) { addChildParent(descA, descB, axiom); descA.accept(this); descB.accept(this); added.add(descA); added.add(descB); } } } }
public void rebuild(OWLEquivalentClassesAxiom axiom) { for (OWLDescription desc : axiom.getDescriptions()) { desc.accept(this); } Set<OWLDescription> equivClasses = this.getRelevantDescriptionsAsSet(0); this.rebuiltAxioms.add(this.factory.getOWLEquivalentClassesAxiom(equivClasses)); }
@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); } }
@Override public void visit(OWLEquivalentClassesAxiom owlEquivalentClassesAxiom) { // get the complex description out of the axiom List<OWLDescription> descriptions = new ArrayList<OWLDescription>(owlEquivalentClassesAxiom.getDescriptions()); Set<OWLDescription> replacements = new HashSet<OWLDescription>(); for (OWLDescription description : descriptions) { // visit the description and record replacment description.accept(descriptionVisitor); OWLDescription replacement = descriptionVisitor.getReplacements().get(description); if (replacement != null) replacements.add(replacement); else replacements.add(description); } // construct new Axiom OWLEquivalentClassesAxiom replacementAxiom = owlDataFactory.getOWLEquivalentClassesAxiom(replacements); // create the changeevents that have to be performed on the ontology try { List<OWLAxiomChange> replaceEvent = OWLUtils.createReplaceAxiomEvents( owlOntology, owlEquivalentClassesAxiom, replacementAxiom); axiomChanges.addAll(replaceEvent); } catch (OWLOntologyChangeException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } // clear the description visitor descriptionVisitor.clear(); super.visit(owlEquivalentClassesAxiom); }
@Override public void visit(OWLEquivalentClassesAxiom axiom) { Set<OWLClassExpression> descs = duplicateSet(axiom.getClassExpressions()); obj = dataFactory.getOWLEquivalentClassesAxiom(descs, duplicateAxiomAnnotations(axiom)); }
public void visit(OWLEquivalentClassesAxiom axiom) { type = AXIOM_TYPE_INDEX_BASE + axiom.getAxiomType().getIndex(); }
public void visit(OWLEquivalentClassesAxiom axiom) { for (OWLClassExpression desc : axiom.getClassExpressions()) { desc.accept(this); } processAxiomAnnotations(axiom); }