@Override public boolean addOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); ModifiableIndexedPropertyChain subPropertyChain = getSubPropertyChain(); ModifiableIndexedObjectProperty superProperty = getSuperProperty(); if (!subPropertyChain.addToldSuperObjectProperty(superProperty, reason)) return false; if (!superProperty.addToldSubPropertyChain(subPropertyChain, reason)) { // revert the changes if (!subPropertyChain.removeToldSuperObjectProperty(superProperty, reason)) throw new ElkUnexpectedIndexingException(this); return false; } // success return true; }
@Override public boolean addOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); ModifiableIndexedPropertyChain subPropertyChain = getSubPropertyChain(); ModifiableIndexedObjectProperty superProperty = getSuperProperty(); if (!subPropertyChain.addToldSuperObjectProperty(superProperty, reason)) return false; if (!superProperty.addToldSubPropertyChain(subPropertyChain, reason)) { // revert the changes if (!subPropertyChain.removeToldSuperObjectProperty(superProperty, reason)) throw new ElkUnexpectedIndexingException(this); return false; } // success return true; }
@Override public boolean addOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); ModifiableIndexedPropertyChain subPropertyChain = getSubPropertyChain(); ModifiableIndexedObjectProperty superProperty = getSuperProperty(); if (!subPropertyChain.addToldSuperObjectProperty(superProperty, reason)) return false; if (!superProperty.addToldSubPropertyChain(subPropertyChain, reason)) { // revert the changes if (!subPropertyChain.removeToldSuperObjectProperty(superProperty, reason)) throw new ElkUnexpectedIndexingException(this); return false; } // success return true; }
@Override public boolean removeOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); ModifiableIndexedPropertyChain subPropertyChain = getSubPropertyChain(); ModifiableIndexedObjectProperty superProperty = getSuperProperty(); if (!subPropertyChain.removeToldSuperObjectProperty(superProperty, reason)) return false; if (!superProperty.removeToldSubPropertyChain(subPropertyChain, reason)) { // revert the changes if (!subPropertyChain.addToldSuperObjectProperty(superProperty, reason)) throw new ElkUnexpectedIndexingException(this); return false; } // success return true; }
@Override public boolean removeOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); ModifiableIndexedPropertyChain subPropertyChain = getSubPropertyChain(); ModifiableIndexedObjectProperty superProperty = getSuperProperty(); if (!subPropertyChain.removeToldSuperObjectProperty(superProperty, reason)) return false; if (!superProperty.removeToldSubPropertyChain(subPropertyChain, reason)) { // revert the changes if (!subPropertyChain.addToldSuperObjectProperty(superProperty, reason)) throw new ElkUnexpectedIndexingException(this); return false; } // success return true; }
@Override public boolean removeOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); ModifiableIndexedPropertyChain subPropertyChain = getSubPropertyChain(); ModifiableIndexedObjectProperty superProperty = getSuperProperty(); if (!subPropertyChain.removeToldSuperObjectProperty(superProperty, reason)) return false; if (!superProperty.removeToldSubPropertyChain(subPropertyChain, reason)) { // revert the changes if (!subPropertyChain.addToldSuperObjectProperty(superProperty, reason)) throw new ElkUnexpectedIndexingException(this); return false; } // success return true; }