public class Aggregates extends Object
| Modifier and Type | Method and Description |
|---|---|
static Aggregate<Map<VarName,Concept>,Optional<Double>> |
average(VarName varName)
Aggregate that finds average (mean) of a match query.
|
static Aggregate<Object,Long> |
count()
Aggregate that counts results of a match query.
|
static Aggregate<Map<VarName,Concept>,Map<Concept,List<Map<VarName,Concept>>>> |
group(VarName varName)
Aggregate that groups results of a match query by variable name
|
static <T> Aggregate<Map<VarName,Concept>,Map<Concept,T>> |
group(VarName varName,
Aggregate<? super Map<VarName,Concept>,T> innerAggregate)
Aggregate that groups results of a match query by variable name, applying an aggregate to each group.
|
static <T> Aggregate<T,List<T>> |
list()
An aggregate that changes match query results into a list.
|
static <T extends Comparable<T>> |
max(VarName varName)
Aggregate that finds maximum of a match query.
|
static Aggregate<Map<VarName,Concept>,Optional<Number>> |
median(VarName varName)
Aggregate that finds median of a match query.
|
static <T extends Comparable<T>> |
min(VarName varName)
Aggregate that finds minimum of a match query.
|
static <S,T> Aggregate<S,Map<String,T>> |
select(com.google.common.collect.ImmutableSet<NamedAggregate<? super S,? extends T>> aggregates)
An aggregate that combines several aggregates together into a map (where keys are the names of the aggregates)
|
static Aggregate<Map<VarName,Concept>,Number> |
sum(VarName varName)
Aggregate that sums results of a match query.
|
public static Aggregate<Map<VarName,Concept>,Optional<Double>> average(VarName varName)
public static Aggregate<Map<VarName,Concept>,Map<Concept,List<Map<VarName,Concept>>>> group(VarName varName)
varName - the variable name to group results bypublic static <T> Aggregate<Map<VarName,Concept>,Map<Concept,T>> group(VarName varName, Aggregate<? super Map<VarName,Concept>,T> innerAggregate)
T - the type of each grouppublic static <T> Aggregate<T,List<T>> list()
T - the type of the results of the match querypublic static <T extends Comparable<T>> Aggregate<Map<VarName,Concept>,Optional<T>> max(VarName varName)
public static Aggregate<Map<VarName,Concept>,Optional<Number>> median(VarName varName)
public static <T extends Comparable<T>> Aggregate<Map<VarName,Concept>,Optional<T>> min(VarName varName)
public static <S,T> Aggregate<S,Map<String,T>> select(com.google.common.collect.ImmutableSet<NamedAggregate<? super S,? extends T>> aggregates)
S - the type of the match query resultsT - the type of the aggregate resultsCopyright © 2017 Grakn Labs Ltd. All rights reserved.