Java源码示例:org.semanticweb.owlapi.model.OWLObjectMaxCardinality
示例1
@Override
public HandlerResult visit(OWLObjectMaxCardinality ce) {
if (ce.getCardinality() == 0) {
// remove the ce if the max cardinality is zero
return HandlerResult.remove();
}
final OWLClassExpression filler = ce.getFiller();
final HandlerResult recursive = filler.accept(this);
OWLObjectSomeValuesFrom newCE;
if (recursive == null) {
newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), filler);
}
else if (recursive.remove) {
return HandlerResult.remove();
}
else {
newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), recursive.modified);
}
return HandlerResult.modified(newCE);
}
示例2
@Override
public OWLObjectMaxCardinality visit(
ElkObjectMaxCardinalityQualified expression) {
return owlFactory_.getOWLObjectMaxCardinality(
expression.getCardinality(), convert(expression.getProperty()),
convert(expression.getFiller()));
}
示例3
@SuppressWarnings("static-method")
public ElkObjectMaxCardinality convert(
OWLObjectMaxCardinality owlObjectMaxCardinality) {
if (owlObjectMaxCardinality.isQualified())
return new ElkObjectMaxCardinalityQualifiedWrap<OWLObjectMaxCardinality>(
owlObjectMaxCardinality);
// else
return new ElkObjectMaxCardinalityUnqualifiedWrap<OWLObjectMaxCardinality>(
owlObjectMaxCardinality);
}
示例4
@Override
public OWLObjectMaxCardinality visit(OWLObjectMaxCardinality ce) {
if (LOG.isDebugEnabled()) {
LOG.debug("Unfolding max_cardinality: "+ce);
}
OWLClassExpression filler = ce.getFiller();
if (filler != null) {
OWLClassExpression unfold = filler.accept(this);
if (unfold != null) {
return factory.getOWLObjectMaxCardinality(ce.getCardinality(), ce.getProperty(), unfold);
}
}
return null;
}
示例5
@Override
public OWLObjectMaxCardinality visit(
ElkObjectMaxCardinalityUnqualified expression) {
return owlFactory_.getOWLObjectMaxCardinality(
expression.getCardinality(), convert(expression.getProperty()));
}
示例6
@Override
public ElkObjectMaxCardinality visit(
OWLObjectMaxCardinality owlObjectMaxCardinality) {
return CONVERTER.convert(owlObjectMaxCardinality);
}
示例7
/**
* Given an OWLClassExpression, determine the particular type of OWLClassExpression that it is,
* and then call the appropriate visit() function for it.
*/
public void visit(OWLClassExpression ce) throws ClassNotFoundException {
if (ce instanceof OWLClass) {
visit((OWLClass) ce);
} else if (ce instanceof OWLObjectSomeValuesFrom) {
visit((OWLObjectSomeValuesFrom) ce);
} else if (ce instanceof OWLObjectAllValuesFrom) {
visit((OWLObjectAllValuesFrom) ce);
} else if (ce instanceof OWLObjectMinCardinality) {
visit((OWLObjectMinCardinality) ce);
} else if (ce instanceof OWLObjectMaxCardinality) {
visit((OWLObjectMaxCardinality) ce);
} else if (ce instanceof OWLObjectExactCardinality) {
visit((OWLObjectExactCardinality) ce);
} else if (ce instanceof OWLObjectHasValue) {
visit((OWLObjectHasValue) ce);
} else if (ce instanceof OWLObjectHasSelf) {
visit((OWLObjectHasSelf) ce);
} else if (ce instanceof OWLDataSomeValuesFrom) {
visit((OWLDataSomeValuesFrom) ce);
} else if (ce instanceof OWLDataAllValuesFrom) {
visit((OWLDataAllValuesFrom) ce);
} else if (ce instanceof OWLDataMinCardinality) {
visit((OWLDataMinCardinality) ce);
} else if (ce instanceof OWLDataMaxCardinality) {
visit((OWLDataMaxCardinality) ce);
} else if (ce instanceof OWLDataExactCardinality) {
visit((OWLDataExactCardinality) ce);
} else if (ce instanceof OWLDataHasValue) {
visit((OWLDataHasValue) ce);
} else if (ce instanceof OWLObjectIntersectionOf) {
visit((OWLObjectIntersectionOf) ce);
} else if (ce instanceof OWLObjectUnionOf) {
visit((OWLObjectUnionOf) ce);
} else if (ce instanceof OWLObjectComplementOf) {
visit((OWLObjectComplementOf) ce);
} else if (ce instanceof OWLObjectOneOf) {
visit((OWLObjectOneOf) ce);
} else {
logger.error(
"Could not visit class expression: {} of type: {}",
ce.toString(),
ce.getClass().toString());
}
}
示例8
@Override
public Void visit(OWLObjectMaxCardinality desc) {
long restriction = addCardinalityRestriction(desc);
graph.addLabel(restriction, OwlLabels.OWL_MAX_CARDINALITY);
return null;
}