public interface MatchQuery extends Query<List<Answer>>, Streamable<Answer>
The MatchQuery is a pattern-matching query. The patterns are described in a declarative fashion, forming a
subgraph, then the MatchQuery will traverse the graph in an efficient fashion to find any matching subgraphs.
Each matching subgraph will produce a map, where keys are variable names and values are concepts in the graph.
| Modifier and Type | Method and Description |
|---|---|
MatchQueryAdmin |
admin() |
<S> AggregateQuery<S> |
aggregate(Aggregate<? super Answer,S> aggregate)
Aggregate results of a query.
|
AskQuery |
ask() |
DeleteQuery |
delete(Collection<? extends VarPattern> deleters) |
DeleteQuery |
delete(String... names) |
DeleteQuery |
delete(VarPattern... deleters) |
MatchQuery |
distinct()
remove any duplicate results from the query
|
java.util.stream.Stream<Concept> |
get(String name) |
InsertQuery |
insert(Collection<? extends VarPattern> vars) |
InsertQuery |
insert(VarPattern... vars) |
MatchQuery |
limit(long limit) |
MatchQuery |
offset(long offset) |
MatchQuery |
orderBy(String varName)
Order the results by degree in ascending order
|
MatchQuery |
orderBy(String varName,
Order order)
Order the results by degree
|
MatchQuery |
orderBy(Var varName)
Order the results by degree in ascending order
|
MatchQuery |
orderBy(Var varName,
Order order)
Order the results by degree
|
MatchQuery |
select(Set<Var> names) |
MatchQuery |
select(String... names) |
MatchQuery |
withGraph(GraknGraph graph) |
execute, isReadOnly, resultsStringiterator, parallelStream, streamforEach, spliterator@CheckReturnValue MatchQuery select(String... names)
names - an array of variable names to select@CheckReturnValue MatchQuery select(Set<Var> names)
names - a set of variable names to select@CheckReturnValue java.util.stream.Stream<Concept> get(String name)
name - a variable name to get@CheckReturnValue AskQuery ask()
@CheckReturnValue InsertQuery insert(VarPattern... vars)
vars - an array of variables to insert for each result of this match query@CheckReturnValue InsertQuery insert(Collection<? extends VarPattern> vars)
vars - a collection of variables to insert for each result of this match query@CheckReturnValue DeleteQuery delete(String... names)
names - an array of variable names to delete for each result of this match query@CheckReturnValue DeleteQuery delete(VarPattern... deleters)
deleters - an array of variables stating what properties to delete for each result of this match query@CheckReturnValue DeleteQuery delete(Collection<? extends VarPattern> deleters)
deleters - a collection of variables stating what properties to delete for each result of this match query@CheckReturnValue MatchQuery orderBy(String varName)
varName - the variable name to order the results by@CheckReturnValue MatchQuery orderBy(Var varName)
varName - the variable name to order the results by@CheckReturnValue MatchQuery orderBy(String varName, Order order)
varName - the variable name to order the results byorder - the ordering to use@CheckReturnValue MatchQuery orderBy(Var varName, Order order)
varName - the variable name to order the results byorder - the ordering to useMatchQuery withGraph(GraknGraph graph)
@CheckReturnValue MatchQuery limit(long limit)
limit - the maximum number of results the query should return@CheckReturnValue MatchQuery offset(long offset)
offset - the number of results to skip@CheckReturnValue MatchQuery distinct()
@CheckReturnValue <S> AggregateQuery<S> aggregate(Aggregate<? super Answer,S> aggregate)
S - the type of the aggregate resultaggregate - the aggregate operation to apply@CheckReturnValue MatchQueryAdmin admin()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.