本文整理匯總了Java中org.semanticweb.owlapi.model.OWLClassExpression.accept方法的典型用法代碼示例。如果您正苦於以下問題:Java OWLClassExpression.accept方法的具體用法?Java OWLClassExpression.accept怎麽用?Java OWLClassExpression.accept使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.semanticweb.owlapi.model.OWLClassExpression
的用法示例。
在下文中一共展示了OWLClassExpression.accept方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
@Override
public HandlerResult visit(OWLObjectUnionOf unionOf) {
Set<OWLClassExpression> newOperands = new HashSet<OWLClassExpression>();
boolean changed = false;
for (OWLClassExpression ce : unionOf.getOperands()) {
HandlerResult handlerResult = ce.accept(this);
if (handlerResult != null) {
if (handlerResult.remove) {
return HandlerResult.remove();
}
changed = true;
newOperands.add(handlerResult.modified);
}
else {
newOperands.add(ce);
}
}
if (changed) {
if (newOperands.size() == 1) {
return HandlerResult.modified(newOperands.iterator().next());
}
return HandlerResult.modified(factory.getOWLObjectUnionOf(newOperands));
}
return null;
}
示例2: unfoldExpressions
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
Set<OWLClassExpression> unfoldExpressions(Collection<OWLClassExpression> expressions) {
Set<OWLClassExpression> unfolded = new HashSet<OWLClassExpression>();
boolean changed = false;
for (OWLClassExpression expression : expressions) {
OWLClassExpression unfoldedExpression = expression.accept(this);
if (unfoldedExpression != null) {
changed = true;
unfolded.add(unfoldedExpression);
}
else {
unfolded.add(expression);
}
}
if (changed) {
return unfolded;
}
return null;
}
示例3: unfoldAxiom
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
OWLEquivalentClassesAxiom unfoldAxiom(OWLEquivalentClassesAxiom ax, OWLClass owlClass) {
Set<OWLClassExpression> existing = ax.getClassExpressionsMinus(owlClass);
OWLClassExpression ce;
if (existing == null || existing.isEmpty()) {
return null;
}
else if (existing.size() == 1) {
ce = existing.iterator().next();
}
else {
ce = factory.getOWLObjectIntersectionOf(existing);
}
if(LOG.isDebugEnabled()) {
LOG.debug("Unfolding axiom: "+ax);
}
OWLClassExpression unfolded = ce.accept(this);
if (unfolded != null) {
return factory.getOWLEquivalentClassesAxiom(owlClass, unfolded);
}
return null;
}
示例4: visit
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
@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: visit
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
public void visit(OWLSubClassOfAxiom subClassAxiom) {
OWLClassExpression subClass = subClassAxiom.getSubClass();
OWLClassExpression supClass = subClassAxiom.getSuperClass();
subClass.accept(this);
supClass.accept(this);
}
示例6: getDefinitionFor
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
protected OWLClassExpression getDefinitionFor(OWLClassExpression description,boolean[] alreadyExists,boolean forcePositive) {
OWLClassExpression definition=m_definitions.get(description);
if (definition==null || (forcePositive && !(definition instanceof OWLClass))) {
definition=m_factory.getOWLClass(IRI.create("internal:def#"+(m_definitions.size()+m_firstReplacementIndex)));
if (!forcePositive && !description.accept(m_plVisitor))
definition=m_factory.getOWLObjectComplementOf(definition);
m_definitions.put(description,definition);
alreadyExists[0]=false;
}
else
alreadyExists[0]=true;
return definition;
}
示例7: visit
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
public void visit(OWLObjectIntersectionOf arg0) {
for (final OWLClassExpression e : arg0.getOperands()) {
e.accept(this);
}
}
示例8: visit
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
public void visit(OWLObjectIntersectionOf object) {
for (OWLClassExpression description : object.getOperands())
description.accept(this);
}
示例9: getNNF
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
public OWLClassExpression getNNF(OWLClassExpression description) {
return description.accept(m_descriptionNNFVisitor);
}
示例10: translateClassExpression
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
public IntegerClassExpression translateClassExpression(OWLClassExpression owlClassExpression)
throws TranslationException {
return owlClassExpression.accept(getClassExpressionTranslator());
}
示例11: visit
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
public Boolean visit(OWLObjectUnionOf object) {
for (OWLClassExpression desc : object.getOperands())
if (desc.accept(this))
return Boolean.TRUE;
return Boolean.FALSE;
}
示例12: classExprToATerm
import org.semanticweb.owlapi.model.OWLClassExpression; //導入方法依賴的package包/類
public static ATermAppl classExprToATerm( OWLClassExpression classExpr,
KnowledgeBase kb) {
PelletVisitor visitor = new PelletVisitor(kb);
classExpr.accept( visitor );
return visitor.result();
}