Interface Aggregate

All Superinterfaces:
AutoCloseable, Copyable<com.complexible.stardog.plan.filter.Expression>, com.complexible.stardog.plan.filter.Expression, Function

public interface Aggregate extends Function, AutoCloseable

A Function which computes an aggregated value over a group of solutions during query execution.

Since:
1.1
Version:
6.0
Author:
Michael Grove, Pavel Klinov
See Also:
  • Aggregates
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Define behaviour of this aggregate when the input is unbound / erroneous
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disposes of the internal state.
    Create a deep copy of the object which does not share any references with the original.
    com.complexible.stardog.plan.filter.expr.ValueOrError
    evaluate(com.complexible.stardog.plan.filter.ValueSolution theValueSolution)
    The return value of evaluating an Aggregate is not necessarily the aggregated value, and can even be null.
    com.complexible.stardog.plan.filter.expr.ValueOrError
    get()
    Get the aggregated value
    com.complexible.stardog.plan.filter.Expression
    Get the argument expression
     
    default boolean
    boolean
    Return whether or not the Aggregate has a distinct modifier applied to it
    default boolean
    void
    Resets the internal state of the aggregate so it can start over.

    Methods inherited from interface com.complexible.stardog.plan.filter.Expression

    accept, couldRaiseError, getArgs, getCategory, replaceArg, setArgs

    Methods inherited from interface com.complexible.stardog.plan.filter.functions.Function

    getDescription, getName, getNames, initialize, isDeterministic
  • Method Details

    • evaluate

      com.complexible.stardog.plan.filter.expr.ValueOrError evaluate(com.complexible.stardog.plan.filter.ValueSolution theValueSolution)
      The return value of evaluating an Aggregate is not necessarily the aggregated value, and can even be null. In many cases the aggregate may be computing a value, as with Avg, rather than something like a running total or a value from the group. In these instances, it is not worth computing the aggregated value since it's not used until the entire group is processed and retrieved via get(). Some aggregates may choose to return the current aggregated value here, but null will often be the return value of this method for aggregates.
      Specified by:
      evaluate in interface com.complexible.stardog.plan.filter.Expression
    • get

      com.complexible.stardog.plan.filter.expr.ValueOrError get()
      Get the aggregated value
      Returns:
      the value
    • isDistinct

      boolean isDistinct()
      Return whether or not the Aggregate has a distinct modifier applied to it
      Returns:
      true if distinct, false otherwise
    • isFixedSizeAggregate

      default boolean isFixedSizeAggregate()
      Returns:
      true if corresponding aggregate is being applied to the decimal value with fixed size, else otherwise;
    • isAppropriateDataType

      default boolean isAppropriateDataType(Datatype theDataType)
      Parameters:
      theDataType - - dataType;
      Returns:
      true if corresponding aggregate can be applied for the corresponding type during Functor's calculation, false otherwise;
    • getErrorBehaviour

      Aggregate.ErrorBehaviour getErrorBehaviour()
      Returns:
      value indicating whether this aggregate can produce unbound or error results
    • copy

      Aggregate copy()
      Create a deep copy of the object which does not share any references with the original.
      Specified by:
      copy in interface Copyable<com.complexible.stardog.plan.filter.Expression>
      Specified by:
      copy in interface Function
      Returns:
      a copy of the object
    • getArg

      com.complexible.stardog.plan.filter.Expression getArg()
      Get the argument expression
      Returns:
      the argument expression
    • reset

      void reset()
      Resets the internal state of the aggregate so it can start over.
    • close

      void close()
      Disposes of the internal state.
      Specified by:
      close in interface AutoCloseable