本文整理汇总了Java中org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet.addNode方法的典型用法代码示例。如果您正苦于以下问题:Java OWLClassNodeSet.addNode方法的具体用法?Java OWLClassNodeSet.addNode怎么用?Java OWLClassNodeSet.addNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet
的用法示例。
在下文中一共展示了OWLClassNodeSet.addNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractMeaningfulRoots
import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入方法依赖的package包/类
/**
* @deprecated
*/
private Set<Integer> extractMeaningfulRoots(NodeSet<OWLClass> nodes, int level){
Set<Integer> mroots=new HashSet<Integer>();
OWLClassNodeSet mrootsClass = new OWLClassNodeSet();
for (Node<OWLClass> node : nodes.getNodes()){
for (Node<OWLClass> topNode : reasoner.getSubClasses(node.getRepresentativeElement(), true)){
mrootsClass.addNode(topNode);
if (class2identifier.containsKey(topNode.getRepresentativeElement())){
mroots.add(class2identifier.get(topNode.getRepresentativeElement()));
}
}
}
if (mroots.size()>=minNumberOfRoots || level==3){ //we want to avoid infinite recursion
return mroots;
}
else {
return extractMeaningfulRoots(mrootsClass, level+1);
}
}
示例2: getDisjointClasses
import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入方法依赖的package包/类
/**
* It was an error in original method. the result set contained both the given class and its equivalents.
*/
public NodeSet<OWLClass> getDisjointClasses(OWLClassExpression ce) {
//super.ensurePrepared();
OWLClassNodeSet nodeSet = new OWLClassNodeSet();
if (!ce.isAnonymous()) {
for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
for (OWLDisjointClassesAxiom ax : ontology.getDisjointClassesAxioms(ce.asOWLClass())) {
for (OWLClassExpression op : ax.getClassExpressions()) {
if (!op.isAnonymous() && !op.equals(ce)) { //Op must be differnt to ce
nodeSet.addNode(getEquivalentClasses(op));
}
}
}
}
}
return nodeSet;
}
示例3: getExplicitOWLDisjointnessAxioms
import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入方法依赖的package包/类
/**
* OWLDisjointAxiom(A,B,C)
* @param reasoner
* @param ontology
* @param cls
* @return
*/
public static OWLClassNodeSet getExplicitOWLDisjointnessAxioms(OWLReasoner reasoner, OWLOntology ontology, OWLClass cls){
OWLClassNodeSet nodeSet = new OWLClassNodeSet();
for (OWLDisjointClassesAxiom ax : ontology.getDisjointClassesAxioms(cls)) {
for (OWLClassExpression op : ax.getClassExpressions()) {
if (!op.isAnonymous() && !op.equals(cls)) { //Op must be differnt to ce
nodeSet.addNode(reasoner.getEquivalentClasses(op));
}
}
}
return nodeSet;
}
示例4: getExplicitDLDisjointnessAxioms
import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入方法依赖的package包/类
/**
* A ^ B -> bottom
* @param reasoner
* @param ontology
* @param cls
* @author Shuo Zhang
* @return
*/
public static OWLClassNodeSet getExplicitDLDisjointnessAxioms(OWLReasoner reasoner, OWLOntology ontology, OWLClass cls){
OWLClassNodeSet nodeSet = new OWLClassNodeSet();
OWLClassExpression subExp;
Set<OWLClassExpression> set;
for (OWLSubClassOfAxiom sax : ontology.getSubClassAxiomsForSuperClass(OWLManager.getOWLDataFactory().getOWLNothing())) {
subExp = sax.getSubClass();
if (subExp instanceof OWLObjectIntersectionOf) {
set = subExp.asConjunctSet();
if (set.contains(cls) && set.size() == 2) {
for (OWLClassExpression op : set) {
if (!op.equals(cls) && !op.isAnonymous()) {
nodeSet.addNode(reasoner.getEquivalentClasses(op));
break;
}
}
}
}
}
return nodeSet;
}
示例5: getDisjointClasses
import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入方法依赖的package包/类
public NodeSet<OWLClass> getDisjointClasses(OWLClassExpression ce) {
ensurePrepared();
OWLClassNodeSet nodeSet = new OWLClassNodeSet();
if (!ce.isAnonymous()) {
for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
for (OWLDisjointClassesAxiom ax : ontology.getDisjointClassesAxioms(ce.asOWLClass())) {
for (OWLClassExpression op : ax.getClassExpressions()) {
if (!op.isAnonymous()) {
nodeSet.addNode(getEquivalentClasses(op));
}
}
}
}
}
return nodeSet;
}