if (!rightProperty_.addRightChain(this)) return false; if (!leftProperty_.addLeftChain(this)) { rightProperty_.removeRightChain(this); return false; if (!rightProperty_.removeRightChain(this)) { rightProperty_.addRightChain(this); totalOccurrenceNo -= increment.totalIncrement; return false;
@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; }
public static ModifiableIndexedPropertyChain createIndexedChain( ModifiableIndexedObjectProperty left, ModifiableIndexedPropertyChain right, ModifiableIndexedObjectProperty[] toldSupers) { ModifiableIndexedComplexPropertyChain chain = new CachedIndexedComplexPropertyChainImpl( left, right); for (ModifiableIndexedObjectProperty sup : toldSupers) { chain.addToldSuperObjectProperty(sup, null); sup.addToldSubPropertyChain(chain, null); } left.addLeftChain(chain); right.addRightChain(chain); return chain; }
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; }
@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; }
if (!rightProperty_.addRightChain(this)) return false; if (!leftProperty_.addLeftChain(this)) { rightProperty_.removeRightChain(this); return false; if (!rightProperty_.removeRightChain(this)) { rightProperty_.addRightChain(this); totalOccurrenceNo -= increment.totalIncrement; return false;
@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; }
if (!rightProperty_.addRightChain(this)) return false; if (!leftProperty_.addLeftChain(this)) { rightProperty_.removeRightChain(this); return false; if (!rightProperty_.removeRightChain(this)) { rightProperty_.addRightChain(this); totalOccurrenceNo -= increment.totalIncrement; return false;
@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; }