本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectPropertyExpression.isOWLBottomObjectProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectPropertyExpression.isOWLBottomObjectProperty方法的具体用法?Java OWLObjectPropertyExpression.isOWLBottomObjectProperty怎么用?Java OWLObjectPropertyExpression.isOWLBottomObjectProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLObjectPropertyExpression
的用法示例。
在下文中一共展示了OWLObjectPropertyExpression.isOWLBottomObjectProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDisjointObjectProperties
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
public NodeSet<OWLObjectPropertyExpression> getDisjointObjectProperties(
OWLObjectPropertyExpression propertyExpression) {
checkPreConditions(propertyExpression);
if (!m_isConsistent)
return new OWLObjectPropertyNodeSet();
classifyObjectProperties();
Set<HierarchyNode<Role>> result = new HashSet<HierarchyNode<Role>>();
if (propertyExpression.getNamedProperty().isOWLTopObjectProperty()) {
result.add(m_objectRoleHierarchy.getBottomNode());
return objectPropertyHierarchyNodesToNodeSet(result);
} else if (propertyExpression.isOWLBottomObjectProperty()) {
HierarchyNode<Role> node = m_objectRoleHierarchy.getTopNode();
result.add(node);
result.addAll(node.getDescendantNodes());
return objectPropertyHierarchyNodesToNodeSet(result);
}
Role role = H(propertyExpression);
Individual freshIndividualA = Individual
.createAnonymous("fresh-individual-A");
Individual freshIndividualB = Individual
.createAnonymous("fresh-individual-B");
Atom roleAssertion = role.getRoleAssertion(freshIndividualA,
freshIndividualB);
Tableau tableau = getTableau();
Set<HierarchyNode<Role>> nodesToTest = new HashSet<HierarchyNode<Role>>();
nodesToTest.addAll(m_objectRoleHierarchy.getTopNode().getChildNodes());
while (!nodesToTest.isEmpty()) {
HierarchyNode<Role> nodeToTest = nodesToTest.iterator().next();
nodesToTest.remove(nodeToTest);
Role roleToTest = nodeToTest.getRepresentative();
Atom roleToTestAssertion = roleToTest.getRoleAssertion(
freshIndividualA, freshIndividualB);
Set<Atom> perTestAtoms = new HashSet<Atom>(2);
perTestAtoms.add(roleAssertion);
perTestAtoms.add(roleToTestAssertion);
if (!tableau.isSatisfiable(false, perTestAtoms, null, null, null,
null, new ReasoningTaskDescription(true,
"disjointness of {0} and {1}", role, roleToTest)))
// disjoint
result.addAll(nodeToTest.getDescendantNodes());
else
// maybe some children are disjoint
nodesToTest.addAll(nodeToTest.getChildNodes());
}
if (result.isEmpty())
result.add(m_objectRoleHierarchy.getBottomNode());
return objectPropertyHierarchyNodesToNodeSet(result);
}
示例2: containsBottomObjectProperty
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
protected boolean containsBottomObjectProperty(List<OWLObjectPropertyExpression> properties) {
for (OWLObjectPropertyExpression property : properties)
if (property.isOWLBottomObjectProperty())
return true;
return false;
}