/** * Interprets this expression as a disjunction and returns the disjuncts. This method does not * normalise the expression (full DNF is not computed). * * @return The sorted stream of disjuncts of this expression if it is a disjunction (object * union of), or otherwise a singleton set containing this expression. Note that nested * disjunctions will be flattened, for example, calling this method on (A or B) or C * will return the set {A, B, C} */ default Stream<OWLClassExpression> disjunctSet() { return asDisjunctSet().stream().sorted(); }
/** * Interprets this expression as a disjunction and returns the disjuncts. This method does not * normalise the expression (full DNF is not computed). * * @return The sorted stream of disjuncts of this expression if it is a disjunction (object * union of), or otherwise a singleton set containing this expression. Note that nested * disjunctions will be flattened, for example, calling this method on (A or B) or C * will return the set {A, B, C} */ default Stream<OWLClassExpression> disjunctSet() { return asDisjunctSet().stream().sorted(); }
/** * Interprets this expression as a disjunction and returns the disjuncts. This method does not * normalise the expression (full DNF is not computed). * * @return The sorted stream of disjuncts of this expression if it is a disjunction (object * union of), or otherwise a singleton set containing this expression. Note that nested * disjunctions will be flattened, for example, calling this method on (A or B) or C * will return the set {A, B, C} */ default Stream<OWLClassExpression> disjunctSet() { return asDisjunctSet().stream().sorted(); }
@Override public Set<OWLClassExpression> asDisjunctSet() { Set<OWLClassExpression> disjuncts = new HashSet<OWLClassExpression>(); for (OWLClassExpression op : getOperands()) { disjuncts.addAll(op.asDisjunctSet()); } return disjuncts; }
public Set<OWLClassExpression> asDisjunctSet() { Set<OWLClassExpression> disjuncts = new HashSet<OWLClassExpression>(); for (OWLClassExpression op : getOperands()) { disjuncts.addAll(op.asDisjunctSet()); } return disjuncts; }
@Nonnull @Override public Set<OWLClassExpression> asDisjunctSet() { Set<OWLClassExpression> disjuncts = new HashSet<>(); for (OWLClassExpression op : getOperands()) { disjuncts.addAll(op.asDisjunctSet()); } return disjuncts; }
@Override public Set<OWLClassExpression> asDisjunctSet() { Set<OWLClassExpression> disjuncts = new HashSet<>(); for (OWLClassExpression op : getOperands()) { disjuncts.addAll(op.asDisjunctSet()); } return disjuncts; }
@Override public void visit(OWLSubClassOfAxiom axiom) { if (subClassOfEntailment != null) { Set<OWLClassExpression> superConjuncts = axiom.getSuperClass().asConjunctSet(); Set<OWLClassExpression> subDisjuncts = axiom.getSubClass().asDisjunctSet(); if (superConjuncts.contains(axiom.getSuperClass()) && subDisjuncts.contains(axiom.getSubClass())) { addExplanation(axiom); } } }
if(expr instanceof OWLObjectUnionOf){ v+=lang.getProperty(Constants.LANG_UNION)+" ("; for(OWLClassExpression e:expr.asDisjunctSet()){ v+= expressionToHTML(e, lang)+", ";
OWLSubClassOfAxiom sameSourceSCA = (OWLSubClassOfAxiom) ax; superClassConjuncts.addAll(sameSourceSCA.getSuperClass().asConjunctSet()); subClassDisjuncts.addAll(sameSourceSCA.getSubClass().asDisjunctSet()); if(oPlusGenerator.hasMultipleSources(ax)) { reconstitutedAxiomSourcesWithMultipleSources.add(ax); subClassDisjuncts.addAll(sca.getSubClass().asDisjunctSet()); superClassConjuncts.addAll(sca.getSuperClass().asConjunctSet()); OWLSubClassOfAxiom mergedAxiom = createSubClassAxiom(dataFactory, subClassDisjuncts, superClassConjuncts);
OWLSubClassOfAxiom sameSourceSCA = (OWLSubClassOfAxiom) ax; superClassConjuncts.addAll(sameSourceSCA.getSuperClass().asConjunctSet()); subClassDisjuncts.addAll(sameSourceSCA.getSubClass().asDisjunctSet()); if (oPlusGenerator.hasMultipleSources(ax)) { reconstitutedAxiomSourcesWithMultipleSources.add(ax); subClassDisjuncts.addAll(sca.getSubClass().asDisjunctSet()); superClassConjuncts.addAll(sca.getSuperClass().asConjunctSet()); OWLSubClassOfAxiom mergedAxiom = createSubClassAxiom(dataFactory, subClassDisjuncts, superClassConjuncts);
OWLSubClassOfAxiom sameSourceSCA = (OWLSubClassOfAxiom) ax; superClassConjuncts.addAll(sameSourceSCA.getSuperClass().asConjunctSet()); subClassDisjuncts.addAll(sameSourceSCA.getSubClass().asDisjunctSet()); if (oPlusGenerator.hasMultipleSources(ax)) { reconstitutedAxiomSourcesWithMultipleSources.add(ax); subClassDisjuncts.addAll(sca.getSubClass().asDisjunctSet()); superClassConjuncts.addAll(sca.getSuperClass().asConjunctSet()); OWLSubClassOfAxiom mergedAxiom = createSubClassAxiom(subClassDisjuncts, superClassConjuncts);
if(subClass instanceof OWLObjectOneOf) { OWLObjectOneOf objectOneOf = (OWLObjectOneOf) subClass; subClassDisjuncts = objectOneOf.asObjectUnionOf().asDisjunctSet(); subClassDisjuncts = subClass.asDisjunctSet();
Set<OWLClassExpression> disjuncts = disjunct.asDisjunctSet(); disjuncts.add(startExpression); OWLClassExpression ce = getDataFactory().getOWLObjectUnionOf(disjuncts);
if (!ce.equals(superClass) && ce.asDisjunctSet().contains(subClass)) { addExplanation(axiom); break;
private OWLAxiom parseClassAxiomRemainder(OWLClassExpression startExpression) { String kw = consumeToken(); if (SUBCLASS_OF.matchesEitherForm(kw)) { OWLClassExpression superClass = parseClassExpression(); return df.getOWLSubClassOfAxiom(startExpression, superClass); } else if (DISJOINT_WITH.matchesEitherForm(kw)) { OWLClassExpression disjointClass = parseClassExpression(); return df.getOWLDisjointClassesAxiom(startExpression, disjointClass); } else if (EQUIVALENT_TO.matchesEitherForm(kw)) { OWLClassExpression equivClass = parseClassExpression(); return df.getOWLEquivalentClassesAxiom(startExpression, equivClass); } else if (AND.matchesEitherForm(kw)) { OWLClassExpression conjunct = parseIntersection(); Set<OWLClassExpression> conjuncts = conjunct.asConjunctSet(); conjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectIntersectionOf(conjuncts); return parseClassAxiomRemainder(ce); } else if (OR.matchesEitherForm(kw)) { OWLClassExpression disjunct = parseUnion(); Set<OWLClassExpression> disjuncts = disjunct.asDisjunctSet(); disjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectUnionOf(disjuncts); return parseClassAxiomRemainder(ce); } else { throw new ExceptionBuilder() .withKeyword(SUBCLASS_OF, DISJOINT_WITH, EQUIVALENT_TO, AND, OR).build(); } }
private OWLAxiom parseClassAxiomRemainder(OWLClassExpression startExpression) { String kw = consumeToken(); if (SUBCLASS_OF.matchesEitherForm(kw)) { OWLClassExpression superClass = parseClassExpression(); return df.getOWLSubClassOfAxiom(startExpression, superClass); } else if (DISJOINT_WITH.matchesEitherForm(kw)) { OWLClassExpression disjointClass = parseClassExpression(); return df.getOWLDisjointClassesAxiom(startExpression, disjointClass); } else if (EQUIVALENT_TO.matchesEitherForm(kw)) { OWLClassExpression equivClass = parseClassExpression(); return df.getOWLEquivalentClassesAxiom(startExpression, equivClass); } else if (AND.matchesEitherForm(kw)) { OWLClassExpression conjunct = parseIntersection(); Set<OWLClassExpression> conjuncts = conjunct.asConjunctSet(); conjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectIntersectionOf(conjuncts); return parseClassAxiomRemainder(ce); } else if (OR.matchesEitherForm(kw)) { OWLClassExpression disjunct = parseUnion(); Set<OWLClassExpression> disjuncts = disjunct.asDisjunctSet(); disjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectUnionOf(disjuncts); return parseClassAxiomRemainder(ce); } else { throw new ExceptionBuilder() .withKeyword(SUBCLASS_OF, DISJOINT_WITH, EQUIVALENT_TO, AND, OR).build(); } }
private OWLAxiom parseClassAxiomRemainder(OWLClassExpression startExpression) { String kw = consumeToken(); if (SUBCLASS_OF.matchesEitherForm(kw)) { OWLClassExpression superClass = parseClassExpression(); return df.getOWLSubClassOfAxiom(startExpression, superClass); } else if (DISJOINT_WITH.matchesEitherForm(kw)) { OWLClassExpression disjointClass = parseClassExpression(); return df.getOWLDisjointClassesAxiom(startExpression, disjointClass); } else if (EQUIVALENT_TO.matchesEitherForm(kw)) { OWLClassExpression equivClass = parseClassExpression(); return df.getOWLEquivalentClassesAxiom(startExpression, equivClass); } else if (AND.matchesEitherForm(kw)) { OWLClassExpression conjunct = parseIntersection(); Set<OWLClassExpression> conjuncts = conjunct.asConjunctSet(); conjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectIntersectionOf(conjuncts); return parseClassAxiomRemainder(ce); } else if (OR.matchesEitherForm(kw)) { OWLClassExpression disjunct = parseUnion(); Set<OWLClassExpression> disjuncts = disjunct.asDisjunctSet(); disjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectUnionOf(disjuncts); return parseClassAxiomRemainder(ce); } else { throw new ExceptionBuilder() .withKeyword(SUBCLASS_OF, DISJOINT_WITH, EQUIVALENT_TO, AND, OR).build(); } }
private OWLAxiom parseClassAxiomRemainder(OWLClassExpression startExpression) { String kw = consumeToken(); if (SUBCLASS_OF.matchesEitherForm(kw)) { OWLClassExpression superClass = parseClassExpression(); return df.getOWLSubClassOfAxiom(startExpression, superClass); } else if (DISJOINT_WITH.matchesEitherForm(kw)) { OWLClassExpression disjointClass = parseClassExpression(); return df.getOWLDisjointClassesAxiom(startExpression, disjointClass); } else if (EQUIVALENT_TO.matchesEitherForm(kw)) { OWLClassExpression equivClass = parseClassExpression(); return df.getOWLEquivalentClassesAxiom(startExpression, equivClass); } else if (AND.matchesEitherForm(kw)) { OWLClassExpression conjunct = parseIntersection(); Set<OWLClassExpression> conjuncts = conjunct.asConjunctSet(); conjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectIntersectionOf(conjuncts); return parseClassAxiomRemainder(ce); } else if (OR.matchesEitherForm(kw)) { OWLClassExpression disjunct = parseUnion(); Set<OWLClassExpression> disjuncts = disjunct.asDisjunctSet(); disjuncts.add(startExpression); OWLClassExpression ce = df.getOWLObjectUnionOf(disjuncts); return parseClassAxiomRemainder(ce); } else { throw new ExceptionBuilder() .withKeyword(SUBCLASS_OF, DISJOINT_WITH, EQUIVALENT_TO, AND, OR).build(); } }
private OWLAxiom parseClassAxiomRemainder(OWLClassExpression startExpression) { String kw = consumeToken(); if (SUBCLASS_OF.matches(kw)) { OWLClassExpression superClass = parseClassExpression(); return dataFactory.getOWLSubClassOfAxiom(startExpression, superClass); } else if (DISJOINT_WITH.matches(kw)) { OWLClassExpression disjointClass = parseClassExpression(); return dataFactory.getOWLDisjointClassesAxiom(startExpression, disjointClass); } else if (EQUIVALENT_TO.matches(kw)) { OWLClassExpression equivClass = parseClassExpression(); return dataFactory.getOWLEquivalentClassesAxiom(startExpression, equivClass); } else if (AND.matches(kw)) { OWLClassExpression conjunct = parseIntersection(); Set<OWLClassExpression> conjuncts = conjunct.asConjunctSet(); conjuncts.add(startExpression); OWLClassExpression ce = dataFactory.getOWLObjectIntersectionOf(conjuncts); return parseClassAxiomRemainder(ce); } else if (OR.matches(kw)) { OWLClassExpression disjunct = parseUnion(); Set<OWLClassExpression> disjuncts = disjunct.asDisjunctSet(); disjuncts.add(startExpression); OWLClassExpression ce = dataFactory.getOWLObjectUnionOf(disjuncts); return parseClassAxiomRemainder(ce); } else { throw new ExceptionBuilder().withKeyword(SUBCLASS_OF, DISJOINT_WITH, EQUIVALENT_TO, AND, OR).build(); } }