本文整理汇总了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);
}
示例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);
}
示例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);
}