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


Java OWLDataPropertyNodeSet类代码示例

本文整理汇总了Java中org.semanticweb.owlapi.reasoner.impl.OWLDataPropertyNodeSet的典型用法代码示例。如果您正苦于以下问题:Java OWLDataPropertyNodeSet类的具体用法?Java OWLDataPropertyNodeSet怎么用?Java OWLDataPropertyNodeSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OWLDataPropertyNodeSet类属于org.semanticweb.owlapi.reasoner.impl包,在下文中一共展示了OWLDataPropertyNodeSet类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDisjointDataProperties

import org.semanticweb.owlapi.reasoner.impl.OWLDataPropertyNodeSet; //导入依赖的package包/类
public NodeSet<OWLDataProperty> getDisjointDataProperties(OWLDataPropertyExpression pe) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    DefaultNodeSet<OWLDataProperty> result = new OWLDataPropertyNodeSet();
    for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
        for (OWLDisjointDataPropertiesAxiom axiom : ontology.getDisjointDataPropertiesAxioms(pe.asOWLDataProperty())) {
            for (OWLDataPropertyExpression dpe : axiom.getPropertiesMinus(pe)) {
                if (!dpe.isAnonymous()) {
                    result.addNode(dataPropertyHierarchyInfo.getEquivalents(dpe.asOWLDataProperty()));
                    result.addAllNodes(getSubDataProperties(dpe.asOWLDataProperty(), false).getNodes());
                }
            }
        }
    }
    return result;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:16,代码来源:StructuralReasoner2.java

示例2: dataPropertyHierarchyNodesToNodeSet

import org.semanticweb.owlapi.reasoner.impl.OWLDataPropertyNodeSet; //导入依赖的package包/类
protected NodeSet<OWLDataProperty> dataPropertyHierarchyNodesToNodeSet(
		Collection<HierarchyNode<AtomicRole>> hierarchyNodes) {
	Set<Node<OWLDataProperty>> result = new HashSet<Node<OWLDataProperty>>();
	for (HierarchyNode<AtomicRole> hierarchyNode : hierarchyNodes)
		result.add(dataPropertyHierarchyNodeToNode(hierarchyNode));
	return new OWLDataPropertyNodeSet(result);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:8,代码来源:Reasoner.java

示例3: getSubDataProperties

import org.semanticweb.owlapi.reasoner.impl.OWLDataPropertyNodeSet; //导入依赖的package包/类
public NodeSet<OWLDataProperty> getSubDataProperties(OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    OWLDataPropertyNodeSet ns = new OWLDataPropertyNodeSet();
    return dataPropertyHierarchyInfo.getNodeHierarchyChildren(pe, direct, ns);
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:6,代码来源:StructuralReasoner2.java

示例4: getSuperDataProperties

import org.semanticweb.owlapi.reasoner.impl.OWLDataPropertyNodeSet; //导入依赖的package包/类
public NodeSet<OWLDataProperty> getSuperDataProperties(OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    OWLDataPropertyNodeSet ns = new OWLDataPropertyNodeSet();
    return dataPropertyHierarchyInfo.getNodeHierarchyParents(pe, direct, ns);
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:6,代码来源:StructuralReasoner2.java

示例5: getDisjointDataProperties

import org.semanticweb.owlapi.reasoner.impl.OWLDataPropertyNodeSet; //导入依赖的package包/类
public NodeSet<OWLDataProperty> getDisjointDataProperties(
		OWLDataPropertyExpression propertyExpression) {
	checkPreConditions(propertyExpression);
	if (m_dlOntology.hasDatatypes()) {
		classifyDataProperties();
		if (!m_isConsistent)
			return new OWLDataPropertyNodeSet();
		Set<HierarchyNode<AtomicRole>> result = new HashSet<HierarchyNode<AtomicRole>>();
		if (propertyExpression.isOWLTopDataProperty()) {
			result.add(m_dataRoleHierarchy.getBottomNode());
			return dataPropertyHierarchyNodesToNodeSet(result);
		} else if (propertyExpression.isOWLBottomDataProperty()) {
			HierarchyNode<AtomicRole> node = m_dataRoleHierarchy
					.getTopNode();
			result.add(node);
			result.addAll(node.getDescendantNodes());
			return dataPropertyHierarchyNodesToNodeSet(result);
		}
		AtomicRole atomicRole = H(propertyExpression.asOWLDataProperty());
		Individual freshIndividual = Individual.create("fresh-individual");
		Constant freshConstant = Constant.createAnonymous("fresh-constant");
		Atom atomicRoleAssertion = atomicRole.getRoleAssertion(
				freshIndividual, freshConstant);
		Tableau tableau = getTableau();
		Set<HierarchyNode<AtomicRole>> nodesToTest = new HashSet<HierarchyNode<AtomicRole>>();
		nodesToTest
				.addAll(m_dataRoleHierarchy.getTopNode().getChildNodes());
		while (!nodesToTest.isEmpty()) {
			HierarchyNode<AtomicRole> nodeToTest = nodesToTest.iterator()
					.next();
			nodesToTest.remove(nodeToTest);
			AtomicRole atomicRoleToTest = nodeToTest.getRepresentative();
			Atom atomicRoleToTestAssertion = atomicRoleToTest
					.getRoleAssertion(freshIndividual, freshConstant);
			Set<Atom> perTestAtoms = new HashSet<Atom>(2);
			perTestAtoms.add(atomicRoleAssertion);
			perTestAtoms.add(atomicRoleToTestAssertion);
			if (!tableau.isSatisfiable(false, perTestAtoms, null, null,
					null, null, new ReasoningTaskDescription(true,
							"disjointness of {0} and {1}", atomicRole,
							atomicRoleToTest)))
				// disjoint
				result.addAll(nodeToTest.getDescendantNodes());
			else
				// maybe some children are disjoint
				nodesToTest.addAll(nodeToTest.getChildNodes());
		}
		if (result.isEmpty())
			result.add(m_dataRoleHierarchy.getBottomNode());
		return dataPropertyHierarchyNodesToNodeSet(result);
	} else {
		OWLDataFactory factory = getDataFactory();
		if (propertyExpression.isOWLTopDataProperty() && isConsistent())
			return new OWLDataPropertyNodeSet(new OWLDataPropertyNode(
					factory.getOWLBottomDataProperty()));
		else if (propertyExpression.isOWLBottomDataProperty()
				&& isConsistent())
			return new OWLDataPropertyNodeSet(new OWLDataPropertyNode(
					factory.getOWLTopDataProperty()));
		else
			return new OWLDataPropertyNodeSet();
	}
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:64,代码来源:Reasoner.java


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