@Override public PropagationFromExistentialFillerRule create( ChainableSubsumerRule next) { return new PropagationFromExistentialFillerRule(next); } };
@Override public final boolean updateOccurrenceNumbers(ModifiableOntologyIndex index, OccurrenceIncrement increment) { if (negativeOccurrenceNo == 0 && increment.negativeIncrement > 0) { // first negative occurrence of this expression if (!PropagationFromExistentialFillerRule.addRuleFor(this, index)) return false; } negativeOccurrenceNo += increment.negativeIncrement; if (negativeOccurrenceNo == 0 && increment.negativeIncrement < 0) { // no negative occurrences of this expression left if (!PropagationFromExistentialFillerRule .removeRuleFor(this, index)) { // revert the changes negativeOccurrenceNo -= increment.negativeIncrement; return false; } } positiveOccurrenceNo += increment.positiveIncrement; return true; }
@Override public boolean addTo(Chain<ChainableSubsumerRule> ruleChain) { if (isEmpty()) return true; PropagationFromExistentialFillerRule rule = ruleChain.getCreate( MATCHER_, FACTORY_); rule.negExistentials_.addAll(this.negExistentials_); return true; }
public static void applyForProperty(LinkedSubsumerRule rule, IndexedObjectProperty property, ContextPremises premises, ClassInferenceProducer producer) { for (;;) { if (rule == null) return; PropagationFromExistentialFillerRule matchedRule = MATCHER_ .match(rule); if (matchedRule != null) { matchedRule.applyForProperty(property, premises, producer); return; } // else rule = rule.next(); } }
@Override public Void visit(PropagationFromExistentialFillerRule rule, IndexedClassExpression premise, ContextPremises premises, ClassInferenceProducer producer) { for (IndexedClassExpression ice : rule.getNegativeExistentials()) { iceValidator_.checkNew(ice); } return null; }
/** * Generates {@link PropagationImpl}s for the {@link ContextPremises} * that apply for the given {@link IndexedObjectProperty} * * @param property * @param premises * @param producer */ public static void generatePropagations(IndexedObjectProperty property, ContextPremises premises, ClassInferenceProducer producer) { for (IndexedClassExpression ice : premises.getComposedSubsumers()) { PropagationFromExistentialFillerRule.applyForProperty( ice.getCompositionRuleHead(), property, premises, producer); } }
@Override public final boolean updateOccurrenceNumbers(ModifiableOntologyIndex index, OccurrenceIncrement increment) { if (negativeOccurrenceNo == 0 && increment.negativeIncrement > 0) { // first negative occurrence of this expression if (!PropagationFromExistentialFillerRule.addRuleFor(this, index)) return false; } negativeOccurrenceNo += increment.negativeIncrement; if (negativeOccurrenceNo == 0 && increment.negativeIncrement < 0) { // no negative occurrences of this expression left if (!PropagationFromExistentialFillerRule .removeRuleFor(this, index)) { // revert the changes negativeOccurrenceNo -= increment.negativeIncrement; return false; } } positiveOccurrenceNo += increment.positiveIncrement; return true; }
@Override public PropagationFromExistentialFillerRule create( ChainableSubsumerRule next) { return new PropagationFromExistentialFillerRule(next); } };
@Override public boolean addTo(Chain<ChainableSubsumerRule> ruleChain) { if (isEmpty()) return true; PropagationFromExistentialFillerRule rule = ruleChain.getCreate( MATCHER_, FACTORY_); rule.negExistentials_.addAll(this.negExistentials_); return true; }
public static void applyForProperty(LinkedSubsumerRule rule, IndexedObjectProperty property, ContextPremises premises, ClassInferenceProducer producer) { for (;;) { if (rule == null) return; PropagationFromExistentialFillerRule matchedRule = MATCHER_ .match(rule); if (matchedRule != null) { matchedRule.applyForProperty(property, premises, producer); return; } // else rule = rule.next(); } }
@Override public final boolean updateOccurrenceNumbers(ModifiableOntologyIndex index, OccurrenceIncrement increment) { if (negativeOccurrenceNo == 0 && increment.negativeIncrement > 0) { // first negative occurrence of this expression if (!PropagationFromExistentialFillerRule.addRuleFor(this, index)) return false; } negativeOccurrenceNo += increment.negativeIncrement; if (negativeOccurrenceNo == 0 && increment.negativeIncrement < 0) { // no negative occurrences of this expression left if (!PropagationFromExistentialFillerRule .removeRuleFor(this, index)) { // revert the changes negativeOccurrenceNo -= increment.negativeIncrement; return false; } } positiveOccurrenceNo += increment.positiveIncrement; return true; }
@Override public PropagationFromExistentialFillerRule create( ChainableSubsumerRule next) { return new PropagationFromExistentialFillerRule(next); } };
@Override public boolean addTo(Chain<ChainableSubsumerRule> ruleChain) { if (isEmpty()) return true; PropagationFromExistentialFillerRule rule = ruleChain.getCreate( MATCHER_, FACTORY_); rule.negExistentials_.addAll(this.negExistentials_); return true; }
/** * Generates {@link PropagationImpl}s for the {@link ContextPremises} * that apply for the given {@link IndexedObjectProperty} * * @param property * @param premises * @param producer */ public static void generatePropagations(IndexedObjectProperty property, ContextPremises premises, ClassInferenceProducer producer) { for (IndexedClassExpression ice : premises.getComposedSubsumers()) { PropagationFromExistentialFillerRule.applyForProperty( ice.getCompositionRuleHead(), property, premises, producer); } }
public static boolean removeRuleFor( ModifiableIndexedObjectSomeValuesFrom existential, ModifiableOntologyIndex index) { return index.remove(existential.getFiller(), new PropagationFromExistentialFillerRule(existential)); }
/** * Generates {@link PropagationImpl}s for the {@link ContextPremises} * that apply for the given {@link IndexedObjectProperty} * * @param property * @param premises * @param producer */ public static void generatePropagations(IndexedObjectProperty property, ContextPremises premises, ClassInferenceProducer producer) { for (IndexedClassExpression ice : premises.getComposedSubsumers()) { PropagationFromExistentialFillerRule.applyForProperty( ice.getCompositionRuleHead(), property, premises, producer); } }
public static boolean addRuleFor( ModifiableIndexedObjectSomeValuesFrom existential, ModifiableOntologyIndex index) { return index.add(existential.getFiller(), new PropagationFromExistentialFillerRule(existential)); }
public static void applyForProperty(LinkedSubsumerRule rule, IndexedObjectProperty property, ContextPremises premises, ClassInferenceProducer producer) { for (;;) { if (rule == null) return; PropagationFromExistentialFillerRule matchedRule = MATCHER_ .match(rule); if (matchedRule != null) { matchedRule.applyForProperty(property, premises, producer); return; } // else rule = rule.next(); } }