@Override public boolean contains(Key key, Value value) { return multimap_.contains(key, value); }
@Override public boolean contains(Key key, Value value) { return multimap_.contains(key, value); }
@Override public boolean contains(Key key, Value value) { return multimap_.contains(key, value); }
/** * Tests if a {@link BackwardLinkChainFromBackwardLinkRule} inferences for * the given {@link ForwardLink} is present in the given {@link Context} * * @param link * @param context * @return {@code true} if the inference is present */ public static boolean containsRuleFor(ForwardLink link, Context context) { BackwardLinkChainFromBackwardLinkRule rule = context .getBackwardLinkRuleChain().find(MATCHER_); return rule == null ? false : rule.forwardLinksByObjectProperty_ .contains(link.getChain(), link.getTarget()); }
/** * Tests if a {@link BackwardLinkChainFromBackwardLinkRule} inferences for * the given {@link ForwardLink} is present in the given {@link Context} * * @param link * @param context * @return {@code true} if the inference is present */ public static boolean containsRuleFor(ForwardLink link, Context context) { BackwardLinkChainFromBackwardLinkRule rule = context .getBackwardLinkRuleChain().find(MATCHER_); return rule == null ? false : rule.forwardLinksByObjectProperty_ .contains(link.getChain(), link.getTarget()); }
/** * Tests if a {@link BackwardLinkChainFromBackwardLinkRule} inferences for * the given {@link ForwardLink} is present in the given {@link Context} * * @param link * @param context * @return {@code true} if the inference is present */ public static boolean containsRuleFor(ForwardLink link, Context context) { BackwardLinkChainFromBackwardLinkRule rule = context .getBackwardLinkRuleChain().find(MATCHER_); return rule == null ? false : rule.forwardLinksByObjectProperty_ .contains(link.getChain(), link.getTarget()); }
/** * checking that all compositions of this property to the right are computed * in the saturations for the respective right properties * * @param ip */ public static void testRightCompositions(IndexedObjectProperty ip, AsymmetricCompositionHook hook) { SaturatedPropertyChain saturation = ip.getSaturated(); Multimap<IndexedPropertyChain, IndexedComplexPropertyChain> compositionsByRight = saturation .getNonRedundantCompositionsByRightSubProperty(); for (IndexedPropertyChain right : compositionsByRight.keySet()) { for (IndexedComplexPropertyChain composition : compositionsByRight .get(right)) { SaturatedPropertyChain rightSaturation = right.getSaturated(); Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compositionsByLeft = rightSaturation .getNonRedundantCompositionsByLeftSubProperty(); if (!compositionsByLeft.contains(ip, composition)) { hook.error(ip, right, composition, ip); } } } }
/** * checking that all compositions of this property to the left are computed * in the saturations for the respective left properties * * @param ipc */ public static void testLeftCompositions(IndexedPropertyChain ipc, AsymmetricCompositionHook hook) { SaturatedPropertyChain saturation = ipc.getSaturated(); Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compositionsByLeft = saturation .getNonRedundantCompositionsByLeftSubProperty(); for (IndexedObjectProperty left : compositionsByLeft.keySet()) { for (IndexedComplexPropertyChain composition : compositionsByLeft .get(left)) { SaturatedPropertyChain leftSaturation = left.getSaturated(); Multimap<IndexedPropertyChain, IndexedComplexPropertyChain> compositionsByRight = leftSaturation .getNonRedundantCompositionsByRightSubProperty(); if (!compositionsByRight.contains(ipc, composition)) { hook.error(left, ipc, composition, ipc); } } } }