@Override public IndexedClassFromDefinitionRule create(ChainableSubsumerRule tail) { return new IndexedClassFromDefinitionRule(tail); } };
@Override public boolean removeOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); boolean success = IndexedClassDecompositionRule.removeRuleFor(this, index, reason); if (success) { success = IndexedClassFromDefinitionRule.removeRuleFor(this, index, reason); if (success) { return true; } // else revert IndexedClassDecompositionRule.addRuleFor(this, index, reason); } // else success = EquivalentClassFirstFromSecondRule.removeRuleFor(this, index, reason); if (success) { success = EquivalentClassSecondFromFirstRule.removeRuleFor(this, index, reason); if (success) { return true; } // else revert EquivalentClassFirstFromSecondRule.addRuleFor(this, index, reason); } // all failed return false; }
@Override public boolean addOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); boolean success = IndexedClassDecompositionRule.addRuleFor(this, index, reason); if (success) { success = IndexedClassFromDefinitionRule.addRuleFor(this, index, reason); if (success) { return true; } // else revert IndexedClassDecompositionRule.removeRuleFor(this, index, reason); } // else success = EquivalentClassFirstFromSecondRule.addRuleFor(this, index, reason); if (success) { success = EquivalentClassSecondFromFirstRule.addRuleFor(this, index, reason); if (success) { return true; } // else revert EquivalentClassFirstFromSecondRule.removeRuleFor(this, index, reason); } // all failed return false; }
@Override public Void visit(IndexedClassFromDefinitionRule rule, IndexedClassExpression premise, ContextPremises premises, ClassInferenceProducer producer) { for (IndexedClassExpression ice : rule.getDefinedClasses()) { iceValidator_.checkNew(ice); } return null; }
@Override public boolean removeOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); boolean success = IndexedClassDecompositionRule.removeRuleFor(this, index, reason); if (success) { success = IndexedClassFromDefinitionRule.removeRuleFor(this, index, reason); if (success) { return true; } // else revert IndexedClassDecompositionRule.addRuleFor(this, index, reason); } // else success = EquivalentClassFirstFromSecondRule.removeRuleFor(this, index, reason); if (success) { success = EquivalentClassSecondFromFirstRule.removeRuleFor(this, index, reason); if (success) { return true; } // else revert EquivalentClassFirstFromSecondRule.addRuleFor(this, index, reason); } // all failed return false; }
@Override public boolean addOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); boolean success = IndexedClassDecompositionRule.addRuleFor(this, index, reason); if (success) { success = IndexedClassFromDefinitionRule.addRuleFor(this, index, reason); if (success) { return true; } // else revert IndexedClassDecompositionRule.removeRuleFor(this, index, reason); } // else success = EquivalentClassFirstFromSecondRule.addRuleFor(this, index, reason); if (success) { success = EquivalentClassSecondFromFirstRule.addRuleFor(this, index, reason); if (success) { return true; } // else revert EquivalentClassFirstFromSecondRule.removeRuleFor(this, index, reason); } // all failed return false; }
@Override public IndexedClassFromDefinitionRule create(ChainableSubsumerRule tail) { return new IndexedClassFromDefinitionRule(tail); } };
@Override public boolean removeOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); boolean success = IndexedClassDecompositionRule.removeRuleFor(this, index, reason); if (success) { success = IndexedClassFromDefinitionRule.removeRuleFor(this, index, reason); if (success) { return true; } // else revert IndexedClassDecompositionRule.addRuleFor(this, index, reason); } // else success = EquivalentClassFirstFromSecondRule.removeRuleFor(this, index, reason); if (success) { success = EquivalentClassSecondFromFirstRule.removeRuleFor(this, index, reason); if (success) { return true; } // else revert EquivalentClassFirstFromSecondRule.addRuleFor(this, index, reason); } // all failed return false; }
@Override public boolean addOccurrence(ModifiableOntologyIndex index) { ElkAxiom reason = getOriginalAxiom(); boolean success = IndexedClassDecompositionRule.addRuleFor(this, index, reason); if (success) { success = IndexedClassFromDefinitionRule.addRuleFor(this, index, reason); if (success) { return true; } // else revert IndexedClassDecompositionRule.removeRuleFor(this, index, reason); } // else success = EquivalentClassFirstFromSecondRule.addRuleFor(this, index, reason); if (success) { success = EquivalentClassSecondFromFirstRule.addRuleFor(this, index, reason); if (success) { return true; } // else revert EquivalentClassFirstFromSecondRule.removeRuleFor(this, index, reason); } // all failed return false; }
@Override public IndexedClassFromDefinitionRule create(ChainableSubsumerRule tail) { return new IndexedClassFromDefinitionRule(tail); } };
@Override public boolean removeFrom(Chain<ChainableSubsumerRule> ruleChain) { if (isEmpty()) return true; IndexedClassFromDefinitionRule rule = ruleChain reason); int j = rule.indexOf(defined, reason); if (j >= 0) { rule.definedClasses_.remove(j); if (rule.isEmpty()) { ruleChain.remove(IndexedClassFromDefinitionRule.MATCHER_); LOGGER_.trace("{}: removed ", NAME);
public static boolean addRuleFor(ModifiableIndexedEquivalentClassesAxiom axiom, ModifiableOntologyIndex index, ElkAxiom reason) { ModifiableIndexedClass definedClass = IndexedClassDecompositionRule.getDefinedClass(axiom); if (definedClass == null) { return false; } // else return index.add(axiom.getSecondMember(), new IndexedClassFromDefinitionRule(definedClass, reason)); }
@Override public boolean removeFrom(Chain<ChainableSubsumerRule> ruleChain) { if (isEmpty()) return true; IndexedClassFromDefinitionRule rule = ruleChain reason); int j = rule.indexOf(defined, reason); if (j >= 0) { rule.definedClasses_.remove(j); if (rule.isEmpty()) { ruleChain.remove(IndexedClassFromDefinitionRule.MATCHER_); LOGGER_.trace("{}: removed ", NAME);
public static boolean removeRuleFor(ModifiableIndexedEquivalentClassesAxiom axiom, ModifiableOntologyIndex index, ElkAxiom reason) { ModifiableIndexedClass definedClass = IndexedClassDecompositionRule.getDefinedClass(axiom); if (definedClass == null) { return false; } // else return index.remove(axiom.getSecondMember(), new IndexedClassFromDefinitionRule(definedClass, reason)); }
@Override public boolean removeFrom(Chain<ChainableSubsumerRule> ruleChain) { if (isEmpty()) return true; IndexedClassFromDefinitionRule rule = ruleChain reason); int j = rule.indexOf(defined, reason); if (j >= 0) { rule.definedClasses_.remove(j); if (rule.isEmpty()) { ruleChain.remove(IndexedClassFromDefinitionRule.MATCHER_); LOGGER_.trace("{}: removed ", NAME);
public static boolean removeRuleFor(ModifiableIndexedEquivalentClassesAxiom axiom, ModifiableOntologyIndex index, ElkAxiom reason) { ModifiableIndexedClass definedClass = IndexedClassDecompositionRule.getDefinedClass(axiom); if (definedClass == null) { return false; } // else return index.remove(axiom.getSecondMember(), new IndexedClassFromDefinitionRule(definedClass, reason)); }
public static boolean addRuleFor(ModifiableIndexedEquivalentClassesAxiom axiom, ModifiableOntologyIndex index, ElkAxiom reason) { ModifiableIndexedClass definedClass = IndexedClassDecompositionRule.getDefinedClass(axiom); if (definedClass == null) { return false; } // else return index.add(axiom.getSecondMember(), new IndexedClassFromDefinitionRule(definedClass, reason)); }