Skip to Content
Cypher ManualExpressionExpression

Expression

Expressions are fundamental components in Cypher that allow you to compute values, perform calculations, and manipulate data within queries. Unlike traditional SQL which focuses on relational data operations, Cypher expressions are designed specifically for graph data structures and provide powerful capabilities for traversing edges, pattern matching, and graph-specific computations.

Cypher expressions serve several key purposes:

  • Value Computation: Calculate derived values from node properties, edge attributes, or computed results
  • Condition Evaluation: Create boolean expressions for filtering nodes, edges, or paths
  • Data Transformation: Convert and format data types for display or further processing
  • Graph Traversal: Navigate through graph structures using path expressions and pattern matching
  • Aggregation: Perform calculations across collections of nodes or edges
  • String and Text Processing: Manipulate text data for search, display, or analysis

Cypher expressions are built from two main categories of components:

  1. Operators: Symbols and keywords that perform basic operations on operands
  2. Functions: Predefined operations that encapsulate complex logic and take parameters

These components work together to create powerful expressions that can handle both simple calculations and complex graph operations.

Operators

Operators in NeuG are symbols or keywords that perform operations on operands. They are fundamental building blocks for constructing expressions and queries.

Supported Operator Types

TypeDescription
ComparisonOperators for comparing values (e.g., =, <>, <, >, <=, >=)
LogicalBoolean operators for combining conditions (e.g., AND, OR, NOT)
ArithmeticMathematical operations (e.g., +, -, *, /, %)
NullOperations for handling null values (e.g., IS NULL, IS NOT NULL)
ListOperations for working with list data structures (e.g., IN)

Functions

Functions in NeuG are predefined operations that take input parameters and return computed values. They provide specialized functionality for data manipulation and analysis.

Supported Function Categories

CategoryDescription
AggregateFunctions that operate on collections of values and return a single result (e.g., COUNT, SUM, AVG, MAX, MIN)
CastFunctions for converting data types between different formats
TemporalFunctions for working with date and time data
Graph PatternFunctions specifically designed for nodes, edges or path