当前位置: 首页>>代码示例>>Java>>正文


Java OWLObjectMaxCardinality.getCardinality方法代码示例

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectMaxCardinality.getCardinality方法的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectMaxCardinality.getCardinality方法的具体用法?Java OWLObjectMaxCardinality.getCardinality怎么用?Java OWLObjectMaxCardinality.getCardinality使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.semanticweb.owlapi.model.OWLObjectMaxCardinality的用法示例。


在下文中一共展示了OWLObjectMaxCardinality.getCardinality方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; //导入方法依赖的package包/类
@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);
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:21,代码来源:CardinalityContraintsTools.java

示例2: visit

import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; //导入方法依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectMaxCardinality ce) {
    boolean neg = negated;
    int card = ce.getCardinality();
    if (negated) {
        card = ce.getCardinality() + 1;
    }
    negated = false;
    OWLClassExpression filler = ce.getFiller().accept(this);
    OWLClassExpression nnf = null;
    if (neg) {
        nnf = dataFactory.getOWLObjectMinCardinality(card,
                ce.getProperty(), filler);
    } else {
        nnf = dataFactory.getOWLObjectMaxCardinality(card,
                ce.getProperty(), filler);
    }
    negated = neg;
    return nnf;
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:21,代码来源:NNF.java

示例3: visit

import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLObjectMaxCardinality d) {
    OWLClassExpression filler=getSimplified(d.getFiller());
    if (filler.isOWLNothing())
        return m_factory.getOWLThing();
    else if (d.getCardinality()<=0)
        return m_factory.getOWLObjectAllValuesFrom(d.getProperty().getSimplified(),m_factory.getOWLObjectComplementOf(filler));
    else
        return m_factory.getOWLObjectMaxCardinality(d.getCardinality(),d.getProperty().getSimplified(),filler);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:10,代码来源:ExpressionManager.java

示例4: visit

import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; //导入方法依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectMaxCardinality ce) {
	OWLClassExpression filler = ce.getFiller();
	OWLClassExpression shortenedFiller = filler.accept(this);
	if(shortenedFiller.isOWLNothing()){// <= n r.\bot \equiv \top
		return df.getOWLThing();
	} else if(beautify && ce.getCardinality() == 0) {// we rewrite <= 0 r C to \neg \exists r C - easier to read for humans
		return df.getOWLObjectComplementOf(df.getOWLObjectSomeValuesFrom(ce.getProperty(), shortenedFiller));
	} else if(!filler.equals(shortenedFiller)){
		return df.getOWLObjectMaxCardinality(ce.getCardinality(), ce.getProperty(), shortenedFiller);
	}
	return ce;
}
 
开发者ID:SmartDataAnalytics,项目名称:OWL2SPARQL,代码行数:14,代码来源:OWLClassExpressionMinimizer.java

示例5: visit

import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; //导入方法依赖的package包/类
@Override
public void visit(OWLObjectMaxCardinality ce) {
    hashCode = primes[44];
    hashCode = hashCode * MULT + ce.getProperty().hashCode();
    hashCode = hashCode * MULT + ce.getCardinality();
    hashCode = hashCode * MULT + ce.getFiller().hashCode();
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:8,代码来源:HashCode.java

示例6: visit

import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; //导入方法依赖的package包/类
public Boolean visit(OWLObjectMaxCardinality object) {
    return object.getCardinality()>0 ? Boolean.TRUE : m_expressionManager.getComplementNNF(object.getFiller()).accept(this);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:4,代码来源:OWLNormalization.java

示例7: visit

import org.semanticweb.owlapi.model.OWLObjectMaxCardinality; //导入方法依赖的package包/类
public void visit(OWLObjectMaxCardinality object) {
    int cardinality=object.getCardinality();
    OWLObjectPropertyExpression onObjectProperty=object.getProperty();
    OWLClassExpression filler=object.getFiller();
    ensureYNotZero();
    boolean isPositive;
    AtomicConcept atomicConcept;
    if (filler instanceof OWLClass) {
        isPositive=true;
        atomicConcept=AtomicConcept.create(((OWLClass)filler).getIRI().toString());
        if (atomicConcept.isAlwaysTrue())
            atomicConcept=null;
    }
    else if (filler instanceof OWLObjectComplementOf) {
        OWLClassExpression internal=((OWLObjectComplementOf)filler).getOperand();
        if (!(internal instanceof OWLClass))
            throw new IllegalStateException("Internal error: Invalid ontology normal form.");
        isPositive=false;
        atomicConcept=AtomicConcept.create(((OWLClass)internal).getIRI().toString());
        if (atomicConcept.isAlwaysFalse())
            atomicConcept=null;
    }
    else
        throw new IllegalStateException("Internal error: Invalid ontology normal form.");
    Role onRole=getRole(onObjectProperty);
    LiteralConcept toConcept=getLiteralConcept(filler);
    AnnotatedEquality annotatedEquality=AnnotatedEquality.create(cardinality,onRole,toConcept);
    Variable[] yVars=new Variable[cardinality+1];
    for (int i=0;i<yVars.length;i++) {
        yVars[i]=nextY();
        m_bodyAtoms.add(getRoleAtom(onObjectProperty,X,yVars[i]));
        if (atomicConcept!=null) {
            Atom atom=Atom.create(atomicConcept,yVars[i]);
            if (isPositive)
                m_bodyAtoms.add(atom);
            else
                m_headAtoms.add(atom);
        }
    }
    // Node ID comparisons are not needed in case of functionality axioms,
    // as the effect of these is simulated by the way in which the rules are applied.
    if (yVars.length>2) {
        for (int i=0;i<yVars.length-1;i++)
            m_bodyAtoms.add(Atom.create(NodeIDLessEqualThan.INSTANCE,yVars[i],yVars[i+1]));
        m_bodyAtoms.add(Atom.create(NodeIDsAscendingOrEqual.create(yVars.length),yVars));
    }
    for (int i=0;i<yVars.length;i++)
        for (int j=i+1;j<yVars.length;j++)
            m_headAtoms.add(Atom.create(annotatedEquality,yVars[i],yVars[j],X));
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:51,代码来源:OWLClausification.java


注:本文中的org.semanticweb.owlapi.model.OWLObjectMaxCardinality.getCardinality方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。