use of ai.grakn.graql.internal.reasoner.MultiUnifierImpl in project grakn by graknlabs.
the class LazyQueryCache method getAnswerStreamWithUnifier.
@Override
public Pair<Stream<Answer>, MultiUnifier> getAnswerStreamWithUnifier(Q query) {
CacheEntry<Q, LazyAnswerIterator> match = this.getEntry(query);
if (match != null) {
Q equivalentQuery = match.query();
MultiUnifier multiUnifier = equivalentQuery.getMultiUnifier(query);
Stream<Answer> unified = match.cachedElement().stream().flatMap(a -> a.unify(multiUnifier));
return new Pair<>(unified, multiUnifier);
}
Stream<Answer> answerStream = record(query, query.getQuery().stream().map(a -> a.explain(new LookupExplanation(query))));
return new Pair<>(answerStream, new MultiUnifierImpl());
}
Aggregations