Module org.neo4j.cypherdsl.core
Package org.neo4j.cypherdsl.core
package org.neo4j.cypherdsl.core
Contains an internal DSL for creating Cypher. This API is in an experimental status at the moment and might change
without further notice.
While we have extensive tests in place to check that queries SDN needs are correctly generated, the AST itself is not validated for type errors. That is, one could misuse the DSL here to create an AST that renders to a syntactically correct Cypher statement, that will explode during runtime. For example using wrongly typed expression (an expression referencing a list while a map is needed or something like that).
With this in mind, please use this DSL consciously if you find it useful. It won't go away anytime soon, but might change in ways that break your code without further notice.
- Author:
- Michael J. Simons
-
ClassDescriptionAn element with an alias.An aliased expression, that deals with named expressions when accepting visitors.The
*
.The boolean literal.See CaseExpression.Specification for a renderable, complete CASE statementExtension of theCase
interface to support generic case.Helper class to collect `when` expressions and createCaseWhenThen
instances when the `then` is provided.Extension theCase
interface to support simple case with an initial expression / condition.This is a marker interface for top level clauses.Builder / factory for variousclauses
.Implementing COLLECT subqueriesA concrete condition representing a comparision between two expressions.Shared interface for all conditions.Exception thrown when extracting parameters from a statement leads to one parameter with a given name appearing with different values.A constant condition that is either always true or false.Added for supporting the Neo5j parser.See Create.The main entry point into the Cypher DSL.See Delete.An existential sub-query can only be used in a where clause.Allows chaining of statements to some other builders.ExposesCall<T>Entrypoint for building procedure calls.Interface to allow creating an expression instead of a statement from an ongoing definition.Used to provide arguments to procedure calls.Used to yield procedure result fields.A step exposing aExposesCreate.create(PatternElement...)
method.A step exposing a severalusing
methods that are provide entry points of adding advanced query hints.Exposes methods to configure aLOAD CSV
clause.A step exposing logical operatorsand
andor
after awhere
clause.A step exposing aExposesMatch.match(PatternElement...)
method.A step exposing aExposesMerge.merge(PatternElement...)
method.ExposesPatternLengthAccessors<T extends RelationshipPattern>This interface is used to derive new relationship patterns from existingrelationships
orchains of relationships
with new lengths (min, max or unbounded) configured.A container that exposes methods to add properties with values to nodes or relationships.A marker interface for things that expose methods to create new relationships to other elements.Return part of a statement.This exposes a call method taking in a statement that represents a valid, correlated subquery.Subqueries can be valid without any further return statement (i.e when the subquery is a void (unit) one, meaning it doesn't yield or return its results.A step exposing aExposesUnwind.unwind(Expression...)
,ExposesUnwind.unwind(Expression)
,ExposesUnwind.unwind(String)
and method.ExposesWhere<T>A step exposing a severalwhere
methods that are provide entry points of adding conditions.A step that exposes theWITH
clause.An expression can be used in many places, i.e. in return statements, pattern elements etc.Represents the FOREACH clause and is currently only producible via the Cypher-Parser.ForeignAdapter<FE>Represents an adapter that allows to turn foreign expressions into Cypher-DSLexpressions
.Defines metadata for a function.A condition checking for the presence of labels on nodes or types on relationships.Visitable implementing hints.This interface represents an element that can be for example an identifiable part of theWITH
clause.Used for subqueries IN TRANSACTIONSHelper class, only for internal use.Represents a label expression, usable inCypher.node(LabelExpression)
.Type of this expressionAllows to add a where clause into the definition of the list.Provides the final step of defining a list comprehension.ListComprehension.OngoingDefinitionWithVariable.in(Expression)
must be used to define the source list.Represents a list expression as in[expression1, expression2, ..., expressionN]
A list of literals.Represents a range literal applied to another expression.Literal<T>Represents a literal with an optional content.Thrown when a given object cannot be used as a Cypher-DSL-Literal.An instance of this interface will be provided after pointing the database to a validURI
of a CSV resource.A dedicated map expression.A map of literals.Represents a map projection as described here.See Match.See Create.An action or event that happens after aMERGE
clause.The type of the action.A named thing exposesNamed.getSymbolicName()
, making the thing identifiable.Represents a named path.Partial path that has a name (p =
).Partial path that has a name (p =
) and is based on a graph algorithm function.This annotation provides information which Neo4j version is required to be able to successfully run a query containing a fragment generated via a method annotated with it.See NodePattern.This is the base class for all nodes.Expression for a single Node label.Represents the literal value null.Allows to define the source of the list predicate.Allows to specify the where condition for the list based predicate.A binary operation.An operator.Operator
type.Represents the list of sort items that make up the order of records in a result set.Parameter<T>Represents a named parameter inside a Cypher statement.Provides the final step of defining a pattern comprehension.Allows to add a where clause into the definition of the pattern.Intermediate step that allows expressing additional, logical operators.See PatternElement.A marker interface used for pattern appearing inexists
orsize
statements.See StandaloneCall.Represents the properties of anode
or arelationship
when used as part of the whole pattern (inside aMATCH
,CREATE
orMERGE
clause as{p1: v1, p2: v2, pn: vn}
.A property.This interface represents an element that has properties.A container having properties.See PropertyLookupQuantifier for path patterns.Synthetic element for the Cypher-DSL AST.A typed subtree representing the arguments of a call to thereduce()
function.Step 4b: Define the initial valueStep 3: Define the map expressionStep 4a: Define the accumulatorStep 2: Define the listSee RelationshipPattern.See RelationshipDetail.While the direction in the schema package is centered around the node, the direction here is the direction between two nodes.RelationshipBase<S extends NodeBase<?>,E extends NodeBase<?>, SELF extends RelationshipBase<S, E, SELF>> This is the base class for all relationships.Represents a chain of relationships.A shared, public interface forrelationships
andchains of relationships
.See Remove.A statement that returns items from the graph.See Return.The container or "body" for return items, order and optional skip and things.See Set.A sort item can be used in anORDER BY
clause and changes the order of the items being returned from a query.Sort direction.Shall be the common interfaces for queries that we support.RepresentsRegularQuery
.Represents aSingleQuery
.Represents aUnionQuery
.Represents aUSE
statement, utilizing a composite graph call.A buildable ongoing MATCH and UPDATE.An interface combining a buildable MATCH and UPDATE with the possibility to add actions after a MERGE clause.StatementBuilder.BuildableStatement<T extends Statement>A statement that has all information required to be build and exposes a build method.A step that exposes only theDELETE
clause.A shared marker interface for things that can be turned into a subquery to be used inside the WHERE clause.Steps for building aForeach
clause.A step that exposes theStatementBuilder.ExposesLimit.limit(Number)
method.Provides a way to specify an action that happens after aMERGE
clause.SeeStatementBuilder.TerminalExposesOrderBy
, but on a with clause.Set part of a statement.A step that exposes the set clause.Exposes node mutations.A step that exposes theStatementBuilder.ExposesSkip.skip(Number)
method.A step providing all the supported updating clauses (DELETE, SET)A trait for an ongoing standalone call to expose all of its results via an asterisk.Initial step of defining aFOREACH-clause
.Second step of defining aFOREACH-clause
in which the updating clause is defined.The union of an in-query call exposing yields.The union of an in-query call exposing new arguments and yields.An in-query call exposing where and return clauses.Combines the capabilities of skip, limit and adds additional expressions to the order-by items.After a MATCH..UPDATE chain has been established, a RETURN can be added, a pipeline with WITH can be started or more mutating steps can be added.An ongoing update statement that can be used to chain more updating statements, define actions on a merge or add a with or return clause.A variant ofStatementBuilder.ExposesSet
that allows for further chaining of actions.An intermediate step while defining the order of a with clause.A match that exposesreturning
and for which it is not decided whether the optional where part has been used or note.A match that knows what to return and which is ready to be build.Represents a reading statement ending in a with clause, potentially already having an order and not exposing order methods.The union type of an ongoing reading with a WITH and a SKIP clause.Combines the capabilities of skip, limit and adds additional expressions to the order-by items.A match that exposesreturning
andwhere
methods to add required information.A match that has a non-emptywhere
-part.The union of a buildable statement and call exposing yields.The union of a buildable statement and call exposing new arguments and yields.A buildable statement exposing where and return clauses.Builder part for unwinding.An ongoing update statement that can be used to chain more update statements or add a with or return clause.A match that knows what to pipe to the next part of a multipart query.A step that exposes theStatementBuilder.TerminalExposesLimit.limit(Number)
method.A step that exposes several methods to specify ordering.A step that exposes theStatementBuilder.TerminalExposesSkip.skip(Number)
method.An intermediate step while defining the order of a result set.The result of a call to a stored procedure not having any results.The statement catalog gives an overview about relevant items in a statement.Enum for the clause in which a comparison was made.This interface represents all kinds of filters in a query such as filters on labels and filters on properties.This type represents a filter on nodes requiring one or more labels.A property that has been resolved.This type encapsulates a comparison in which a property of a node or relationship was used.A token can either describe a node label or a relationship type.The specific token type.Context for while rendering a statement.The string representation of a string literal will be a quoted Cypher string in single tickmarks with escaped reserved characters.Represents a "callable" sub-query.A sub-query expression can either be anEXISTS-tential
or aCOUNT
expression as of Neo4j 5.Something that can build counting sub-queries.A symbolic name to identify nodes, relationships and aliased items.A literal representing a temporal value to be formatted in a way that Neo4j's Cypher understands it.TreeNode<E>A mutable tree structure providing Breadth-first search (aka in-level order traversal) and pre-ordered depth-first search.Represents a part of a union.See Unwind.The USE clause can be prepended to statements or be used in a CALL subquery.Roughly corresponding to Where.See With.