Refine search
public void visit(OWLObjectUnionOf node) { for (OWLClassExpression desc : node.getOperands()) { desc.accept(this); } }
@Override public OWLClassExpression visit(OWLObjectUnionOf ce) { Stream<OWLClassExpression> ops = ce.operands().map(p -> p.accept(this)); if (negated) { // Flip to an intersection return df.getOWLObjectIntersectionOf(ops); } return df.getOWLObjectUnionOf(ops); }
@Override public OWLClassExpression visit(OWLObjectUnionOf d) { List<OWLClassExpression> newDisjuncts=new ArrayList<>(); for (OWLClassExpression description : d.getOperandsAsList()) { OWLClassExpression descriptionSimplified=getSimplified(description); if (descriptionSimplified.isOWLThing()) return m_factory.getOWLThing(); else if (descriptionSimplified.isOWLNothing()) continue; else if (descriptionSimplified instanceof OWLObjectUnionOf) newDisjuncts.addAll(((OWLObjectUnionOf)descriptionSimplified).getOperandsAsList()); else newDisjuncts.add(descriptionSimplified); } return m_factory.getOWLObjectUnionOf(newDisjuncts); } @Override
@Override public void visit(OWLObjectUnionOf ce) { if (ce.getOperands().size() < 2) { if (ce.getOperands().size() <= 0) { throw new RuntimeException(ce + " wrong number of operands"); } stack.push(ce.getOperandsAsList().get(0)); } else { Set<OWLClassExpression> operands = new HashSet<>(); for (OWLClassExpression c : ce.getOperands()) { c.accept(this); operands.add(stack.pop()); } stack.push(factory.getOWLObjectUnionOf(operands)); } }
@Override public OWLClassExpression visit(OWLObjectUnionOf ce) { List<OWLClassExpression> operands = new ArrayList<>(); for (OWLClassExpression operand : ce.getOperands()) { OWLClassExpression newOperand = operand.accept(this); if(newOperand instanceof OWLObjectUnionOf){ operands.addAll(((OWLObjectUnionOf) newOperand).getOperandsAsList()); } else { operands.add(newOperand); } } Collections.sort(operands); return new OWLObjectUnionOfImplExt(operands); }
} else if (description instanceof OWLObjectUnionOf) { SortedSet<OWLIndividual> ret = new TreeSet<>(); for (OWLClassExpression operand : ((OWLObjectUnionOf) description).getOperands()) { ret.addAll(getIndividualsImpl(operand)); .filter(e -> e.getValue().stream().anyMatch(targetSet::contains)) .map(Entry::getKey) .collect(Collectors.toCollection(TreeSet::new)); } else if (description instanceof OWLObjectAllValuesFrom) { } else if (filler instanceof OWLDataIntersectionOf) { return ((OWLDataIntersectionOf) filler).getOperands().stream() .map(dr -> getIndividuals(df.getOWLDataSomeValuesFrom(property, dr))) .reduce((s1, s2) -> { s1.retainAll(s2); } else if (filler instanceof OWLDataUnionOf) { return ((OWLDataUnionOf) filler).getOperands().stream() .map(dr -> getIndividuals(df.getOWLDataSomeValuesFrom(property, dr))) .reduce((s1, s2) -> { s1.addAll(s2); return new TreeSet<>(Sets.difference( individuals, getIndividualsImpl(df.getOWLDataSomeValuesFrom( property, ((OWLDataComplementOf) filler).getDataRange()))));
@Override public OWLClassExpression visit(OWLObjectUnionOf ce) { Set<OWLClassExpression> descs = new HashSet<>(); ce.operands().forEach(op -> visitOperand(descs, op)); return ldf.getOWLObjectUnionOf(descs); }
OWLClassExpression simplifiedDescription=m_expressionManager.getNNF(m_expressionManager.getSimplified(m_factory.getOWLObjectUnionOf(inclusions.remove(inclusions.size()-1)))); if (!simplifiedDescription.isOWLThing()) { if (simplifiedDescription instanceof OWLObjectUnionOf) { OWLObjectUnionOf objectOr=(OWLObjectUnionOf)simplifiedDescription; List<OWLClassExpression> descriptions= asList(objectOr.operands(), OWLClassExpression.class); if (!distributeUnionOverAndObject(descriptions,inclusions) && !optimizedNegativeOneOfTranslation(descriptions,m_axioms.m_facts)) { for (int index=0;index<descriptions.size();index++) descriptions.set(index, descriptions.get(index).accept(classExpressionNormalizer)); m_axioms.m_conceptInclusions.add(descriptions); objectAnd.operands().forEach(c->inclusions.add(Arrays.asList(c))); OWLClassExpression normalized=simplifiedDescription.accept(classExpressionNormalizer); m_axioms.m_conceptInclusions.add(Arrays.asList(normalized)); OWLDataRange simplifiedDescription=m_expressionManager.getNNF(m_expressionManager.getSimplified(m_factory.getOWLDataUnionOf(dataRangeInclusions.remove(classExpressionNormalizer.m_newDataRangeInclusions.size()-1)))); if (!simplifiedDescription.isTopDatatype()) { if (simplifiedDescription instanceof OWLDataUnionOf) { dataAnd.operands().forEach(d->dataRangeInclusions.add(Arrays.asList(d)));
OWLIndividual individual = ((OWLClassAssertionAxiom) axiom).getIndividual(); if (ce.isOWLThing()) { return true; } else if (ce.isOWLNothing()) { return false; } else if (!ce.isAnonymous()) { return getSubClasses(ce.asOWLClass(), false).getFlattened().stream() .anyMatch(sub -> getRootOntology().containsAxiom(df.getOWLClassAssertionAxiom(sub, individual), INCLUDED, AxiomAnnotations.IGNORE_AXIOM_ANNOTATIONS)); } else { if (ce instanceof OWLObjectIntersectionOf) { return ((OWLObjectIntersectionOf) ce).getOperands().stream() .allMatch(op -> isEntailed(df.getOWLClassAssertionAxiom(op, individual))); } else if (ce instanceof OWLObjectUnionOf) { return ((OWLObjectUnionOf) ce).getOperands().stream() .anyMatch(op -> isEntailed(df.getOWLClassAssertionAxiom(op, individual))); } else if (ce instanceof OWLObjectSomeValuesFrom) { OWLObjectPropertyExpression ope = ((OWLObjectSomeValuesFrom) ce).getProperty();
if (ax.classExpressions().count() != 2) { error(ax, false); return; Iterator<OWLClassExpression> it = ax.classExpressions().iterator(); OWLClassExpression ce1 = it.next(); OWLClassExpression ce2 = it.next(); if (ce1.isBottomEntity() || ce1.isTopEntity() || ce2.isBottomEntity() || ce2 .isTopEntity()) { error( addQualifiers(c, ax.annotations()); } else if (ce2 instanceof OWLObjectUnionOf) { List<? extends OWLClassExpression> list2 = ((OWLObjectUnionOf) ce2).getOperandsAsList(); for (OWLClassExpression oce : list2) { String id = getIdentifier(oce);
private OWLAxiom subClassOfSingle(OWLClassExpression sub, OWLClassExpression sup) { return df.getOWLSubClassOfAxiom(df.getOWLThing(), df.getOWLObjectUnionOf(df.getOWLObjectComplementOf(sub), sup).getNNF()); }
if(!currDomain.isOWLThing() && !topARefinementsLength.containsKey(currDomain)){ topARefinementsLength.put(currDomain, 0); if(description.isOWLThing()) { if(currDomain.isOWLThing()) { if(maxLength>topRefinementsLength) computeTopRefinements(maxLength); } else if(!description.isAnonymous()) { refinements.addAll(classHierarchy.getSubClasses(description, true)); refinements.remove(df.getOWLNothing()); } else if (description instanceof OWLObjectComplementOf) { OWLClassExpression operand = ((OWLObjectComplementOf) description).getOperand(); if(!c.isOWLThing()){ refinements.add(df.getOWLObjectComplementOf(c)); List<OWLClassExpression> operands = ((OWLObjectUnionOf) description).getOperandsAsList(); for(OWLClassExpression child : operands) { refinements.add(df.getOWLObjectSomeValuesFrom(role, c));
Set<OWLClassExpression> tmp; if (concept.isOWLThing()) { return (Set<OWLClassExpression>) topSet.clone(); } else if (concept.isOWLNothing()) { return new HashSet<>(); } else if (!concept.isAnonymous()) { if(!c.isOWLThing()){ refinements.add(df.getOWLObjectComplementOf(c)); List<OWLClassExpression> operands = ((OWLObjectUnionOf) concept).getOperandsAsList(); for(OWLClassExpression child : operands) { for(OWLClassExpression child : ((OWLObjectUnionOf) concept).getOperandsAsList()) { List<OWLClassExpression> newChildren = new LinkedList<>(operands); newChildren.remove(child); refinements.add(df.getOWLObjectSomeValuesFrom(role, c)); if(filler.isOWLNothing()) refinements.add(df.getOWLNothing());
public OWLClassExpression visit(OWLObjectUnionOf desc) { Set<OWLClassExpression> descs = new HashSet<OWLClassExpression>(); for (OWLClassExpression op : desc.getOperands()) { // if(!op.isClassExpressionLiteral()) { OWLClassExpression flatOp = op.accept(this); if (flatOp.isAnonymous() || signature.contains(flatOp.asOWLClass())) { OWLClass name = createNewName(); descs.add(name); axioms.add(df.getOWLSubClassOfAxiom(name, flatOp)); } else { descs.add(flatOp); } // } // else { // OWLClass name = createNewName(); // descs.add(name); // axioms.add(df.getOWLSubClassOfAxiom(name, op)); // } } return df.getOWLObjectUnionOf(descs); }
public OWLClassExpression visit(OWLObjectUnionOf desc) { Set<OWLClassExpression> ops = new HashSet<OWLClassExpression>(); for (OWLClassExpression op : desc.getOperands()) { ops.add(op.accept(this)); } if (negated) { // Flip to an intersection return dataFactory.getOWLObjectIntersectionOf(ops); } else { return dataFactory.getOWLObjectUnionOf(ops); } }