Class Functions


  • @API(status=EXPERIMENTAL,
         since="1.0")
    public final class Functions
    extends java.lang.Object
    Factory methods for creating instances of functions.
    Since:
    1.0
    Author:
    Michael J. Simons, Gerrit Meier, Romain Rossi
    • Method Detail

      • id

        public static FunctionInvocation id​(Node node)
        Creates a function invocation for id{}. See id.
        Parameters:
        node - The node for which the internal id should be retrieved
        Returns:
        A function call for id() on a node.
      • id

        public static FunctionInvocation id​(Relationship relationship)
        Creates a function invocation for id{}. See id.
        Parameters:
        relationship - The relationship for which the internal id should be retrieved
        Returns:
        A function call for id() on a relationship.
      • labels

        public static FunctionInvocation labels​(Node node)
        Creates a function invocation for labels{}. See labels.
        Parameters:
        node - The node for which the labels should be retrieved
        Returns:
        A function call for labels() on a node.
      • type

        public static FunctionInvocation type​(Relationship relationship)
        Creates a function invocation for type{}. See type.
        Parameters:
        relationship - The relationship for which the type should be retrieved
        Returns:
        A function call for type() on a relationship.
      • count

        public static FunctionInvocation count​(Node node)
        Parameters:
        node - The named node to be counted
        Returns:
        A function call for count() for one named node
        See Also:
        count(Expression)
      • count

        public static FunctionInvocation count​(Expression expression)
        Creates a function invocation for the count() function. See count.
        Parameters:
        expression - An expression describing the things to count.
        Returns:
        A function call for count() for an expression like Cypher.asterisk() etc.
      • countDistinct

        public static FunctionInvocation countDistinct​(Node node)
        Creates a function invocation for a count() function with DISTINCT added.
        Parameters:
        node - The named node to be counted
        Returns:
        A function call for count() for one named node
        See Also:
        countDistinct(Expression)
      • countDistinct

        public static FunctionInvocation countDistinct​(Expression expression)
        Creates a function invocation for a count() function with DISTINCT added. See count.
        Parameters:
        expression - An expression describing the things to count.
        Returns:
        A function call for count() for an expression like Cypher.asterisk() etc.
      • coalesce

        public static FunctionInvocation coalesce​(Expression... expressions)
        Creates a function invocation for the coalesce() function. See coalesce.
        Parameters:
        expressions - One or more expressions to be coalesced
        Returns:
        A function call for coalesce.
      • toLower

        public static FunctionInvocation toLower​(Expression expression)
        Creates a function invocation for the toLower() function. See toLower.
        Parameters:
        expression - An expression resolving to a string
        Returns:
        A function call for toLower() for one expression
      • size

        public static FunctionInvocation size​(Expression expression)
        Creates a function invocation for the size() function. size can be applied to
        Parameters:
        expression - The expression who's size is to be returned
        Returns:
        A function call for size() for one expression
      • size

        public static FunctionInvocation size​(RelationshipPattern pattern)
        Creates a function invocation for the size() function. size can be applied to
        Parameters:
        pattern - The pattern for which size() should be invoked.
        Returns:
        A function call for size() for a pattern
      • exists

        public static FunctionInvocation exists​(Expression expression)
        Creates a function invocation for the exists() function. See exists.
        Parameters:
        expression - The expression who's existence is to be evaluated
        Returns:
        A function call for exists() for one expression
      • distance

        public static FunctionInvocation distance​(Expression point1,
                                                  Expression point2)
        Creates a function invocation for the distance() function. See exists. Both points need to be in the same coordinate system.
        Parameters:
        point1 - Point 1
        point2 - Point 2
        Returns:
        A function call for distance()
      • point

        public static FunctionInvocation point​(MapExpression parameterMap)
        Creates a function invocation for the point() function. See point.
        Parameters:
        parameterMap - The map of parameters for point()
        Returns:
        A function call for point()
      • avg

        public static FunctionInvocation avg​(Expression expression)
        Creates a function invocation for the avg() function. See avg.
        Parameters:
        expression - The things to average
        Returns:
        A function call for avg()
      • collect

        public static FunctionInvocation collect​(Expression expression)
        Creates a function invocation for the collect() function. See collect.
        Parameters:
        expression - The things to collect
        Returns:
        A function call for collect()
      • max

        public static FunctionInvocation max​(Expression expression)
        Creates a function invocation for the max() function. See max.
        Parameters:
        expression - A list from which the maximum element value is returned
        Returns:
        A function call for max()
      • min

        public static FunctionInvocation min​(Expression expression)
        Creates a function invocation for the min() function. See min.
        Parameters:
        expression - A list from which the minimum element value is returned
        Returns:
        A function call for min()
      • percentileCont

        public static FunctionInvocation percentileCont​(Expression expression,
                                                        java.lang.Number percentile)
        Creates a function invocation for the percentileCont() function. See percentileCont.
        Parameters:
        expression - A numeric expression
        percentile - A numeric value between 0.0 and 1.0
        Returns:
        A function call for percentileCont()
      • percentileDisc

        public static FunctionInvocation percentileDisc​(Expression expression,
                                                        java.lang.Number percentile)
        Creates a function invocation for the percentileDisc() function. See percentileDisc.
        Parameters:
        expression - A numeric expression
        percentile - A numeric value between 0.0 and 1.0
        Returns:
        A function call for percentileDisc()
      • stDev

        public static FunctionInvocation stDev​(Expression expression)
        Creates a function invocation for the stDev() function. See stDev.
        Parameters:
        expression - A numeric expression
        Returns:
        A function call for stDev()
      • stDevP

        public static FunctionInvocation stDevP​(Expression expression)
        Creates a function invocation for the stDevP() function. See stDevP.
        Parameters:
        expression - A numeric expression
        Returns:
        A function call for stDevP()
      • sum

        public static FunctionInvocation sum​(Expression expression)
        Creates a function invocation for the sum() function. See sum.
        Parameters:
        expression - An expression returning a set of numeric values
        Returns:
        A function call for sum()
      • range

        public static FunctionInvocation range​(Expression start,
                                               Expression end,
                                               Expression step)
        Creates a function invocation for the range() function. See range.
        Parameters:
        start - the range's start
        end - the range's end
        step - the range's step
        Returns:
        A function call for range()
      • head

        public static FunctionInvocation head​(Expression expression)
        Creates a function invocation for the head() function. See head.
        Parameters:
        expression - A list from which the head element is returned
        Returns:
        A function call for head()
      • last

        public static FunctionInvocation last​(Expression expression)
        Creates a function invocation for the last() function. See last.
        Parameters:
        expression - A list from which the last element is returned
        Returns:
        A function call for last()
      • nodes

        public static FunctionInvocation nodes​(NamedPath path)
        Creates a function invocation for nodes{}. See labels.
        Parameters:
        path - The path for which the number of nodes should be retrieved
        Returns:
        A function call for nodes() on a node.
        Since:
        1.1