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


Java OWLObjectUnionOf.getOperands方法代码示例

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


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

示例1: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
@Override
public HandlerResult visit(OWLObjectUnionOf unionOf) {
	Set<OWLClassExpression> newOperands = new HashSet<OWLClassExpression>();
	boolean changed = false;
	for (OWLClassExpression ce : unionOf.getOperands()) {
		HandlerResult handlerResult = ce.accept(this);
		if (handlerResult != null) {
			if (handlerResult.remove) {
				return HandlerResult.remove();
			}
			changed = true;
			newOperands.add(handlerResult.modified);
		}
		else {
			newOperands.add(ce);
		}
	}
	if (changed) {
		if (newOperands.size() == 1) {
			return HandlerResult.modified(newOperands.iterator().next());
		}
		return HandlerResult.modified(factory.getOWLObjectUnionOf(newOperands));
	}
	return null;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:26,代码来源:CardinalityContraintsTools.java

示例2: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
public void visit(OWLObjectUnionOf union) {

			Set<OWLClassExpression> ops = union.getOperands();
			for (OWLClassExpression op : ops) {
				/*
				 * ArrayList<OWLClassExpression> l = new
				 * ArrayList<OWLClassExpression>(); new
				 * NormalizatorClassExpressionVisitor(op, l); list.addAll(l);
				 */
				try {
					list.addAll(getListOfConjunctions(op));
				} catch (UnusedClassExpressionException e) {
					errorCnt++;
				}
			}

		}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:18,代码来源:CEXOWL2ELProfile.java

示例3: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLObjectUnionOf d) {
    Set<OWLClassExpression> newDisjuncts=new HashSet<OWLClassExpression>();
    for (OWLClassExpression description : d.getOperands()) {
        OWLClassExpression descriptionNNF=getNNF(description);
        newDisjuncts.add(descriptionNNF);
    }
    return m_factory.getOWLObjectUnionOf(newDisjuncts);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:9,代码来源:ExpressionManager.java

示例4: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
@Override
public OWLObjectUnionOf visit(OWLObjectUnionOf ce) {
	if (LOG.isDebugEnabled()) {
		LOG.debug("Unfolding union_of: "+ce);
	}
	
	Set<OWLClassExpression> operands = ce.getOperands();
	if (operands != null && !operands.isEmpty()) {
		Set<OWLClassExpression> unfolded = unfoldExpressions(operands);
		if (unfolded != null) {
			return factory.getOWLObjectUnionOf(unfolded);
		}
	}
	return null;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:16,代码来源:TBoxUnFoldingTool.java

示例5: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
public void visit(OWLObjectUnionOf arg0) {
	boolean isFirst=true;
	for (OWLClassExpression operand : arg0.getOperands()) {
		if (!isFirst)
			writer.write(" or ");
		operand.accept(this);
		isFirst=false;
	}
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:10,代码来源:NiceAxiomPrinter.java

示例6: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
@Override
public Void visit(OWLObjectUnionOf desc) {
  long subject = getOrCreateNode(getIri(desc), OwlLabels.OWL_UNION_OF, OwlLabels.OWL_ANONYMOUS);
  for (OWLClassExpression expression : desc.getOperands()) {
    long object = getOrCreateNode(getIri(expression));
    getOrCreateRelationship(subject, object, OwlRelationships.OPERAND);
  }
  return null;
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:10,代码来源:GraphOwlVisitor.java

示例7: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectUnionOf ce) {
    Set<OWLClassExpression> ops = new HashSet<>();
    for (OWLClassExpression op : ce.getOperands()) {
        ops.add(op.accept(this));
    }
    if (negated) {
        // Flip to an intersection
        return dataFactory.getOWLObjectIntersectionOf(ops);
    } else {
        return dataFactory.getOWLObjectUnionOf(ops);
    }
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:14,代码来源:NNF.java

示例8: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
@Override
public Set<OWLClassExpression> visit(OWLObjectUnionOf ce) {
    Set<OWLClassExpression> result = new HashSet<>();
    result.add(ce);
    for (OWLClassExpression op : ce.getOperands()) {
        result.addAll(op.accept(this));
    }
    return result;
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:10,代码来源:OWLClassExpressionCollector.java

示例9: getConceptForUnionOf

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
/**
 * Returns the concept for an ObjectUnionOf. This is just used to borrow
 * relationships and never actually creates an anonymous concept.
 *
 * @param expr the expr
 * @param ontology the ontology
 * @param level the level
 * @return the concept for union
 * @throws Exception the exception
 */
private Concept getConceptForUnionOf(OWLObjectUnionOf expr,
  OWLOntology ontology, int level) throws Exception {
  String uuid = TerminologyUtility.getUuid(expr.toString()).toString();

  if (idMap.containsKey(uuid)) {
    return getConcept(idMap.get(uuid));
  }

  Concept concept = new ConceptJpa();
  setCommonFields(concept);
  concept.setWorkflowStatus(WorkflowStatus.PUBLISHED);
  concept.setAnonymous(true);
  concept.setTerminologyId(uuid);
  concept.setName(expr.toString());
  concept.setUsesRelationshipIntersection(false);
  concept.setUsesRelationshipUnion(true);

  // Handle nested class expressions
  if (expr.getOperands().size() > 1) {

    // Iterate through expressions and either add a parent relationship
    // or add relationships from the concept itself. No new anonymous
    // concepts are directly created here.
    for (final OWLClassExpression expr2 : expr.getOperands()) {
      final Concept concept2 =
          getConceptForOwlClassExpression(expr2, ontology, level + 1);
      // If it's a restriction, borrow its relationships
      if (expr2 instanceof OWLObjectIntersectionOf) {
        // make an anonymous concept out of this and a relationship to it.
        // Add if anonymous and doesn't exist yet
        if (concept2.isAnonymous()
            && !idMap.containsKey(concept2.getTerminologyId())) {
          addAnonymousConcept(concept2);
          exprMap.put(concept2.getTerminologyId(), expr);
        }
        ConceptRelationship rel =
            getSubClassOfRelationship(concept, concept2);
        rel.setRelationshipType("other");
        rel.setAdditionalRelationshipType("");
        concept.getRelationships().add(rel);
      }

      // otherwise, unknown type
      else {
        throw new Exception("Unexpected operand expression type - " + expr2);
      }
    }

    return concept;

  }

  // ASSUMPTION: union has at least two sub-expressions
  else {
    throw new Exception(
        "Unexpected number of union nested class expressions - " + expr);
  }

}
 
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:70,代码来源:OwlLoaderAlgorithm.java

示例10: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
public void visit(OWLObjectUnionOf object) {
    for (OWLClassExpression description : object.getOperands())
        description.accept(this);
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:5,代码来源:BuiltInPropertyManager.java

示例11: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
public Boolean visit(OWLObjectUnionOf object) {
    for (OWLClassExpression desc : object.getOperands())
        if (desc.accept(this))
            return Boolean.TRUE;
    return Boolean.FALSE;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:7,代码来源:OWLNormalization.java

示例12: visit

import org.semanticweb.owlapi.model.OWLObjectUnionOf; //导入方法依赖的package包/类
@Override
public void visit(@Nonnull OWLObjectUnionOf ce) {
    for (OWLClassExpression operand : ce.getOperands()) {
        operand.accept(this);
    }
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:7,代码来源:AbstractEntityRegistrationManager.java


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