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


Java OWLClassExpression.isOWLThing方法代码示例

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


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

示例1: isSubClassOf

import org.semanticweb.owlapi.model.OWLClassExpression; //导入方法依赖的package包/类
/**
 * Checks whether a class expression is a subclass of another class expression.
 * @param subClassExpr class expression on the left-hand side 
 * @param superClassExpr class expression on the right-hand side
 * @return <code>true</code> if the class expression on the left-hand side is a subclass of the class expression
 * on the right-hand side, <code>false</code> otherwise
 */
protected boolean isSubClassOf(OWLClassExpression subClassExpr, OWLClassExpression superClassExpr) {
	boolean ret = subClassExpr.isOWLNothing() || superClassExpr.isOWLThing() || subClassExpr.equals(superClassExpr);
	if (!ret) {
		OWLSubClassOfAxiom axiom = getReasoner().getRootOntology().
			getOWLOntologyManager().getOWLDataFactory().getOWLSubClassOfAxiom(subClassExpr, superClassExpr);
		if (!getReasoner().isEntailmentCheckingSupported(axiom.getAxiomType())){
			throw new RuntimeException("ERROR : Entailment not supported by reasoner '" + getReasoner().getReasonerName() + "'.");
		}
		ret = getReasoner().isEntailed(axiom);
	}
	return ret;
}
 
开发者ID:julianmendez,项目名称:ontocomplib,代码行数:20,代码来源:IndividualContext.java

示例2: visit

import org.semanticweb.owlapi.model.OWLClassExpression; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLObjectIntersectionOf d) {
    Set<OWLClassExpression> newConjuncts=new HashSet<OWLClassExpression>();
    for (OWLClassExpression description : d.getOperands()) {
        OWLClassExpression descriptionSimplified=getSimplified(description);
        if (descriptionSimplified.isOWLThing())
            continue;
        else if (descriptionSimplified.isOWLNothing())
            return m_factory.getOWLNothing();
        else if (descriptionSimplified instanceof OWLObjectIntersectionOf)
            newConjuncts.addAll(((OWLObjectIntersectionOf)descriptionSimplified).getOperands());
        else
            newConjuncts.add(descriptionSimplified);
    }
    return m_factory.getOWLObjectIntersectionOf(newConjuncts);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:16,代码来源:ExpressionManager.java

示例3: getEquivalentClasses

import org.semanticweb.owlapi.model.OWLClassExpression; //导入方法依赖的package包/类
public Node<OWLClass> getEquivalentClasses(OWLClassExpression queryClassExpression) {
	classifyClasses();
	if (queryClassExpression.isOWLNothing()) {
           return getBottomClassNode();
       } else if (queryClassExpression.isOWLThing()) {
       	return getTopClassNode();
       } else if (queryClassExpression instanceof OWLClass ){
       	OWLClass queryClass = (OWLClass) queryClassExpression;
       	return owlClassHierarchyNodeToNode(classHierarchy.getNodeForElement(queryClass));
       }
	// not supported yet
	return new OWLClassNode();
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:14,代码来源:Wolpertinger.java

示例4: hasMatchingIntersection

import org.semanticweb.owlapi.model.OWLClassExpression; //导入方法依赖的package包/类
/**
 * Search for the first class with a matching equivalent class definition. 
 * 
 * @param c
 * @param genus
 * @param relation
 * @return match or null
 */
private OWLClass hasMatchingIntersection(OWLClass c, OWLClass genus, OWLObjectProperty relation) {
	for(OWLOntology o : allOntologies) {
		Set<OWLEquivalentClassesAxiom> eqAxioms = o.getEquivalentClassesAxioms(c);
		for (OWLEquivalentClassesAxiom eqAxiom : eqAxioms) {
			Set<OWLClassExpression> expressions = eqAxiom.getClassExpressionsMinus(c);
			for (OWLClassExpression expression : expressions) {
				if (expression instanceof OWLObjectIntersectionOf) {
					OWLObjectIntersectionOf intersection = (OWLObjectIntersectionOf) expression;
					OWLClass differentiaCls = null;
					boolean matchesGenus = false;
					boolean matchesRelation = false;
					Set<OWLClassExpression> operands = intersection.getOperands();
					if (operands.size() == 2) {
						for (OWLClassExpression operand : operands) {
							if (operand.isAnonymous() == false) {
								OWLClass currentGenus = operand.asOWLClass();
								if (genus.equals(currentGenus)) {
									matchesGenus = true;
								}
							}
							else if (operand instanceof OWLObjectSomeValuesFrom) {
								OWLObjectSomeValuesFrom differentia = (OWLObjectSomeValuesFrom) operand;
								if (relation.equals(differentia.getProperty())) {
									matchesRelation = true;
									OWLClassExpression filler = differentia.getFiller();
									if (!filler.isAnonymous() && !filler.isOWLNothing() && !filler.isOWLThing()) {
										differentiaCls = filler.asOWLClass();
									}
								}
							}
						}
						if (matchesGenus && matchesRelation ) {
							 return differentiaCls;
						}
					}
				}
			}
		}
	}
	return null;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:50,代码来源:LinkMaker.java


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