當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。