private Collection<? extends InferenceMatch> getWatchInferences( ConclusionMatch conclusion) { // need this method since some java compilers have problems for casting // directly return watchedInferences_.get(conclusion); }
private Collection<? extends InferenceMatch> getWatchInferences( ConclusionMatch conclusion) { // need this method since some java compilers have problems for casting // directly return watchedInferences_.get(conclusion); }
@Override public Collection<Value> get(Key key) { return multimap_.get(key); }
@Override public Collection<Value> get(Key key) { return multimap_.get(key); }
private Collection<? extends InferenceMatch> getWatchInferences( ConclusionMatch conclusion) { // need this method since some java compilers have problems for casting // directly return watchedInferences_.get(conclusion); }
@Override public Collection<Value> get(Key key) { return multimap_.get(key); }
/** * Prints key-value entries present in the first {@link Multimap} but not in * the second {@link Multimap} using the given {@link Writer} and prefixing * all messages with a given prefix. * * @param first * @param second * @param writer * @param prefix * @throws IOException */ public static <K, V> void dumpDiff(Multimap<K, V> first, Multimap<K, V> second, Writer writer, String prefix) throws IOException { for (K key : first.keySet()) { Collection<V> firstValues = first.get(key); Collection<V> secondValues = second.get(key); dumpDiff(firstValues, secondValues, writer, prefix + key + "->"); } }
/** * Prints key-value entries present in the first {@link Multimap} but not in * the second {@link Multimap} using the given {@link Writer} and prefixing * all messages with a given prefix. * * @param first * @param second * @param writer * @param prefix * @throws IOException */ public static <K, V> void dumpDiff(Multimap<K, V> first, Multimap<K, V> second, Writer writer, String prefix) throws IOException { for (K key : first.keySet()) { Collection<V> firstValues = first.get(key); Collection<V> secondValues = second.get(key); dumpDiff(firstValues, secondValues, writer, prefix + key + "->"); } }
/** * Prints key-value entries present in the first {@link Multimap} but not in * the second {@link Multimap} using the given {@link Writer} and prefixing * all messages with a given prefix. * * @param first * @param second * @param writer * @param prefix * @throws IOException */ public static <K, V> void dumpDiff(Multimap<K, V> first, Multimap<K, V> second, Writer writer, String prefix) throws IOException { for (K key : first.keySet()) { Collection<V> firstValues = first.get(key); Collection<V> secondValues = second.get(key); dumpDiff(firstValues, secondValues, writer, prefix + key + "->"); } }
private void apply( Multimap<IndexedPropertyChain, IndexedComplexPropertyChain> compsByForwardRelations, BackwardLink link, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all forward links */ if (compsByForwardRelations == null) return; for (IndexedPropertyChain forwardRelation : new LazySetIntersection<IndexedPropertyChain>( compsByForwardRelations.keySet(), forwardLinksByObjectProperty_.keySet())) { Collection<IndexedComplexPropertyChain> compositions = compsByForwardRelations .get(forwardRelation); Collection<IndexedContextRoot> forwardTargets = forwardLinksByObjectProperty_ .get(forwardRelation); for (IndexedComplexPropertyChain composition : compositions) for (IndexedContextRoot forwardTarget : forwardTargets) IndexedObjectSomeValuesFrom.Helper.produceComposedLink( producer, link.getTraceRoot(), link.getRelation(), premises.getRoot(), forwardRelation, forwardTarget, composition); } }
private void apply( Multimap<IndexedPropertyChain, IndexedComplexPropertyChain> compsByForwardRelations, BackwardLink link, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all forward links */ if (compsByForwardRelations == null) return; for (IndexedPropertyChain forwardRelation : new LazySetIntersection<IndexedPropertyChain>( compsByForwardRelations.keySet(), forwardLinksByObjectProperty_.keySet())) { Collection<IndexedComplexPropertyChain> compositions = compsByForwardRelations .get(forwardRelation); Collection<IndexedContextRoot> forwardTargets = forwardLinksByObjectProperty_ .get(forwardRelation); for (IndexedComplexPropertyChain composition : compositions) for (IndexedContextRoot forwardTarget : forwardTargets) IndexedObjectSomeValuesFrom.Helper.produceComposedLink( producer, link.getTraceRoot(), link.getRelation(), premises.getRoot(), forwardRelation, forwardTarget, composition); } }
private void apply( final Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compsByBackwardRelation, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all non-reflexive backward links */ final Map<IndexedObjectProperty, ? extends SubContextPremises> subContextMap = premises .getSubContextPremisesByObjectProperty(); for (IndexedObjectProperty backwardRelation : new LazySetIntersection<IndexedObjectProperty>( compsByBackwardRelation.keySet(), subContextMap.keySet())) { Collection<IndexedComplexPropertyChain> compositions = compsByBackwardRelation .get(backwardRelation); SubContextPremises subPremises = subContextMap .get(backwardRelation); for (IndexedComplexPropertyChain composition : compositions) for (IndexedContextRoot source : subPremises.getLinkedRoots()) { IndexedObjectSomeValuesFrom.Helper.produceComposedLink( producer, source, backwardRelation, premises.getRoot(), forwardLink_.getChain(), forwardLink_.getTarget(), composition); } } }
private void apply( final Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compsByBackwardRelation, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all non-reflexive backward links */ final Map<IndexedObjectProperty, ? extends SubContextPremises> subContextMap = premises .getSubContextPremisesByObjectProperty(); for (IndexedObjectProperty backwardRelation : new LazySetIntersection<IndexedObjectProperty>( compsByBackwardRelation.keySet(), subContextMap.keySet())) { Collection<IndexedComplexPropertyChain> compositions = compsByBackwardRelation .get(backwardRelation); SubContextPremises subPremises = subContextMap .get(backwardRelation); for (IndexedComplexPropertyChain composition : compositions) for (IndexedContextRoot source : subPremises.getLinkedRoots()) { IndexedObjectSomeValuesFrom.Helper.produceComposedLink( producer, source, backwardRelation, premises.getRoot(), forwardLink_.getChain(), forwardLink_.getTarget(), composition); } } }
private void apply( final Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compsByBackwardRelation, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all non-reflexive backward links */ final Map<IndexedObjectProperty, ? extends SubContextPremises> subContextMap = premises .getSubContextPremisesByObjectProperty(); for (IndexedObjectProperty backwardRelation : new LazySetIntersection<IndexedObjectProperty>( compsByBackwardRelation.keySet(), subContextMap.keySet())) { Collection<IndexedComplexPropertyChain> compositions = compsByBackwardRelation .get(backwardRelation); SubContextPremises subPremises = subContextMap .get(backwardRelation); for (IndexedComplexPropertyChain composition : compositions) for (IndexedContextRoot source : subPremises.getLinkedRoots()) { IndexedObjectSomeValuesFrom.Helper.produceComposedLink( producer, source, backwardRelation, premises.getRoot(), forwardLink_.getChain(), forwardLink_.getTarget(), composition); } } }
private void apply( final Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compsByBackwardRelation, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all reflexive backward links */ final Set<IndexedObjectProperty> reflexiveBackwardRelations = premises .getLocalReflexiveObjectProperties(); for (IndexedObjectProperty backwardRelation : new LazySetIntersection<IndexedObjectProperty>( compsByBackwardRelation.keySet(), reflexiveBackwardRelations)) { Collection<IndexedComplexPropertyChain> compositions = compsByBackwardRelation .get(backwardRelation); for (IndexedComplexPropertyChain composition : compositions) { IndexedContextRoot root = premises.getRoot(); IndexedObjectSomeValuesFrom.Helper.produceComposedLink(producer, root, backwardRelation, root, forwardLink_.getChain(), forwardLink_.getTarget(), composition); } } }
private void apply( final Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compsByBackwardRelation, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all reflexive backward links */ final Set<IndexedObjectProperty> reflexiveBackwardRelations = premises .getLocalReflexiveObjectProperties(); for (IndexedObjectProperty backwardRelation : new LazySetIntersection<IndexedObjectProperty>( compsByBackwardRelation.keySet(), reflexiveBackwardRelations)) { Collection<IndexedComplexPropertyChain> compositions = compsByBackwardRelation .get(backwardRelation); for (IndexedComplexPropertyChain composition : compositions) { IndexedContextRoot root = premises.getRoot(); IndexedObjectSomeValuesFrom.Helper.produceComposedLink(producer, root, backwardRelation, root, forwardLink_.getChain(), forwardLink_.getTarget(), composition); } } }
private void apply( final Multimap<IndexedObjectProperty, IndexedComplexPropertyChain> compsByBackwardRelation, ContextPremises premises, ClassInferenceProducer producer) { /* compose the link with all reflexive backward links */ final Set<IndexedObjectProperty> reflexiveBackwardRelations = premises .getLocalReflexiveObjectProperties(); for (IndexedObjectProperty backwardRelation : new LazySetIntersection<IndexedObjectProperty>( compsByBackwardRelation.keySet(), reflexiveBackwardRelations)) { Collection<IndexedComplexPropertyChain> compositions = compsByBackwardRelation .get(backwardRelation); for (IndexedComplexPropertyChain composition : compositions) { IndexedContextRoot root = premises.getRoot(); IndexedObjectSomeValuesFrom.Helper.produceComposedLink(producer, root, backwardRelation, root, forwardLink_.getChain(), forwardLink_.getTarget(), composition); } } }
@Override public Void visit(BackwardLinkChainFromBackwardLinkRule rule, BackwardLink premise, ContextPremises premises, ClassInferenceProducer producer) { for (IndexedPropertyChain prop : rule .getForwardLinksByObjectProperty().keySet()) { for (IndexedContextRoot target : rule .getForwardLinksByObjectProperty().get(prop)) { target.accept(rootValidator_); } } return null; }
@Override public void execute(ReasonerStage stage) throws ElkException { super.execute(stage); // FIXME: get rid of casts try { for (PostProcessingStage ppStage : instantiate( postProcesingMap.get(stage.getClass()), ((AbstractReasonerStage) stage).reasoner)) { ElkTimer.getNamedTimer(ppStage.getName()).start(); ppStage.execute(); ElkTimer.getNamedTimer(ppStage.getName()).stop(); } } catch (Exception e) { throw new ElkRuntimeException(e); } }
/** * 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); } } } }