/** * implements rules [D1], [O1] and [C1]:<br> * - ignore if e1 is bot or e2 is top<br> * - replace by emptiness if e2 is bot but e1 is not top<br> * - inconsistency if e1 is top and e2 is bot * * @param e1 * @param e2 * @throws InconsistentOntologyException */ void addInclusion(T e1, T e2) throws InconsistentOntologyException { if (e1.isBottom() || e2.isTop()) return; if (e2.isBottom()) { // emptiness if (e1.isTop()) throw new InconsistentOntologyException(); NaryAxiom<T> ax = new NaryAxiomImpl<>(ImmutableList.of(e1, e1)); disjointness.add(ax); } else { BinaryAxiom<T> ax = new BinaryAxiomImpl<>(e1, e2); inclusions.add(ax); } }
/** * implements rules [D1], [O1] and [C1]:<br> * - ignore if e1 is bot or e2 is top<br> * - replace by emptiness if e2 is bot but e1 is not top<br> * - inconsistency if e1 is top and e2 is bot * * @param e1 * @param e2 * @throws InconsistentOntologyException */ void addInclusion(T e1, T e2) throws InconsistentOntologyException { if (e1.isBottom() || e2.isTop()) return; if (e2.isBottom()) { // emptiness if (e1.isTop()) throw new InconsistentOntologyException(); NaryAxiom<T> ax = new NaryAxiomImpl<>(ImmutableList.of(e1, e1)); disjointness.add(ax); } else { BinaryAxiom<T> ax = new BinaryAxiomImpl<>(e1, e2); inclusions.add(ax); } }
/** * Normalizes and adds a data property range axiom * <p> * DataPropertyRange := 'DataPropertyRange' '(' axiomAnnotations DataPropertyExpression DataRange ')' * <p> * Implements rule [D3]: * - ignore if the property is bot or the range is rdfs:Literal (top datatype) * - inconsistency if the property is top but the range is not rdfs:Literal * * @throws InconsistentOntologyException */ @Override public void addDataPropertyRangeAxiom(DataPropertyRangeExpression range, Datatype datatype) throws InconsistentOntologyException { checkSignature(range); checkSignature(datatype); if (datatype.equals(DatatypeImpl.rdfsLiteral)) return; // otherwise the datatype is not top if (range.getProperty().isBottom()) return; if (range.getProperty().isTop()) throw new InconsistentOntologyException(); BinaryAxiom<DataRangeExpression> ax = new BinaryAxiomImpl<>(range, datatype); subDataRangeAxioms.add(ax); }
/** * Normalizes and adds a data property range axiom * <p> * DataPropertyRange := 'DataPropertyRange' '(' axiomAnnotations DataPropertyExpression DataRange ')' * <p> * Implements rule [D3]: * - ignore if the property is bot or the range is rdfs:Literal (top datatype) * - inconsistency if the property is top but the range is not rdfs:Literal * * @throws InconsistentOntologyException */ @Override public void addDataPropertyRangeAxiom(DataPropertyRangeExpression range, Datatype datatype) throws InconsistentOntologyException { checkSignature(range); checkSignature(datatype); if (datatype.equals(DatatypeImpl.rdfsLiteral)) return; // otherwise the datatype is not top if (range.getProperty().isBottom()) return; if (range.getProperty().isTop()) throw new InconsistentOntologyException(); BinaryAxiom<DataRangeExpression> ax = new BinaryAxiomImpl<>(range, datatype); subDataRangeAxioms.add(ax); }