• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java OWLClassNodeSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



OWLClassNodeSet类属于org.semanticweb.owlapi.reasoner.impl包,在下文中一共展示了OWLClassNodeSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
	}
	
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:27,代码来源:OntologyProcessing.java


示例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;
   }
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:23,代码来源:StructuralReasonerExtended.java


示例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;
	
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:23,代码来源:DisjointnessAxiomExtractor.java


示例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;
       
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:33,代码来源:DisjointnessAxiomExtractor.java


示例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;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:17,代码来源:StructuralReasoner2.java


示例6: getTypes

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getTypes(OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
    for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
        for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(ind)) {
            OWLClassExpression ce = axiom.getClassExpression();
            if (!ce.isAnonymous()) {
                result.addNode(classHierarchyInfo.getEquivalents(ce.asOWLClass()));
                if (!direct) {
                    result.addAllNodes(getSuperClasses(ce, false).getNodes());
                }
            }
        }
    }
    return result;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:17,代码来源:StructuralReasoner2.java


示例7: getSubClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getSubClasses(OWLClassExpression ce, boolean direct)
throws ReasonerInterruptedException, TimeOutException,
FreshEntitiesException, InconsistentOntologyException,
ClassExpressionNotInProfileException {

	DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
	Set<OWLObject> subs = gw.queryDescendants(ce, false, true);
	for (OWLObject s : subs) {
		if (s instanceof OWLClassExpression) {
			if (s instanceof OWLClass) {
				result.addEntity((OWLClass) s);
			}
			else {

			}
		}
		else {

		}
	}
	return result;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:23,代码来源:GraphReasoner.java


示例8: getSuperClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce,
		boolean direct) throws InconsistentOntologyException,
		ClassExpressionNotInProfileException, FreshEntitiesException,
		ReasonerInterruptedException, TimeOutException {

	DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
	Set<OWLObject> supers = gw.getSubsumersFromClosure(ce);
	for (OWLObject sup : supers) {
		if (sup instanceof OWLClassExpression) {
			if (sup instanceof OWLClass) {
				result.addEntity((OWLClass) sup);
			}
			else {

			}
		}
		else {

		}
	}
	return result;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:23,代码来源:GraphReasoner.java


示例9: getDisjointClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
/**
 * Getting all disjoint classes is costly. We get only explicit disjointness.
 * We will complete with questions (A intersection B) later  if necessary
 */
public NodeSet<OWLClass> getDisjointClasses(OWLClassExpression ce) {
       
	 OWLClassNodeSet nodeSet = new OWLClassNodeSet();
        
     if (!ce.isAnonymous()) {
	     for (OWLOntology ontology : getRootOntology().getImportsClosure()) {	        	
		        nodeSet.addAllNodes(DisjointnessAxiomExtractor.getExplicitOWLDisjointnessAxioms(this, ontology, ce.asOWLClass()).getNodes());
		        nodeSet.addAllNodes(DisjointnessAxiomExtractor.getExplicitOWLDisjointnessAxioms(this, ontology, ce.asOWLClass()).getNodes());
		        nodeSet.addAllNodes(DisjointnessAxiomExtractor.getExplicitOWLDisjointnessAxioms(this, ontology, ce.asOWLClass()).getNodes());
	     }
     }
        
     return nodeSet;
	
	/*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));
                       }
                   }
               }
           }
       } */       
       
   }
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:33,代码来源:ElkReasonerAdapted.java


示例10: getSubClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getSubClasses(OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
	 
	OWLClassNodeSet ns = new OWLClassNodeSet();
    
    try{        	
    	//System.out.println("Class ok: " + ce.toString());        	
    	return super.getSubClasses(ce, direct);
    }
    catch (StackOverflowError e){
		//to catch StackOverflowError error
		System.err.println("StackOverflowError in Structural reasoner: getSubClasses for Class " + ce.toString());
		return ns;
	}
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:15,代码来源:StructuralReasonerExtended.java


示例11: getSuperClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    
	OWLClassNodeSet ns = new OWLClassNodeSet();
    
    try{
    	return super.getSuperClasses(ce, direct);
    }
    catch (StackOverflowError e){
		//to catch StackOverflowError error
		System.err.println("StackOverflowError in Structural reasoner: getSuperClasses for Class " + ce.toString());
		return ns;
	}
    
    
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:16,代码来源:StructuralReasonerExtended.java


示例12: getDisjointClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
/**
 * Getting all disjoint classes is costly. We get only explicit disjointness.
 * We will complete with questions (A intersection B) later  if necessary
 */
public NodeSet<OWLClass> getDisjointClasses(OWLClassExpression ce) {
       OWLClassNodeSet nodeSet = new OWLClassNodeSet();
       
       if (!ce.isAnonymous()) {
        for (OWLOntology ontology : getRootOntology().getImportsClosure()) {	        	
	        nodeSet.addAllNodes(DisjointnessAxiomExtractor.getExplicitOWLDisjointnessAxioms(this, ontology, ce.asOWLClass()).getNodes());
	        nodeSet.addAllNodes(DisjointnessAxiomExtractor.getExplicitOWLDisjointnessAxioms(this, ontology, ce.asOWLClass()).getNodes());
	        nodeSet.addAllNodes(DisjointnessAxiomExtractor.getExplicitOWLDisjointnessAxioms(this, ontology, ce.asOWLClass()).getNodes());
        }
       }
       
       return nodeSet;
       
       
       /*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));
                   }
               }
           }
       }
   	}*/
   }
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:31,代码来源:HermiT_adapted.java


示例13: getSubClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getSubClasses(OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    OWLClassNodeSet ns = new OWLClassNodeSet();
    if (!ce.isAnonymous()) {
        ensurePrepared();
        return classHierarchyInfo.getNodeHierarchyChildren(ce.asOWLClass(), direct, ns);
    }
    return ns;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:9,代码来源:StructuralReasoner2.java


示例14: getSuperClasses

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    OWLClassNodeSet ns = new OWLClassNodeSet();
    if (!ce.isAnonymous()) {
        ensurePrepared();
        return classHierarchyInfo.getNodeHierarchyParents(ce.asOWLClass(), direct, ns);
    }
    return ns;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:9,代码来源:StructuralReasoner2.java


示例15: getDataPropertyDomains

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getDataPropertyDomains(OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
    for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
        for (OWLDataPropertyDomainAxiom axiom : ontology.getDataPropertyDomainAxioms(pe)) {
            result.addNode(getEquivalentClasses(axiom.getDomain()));
            if (!direct) {
                result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes());
            }
        }
    }
    return result;
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:14,代码来源:StructuralReasoner2.java


示例16: getTypesLoadsTypesIncludingInferred

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
@Test
public void getTypesLoadsTypesIncludingInferred() {
    final Set<URI> typeUris = initTypes();
    final NodeSet<OWLClass> types = new OWLClassNodeSet(typeUris.stream().map(
            uri -> new OWLClassNode(dataFactory.getOWLClass(IRI.create(uri)))).collect(
            Collectors.toSet()));
    when(reasonerMock.getTypes(dataFactory.getOWLNamedIndividual(IRI.create(PK)), false)).thenReturn(types);

    final Set<Axiom<URI>> result = typesHandler.getTypes(INDIVIDUAL, null, true);

    assertEquals(typeUris.size(), result.size());
    for (Axiom<URI> ax : result) {
        assertTrue(typeUris.contains(ax.getValue().getValue()));
    }
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:16,代码来源:TypesHandlerTest.java


示例17: atomicConceptHierarchyNodesToNodeSet

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的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


示例18: convertClassNodes

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public OWLClassNodeSet convertClassNodes(
		Iterable<? extends Node<ElkClass>> nodes) {
	Set<org.semanticweb.owlapi.reasoner.Node<OWLClass>> owlNodes = new HashSet<org.semanticweb.owlapi.reasoner.Node<OWLClass>>();
	for (Node<ElkClass> node : nodes) {
		owlNodes.add(convertClassNode(node));
	}
	return new OWLClassNodeSet(owlNodes);
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:9,代码来源:ElkConverter.java


示例19: owlClassHierarchyNodesToNodeSet

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的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


示例20: getTypes

import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; //导入依赖的package包/类
public NodeSet<OWLClass> getTypes(OWLNamedIndividual individual, boolean arg1) {
	//TODO Indirect
	Set<OWLClass> classes = rootOntology.getClassesInSignature();
	OWLClassNodeSet result = new OWLClassNodeSet ();
	for (OWLClass cl : classes) {
		OWLClassAssertionAxiom impl = new OWLClassAssertionAxiomImpl (individual, cl, new HashSet<OWLAnnotation> ());
		if(isEntailed(impl)) {
			result.addEntity(cl);
		}
	}
	return result;
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:13,代码来源:Wolpertinger.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DAG类代码示例发布时间:2022-05-22
下一篇:
Java TagTechnology类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap