@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; }
public static ModifiableIndexedObjectProperty createIndexedObjectProperty( ModifiableOntologyIndex index, ElkObjectProperty prop, ModifiableIndexedPropertyChain[] toldSubs, ModifiableIndexedObjectProperty[] toldSupers) { ModifiableIndexedObjectProperty property = new CachedIndexedObjectPropertyImpl( prop); for (ModifiableIndexedPropertyChain sub : toldSubs) { property.addToldSubPropertyChain(sub, null); sub.addToldSuperObjectProperty(property, null); } for (ModifiableIndexedObjectProperty sup : toldSupers) { property.addToldSuperObjectProperty(sup, null); sup.addToldSubPropertyChain(property, null); } return property; }