本文整理汇总了Java中org.semanticweb.owlapi.model.OWLClassExpression.isOWLNothing方法的典型用法代码示例。如果您正苦于以下问题:Java OWLClassExpression.isOWLNothing方法的具体用法?Java OWLClassExpression.isOWLNothing怎么用?Java OWLClassExpression.isOWLNothing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLClassExpression
的用法示例。
在下文中一共展示了OWLClassExpression.isOWLNothing方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例3: visit
import org.semanticweb.owlapi.model.OWLClassExpression; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLObjectSomeValuesFrom d) {
OWLClassExpression filler=getSimplified(d.getFiller());
if (filler.isOWLNothing())
return m_factory.getOWLNothing();
else
return m_factory.getOWLObjectSomeValuesFrom(d.getProperty().getSimplified(),filler);
}
示例4: 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();
}
示例5: 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;
}