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

Java OWLPropertyExpression类代码示例

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

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



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

示例1: filterEdges

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
protected void filterEdges(Set<OWLGraphEdge> edges, Set<? extends OWLPropertyExpression> overProperties) {
	Set<OWLGraphEdge> rmEdges = new OWLGraphEdgeSet();
	for (OWLGraphEdge e : edges) {
		if (overProperties != null) {
			if (e.getQuantifiedPropertyList().size() > 1) {
				// if a filter set is provided, do not yield any chains
				rmEdges.add(e);
				continue;					
			}
			OWLQuantifiedProperty qp = e.getSingleQuantifiedProperty();
			if (qp.isSomeValuesFrom() && !overProperties.contains(qp.getProperty())) {
				rmEdges.add(e);
				continue;
			}
		}
		if (isExcludeEdge(e)) {
			rmEdges.add(e);
		}
	}

	edges.removeAll(rmEdges);
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:23,代码来源:OWLGraphWrapperEdges.java


示例2: testSagaComplex

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Test
public void testSagaComplex() throws Exception {
	OWLObject focusObject = g.getOWLClassByIdentifier("GO:0000124"); // SAGA complex
	Set<OWLPropertyExpression> props = new HashSet<OWLPropertyExpression>();
	props.add(g.getOWLObjectProperty(OBOUpperVocabulary.BFO_part_of.getIRI()));
	
	ShuntGraphPair pair = ShuntGraphUtils.createShuntGraphPair(g, focusObject, props, true);
	
	OWLShuntGraph topology = pair.getTopologyGraph();
	
	checkNodesSagaComplex(g, topology);
	checkTopologyRelationsSagaComplex(g, topology);
	
	OWLShuntGraph inferred = pair.getInferredGraph();
	
	checkNodesSagaComplex(g, inferred);
	checkInferredRelationsSagaComplex(g, inferred);
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:19,代码来源:ShuntGraphUtilsNRTest.java


示例3: testSagaTypeComplexWithChildren

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Test
public void testSagaTypeComplexWithChildren() throws Exception {
	OWLObject focusObject = g.getOWLClassByIdentifier("GO:0070461"); // SAGA-type complex
	Set<OWLPropertyExpression> props = new HashSet<OWLPropertyExpression>();
	props.add(g.getOWLObjectProperty(OBOUpperVocabulary.BFO_part_of.getIRI()));
	
	ShuntGraphPair pair = ShuntGraphUtils.createShuntGraphPair(g, focusObject, props, true);
	
	OWLShuntGraph topology = pair.getTopologyGraph();
	
	checkNodesSagaTypeComplexWithChildren(g, topology);
	checkTopologyRelationsSagaTypeComplexWithChildren(g, topology);
	
	OWLShuntGraph inferred = pair.getInferredGraph();
	
	checkNodesSagaTypeComplexWithChildren(g, inferred);
	checkInferredRelationsSagaTypeComplexWithChildren(g, inferred);
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:19,代码来源:ShuntGraphUtilsNRTest.java


示例4: testSagaTypeComplexWithoutChildren

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Test
public void testSagaTypeComplexWithoutChildren() throws Exception {
	OWLObject focusObject = g.getOWLClassByIdentifier("GO:0070461"); // SAGA-type complex
	Set<OWLPropertyExpression> props = new HashSet<OWLPropertyExpression>();
	props.add(g.getOWLObjectProperty(OBOUpperVocabulary.BFO_part_of.getIRI()));
	
	ShuntGraphPair pair = ShuntGraphUtils.createShuntGraphPair(g, focusObject, props, false);
	
	OWLShuntGraph topology = pair.getTopologyGraph();
	
	checkNodesSagaTypeComplexWithoutChildren(g, topology);
	checkTopologyRelationsSagaTypeComplexWithoutChildren(g, topology);
	
	OWLShuntGraph inferred = pair.getInferredGraph();
	
	checkNodesSagaTypeComplexWithoutChildren(g, inferred);
	checkInferredRelationsSagaTypeComplexWithoutChildren(g, inferred);
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:19,代码来源:ShuntGraphUtilsNRTest.java


示例5: shouldGetOntologyRoots

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * Test {@link OWLGraphWrapperEdgesExtended#getOntologyRoots(Set)} and 
 * {@link OWLGraphWrapperEdgesExtended#getOntologyRoots()}.
 */
@Test
public void shouldGetOntologyRoots() {
	//the ontology has 2 roots, FOO:0001 and FOO:0100
    //NCBITaxon are due to GCI relations
    Set<OWLClass> expectedRoots = new HashSet<OWLClass>(Arrays.asList(
            wrapper.getOWLClassByIdentifier("FOO:0001"), 
            wrapper.getOWLClassByIdentifier("FOO:0100"), 
            wrapper.getOWLClassByIdentifier("NCBITaxon:1"))); 
	assertEquals("Incorrect roots returned", expectedRoots, wrapper.getOntologyRoots());
	
	expectedRoots = new HashSet<OWLClass>(Arrays.asList(
               wrapper.getOWLClassByIdentifier("FOO:0001"), 
               wrapper.getOWLClassByIdentifier("FOO:0100"), 
               wrapper.getOWLClassByIdentifier("NCBITaxon:1"), 
               wrapper.getOWLClassByIdentifier("FOO:0012"), 
               wrapper.getOWLClassByIdentifier("FOO:0007"), 
               wrapper.getOWLClassByIdentifier("FOO:0008"), 
               wrapper.getOWLClassByIdentifier("FOO:0009")));
       assertEquals("Incorrect roots returned", expectedRoots, 
               wrapper.getOntologyRoots(new HashSet<OWLPropertyExpression>(
                   Arrays.asList(wrapper.getOWLObjectPropertyByIdentifier("BFO:0000050")))));
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:27,代码来源:OWLGraphWrapperEdgesExtendedTest.java


示例6: addSubPropertyAxiom

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
private void addSubPropertyAxiom(OWLSubPropertyAxiom<?> axiom)
{
   OWLPropertyExpression<?,?> subProperty = axiom.getSubProperty();
   OWLPropertyExpression<?,?> superProperty = axiom.getSuperProperty();
   
   OwlNode<OWLPropertyExpression<?,?>> subClassNode = createNode(subProperty);
   OwlNode<OWLPropertyExpression<?,?>> superClassNode = createNode(superProperty);
   
   if (mPropertyCache.contains(subProperty)) {
      subClassNode = findNode(subProperty);
      superClassNode.setParent(subClassNode.getParent());
      subClassNode.setParent(superClassNode);
   }
   else if (mPropertyCache.contains(superProperty)) {
      superClassNode = findNode(superProperty);
      subClassNode.setParent(superClassNode);
   }
   else {
      superClassNode.setParent(mRoot);
      subClassNode.setParent(superClassNode);
   }
   mPropertyCache.add(subProperty);
   mPropertyCache.add(superProperty);
}
 
开发者ID:obidea,项目名称:semantika,代码行数:25,代码来源:OwlPropertyStructureHandler.java


示例7: getAncestors

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Override
public OwlNodeSet<OWLPropertyExpression<?, ?>> getAncestors(OWLPropertyExpression<?, ?> entity, boolean direct)
{
   OwlNodeSet<OWLPropertyExpression<?, ?>> ancestors = new OwlNodeSet<OWLPropertyExpression<?, ?>>();
   OwlNode<OWLPropertyExpression<?, ?>> node = mRoot.findNode(entity);
   if (node != null) {
      OwlNode<OWLPropertyExpression<?, ?>> parent = node.getParent();
      while (!parent.isRoot()) {
         ancestors.addNode(parent);
         if (direct) {
            break;
         }
         parent = parent.getParent();
      }
   }
   return ancestors;
}
 
开发者ID:obidea,项目名称:semantika,代码行数:18,代码来源:OwlPropertyStructureHandler.java


示例8: getDescendants

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Override
public OwlNodeSet<OWLPropertyExpression<?,?>> getDescendants(OWLPropertyExpression<?,?> entity, boolean direct)
{
   OwlNodeSet<OWLPropertyExpression<?,?>> descendants = new OwlNodeSet<OWLPropertyExpression<?,?>>();
   OwlNode<OWLPropertyExpression<?,?>> node = mRoot.findNode(entity);
   if (node != null) {
      OwlNodeSet<OWLPropertyExpression<?,?>> children = node.getChildren();
      if (direct) {
         descendants.addNodeSet(children);
      }
      else {
         collectChildren(children, descendants);
      }
   }
   return descendants;
}
 
开发者ID:obidea,项目名称:semantika,代码行数:17,代码来源:OwlPropertyStructureHandler.java


示例9: setAndFilterRedundantPredictions

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * side-effects: removes redundant predictions over a set of relationships.
 * If overProps set is empty, only the subClassOf hierarchy is used, if it's
 * null all relationships are used.
 * 
 * @param predictions
 * @param aClasses
 * @param overProps
 */
protected void setAndFilterRedundantPredictions(Set<Prediction> predictions, Set<OWLClass> aClasses, Set<OWLPropertyExpression> overProps) {
	Set<Prediction> newPredictions = new HashSet<Prediction>();

	for (Prediction p : predictions) {
		boolean isRedundant = false;
		GeneAnnotation a = p.getGeneAnnotation();
		OWLClass cls = (OWLClass) graph.getOWLObjectByIdentifier(a.getCls());
		for (OWLClass aClass : aClasses) {
			if (graph.getAncestorsReflexive(aClass, overProps).contains(cls)) {
				isRedundant = true;
				break;
			}
		}
		if (isRedundant && this.removeAllRedundant) {
			continue;
		}
		p.setRedundantWithExistingAnnotations(isRedundant);
		
		isRedundant = false;
		for (Prediction p2 : predictions) {
			GeneAnnotation a2 = p2.getGeneAnnotation();
			OWLClass cls2 = (OWLClass) graph.getOWLObjectByIdentifier(a2.getCls());
			if (graph.getAncestors(cls2).contains(cls)) {
				isRedundant = true;
				break;
			}
		}
		if (isRedundant && this.removeAllRedundant) {
			continue;
		}
		p.setRedundantWithOtherPredictions(isRedundant);
		newPredictions.add(p);
	}
	predictions.clear();
	predictions.addAll(newPredictions);

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


示例10: classifyRelationship

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * Classify the an edge and target as a human readable string for further processing.
 * 
 * @param owlGraphEdge edge under consideration
 * @param edgeDirector 
 * @param props properties set
 * @return null, "simplesubclass", "typesubclass", or "identity".
 * @see #addDirectDescendentsToShuntGraph
 * @see #addStepwiseAncestorsToShuntGraph
 */
public String classifyRelationship(OWLGraphEdge owlGraphEdge, OWLObject edgeDirector, Set<? extends OWLPropertyExpression> props){		
	String retval = null;
	
	OWLQuantifiedProperty qp = owlGraphEdge.getSingleQuantifiedProperty();
	if( qp.isSubClassOf() || props.contains(qp.getProperty()) ){
		//OWLObject target = owlGraphEdge.getTarget();
		if( edgeDirector instanceof OWLClass ){
			retval = "simplesubclass";
		}else if( edgeDirector instanceof OWLObjectSomeValuesFrom ){
			OWLObjectSomeValuesFrom some = (OWLObjectSomeValuesFrom)edgeDirector;
			if( props.contains(some.getProperty()) ){
				OWLClassExpression clsexp = some.getFiller();
				if( ! clsexp.isAnonymous()){
					retval = "typesubclass";
				}
			}
		}
	}else if( qp.isIdentity() ){
		retval = "identity";
	}else{
		if (LOG.isDebugEnabled()) {
			LOG.debug("Skipping complex edge: "+owlGraphEdge);
		}
	}
	
	return retval;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:38,代码来源:OWLGraphWrapperEdgesAdvanced.java


示例11: findLeastCommonAncestors

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * Find lest common ancestors to {@code x} and {@code y} that can be reached 
 * over the specified set of relations. 
 * @param g
 * @param x
 * @param y
 * @param overProps
 * @return
 */
public static Set<OWLObject> findLeastCommonAncestors(OWLGraphWrapper g,
        OWLObject x, OWLObject y, Set<OWLPropertyExpression> overProps) {
    Set<OWLObject> cas = findCommonAncestors(g,x,y, overProps);
    Set<OWLObject> lcas = new HashSet<OWLObject>();
    lcas.addAll(cas);
    for (OWLObject z : cas) {
        lcas.removeAll(g.getAncestors(z, overProps));
    }
    return lcas;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:20,代码来源:OWLGraphUtil.java


示例12: getOutgoingEdges

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * retrieves direct edges from a source
 * to the direct **named** target for a given set of properties
 * <ul>
 * <li>e.g. if (A SubClassOf B) then outgoing(A) = { &lt;A,sub,B&gt;}</li>
 * <li>e.g. if (A SubClassOf R some B) then outgoing(A) = { &lt;A, R-some, B&gt; }</li>
 * <li>e.g. if (A SubClassOf R some (R2 some B)) then outgoing(A) = { &lt;A, [R-some,R2-same], B&gt; }</li>
 * </ul>
 * @param cls source
 * @param props
 * @return all edges that originate from source to nearest named object target
 */
public Set<OWLGraphEdge> getOutgoingEdges(OWLObject cls, Set<? extends OWLPropertyExpression> props) {
	Set<OWLGraphEdge> pEdges = getPrimitiveOutgoingEdges(cls);
	LOG.debug("primitive edges:"+cls+" --> "+pEdges);

	Set<OWLGraphEdge> edges = new OWLGraphEdgeSet();
	for (OWLGraphEdge e : pEdges) {
	    edges.addAll(primitiveEdgeToFullEdges(e));
	}
       if (props != null) {
           filterEdges(edges, props);
       }
	LOG.debug("  all:"+cls+" --> "+edges);
	return edges;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:27,代码来源:OWLGraphWrapperEdges.java


示例13: getAncestors

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * As {@link getAncestors(OWLObject s, Set<OWLProperty) overProps}, 
 * but if isStrict is true, then only consider paths that include at least one edge
 * with a property in the specified set. i.e. exclude subclass-only paths. 
 * 
 * @param s
 * @param overProperties
 * @return
 */

public Set<OWLObject> getAncestors(OWLObject x, Set<OWLPropertyExpression> overProps, boolean isStrict) {
	Set<OWLObject> ancs = new HashSet<OWLObject>();
	for (OWLGraphEdge e : getOutgoingEdgesClosure(x, overProps)) {
		boolean isAddMe = false;
		if (overProps != null) {
			List<OWLQuantifiedProperty> qps = e.getQuantifiedPropertyList();
			if (qps.size() == 0) {
				// identity
				if (!isStrict)
					isAddMe = true;
			}
			else if (qps.size() == 1) {
				OWLQuantifiedProperty qp = qps.get(0);
				if (qp.isIdentity()) {
					if (!isStrict)
						isAddMe = true;
				}
				else if (qp.isSubClassOf()) {
					if (!isStrict)
						isAddMe = true;
				}
				else if (qp.isSomeValuesFrom() && overProps.contains(qp.getProperty())) {
					isAddMe = true;
				}
			}
			else if (!isStrict) {
			    isAddMe = true;
			}
		}
		else {
			isAddMe = true;
		}
		if (isAddMe)
			ancs.add(e.getTarget());
	}
	return ancs;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:48,代码来源:OWLGraphWrapperEdges.java


示例14: shouldGetGCIAncestorsOverProps

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * Test {@link OWLGraphWrapperEdgesExtended#getNamedAncestorsWithGCI(OWLClass, Set)}.
 */
@SuppressWarnings("rawtypes")
@Test
public void shouldGetGCIAncestorsOverProps() throws OWLOntologyCreationException, 
OBOFormatParserException, IOException {
    ParserWrapper parserWrapper = new ParserWrapper();
    OWLOntology ont = parserWrapper.parse(this.getClass().getResource(
            "/graph/gciRelRetrieval.obo").getFile());
    OWLGraphWrapper wrapper = new OWLGraphWrapper(ont);
    
    OWLClass cls8 = wrapper.getOWLClassByIdentifier("ID:8");
    OWLClass cls6 = wrapper.getOWLClassByIdentifier("ID:6");
    OWLClass cls4 = wrapper.getOWLClassByIdentifier("ID:4");
    OWLClass cls5 = wrapper.getOWLClassByIdentifier("ID:5");
    OWLClass cls9 = wrapper.getOWLClassByIdentifier("ID:9");
    OWLClass cls10 = wrapper.getOWLClassByIdentifier("ID:10");
    
    Set<OWLClass> expectedAncestors = new HashSet<OWLClass>();
    Set<OWLPropertyExpression> overProps = new HashSet<OWLPropertyExpression>();
    overProps.add(wrapper.getOWLObjectPropertyByIdentifier("BFO:0000050"));
    //no ancestors through GCI
    expectedAncestors.add(cls4);
    expectedAncestors.add(cls6);
    assertEquals("Incorrect ancestors with GCI over props", expectedAncestors, 
            wrapper.getNamedAncestorsWithGCI(cls8, overProps));
    //ancestors with GCI
    expectedAncestors = new HashSet<OWLClass>();
    overProps = new HashSet<OWLPropertyExpression>();
    overProps.add(wrapper.getOWLObjectPropertyByIdentifier("RO:0002202"));
    expectedAncestors.add(cls10);
    expectedAncestors.add(cls6);
    expectedAncestors.add(cls5);
    assertEquals("Incorrect ancestors through GCI and classical relations", 
            expectedAncestors, wrapper.getNamedAncestorsWithGCI(cls9, overProps));
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:38,代码来源:OWLGraphWrapperEdgesExtendedTest.java


示例15: collectChildren

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
private static void collectChildren(OwlNodeSet<OWLPropertyExpression<?,?>> children, OwlNodeSet<OWLPropertyExpression<?,?>> descendants)
{
   if (children.isEmpty()) {
      return;
   }
   descendants.addNodeSet(children);
   OwlNodeSet<OWLPropertyExpression<?,?>> newChildren = new OwlNodeSet<OWLPropertyExpression<?,?>>();
   for (OwlNode<OWLPropertyExpression<?,?>> node : children.getNodes()) {
      newChildren.addNodeSet(node.getChildren());
   }
   collectChildren(newChildren, descendants);
}
 
开发者ID:obidea,项目名称:semantika,代码行数:13,代码来源:OwlPropertyStructureHandler.java


示例16: visit

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Override
public void visit(OWLObjectPropertyDomainAxiom axiom)
{
   addSubClassAxiom(axiom.asOWLSubClassOfAxiom());
   
   OWLObjectPropertyExpression op = axiom.getProperty();
   OwlNodeSet<OWLPropertyExpression<?,?>> descendants = mPropertyStructureHandler.getDescendants(op, false);
   for (OwlNode<OWLPropertyExpression<?,?>> node : descendants.getNodes()) {
      op = (OWLObjectPropertyExpression) node.getEntity();
      axiom = mOwlDataFactory.getOWLObjectPropertyDomainAxiom(op, axiom.getDomain());
      addSubClassAxiom(axiom.asOWLSubClassOfAxiom());
   }
}
 
开发者ID:obidea,项目名称:semantika,代码行数:14,代码来源:OwlClassStructureHandler.java


示例17: equals

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    return obj instanceof OWLPropertyExpression;
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:8,代码来源:OWLPropertyExpressionImpl.java


示例18: visit

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
@Override
public void visit(@Nonnull OWLHasKeyAxiom axiom) {
    axiom.getClassExpression().accept(this);
    for (OWLPropertyExpression prop : axiom.getPropertyExpressions()) {
        prop.accept(this);
    }
    processAxiomAnnotations(axiom);
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:9,代码来源:AbstractEntityRegistrationManager.java


示例19: getAncestorsReflexive

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
public Set<OWLObject> getAncestorsReflexive(OWLObject x, Set<OWLPropertyExpression> overProps) {
	Set<OWLObject> ancs = new HashSet<OWLObject>(getAncestors(x, overProps));
	ancs.add(x);
	return ancs;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:6,代码来源:OWLGraphWrapperEdges.java


示例20: getGCIEdges

import org.semanticweb.owlapi.model.OWLPropertyExpression; //导入依赖的package包/类
/**
 * Retrieve OBO GCI relations for {@code obj} as a {@code Set} of {@code OWLGraphEdge}s.
 * See {@link #getGCIOutgoingEdges(OWLObject)} for details about OBO GCI relations, 
 * and about retrieving the associated "gci_filler" and "gci_relation".
 * <p>
 * If {@code bySource} is {@code true}, edges outgoing from {@code obj} are retrieved, 
 * otherwise, edges incoming to {@code obj} are retrieved. If {@code overProperties} 
 * is not {@code null}, only the specified set of properties will be considered. Note 
 * that this does not filter for the "gci_relation" (as returned by 
 * {@link OWLGraphEdge#getGCIRelation()}), but for the actual property 
 * of the {@code OWLGraphEdge}s (as returned by 
 * {@link OWLGraphEdge#getQuantifiedPropertyList()}). 
 * <p>
 * Advanced usage notice: note that if the desired set of properties is {P},
 * and there exists a property chain Q o R --> P, then be sure to include Q and R in
 * the specified set.
 * 
 * @param obj               The {@code OWLObject} for which we want to retrieve 
 *                          OBO GCI relations
 * @param bySource          A {@code boolean} defining whether outgoing edges 
 *                          (when {@code true}) or incoming edges (when {@code false}) 
 *                          should be retrieved.
 * @param overProperties    A {@code Set} of {@code OWLPropertyExpression} allowing 
 *                          to filter the {@code OWLGraphEdge}s returned.
 * @return                  A {@code Set} of {@code OWLGraphEdge}s corresponding to 
 *                          GCI relations for {@code obj}.
 */
private Set<OWLGraphEdge> getGCIEdges(OWLClass obj, boolean bySource, 
        Set<OWLPropertyExpression> overProperties) {
    lazyLoadGCIRelCache();
    
    Set<OWLGraphEdge> cachedEdges = null;
    if (bySource) {
        cachedEdges = this.gciRelationBySource.get(obj);
    } else {
        cachedEdges = this.gciRelationByTarget.get(obj);
    }
    if (LOG.isTraceEnabled()) {
        LOG.trace("GCI edges retrieved for " + obj + ": " + cachedEdges);
    }
    if (cachedEdges != null) {
        //defensive copying
        Set<OWLGraphEdge> edges = new OWLGraphEdgeSet(cachedEdges);
        filterEdges(edges, overProperties);
        return edges;
    } 

    return new OWLGraphEdgeSet();
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:50,代码来源:OWLGraphWrapperEdgesExtended.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java OConcurrentModificationException类代码示例发布时间:2022-05-22
下一篇:
Java TimelineItem类代码示例发布时间: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