本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
}
}
示例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);
}
}
示例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;
}
示例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++;
}
}
}
示例13: visit
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
public void visit(OWLObjectIntersectionOf arg0) {
for (final OWLClassExpression e : arg0.getOperands()) {
e.accept(this);
}
}
示例14: visit
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入方法依赖的package包/类
public void visit(OWLObjectIntersectionOf object) {
for (OWLClassExpression description : object.getOperands())
description.accept(this);
}
示例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;
}