本文整理汇总了Java中org.semanticweb.owlapi.model.OWLDataMaxCardinality.getCardinality方法的典型用法代码示例。如果您正苦于以下问题:Java OWLDataMaxCardinality.getCardinality方法的具体用法?Java OWLDataMaxCardinality.getCardinality怎么用?Java OWLDataMaxCardinality.getCardinality使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLDataMaxCardinality
的用法示例。
在下文中一共展示了OWLDataMaxCardinality.getCardinality方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLDataMaxCardinality; //导入方法依赖的package包/类
public void visit(OWLDataMaxCardinality object) {
int number=object.getCardinality();
LiteralDataRange negatedDataRange=m_dataRangeConverter.convertDataRange(object.getFiller()).getNegation();
ensureYNotZero();
Variable[] yVars=new Variable[number+1];
for (int i=0;i<yVars.length;i++) {
yVars[i]=nextY();
m_bodyAtoms.add(getRoleAtom(object.getProperty(),X,yVars[i]));
if (negatedDataRange.isNegatedInternalDatatype()) {
InternalDatatype negated=(InternalDatatype)negatedDataRange.getNegation();
if (!negated.isAlwaysTrue())
m_bodyAtoms.add(Atom.create(negated,yVars[i]));
}
else {
if (!negatedDataRange.isAlwaysFalse())
m_headAtoms.add(Atom.create((DLPredicate)negatedDataRange,yVars[i]));
}
}
for (int i=0;i<yVars.length;i++)
for (int j=i+1;j<yVars.length;j++)
m_headAtoms.add(Atom.create(Equality.INSTANCE,yVars[i],yVars[j]));
}
示例2: visit
import org.semanticweb.owlapi.model.OWLDataMaxCardinality; //导入方法依赖的package包/类
@Override
public OWLClassExpression visit(OWLDataMaxCardinality ce) {
boolean neg = negated;
int card = ce.getCardinality();
if (negated) {
card = ce.getCardinality() + 1;
}
negated = false;
OWLDataRange filler = ce.getFiller().accept(this);
OWLClassExpression nnf = null;
if (neg) {
nnf = dataFactory.getOWLDataMinCardinality(card, ce.getProperty(),
filler);
} else {
nnf = dataFactory.getOWLDataMaxCardinality(card, ce.getProperty(),
filler);
}
negated = neg;
return nnf;
}
示例3: visit
import org.semanticweb.owlapi.model.OWLDataMaxCardinality; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLDataMaxCardinality d) {
OWLDataRange filler=getSimplified(d.getFiller());
if (isBottomDataRange(filler))
return m_factory.getOWLThing();
else if (d.getCardinality()<=0)
return m_factory.getOWLDataAllValuesFrom(d.getProperty(),m_factory.getOWLDataComplementOf(filler));
else
return m_factory.getOWLDataMaxCardinality(d.getCardinality(),d.getProperty(),filler);
}
示例4: visit
import org.semanticweb.owlapi.model.OWLDataMaxCardinality; //导入方法依赖的package包/类
@Override
public void visit(OWLDataMaxCardinality ce) {
hashCode = primes[36];
hashCode = hashCode * MULT + ce.getProperty().hashCode();
hashCode = hashCode * MULT + ce.getCardinality();
hashCode = hashCode * MULT + ce.getFiller().hashCode();
}