public class Graql extends Object
| Modifier and Type | Method and Description |
|---|---|
static Pattern |
and(Collection<? extends Pattern> patterns) |
static Pattern |
and(Pattern... patterns) |
static ComputeQueryBuilder |
compute() |
static ValuePredicate |
contains(String substring) |
static ValuePredicate |
contains(VarPattern varPattern) |
static Aggregate<Object,Long> |
count()
Create an aggregate that will count the results of a query.
|
static ValuePredicate |
eq(Object value) |
static ValuePredicate |
eq(VarPattern varPattern) |
static Aggregate<Answer,Map<Concept,List<Answer>>> |
group(String var)
Create an aggregate that will group a query by a variable.
|
static <T> Aggregate<Answer,Map<Concept,T>> |
group(String var,
Aggregate<? super Answer,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 MatchQuery |
match(Collection<? extends Pattern> patterns) |
static MatchQuery |
match(Pattern... patterns) |
static <T extends Comparable<T>> |
max(String var)
Create an aggregate that will find the maximum of a variable's values.
|
static Aggregate<Answer,Optional<Double>> |
mean(String var)
Create an aggregate that will find the mean of a variable's values.
|
static Aggregate<Answer,Optional<Number>> |
median(String var)
Create an aggregate that will find the median of a variable's values.
|
static <T extends Comparable<T>> |
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 java.util.stream.Stream<Query<?>> |
parseList(String queryString) |
static List<Pattern> |
parsePatterns(String patternsString) |
static <T extends Query<?>> |
parseTemplate(String template,
Map<String,Object> data) |
static ValuePredicate |
regex(String pattern) |
static <S,T> Aggregate<S,Map<String,T>> |
select(NamedAggregate<? super S,? extends T>... aggregates)
Create an aggregate that will collect together several named aggregates into a map.
|
static <S,T> Aggregate<S,Map<String,T>> |
select(Set<NamedAggregate<? super S,? extends T>> aggregates)
Create an aggregate that will collect together several named aggregates into a map.
|
static Aggregate<Answer,Optional<Double>> |
std(String var)
Create an aggregate that will find the unbiased sample standard deviation of a variable's values.
|
static Aggregate<Answer,Number> |
sum(String var)
Create an aggregate that will sum the values of a variable.
|
static Var |
var() |
static Var |
var(String name) |
static QueryBuilder |
withoutGraph() |
@CheckReturnValue public static QueryBuilder withoutGraph()
@CheckReturnValue public static MatchQuery match(Pattern... patterns)
patterns - an array of patterns to match in the graph@CheckReturnValue public static MatchQuery match(Collection<? extends Pattern> patterns)
patterns - a collection of patterns to match in the graph@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 ComputeQueryBuilder compute()
@CheckReturnValue public static List<Pattern> parsePatterns(String patternsString)
patternsString - a string representing a list of patterns@CheckReturnValue public static <T extends Query<?>> T parse(String queryString)
queryString - a string representing a query@CheckReturnValue public static java.util.stream.Stream<Query<?>> parseList(String queryString)
queryString - a string representing several queries@CheckReturnValue public static <T extends Query<?>> java.util.stream.Stream<T> parseTemplate(String template, Map<String,Object> data)
template - a string representing a templated graql querydata - data to use in template@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<Object,Long> count()
@CheckReturnValue public static Aggregate<Answer,Number> sum(String var)
@CheckReturnValue public static <T extends Comparable<T>> Aggregate<Answer,Optional<T>> max(String var)
var - the variable to find the maximum of@CheckReturnValue public static <T extends Comparable<T>> Aggregate<Answer,Optional<T>> min(String var)
var - the variable to find the maximum of@CheckReturnValue public static Aggregate<Answer,Optional<Double>> mean(String var)
var - the variable to find the mean of@CheckReturnValue public static Aggregate<Answer,Optional<Number>> median(String var)
var - the variable to find the median of@CheckReturnValue public static Aggregate<Answer,Optional<Double>> std(String var)
var - the variable to find the standard deviation of@CheckReturnValue public static Aggregate<Answer,Map<Concept,List<Answer>>> group(String var)
var - the variable to group results by@CheckReturnValue public static <T> Aggregate<Answer,Map<Concept,T>> group(String var, Aggregate<? super Answer,T> aggregate)
T - the type the aggregate returnsvar - the variable to group results byaggregate - the aggregate to apply to each group@CheckReturnValue @SafeVarargs public static <S,T> Aggregate<S,Map<String,T>> select(NamedAggregate<? super S,? extends T>... aggregates)
S - the type that the query returnsT - the type that each aggregate returnsaggregates - the aggregates to join together@CheckReturnValue public static <S,T> Aggregate<S,Map<String,T>> select(Set<NamedAggregate<? super S,? extends T>> aggregates)
S - the type that the query returnsT - the type that each aggregate returnsaggregates - the aggregates to join together@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 © 2017 Grakn Labs Ltd. All rights reserved.