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


Java Node.getSize方法代码示例

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


在下文中一共展示了Node.getSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: atomicConceptHierarchyNodesToNodeSet

import org.semanticweb.owlapi.reasoner.Node; //导入方法依赖的package包/类
protected NodeSet<OWLClass> atomicConceptHierarchyNodesToNodeSet(
		Collection<HierarchyNode<AtomicConcept>> hierarchyNodes) {
	Set<Node<OWLClass>> result = new HashSet<Node<OWLClass>>();
	for (HierarchyNode<AtomicConcept> hierarchyNode : hierarchyNodes) {
		Node<OWLClass> node = atomicConceptHierarchyNodeToNode(hierarchyNode);
		if (node.getSize() != 0)
			result.add(node);
	}
	return new OWLClassNodeSet(result);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:11,代码来源:Reasoner.java

示例2: owlClassHierarchyNodesToNodeSet

import org.semanticweb.owlapi.reasoner.Node; //导入方法依赖的package包/类
protected NodeSet<OWLClass> owlClassHierarchyNodesToNodeSet(Collection<HierarchyNode<OWLClass>> hierarchyNodes) {
    Set<Node<OWLClass>> result=new HashSet<Node<OWLClass>>();
    for (HierarchyNode<OWLClass> hierarchyNode : hierarchyNodes) {
        Node<OWLClass> node=owlClassHierarchyNodeToNode(hierarchyNode);
        if (node.getSize()!=0)
            result.add(node);
    }
    return new OWLClassNodeSet(result);
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:10,代码来源:Wolpertinger.java

示例3: performConsistencyChecks

import org.semanticweb.owlapi.reasoner.Node; //导入方法依赖的package包/类
public ConsistencyReport performConsistencyChecks(){

		if(graph == null){
			return new ConsistencyReport("The ontology is not set.");
		}

		OWLOntology ont = graph.getSourceOntology();
		reasoner = getReasoner(ont);
		long t1 = System.currentTimeMillis();

		logInfo("Consistency check started............");
		boolean consistent = reasoner.isConsistent();

		logInfo("Is the ontology consistent ....................." + consistent + ", " + (System.currentTimeMillis()-t1)/100);

		List<String> errors = new ArrayList<String>();
		Set<OWLEntity> unsatisfiable = new HashSet<OWLEntity>();
		if(!consistent){
			errors.add("The ontology '" + graph.getOntologyId() + " ' is not consistent");
		}

		// We can easily get a list of unsatisfiable classes.  (A class is unsatisfiable if it
		// can't possibly have any instances).  Note that the getunsatisfiableClasses method
		// is really just a convenience method for obtaining the classes that are equivalent
		// to owl:Nothing.
		OWLClass nothing = graph.getDataFactory().getOWLNothing();
		Node<OWLClass> unsatisfiableClasses = reasoner.getUnsatisfiableClasses();
		if (unsatisfiableClasses.getSize() > 0) {
			for(OWLClass cls : unsatisfiableClasses.getEntities()) {
				logInfo("unsat: "+cls.getIRI());
				if (cls.equals(nothing)) {
					// nothing to see here, move along
					continue;
				}
				StringBuilder sb = new StringBuilder();
				sb.append("Unsatisfiable: ").append(graph.getIdentifier(cls));
				String lbl = graph.getLabel(cls);
				if (lbl != null) {
					sb.append(" '").append(lbl).append("'");
				}
				errors.add(sb.toString());
				unsatisfiable.add(cls);
			}
		}


		return new ConsistencyReport(errors, unsatisfiable);

	}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:50,代码来源:InferenceBuilder.java


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