org.semanticweb.owlapi.search.EquivalentVisitor Maven / Gradle / Ivy
package org.semanticweb.owlapi.search;
import static org.semanticweb.owlapi.util.OWLAPIStreamUtils.empty;
import java.util.stream.Stream;
import org.semanticweb.owlapi.model.*;
@SuppressWarnings("unchecked")
class EquivalentVisitor implements OWLAxiomVisitorEx> {
private final boolean equiv;
EquivalentVisitor(boolean equiv) {
this.equiv = equiv;
}
@Override
public Stream doDefault(Object o) {
return empty();
}
@Override
public Stream visit(OWLEquivalentClassesAxiom axiom) {
if (equiv) {
return (Stream) axiom.classExpressions();
}
return doDefault(axiom);
}
@Override
public Stream visit(OWLEquivalentDataPropertiesAxiom axiom) {
if (equiv) {
return (Stream) axiom.properties();
}
return doDefault(axiom);
}
@Override
public Stream visit(OWLEquivalentObjectPropertiesAxiom axiom) {
if (equiv) {
return (Stream) axiom.properties();
}
return doDefault(axiom);
}
@Override
public Stream visit(OWLDifferentIndividualsAxiom axiom) {
if (!equiv) {
return (Stream) axiom.individuals();
}
return doDefault(axiom);
}
@Override
public Stream visit(OWLSameIndividualAxiom axiom) {
if (equiv) {
return (Stream) axiom.individuals();
}
return doDefault(axiom);
}
@Override
public Stream visit(OWLDisjointClassesAxiom axiom) {
if (!equiv) {
return (Stream) axiom.classExpressions();
}
return doDefault(axiom);
}
@Override
public Stream visit(OWLDisjointDataPropertiesAxiom axiom) {
if (!equiv) {
return (Stream) axiom.properties();
}
return doDefault(axiom);
}
@Override
public Stream visit(OWLDisjointObjectPropertiesAxiom axiom) {
if (!equiv) {
return (Stream) axiom.properties();
}
return doDefault(axiom);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy