/** * @param i individual * @param p property to search * @param lit literal to search * @param ontology ontology to search * @return true if value present */ public static boolean hasDataPropertyValue(OWLIndividual i, OWLDataPropertyExpression p, OWLLiteral lit, OWLOntology ontology) { return contains(Searcher.values(ontology.dataPropertyAssertionAxioms(i), p), lit); }
/** * @param i individual * @param p property to search * @param lit literal to search * @param ontology ontology to search * @return true if value present */ public static boolean hasNegativeDataPropertyValue(OWLIndividual i, OWLDataPropertyExpression p, OWLLiteral lit, OWLOntology ontology) { return contains(Searcher.negValues(ontology.negativeDataPropertyAssertionAxioms(i), p), lit); }
/** * @param i individual * @param p property to search * @param j individual to search * @param ontology ontology to search * @return true if value present */ public static boolean hasNegativeObjectPropertyValue(OWLIndividual i, OWLObjectPropertyExpression p, OWLIndividual j, OWLOntology ontology) { return contains(Searcher.negValues(ontology.negativeObjectPropertyAssertionAxioms(i), p), j); }
/** * @param i individual * @param p property to search * @param lit literal to search * @param ontology ontology to search * @return true if value present */ public static boolean hasDataPropertyValue(OWLIndividual i, OWLDataPropertyExpression p, OWLLiteral lit, OWLOntology ontology) { return contains(Searcher.values(ontology.dataPropertyAssertionAxioms(i), p), lit); }
/** * @param i individual * @param p property to search * @param j individual to search * @param ontology ontology to search * @return true if value present */ public static boolean hasNegativeObjectPropertyValue(OWLIndividual i, OWLObjectPropertyExpression p, OWLIndividual j, OWLOntology ontology) { return contains(Searcher.negValues(ontology.negativeObjectPropertyAssertionAxioms(i), p), j); }
/** * @param i individual * @param p property to search * @param j individual to search * @param ontology ontology to search * @return true if value present */ public static boolean hasObjectPropertyValue(OWLIndividual i, OWLObjectPropertyExpression p, OWLIndividual j, OWLOntology ontology) { return contains(Searcher.values(ontology.objectPropertyAssertionAxioms(i), p), j); }
/** * @param i individual * @param p property to search * @param lit literal to search * @param ontology ontology to search * @return true if value present */ public static boolean hasDataPropertyValue(OWLIndividual i, OWLDataPropertyExpression p, OWLLiteral lit, OWLOntology ontology) { return contains(Searcher.values(ontology.dataPropertyAssertionAxioms(i), p), lit); }
/** * @param i individual * @param p property to search * @param j individual to search * @param ontology ontology to search * @return true if value present */ public static boolean hasObjectPropertyValue(OWLIndividual i, OWLObjectPropertyExpression p, OWLIndividual j, OWLOntology ontology) { return contains(Searcher.values(ontology.objectPropertyAssertionAxioms(i), p), j); }
/** * @param i individual * @param p property to search * @param j individual to search * @param ontology ontology to search * @return true if value present */ public static boolean hasObjectPropertyValue(OWLIndividual i, OWLObjectPropertyExpression p, OWLIndividual j, OWLOntology ontology) { return contains(Searcher.values(ontology.objectPropertyAssertionAxioms(i), p), j); }
/** * @param i individual * @param p property to search * @param lit literal to search * @param ontology ontology to search * @return true if value present */ public static boolean hasNegativeDataPropertyValue(OWLIndividual i, OWLDataPropertyExpression p, OWLLiteral lit, OWLOntology ontology) { return contains(Searcher.negValues(ontology.negativeDataPropertyAssertionAxioms(i), p), lit); }
/** * @param i individual * @param p property to search * @param j individual to search * @param ontology ontology to search * @return true if value present */ public static boolean hasNegativeObjectPropertyValue(OWLIndividual i, OWLObjectPropertyExpression p, OWLIndividual j, OWLOntology ontology) { return contains(Searcher.negValues(ontology.negativeObjectPropertyAssertionAxioms(i), p), j); }
/** * @param i individual * @param p property to search * @param lit literal to search * @param ontology ontology to search * @return true if value present */ public static boolean hasNegativeDataPropertyValue(OWLIndividual i, OWLDataPropertyExpression p, OWLLiteral lit, OWLOntology ontology) { return contains(Searcher.negValues(ontology.negativeDataPropertyAssertionAxioms(i), p), lit); }
@Override public Boolean visit(OWLEquivalentClassesAxiom axiom) { if (!contains(axiom.classExpressions(), cls())) { return isRoot; } boolean check = false; Iterator<OWLClassExpression> it = axiom.classExpressions().iterator(); while (it.hasNext()) { OWLClassExpression desc = it.next(); if (!desc.equals(cls)) { check = check(desc); if (check) { isRoot = Boolean.FALSE; return isRoot; } } } isRoot = Boolean.valueOf(check); return isRoot; } }
@Override public Boolean visit(OWLEquivalentClassesAxiom axiom) { if (!contains(axiom.classExpressions(), cls())) { return isRoot; } boolean check = false; Iterator<OWLClassExpression> it = axiom.classExpressions().iterator(); while (it.hasNext()) { OWLClassExpression desc = it.next(); if (!desc.equals(cls)) { check = check(desc); if (check) { isRoot = Boolean.FALSE; return isRoot; } } } isRoot = Boolean.valueOf(check); return isRoot; } }
@Override public void visit(OWLEquivalentClassesAxiom axiom) { if (axiom.classExpressions().count() == 2 && contains(axiom.classExpressions(), dataFactory.getOWLNothing())) { desc = axiom.classExpressions().filter(c -> !c.isOWLNothing()).findFirst().orElse(null); if (desc != null) { return; } } // (C and not D) or (not C and D) Iterator<OWLClassExpression> it = axiom.classExpressions().iterator(); OWLClassExpression descC = it.next(); OWLClassExpression notC = dataFactory.getOWLObjectComplementOf(descC); OWLClassExpression descD = it.next(); OWLClassExpression notD = dataFactory.getOWLObjectComplementOf(descD); OWLObjectIntersectionOf left = dataFactory .getOWLObjectIntersectionOf(CollectionFactory.createSet(descC, notD)); OWLObjectIntersectionOf right = dataFactory .getOWLObjectIntersectionOf(CollectionFactory.createSet(notC, descD)); desc = dataFactory.getOWLObjectUnionOf(CollectionFactory.createSet(left, right)); } }
@Override public void visit(OWLEquivalentClassesAxiom axiom) { if (axiom.classExpressions().count() == 2 && contains(axiom.classExpressions(), dataFactory.getOWLNothing())) { desc = axiom.classExpressions().filter(c -> !c.isOWLNothing()).findFirst().orElse(null); if (desc != null) { return; } } // (C and not D) or (not C and D) Iterator<OWLClassExpression> it = axiom.classExpressions().iterator(); OWLClassExpression descC = it.next(); OWLClassExpression notC = dataFactory.getOWLObjectComplementOf(descC); OWLClassExpression descD = it.next(); OWLClassExpression notD = dataFactory.getOWLObjectComplementOf(descD); OWLObjectIntersectionOf left = dataFactory .getOWLObjectIntersectionOf(CollectionFactory.createSet(descC, notD)); OWLObjectIntersectionOf right = dataFactory .getOWLObjectIntersectionOf(CollectionFactory.createSet(notC, descD)); desc = dataFactory.getOWLObjectUnionOf(CollectionFactory.createSet(left, right)); } }
@Override public void ontologiesChanged(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (!change.isAxiomChange() || !contains(ontology.importsClosure(), change.getOntology())) { continue; } OWLAxiom axiom = change.getAxiom(); if (change.isAddAxiom()) { addAxiom(axiom); } else if (change.isRemoveAxiom()) { removeAxiom(axiom); } else { throw new UnsupportedOperationException("Unrecognized axiom change: " + change); } } } }
@Override public void ontologiesChanged(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (!change.isAxiomChange() || !contains(ontology.importsClosure(), change.getOntology())) { continue; } OWLAxiom axiom = change.getAxiom(); if (change.isAddAxiom()) { addAxiom(axiom); } else if (change.isRemoveAxiom()) { removeAxiom(axiom); } else { throw new UnsupportedOperationException("Unrecognized axiom change: " + change); } } } }
@Override public void ontologiesChanged(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (!change.isAxiomChange() || !contains(ontology.importsClosure(), change.getOntology())) { continue; } OWLAxiom axiom = change.getAxiom(); if (change.isAddAxiom()) { addAxiom(axiom); } else if (change.isRemoveAxiom()) { removeAxiom(axiom); } else { throw new UnsupportedOperationException("Unrecognized axiom change: " + change); } } } }
@Override public void ontologiesChanged(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (!change.isAxiomChange() || !contains(ontology.importsClosure(), change.getOntology())) { continue; } OWLAxiom axiom = change.getAxiom(); if (change.isAddAxiom()) { addAxiom(axiom); } else if (change.isRemoveAxiom()) { removeAxiom(axiom); } else { throw new UnsupportedOperationException("Unrecognized axiom change: " + change); } } } }