@Override public void visit(OWLDisjointClassesAxiom axiom) { hashCode = 31; hashCode = hashCode * MULT + axiom.getClassExpressions().hashCode(); hashCode = hashCode * MULT + axiom.getAnnotations().hashCode(); }
public void visit(OWLDisjointClassesAxiom axiom) { hashCode = 31; hashCode = hashCode * MULT + axiom.getClassExpressions().hashCode(); hashCode = hashCode * MULT + axiom.getAnnotations().hashCode(); }
@Override public void visit(OWLDisjointClassesAxiom axiom) { hashCode = primes[8]; hashCode = hashCode * MULT + axiom.getClassExpressions().hashCode(); hashCode = hashCode * MULT + axiom.getAnnotations().hashCode(); }
private void generateChangesToRemoveDefinitionFromOntology(@Nonnull OWLOntology o, @Nonnull List<OWLOntologyChange> changes) { o.getSubClassAxiomsForSubClass(cls).forEach(ax -> changes.add(new RemoveAxiom(o, ax))); o.getEquivalentClassesAxioms(cls).forEach(ax -> changes.add(new RemoveAxiom(o, ax))); o.getDisjointClassesAxioms(cls).forEach(ax -> { changes.add(new RemoveAxiom(o, ax)); Set<OWLClassExpression> remainingDisjointClasses = ax.getClassExpressionsMinus(cls); if(remainingDisjointClasses.size() > 1) { OWLAxiom freshAx = dataFactory.getOWLDisjointClassesAxiom(remainingDisjointClasses, ax.getAnnotations()); changes.add(new AddAxiom(o, freshAx)); } }); o.getHasKeyAxioms(cls).forEach(ax -> new RemoveAxiom(o, ax)); o.getDisjointUnionAxioms(cls).forEach(ax -> new RemoveAxiom(o, ax)); } }
pairwiseDisjointClassesAxioms.add(ax); OWLClassExpression disjointWith = ax.getClassExpressionsMinus(cls).iterator().next(); disjointClasses.put(disjointWith, ax.getAnnotations());
private void tr(OWLDisjointClassesAxiom ax) { // use set, the OWL-API does not provide an order Set<OWLClassExpression> set = ax.getClassExpressions(); if (set.size() != 2) { error("Expected two classes in a disjoin classes axiom.", ax); } Iterator<OWLClassExpression> it = set.iterator(); OWLClassExpression ce1 = it.next(); OWLClassExpression ce2 = it.next(); if (ce1.isBottomEntity() || ce1.isTopEntity() || ce2.isBottomEntity() || ce2.isTopEntity()) { error("Disjoint classes axiom using Top or Bottom entities are not supported.", ax); } String cls2 = this.getIdentifier(ce2); if(cls2 == null){ error(ax); return; } if (ce1.isAnonymous()) { error(ax); return; } OWLClass cls1 = ce1.asOWLClass(); Frame f = getTermFrame(cls1); Clause c = new Clause(); c.setTag(OboFormatTag.TAG_DISJOINT_FROM.getTag()); c.setValue(cls2); f.addClause(c); addQualifiers(c, ax.getAnnotations()); }
if (ax.getClassExpressions().size() > 2) { Map<Object, Set<OWLAnnotation>> map = new HashMap<Object, Set<OWLAnnotation>>(); map.put(ax.getClassExpressions(), ax.getAnnotations()); writeSection(DISJOINT_CLASSES, map, ",", false, ontology);