Search in sources :

Example 1 with MatchBase

use of ai.grakn.graql.internal.query.match.MatchBase in project grakn by graknlabs.

the class QueryBuilderImpl method match.

/**
 * @param patterns a collection of patterns to match in the knowledge base
 * @return a {@link Match} that will find matches of the given patterns
 */
@Override
public Match match(Collection<? extends Pattern> patterns) {
    Conjunction<PatternAdmin> conjunction = Patterns.conjunction(Sets.newHashSet(AdminConverter.getPatternAdmins(patterns)));
    MatchBase base = new MatchBase(conjunction);
    Match match = infer ? base.infer(materialise).admin() : base;
    return tx.map(match::withTx).orElse(match);
}
Also used : PatternAdmin(ai.grakn.graql.admin.PatternAdmin) VarPatternAdmin(ai.grakn.graql.admin.VarPatternAdmin) MatchBase(ai.grakn.graql.internal.query.match.MatchBase) Match(ai.grakn.graql.Match)

Aggregations

Match (ai.grakn.graql.Match)1 PatternAdmin (ai.grakn.graql.admin.PatternAdmin)1 VarPatternAdmin (ai.grakn.graql.admin.VarPatternAdmin)1 MatchBase (ai.grakn.graql.internal.query.match.MatchBase)1