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


Java OWLObjectPropertyExpression.isOWLBottomObjectProperty方法代码示例

本文整理汇总了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);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:49,代码来源:Reasoner.java

示例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;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:7,代码来源:OWLNormalization.java


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