public class MatchQueryBase extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
MatchQueryBase(Conjunction<PatternAdmin> pattern) |
| 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
|
boolean |
equals(Object o) |
List<Answer> |
execute()
Execute the query against the graph (potentially writing to the graph) and return a result
|
java.util.stream.Stream<Concept> |
get(String name) |
Optional<GraknGraph> |
getGraph() |
Set<OntologyConcept> |
getOntologyConcepts() |
Set<OntologyConcept> |
getOntologyConcepts(GraknGraph graph) |
Conjunction<PatternAdmin> |
getPattern() |
Set<Var> |
getSelectedNames() |
int |
hashCode() |
MatchQuery |
infer(boolean materialise) |
InsertQuery |
insert(Collection<? extends VarPattern> vars) |
InsertQuery |
insert(VarPattern... vars) |
boolean |
isReadOnly()
Whether this query will modify the graph
|
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
|
java.util.stream.Stream<String> |
resultsString(Printer printer)
Execute the query and return a human-readable stream of results
|
MatchQuery |
select(Set<Var> names) |
MatchQuery |
select(String... names) |
java.util.stream.Stream<Answer> |
stream() |
java.util.stream.Stream<Answer> |
stream(Optional<GraknGraph> optionalGraph)
Execute the query using the given graph.
|
String |
toString() |
MatchQuery |
withGraph(GraknGraph graph) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waititerator, parallelStreamforEach, spliteratorpublic MatchQueryBase(Conjunction<PatternAdmin> pattern)
pattern - a pattern to match in the graphpublic java.util.stream.Stream<Answer> stream(Optional<GraknGraph> optionalGraph)
optionalGraph - the graph to use to execute the querypublic Set<OntologyConcept> getOntologyConcepts(GraknGraph graph)
graph - the graph to use to get types frompublic Set<OntologyConcept> getOntologyConcepts()
public Conjunction<PatternAdmin> getPattern()
public Optional<GraknGraph> getGraph()
public Set<Var> getSelectedNames()
public final MatchQuery infer(boolean materialise)
public final java.util.stream.Stream<String> resultsString(Printer printer)
QueryresultsString in interface Query<List<Answer>>public final boolean isReadOnly()
QueryisReadOnly in interface Query<List<Answer>>public final MatchQueryAdmin admin()
admin in interface MatchQuerypublic final List<Answer> execute()
Querypublic final java.util.stream.Stream<Answer> stream()
stream in interface Streamable<Answer>public final MatchQuery withGraph(GraknGraph graph)
public final MatchQuery limit(long limit)
limit in interface MatchQuerylimit - the maximum number of results the query should returnpublic final MatchQuery offset(long offset)
offset in interface MatchQueryoffset - the number of results to skippublic final MatchQuery distinct()
MatchQuerydistinct in interface MatchQuerypublic final <S> AggregateQuery<S> aggregate(Aggregate<? super Answer,S> aggregate)
MatchQueryaggregate in interface MatchQueryS - the type of the aggregate resultaggregate - the aggregate operation to applypublic final MatchQuery select(String... names)
select in interface MatchQuerynames - an array of variable names to selectpublic final MatchQuery select(Set<Var> names)
select in interface MatchQuerynames - a set of variable names to selectpublic final java.util.stream.Stream<Concept> get(String name)
get in interface MatchQueryname - a variable name to getpublic final AskQuery ask()
ask in interface MatchQuerypublic final InsertQuery insert(VarPattern... vars)
insert in interface MatchQueryvars - an array of variables to insert for each result of this match querypublic final InsertQuery insert(Collection<? extends VarPattern> vars)
insert in interface MatchQueryvars - a collection of variables to insert for each result of this match querypublic final DeleteQuery delete(VarPattern... deleters)
delete in interface MatchQuerydeleters - an array of variables stating what properties to delete for each result of this match querypublic final DeleteQuery delete(String... names)
delete in interface MatchQuerynames - an array of variable names to delete for each result of this match querypublic final DeleteQuery delete(Collection<? extends VarPattern> deleters)
delete in interface MatchQuerydeleters - a collection of variables stating what properties to delete for each result of this match querypublic final MatchQuery orderBy(String varName)
MatchQueryorderBy in interface MatchQueryvarName - the variable name to order the results bypublic final MatchQuery orderBy(Var varName)
MatchQueryorderBy in interface MatchQueryvarName - the variable name to order the results bypublic final MatchQuery orderBy(String varName, Order order)
MatchQueryorderBy in interface MatchQueryvarName - the variable name to order the results byorder - the ordering to usepublic final MatchQuery orderBy(Var varName, Order order)
MatchQueryorderBy in interface MatchQueryvarName - the variable name to order the results byorder - the ordering to useCopyright © 2017 Grakn Labs Ltd. All rights reserved.