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


Java OWLObjectIntersectionOf.getOperands方法代码示例

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


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

示例1: visit

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
@Override
public HandlerResult visit(OWLObjectIntersectionOf intersectionOf) {
	Set<OWLClassExpression> newOperands = new HashSet<OWLClassExpression>();
	boolean changed = false;
	for (OWLClassExpression ce : intersectionOf.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.getOWLObjectIntersectionOf(newOperands));
		
	}
	return null;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:27,代码来源:CardinalityContraintsTools.java

示例2: flattenConjunction

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
private Set<Integer> flattenConjunction(OWLObjectIntersectionOf conjunction, Set<Definition> newDefinitions,
		Set<Integer> newNames) {
	Set<Integer> atomIds = new HashSet<>();
	for (OWLClassExpression operand : conjunction.getOperands()) {
		atomIds.addAll(flattenClassExpression(operand, newDefinitions, newNames));
	}
	return atomIds;
}
 
开发者ID:julianmendez,项目名称:uel,代码行数:9,代码来源:UelOntology.java

示例3: visit

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLObjectIntersectionOf object) {
    OWLClassExpression definition=getDefinitionFor(object,m_alreadyExists);
    if (!m_alreadyExists[0])
        for (OWLClassExpression description : object.getOperands())
            m_newInclusions.add(new OWLClassExpression[] { negative(definition),description });
    return definition;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:8,代码来源:OWLNormalization.java

示例4: visit

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLObjectIntersectionOf d) {
    Set<OWLClassExpression> newConjuncts=new HashSet<OWLClassExpression>();
    for (OWLClassExpression description : d.getOperands()) {
        OWLClassExpression descriptionSimplified=getSimplified(description);
        if (descriptionSimplified.isOWLThing())
            continue;
        else if (descriptionSimplified.isOWLNothing())
            return m_factory.getOWLNothing();
        else if (descriptionSimplified instanceof OWLObjectIntersectionOf)
            newConjuncts.addAll(((OWLObjectIntersectionOf)descriptionSimplified).getOperands());
        else
            newConjuncts.add(descriptionSimplified);
    }
    return m_factory.getOWLObjectIntersectionOf(newConjuncts);
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:16,代码来源:ExpressionManager.java

示例5: visit

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

示例6: visit

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
@Override
public IntegerClassExpression visit(OWLObjectIntersectionOf ce) {
	Objects.requireNonNull(ce);
	Set<OWLClassExpression> operands = ce.getOperands();
	Set<IntegerClassExpression> classExpressionList = new HashSet<>();
	operands.forEach(elem -> {
		classExpressionList.add(elem.accept(this));
	});
	return getDataTypeFactory().createObjectIntersectionOf(classExpressionList);
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:11,代码来源:ClassExpressionTranslator.java

示例7: generateLabel

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
public String generateLabel(OWLClassExpression x) {
	StringBuffer sb = new StringBuffer();
	if (x instanceof OWLObjectSomeValuesFrom) {
		OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom) x;	
		OWLObjectPropertyExpression p = svf.getProperty();
		if (propertyToFormatMap.containsKey(p)) {
			return String.format(propertyToFormatMap.get(p), generateLabel(svf.getFiller()));
		}
		else {
			String pStr = p.toString();
			if (p instanceof OWLEntity) {
				pStr = getAnyLabel((OWLEntity)p);
			}
			return pStr + " some "+generateLabel(svf.getFiller());
		}
	}
	else if (x instanceof OWLObjectIntersectionOf) {
		OWLObjectIntersectionOf oio = (OWLObjectIntersectionOf) x;
		for (OWLClassExpression op : oio.getOperands()) {
			if (sb.length() > 0) {
				sb.append(" and ");
			}
			sb.append(generateLabel(op));
		}
		return sb.toString();
	}
	else if (x instanceof OWLClass) {
		return this.getAnyLabel((OWLClass) x);
	}
	return x.toString();
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:32,代码来源:AbstractSimPreProcessor.java

示例8: visit

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

示例9: visit

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
@Override
public void visit(OWLObjectIntersectionOf desc) {
          for (OWLClassExpression op : desc.getOperands()) {
              op.accept(this);
              if (foundOtherNamedClass) {
                  break;
              }
          }
      }
 
开发者ID:ics-upmc,项目名称:archonte,代码行数:10,代码来源:DifferentialClassHierarchyProvider.java

示例10: visit

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

示例11: visit

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
@Override
public Set<OWLClassExpression> visit(OWLObjectIntersectionOf 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

示例12: visit

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

			Set<OWLClassExpression> ops = inters.getOperands();
			List<List<OWLClassExpression>> lists = new ArrayList<List<OWLClassExpression>>();
			for (OWLClassExpression op : ops) {
				try {
					lists.add(getListOfConjunctions(op));
					list.addAll(getConjunctionsFromLists(getCartesianProduct(lists)));
				} catch (UnusedClassExpressionException e) {
					errorCnt++;
				}
			}

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

示例13: visit

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
public void visit(OWLObjectIntersectionOf arg0) {
    for (final OWLClassExpression e : arg0.getOperands()) {
        e.accept(this);
    }
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:6,代码来源:IntegrityConstraintClassParser.java

示例14: visit

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

示例15: hasMatchingIntersection

import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
/**
 * Search for the first class with a matching equivalent class definition. 
 * 
 * @param c
 * @param genus
 * @param relation
 * @return match or null
 */
private OWLClass hasMatchingIntersection(OWLClass c, OWLClass genus, OWLObjectProperty relation) {
	for(OWLOntology o : allOntologies) {
		Set<OWLEquivalentClassesAxiom> eqAxioms = o.getEquivalentClassesAxioms(c);
		for (OWLEquivalentClassesAxiom eqAxiom : eqAxioms) {
			Set<OWLClassExpression> expressions = eqAxiom.getClassExpressionsMinus(c);
			for (OWLClassExpression expression : expressions) {
				if (expression instanceof OWLObjectIntersectionOf) {
					OWLObjectIntersectionOf intersection = (OWLObjectIntersectionOf) expression;
					OWLClass differentiaCls = null;
					boolean matchesGenus = false;
					boolean matchesRelation = false;
					Set<OWLClassExpression> operands = intersection.getOperands();
					if (operands.size() == 2) {
						for (OWLClassExpression operand : operands) {
							if (operand.isAnonymous() == false) {
								OWLClass currentGenus = operand.asOWLClass();
								if (genus.equals(currentGenus)) {
									matchesGenus = true;
								}
							}
							else if (operand instanceof OWLObjectSomeValuesFrom) {
								OWLObjectSomeValuesFrom differentia = (OWLObjectSomeValuesFrom) operand;
								if (relation.equals(differentia.getProperty())) {
									matchesRelation = true;
									OWLClassExpression filler = differentia.getFiller();
									if (!filler.isAnonymous() && !filler.isOWLNothing() && !filler.isOWLThing()) {
										differentiaCls = filler.asOWLClass();
									}
								}
							}
						}
						if (matchesGenus && matchesRelation ) {
							 return differentiaCls;
						}
					}
				}
			}
		}
	}
	return null;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:50,代码来源:LinkMaker.java


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