public class Graql extends Object
| Modifier and Type | Method and Description |
|---|---|
static Pattern |
and(Collection<? extends Pattern> patterns) |
static Pattern |
and(Pattern... patterns) |
static <T extends Answer> |
compute(GraqlSyntax.Compute.Method<T> method) |
static ValuePredicate |
contains(String substring) |
static ValuePredicate |
contains(VarPattern varPattern) |
static Aggregate<Value> |
count(String... vars)
Create an aggregate that will count the results of a query.
|
static DefineQuery |
define(Collection<? extends VarPattern> varPatterns) |
static DefineQuery |
define(VarPattern... varPatterns) |
static ValuePredicate |
eq(Object value) |
static ValuePredicate |
eq(VarPattern varPattern) |
static Aggregate<AnswerGroup<ConceptMap>> |
group(String var)
Create an aggregate that will group a query by a variable.
|
static <T extends Answer> |
group(String var,
Aggregate<T> aggregate)
Create an aggregate that will group a query by a variable and apply the given aggregate to each group
|
static ValuePredicate |
gt(Comparable value) |
static ValuePredicate |
gt(VarPattern varPattern) |
static ValuePredicate |
gte(Comparable value) |
static ValuePredicate |
gte(VarPattern varPattern) |
static InsertQuery |
insert(Collection<? extends VarPattern> varPatterns) |
static InsertQuery |
insert(VarPattern... varPatterns) |
static VarPattern |
label(Label label) |
static VarPattern |
label(String label) |
static ValuePredicate |
lt(Comparable value) |
static ValuePredicate |
lt(VarPattern varPattern) |
static ValuePredicate |
lte(Comparable value) |
static ValuePredicate |
lte(VarPattern varPattern) |
static Match |
match(Collection<? extends Pattern> patterns) |
static Match |
match(Pattern... patterns) |
static Aggregate<Value> |
max(String var)
Create an aggregate that will find the maximum of a variable's values.
|
static Aggregate<Value> |
mean(String var)
Create an aggregate that will find the mean of a variable's values.
|
static Aggregate<Value> |
median(String var)
Create an aggregate that will find the median of a variable's values.
|
static Aggregate<Value> |
min(String var)
Create an aggregate that will find the minimum of a variable's values.
|
static ValuePredicate |
neq(Object value) |
static ValuePredicate |
neq(VarPattern varPattern) |
static Pattern |
or(Collection<? extends Pattern> patterns) |
static Pattern |
or(Pattern... patterns) |
static <T extends Query<?>> |
parse(String queryString) |
static QueryParser |
parser()
Get a
QueryParser for parsing queries from strings |
static ValuePredicate |
regex(String pattern) |
static Aggregate<Value> |
std(String var)
Create an aggregate that will find the unbiased sample standard deviation of a variable's values.
|
static Aggregate<Value> |
sum(String var)
Create an aggregate that will sum the values of a variable.
|
static UndefineQuery |
undefine(Collection<? extends VarPattern> varPatterns) |
static UndefineQuery |
undefine(VarPattern... varPatterns) |
static Var |
var() |
static Var |
var(String name) |
static QueryBuilder |
withoutGraph() |
@CheckReturnValue public static QueryBuilder withoutGraph()
@CheckReturnValue public static Match match(Pattern... patterns)
patterns - an array of patterns to match in the graphMatch that will find matches of the given patterns@CheckReturnValue public static Match match(Collection<? extends Pattern> patterns)
patterns - a collection of patterns to match in the graphMatch that will find matches of the given patterns@CheckReturnValue public static InsertQuery insert(VarPattern... varPatterns)
varPatterns - an array of variable patterns to insert into the graph@CheckReturnValue public static InsertQuery insert(Collection<? extends VarPattern> varPatterns)
varPatterns - a collection of variable patterns to insert into the graph@CheckReturnValue public static DefineQuery define(VarPattern... varPatterns)
varPatterns - an array of VarPatterns defining SchemaConceptsDefineQuery that will apply the changes described in the patterns@CheckReturnValue public static DefineQuery define(Collection<? extends VarPattern> varPatterns)
varPatterns - a collection of VarPatterns defining SchemaConceptsDefineQuery that will apply the changes described in the patterns@CheckReturnValue public static UndefineQuery undefine(VarPattern... varPatterns)
varPatterns - an array of VarPatterns undefining SchemaConceptsUndefineQuery that will remove the changes described in the patterns@CheckReturnValue public static UndefineQuery undefine(Collection<? extends VarPattern> varPatterns)
varPatterns - a collection of VarPatterns undefining SchemaConceptsUndefineQuery that will remove the changes described in the patterns@CheckReturnValue public static <T extends Answer> ComputeQuery<T> compute(GraqlSyntax.Compute.Method<T> method)
public static QueryParser parser()
QueryParser for parsing queries from strings@CheckReturnValue public static <T extends Query<?>> T parse(String queryString)
queryString - a string representing a query@CheckReturnValue public static Var var(String name)
name - the name of the variable@CheckReturnValue public static Var var()
@CheckReturnValue public static VarPattern label(Label label)
label - the label of a concept@CheckReturnValue public static VarPattern label(String label)
label - the label of a concept@CheckReturnValue public static Pattern and(Pattern... patterns)
patterns - an array of patterns to match@CheckReturnValue public static Pattern and(Collection<? extends Pattern> patterns)
patterns - a collection of patterns to match@CheckReturnValue public static Pattern or(Pattern... patterns)
patterns - an array of patterns to match@CheckReturnValue public static Pattern or(Collection<? extends Pattern> patterns)
patterns - a collection of patterns to match@CheckReturnValue public static Aggregate<Value> count(String... vars)
@CheckReturnValue public static Aggregate<Value> sum(String var)
@CheckReturnValue public static Aggregate<Value> min(String var)
var - the variable to find the maximum of@CheckReturnValue public static Aggregate<Value> max(String var)
var - the variable to find the maximum of@CheckReturnValue public static Aggregate<Value> mean(String var)
var - the variable to find the mean of@CheckReturnValue public static Aggregate<Value> median(String var)
var - the variable to find the median of@CheckReturnValue public static Aggregate<Value> std(String var)
var - the variable to find the standard deviation of@CheckReturnValue public static Aggregate<AnswerGroup<ConceptMap>> group(String var)
var - the variable to group results by@CheckReturnValue public static <T extends Answer> Aggregate<AnswerGroup<T>> group(String var, Aggregate<T> aggregate)
T - the type the aggregate returnsvar - the variable to group results byaggregate - the aggregate to apply to each group@CheckReturnValue public static ValuePredicate eq(Object value)
value - the value@CheckReturnValue public static ValuePredicate eq(VarPattern varPattern)
varPattern - the variable pattern representing a resource@CheckReturnValue public static ValuePredicate neq(Object value)
value - the value@CheckReturnValue public static ValuePredicate neq(VarPattern varPattern)
varPattern - the variable pattern representing a resource@CheckReturnValue public static ValuePredicate gt(Comparable value)
value - the value@CheckReturnValue public static ValuePredicate gt(VarPattern varPattern)
varPattern - the variable pattern representing a resource@CheckReturnValue public static ValuePredicate gte(Comparable value)
value - the value@CheckReturnValue public static ValuePredicate gte(VarPattern varPattern)
varPattern - the variable pattern representing a resource@CheckReturnValue public static ValuePredicate lt(Comparable value)
value - the value@CheckReturnValue public static ValuePredicate lt(VarPattern varPattern)
varPattern - the variable pattern representing a resource@CheckReturnValue public static ValuePredicate lte(Comparable value)
value - the value@CheckReturnValue public static ValuePredicate lte(VarPattern varPattern)
varPattern - the variable pattern representing a resource@CheckReturnValue public static ValuePredicate regex(String pattern)
pattern - a regex pattern@CheckReturnValue public static ValuePredicate contains(String substring)
substring - a substring to match@CheckReturnValue public static ValuePredicate contains(VarPattern varPattern)
varPattern - the variable pattern representing a resourceCopyright © 2018 Grakn Labs Ltd. All rights reserved.