本文整理匯總了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;
}
示例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: 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();
}
示例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;
}