java.lang.Object
org.neo4j.cypherdsl.core.Cypher
The main entry point into the Cypher DSL.
The Cypher Builder API is intended for framework usage to produce Cypher statements required for database operations.
- Since:
- 1.0
- Author:
- Michael J. Simons, Gerrit Meier, Andreas Berger
-
Method Summary
Modifier and TypeMethodDescriptionstatic <FE> @NotNull ForeignAdapter<FE>adapt(FE expression) Provides access to the foreign DSL adapter.static <T> @NotNull Parameter<T>anonParameter(T value) Creates a new anonymous parameter with a value bound to it.static @NotNull NodeanyNode()static @NotNull Nodestatic @NotNull NodeanyNode(SymbolicName symbolicName) static @NotNull MapExpressionasExpression(Map<String, Object> map) Creates a map of expression from a Java Map.static @NotNull Asteriskasterisk()static @NotNull StatementBuilder.OngoingStandaloneCallWithoutArgumentsStarts defining a procedure call of the procedure with the given procedureName.static @NotNull StatementBuilder.OngoingStandaloneCallWithoutArgumentsStarts defining a procedure call of the procedure with the given qualified name.static @NotNull StatementBuilder.OngoingStandaloneCallWithoutArgumentscall(Collection<String> namespaceAndProcedure) Starts defining a procedure call of the procedure with the given qualified name.Starts building a statement based on one subquery.static @NotNull Casestatic @NotNull CasecaseExpression(@Nullable Expression expression) create(Collection<? extends PatternElement> pattern) Starts building a statement based on aCREATEclause.create(PatternElement... pattern) Starts building a statement based on aCREATEclause.static Stringformat(Expression expression) Tries to format this expression into something human-readable.static @NotNull PatternComprehension.OngoingDefinitionWithPatternlistBasedOn(NamedPath namedPath) Creates a list comprehension starting with anamed path.static @NotNull PatternComprehension.OngoingDefinitionWithPatternlistBasedOn(RelationshipPattern relationshipPattern) Creates a list comprehension starting with aRelationshipor achain of relationships.static @NotNull ListExpressionlistOf(Collection<? extends Expression> expressions) Creates alist-expressionfrom several expressions.static @NotNull ListExpressionlistOf(Expression... expressions) Creates alist-expressionfrom several expressions.static @NotNull ListComprehension.OngoingDefinitionWithVariablelistWith(SymbolicName variable) Starts defining alist comprehension.static <T> @NotNull Literal<T>Creates a newLiteral<?>from the givenobject.Starts building aLOAD CSV.Starts building aLOAD CSV.static @NotNull MapExpressionCreates a map of expression from a list of key/value pairs.match(boolean optional, Collection<? extends PatternElement> pattern) Starts building a statement based on a match clause.match(boolean optional, PatternElement... pattern) Starts building a statement based on a match clause.match(Collection<? extends PatternElement> pattern) Starts building a statement based on a match clause.match(PatternElement... pattern) Starts building a statement based on a match clause.merge(Collection<? extends PatternElement> pattern) Starts building a statement based on aMERGEclause.merge(PatternElement... pattern) Starts building a statement based on aMERGEclause.static @NotNull SymbolicNameCreates a new symbolic name.static @NotNull NodeCreate a new Node representation with at least one label, the "primary" label.static @NotNull NodeCreate a new Node representation with at least one label, the "primary" label.static @NotNull Nodenode(String primaryLabel, MapExpression properties, String... additionalLabels) Create a new Node representation with at least one label, the "primary" label.static @NotNull Nodenode(String primaryLabel, MapExpression properties, Collection<String> additionalLabels) Create a new Node representation with at least one label, the "primary" label.static @NotNull Nodenode(LabelExpression labelExpression) optionalMatch(Collection<? extends PatternElement> pattern) Prepares an optional match statement.optionalMatch(PatternElement... pattern) Prepares an optional match statement.Creates a new parameter placeholder.static <T> @NotNull Parameter<T>Creates a new parameter with the givennameand a value bound to it.Starts defining a named path by indicating a name.path(SymbolicName name) Starts defining a named path by indicating a name.static @NotNull PropertyDereferences a property for a symbolic name, most likely pointing to a property container like a node or a relationship.static @NotNull Propertyproperty(String containerName, Collection<String> names) Dereferences a property for a symbolic name, most likely pointing to a property container like a node or a relationship.static @NotNull Propertyproperty(String containerName, Expression lookup) Creates a dynamic lookup of a property for a symbolic name, most likely pointing to a property container like a node or a relationship.static @NotNull Propertyproperty(Expression expression, String... names) Dereferences a property on a arbitrary expression.static @NotNull Propertyproperty(Expression expression, Collection<String> names) Dereferences a property on a arbitrary expression.static @NotNull Propertyproperty(Expression expression, Expression lookup) Creates a dynamic lookup of a property on a arbitrary expression.static @NotNull StringEscapes and quotes theunquotedStringfor safe usage in Neo4j-Browser and Shell.static @NotNull ExpressionCreates an expression from a raw string fragment.returning(Collection<? extends Expression> expressions) A RETURN statement without a previous match.returning(Expression... expressions) A RETURN statement without a previous match.returningRaw(Expression rawExpression) Creates aRETURNclause from a raw Cypher expression created viaraw(String, Object...).shortestPath(String name) Starts defining a named path defined by theshortestPathbetween a relationship by indicating a name.shortestPath(SymbolicName name) Starts defining a named path defined by theshortestPathbetween a relationship by indicating a name.static @NotNull SortItemsort(Expression expression) static @NotNull SortItemsort(Expression expression, SortItem.Direction direction) static @NotNull MapExpressionsortedMapOf(Object... keysAndValues) Creates an alphabetically sorted map of expression from a list of key/value pairs.static @NotNull ExpressionsubList(Expression targetExpression, Integer start, Integer end) Creates a closed range with given boundaries.static @NotNull ExpressionsubList(Expression targetExpression, Expression start, Expression end) Creates a closed range with given boundaries.static @NotNull ExpressionsubListFrom(Expression targetExpression, Integer start) Creates an open range starting atstart.static @NotNull ExpressionsubListFrom(Expression targetExpression, Expression start) Creates an open range starting atstart.static @NotNull ExpressionsubListUntil(Expression targetExpression, Integer end) Creates an open range starting atstart.static @NotNull ExpressionsubListUntil(Expression targetExpression, Expression end) Creates an open range starting atstart.static @NotNull Statement.UnionQueryunion(Collection<Statement> statements) Creates aUNIONstatement from several other statements.static @NotNull Statement.UnionQueryCreates aUNIONstatement from several other statements.static @NotNull StatementunionAll(Collection<Statement> statements) Creates aUNION ALLstatement from several other statements.static @NotNull StatementCreates aUNION ALLstatement from several other statements.unwind(Collection<? extends Expression> expressions) Starts building a statement starting with anUNWINDclause.unwind(Expression expression) Starts building a statement starting with anUNWINDclause.unwind(Expression... expressions) Starts building a statement starting with anUNWINDclause.static Statement.UseStatementDecorates the given statement by prepending a static USE clause.static Statement.UseStatementDecorates the given statement by prepending a dynamic USE clause.static Statement.UseStatementuse(StringLiteral target, Statement statement) Decorates the given statement by prepending a dynamic USE clause.static Statement.UseStatementuse(SymbolicName target, Statement statement) Decorates the given statement by prepending a dynamic USE clause.static @NotNull ExposesLoadCSVStarts building aLOAD CSVclause by using a periodic commit.static @NotNull ExposesLoadCSVusingPeriodicCommit(@Nullable Integer rate) Starts building aLOAD CSVclause by using a periodic commit.static @NotNull ListOperatorvalueAt(Expression targetExpression, Integer index) Creates a single valued range atindex.static @NotNull ListOperatorvalueAt(Expression targetExpression, Expression index) Creates a single valued range atindex.Starts a statement with a leadingWITH.with(Collection<IdentifiableElement> elements) Starts a statement with a leadingWITH.with(IdentifiableElement... elements) Starts a statement with a leadingWITH.
-
Method Details
-
node
@NotNull @Contract(pure=true) public static @NotNull Node node(String primaryLabel, String... additionalLabels) Create a new Node representation with at least one label, the "primary" label. This is required. All other labels are optional.- Parameters:
primaryLabel- The primary label this node is identified by.additionalLabels- Additional labels- Returns:
- A new node representation
-
node
@NotNull @Contract(pure=true) public static @NotNull Node node(String primaryLabel, List<String> additionalLabels) Create a new Node representation with at least one label, the "primary" label. This is required. All other labels are optional.- Parameters:
primaryLabel- The primary label this node is identified by.additionalLabels- Additional labels- Returns:
- A new node representation
-
node
@NotNull @Contract(pure=true) public static @NotNull Node node(String primaryLabel, MapExpression properties, String... additionalLabels) Create a new Node representation with at least one label, the "primary" label. This is required. All other labels are optional. This method also takes a map of properties. This allows the returned node object to be used in aMATCHorMERGEstatement.- Parameters:
primaryLabel- The primary label this node is identified by.properties- The properties expected to exist on the node.additionalLabels- Additional labels- Returns:
- A new node representation
-
node
@NotNull @Contract(pure=true) public static @NotNull Node node(String primaryLabel, MapExpression properties, Collection<String> additionalLabels) Create a new Node representation with at least one label, the "primary" label. This is required. All other labels are optional. This method also takes a map of properties. This allows the returned node object to be used in aMATCHorMERGEstatement.- Parameters:
primaryLabel- The primary label this node is identified by.properties- The properties expected to exist on the node.additionalLabels- Additional labels- Returns:
- A new node representation
- Since:
- 2021.2.2
-
anyNode
- Returns:
- A node matching any node.
-
node
- Parameters:
labelExpression- required expression- Returns:
- A node matching a label expression
- Since:
- 2023.0.2
-
asterisk
- Returns:
- The
*wildcard literal.
-
anyNode
- Parameters:
symbolicName- The new symbolic name- Returns:
- A node matching any node with the symbolic the given
symbolicName.
-
anyNode
- Parameters:
symbolicName- The new symbolic name- Returns:
- A node matching any node with the symbolic the given
symbolicName.
-
property
@NotNull @Contract(pure=true) public static @NotNull Property property(String containerName, String... names) Dereferences a property for a symbolic name, most likely pointing to a property container like a node or a relationship.- Parameters:
containerName- The symbolic name of a property containernames- The names of the properties to dereference. More than one name does create a nested property likecontainerName.name1.name2.- Returns:
- A new property
-
property
@NotNull @Contract(pure=true) public static @NotNull Property property(String containerName, Collection<String> names) Dereferences a property for a symbolic name, most likely pointing to a property container like a node or a relationship.- Parameters:
containerName- The symbolic name of a property containernames- The names of the properties to dereference. More than one name does create a nested property likecontainerName.name1.name2.- Returns:
- A new property
- Since:
- 2021.2.2
-
property
@NotNull @Contract(pure=true) public static @NotNull Property property(Expression expression, String... names) Dereferences a property on a arbitrary expression.- Parameters:
expression- The expression that describes some sort of accessible mapnames- The names of the properties to dereference. More than one name does create a nested property likeexpression.name1.name2.- Returns:
- A new property.
-
property
@NotNull @Contract(pure=true) public static @NotNull Property property(Expression expression, Collection<String> names) Dereferences a property on a arbitrary expression.- Parameters:
expression- The expression that describes some sort of accessible mapnames- The names of the properties to dereference. More than one name does create a nested property likeexpression.name1.name2.- Returns:
- A new property.
- Since:
- 2021.2.2
-
property
@NotNull @Contract(pure=true) public static @NotNull Property property(String containerName, Expression lookup) Creates a dynamic lookup of a property for a symbolic name, most likely pointing to a property container like a node or a relationship. A dynamic property will be rendered asp[expression].- Parameters:
containerName- The symbolic name of a property containerlookup- An expression to use as a dynamic lookup for properties of the container with the given name- Returns:
- A new property
- Since:
- 2021.0.0
-
property
@NotNull @Contract(pure=true) public static @NotNull Property property(Expression expression, Expression lookup) Creates a dynamic lookup of a property on a arbitrary expression. A dynamic property will be rendered asp[expression].- Parameters:
expression- The expression that describes some sort of accessible maplookup- An expression to use as a dynamic lookup for properties of the container the expression resolved to- Returns:
- A new property.
- Since:
- 2021.0.0
-
path
Starts defining a named path by indicating a name.- Parameters:
name- The name of the new path- Returns:
- An ongoing definition of a named path
- Since:
- 1.1
-
path
@NotNull @Contract(pure=true) public static NamedPath.OngoingDefinitionWithName path(SymbolicName name) Starts defining a named path by indicating a name.- Parameters:
name- The name of the new path- Returns:
- An ongoing definition of a named path
- Since:
- 1.1
-
shortestPath
@NotNull @Contract(pure=true) public static NamedPath.OngoingShortestPathDefinitionWithName shortestPath(String name) Starts defining a named path defined by theshortestPathbetween a relationship by indicating a name.- Parameters:
name- The name of the new shortestPath path- Returns:
- An ongoing definition of a named path
- Since:
- 1.1.1
-
shortestPath
@NotNull @Contract(pure=true) public static NamedPath.OngoingShortestPathDefinitionWithName shortestPath(SymbolicName name) Starts defining a named path defined by theshortestPathbetween a relationship by indicating a name.- Parameters:
name- The name of the new shortestPath path- Returns:
- An ongoing definition of a named path
- Since:
- 1.1.1
-
name
Creates a new symbolic name.- Parameters:
value- The value of the symbolic name- Returns:
- A new symbolic name
-
parameter
Creates a new parameter placeholder. Existing $-signs will be removed.- Parameters:
name- The name of the parameter, must not be null- Returns:
- The new parameter
-
parameter
@NotNull @Contract(pure=true) public static <T> @NotNull Parameter<T> parameter(String name, T value) Creates a new parameter with the givennameand a value bound to it. The value can be retrieved from the final statement build.- Type Parameters:
T- Type of the new parameter- Parameters:
name- The name of the parameter, must not be nullvalue- The value of the parameter.- Returns:
- The new parameter
- Since:
- 2021.0.0
-
anonParameter
Creates a new anonymous parameter with a value bound to it. The value can be retrieved from the final statement build. The name will be available as soon as the statement has been rendered.- Type Parameters:
T- Type of the new parameter- Parameters:
value- The value of the parameter.- Returns:
- The new parameter
- Since:
- 2021.1.0
-
optionalMatch
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingWithoutWhere optionalMatch(PatternElement... pattern) Prepares an optional match statement.- Parameters:
pattern- The patterns to match- Returns:
- An ongoing match that is used to specify an optional where and a required return clause
-
optionalMatch
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingWithoutWhere optionalMatch(Collection<? extends PatternElement> pattern) Prepares an optional match statement.- Parameters:
pattern- The patterns to match- Returns:
- An ongoing match that is used to specify an optional where and a required return clause
- Since:
- 2021.2.2
-
match
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingWithoutWhere match(PatternElement... pattern) Starts building a statement based on a match clause. Usenode(String, String...)and related to retrieve a node or a relationship, which both are pattern elements.- Parameters:
pattern- The patterns to match- Returns:
- An ongoing match that is used to specify an optional where and a required return clause
-
match
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingWithoutWhere match(Collection<? extends PatternElement> pattern) Starts building a statement based on a match clause. Usenode(String, String...)and related to retrieve a node or a relationship, which both are pattern elements.- Parameters:
pattern- The patterns to match- Returns:
- An ongoing match that is used to specify an optional where and a required return clause
- Since:
- 2021.2.2
-
match
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingWithoutWhere match(boolean optional, PatternElement... pattern) Starts building a statement based on a match clause. Usenode(String, String...)and related to retrieve a node or a relationship, which both are pattern elements.- Parameters:
optional- A flag whether theMATCHclause includes theOPTIONALkeyword.pattern- The patterns to match- Returns:
- An ongoing match that is used to specify an optional where and a required return clause
- Since:
- 2020.1.3
-
match
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingWithoutWhere match(boolean optional, Collection<? extends PatternElement> pattern) Starts building a statement based on a match clause. Usenode(String, String...)and related to retrieve a node or a relationship, which both are pattern elements.- Parameters:
optional- A flag whether theMATCHclause includes theOPTIONALkeyword.pattern- The patterns to match- Returns:
- An ongoing match that is used to specify an optional where and a required return clause
- Since:
- 2021.2.2
-
create
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingUpdate create(PatternElement... pattern) Starts building a statement based on aCREATEclause.- Parameters:
pattern- The patterns to create- Returns:
- An ongoing
CREATEthat can be used to specifyWITHandRETURNINGetc.
-
create
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingUpdate create(Collection<? extends PatternElement> pattern) Starts building a statement based on aCREATEclause.- Parameters:
pattern- The patterns to create- Returns:
- An ongoing
CREATEthat can be used to specifyWITHandRETURNINGetc. - Since:
- 2021.2.2
-
with
@NotNull @Contract(pure=true) public static StatementBuilder.OrderableOngoingReadingAndWithWithoutWhere with(String... variables) Starts a statement with a leadingWITH. Those are useful for passing on lists of various type that can be unwound later on etc. A leadingWITHobviously cannot be used with patterns and needs its arguments to have an alias.- Parameters:
variables- One ore more variables.- Returns:
- An ongoing with clause.
- Since:
- 2020.1.2
-
with
@NotNull @Contract(pure=true) public static StatementBuilder.OrderableOngoingReadingAndWithWithoutWhere with(IdentifiableElement... elements) Starts a statement with a leadingWITH. Those are useful for passing on lists of various type that can be unwound later on etc. A leadingWITHcannot be used with patterns obviously and needs its arguments to have an alias.- Parameters:
elements- One ore more variables.- Returns:
- An ongoing with clause.
- Since:
- 2020.1.2
-
with
@NotNull @Contract(pure=true) public static StatementBuilder.OrderableOngoingReadingAndWithWithoutWhere with(Collection<IdentifiableElement> elements) Starts a statement with a leadingWITH. Those are useful for passing on lists of various type that can be unwound later on etc. A leadingWITHcannot be used with patterns obviously and needs its arguments to have an alias.This method takes both aliased and non-aliased expression. The later will produce only valid Cypher when used in combination with a correlated subquery via
call(Statement).- Parameters:
elements- One ore more expressions.- Returns:
- An ongoing with clause.
- Since:
- 2021.2.2
-
merge
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingMerge merge(PatternElement... pattern) Starts building a statement based on aMERGEclause.- Parameters:
pattern- The patterns to merge- Returns:
- An ongoing
MERGEthat can be used to specifyWITHandRETURNINGetc.
-
merge
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingMerge merge(Collection<? extends PatternElement> pattern) Starts building a statement based on aMERGEclause.- Parameters:
pattern- The patterns to merge- Returns:
- An ongoing
MERGEthat can be used to specifyWITHandRETURNINGetc. - Since:
- 2021.2.2
-
unwind
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingUnwind unwind(Expression expression) Starts building a statement starting with anUNWINDclause. The expression needs to be an expression evaluating to a list, otherwise the query will fail.- Parameters:
expression- The expression to unwind- Returns:
- An ongoing
UNWIND.
-
unwind
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingUnwind unwind(Expression... expressions) Starts building a statement starting with anUNWINDclause. The expressions passed will be turned into a list expression- Parameters:
expressions- expressions to unwind- Returns:
- a new instance of
StatementBuilder.OngoingUnwind
-
unwind
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingUnwind unwind(Collection<? extends Expression> expressions) Starts building a statement starting with anUNWINDclause. The expressions passed will be turned into a list expression- Parameters:
expressions- expressions to unwind- Returns:
- a new instance of
StatementBuilder.OngoingUnwind - Since:
- 2021.2.2
-
sort
- Parameters:
expression- The expression by which things should be sorted- Returns:
- A sort item, providing means to specify ascending or descending order
-
sort
@NotNull @Contract(pure=true) public static @NotNull SortItem sort(Expression expression, SortItem.Direction direction) - Parameters:
expression- The expression by which things should be sorteddirection- The direction to sort by. Defaults toSortItem.Direction.UNDEFINED.- Returns:
- A sort item
- Since:
- 2021.1.0
-
mapOf
Creates a map of expression from a list of key/value pairs.- Parameters:
keysAndValues- A list of key and values. Must be an even number, with alternatingStringandExpression- Returns:
- A new map expression.
-
sortedMapOf
@NotNull @Contract(pure=true) public static @NotNull MapExpression sortedMapOf(Object... keysAndValues) Creates an alphabetically sorted map of expression from a list of key/value pairs.- Parameters:
keysAndValues- A list of key and values. Must be an even number, with alternatingStringandExpression- Returns:
- A new map expression.
-
asExpression
@NotNull @Contract(pure=true) public static @NotNull MapExpression asExpression(Map<String, Object> map) Creates a map of expression from a Java Map.- Parameters:
map- A map to be turned into a MapExpression- Returns:
- A new map expression.
- Since:
- 2021.1.0
-
listOf
@NotNull @Contract(pure=true) public static @NotNull ListExpression listOf(Expression... expressions) Creates alist-expressionfrom several expressions.- Parameters:
expressions- expressions to get combined into a list- Returns:
- a new instance of
ListExpression
-
listOf
@NotNull @Contract(pure=true) public static @NotNull ListExpression listOf(Collection<? extends Expression> expressions) Creates alist-expressionfrom several expressions.- Parameters:
expressions- expressions to get combined into a list- Returns:
- a new instance of
ListExpression - Since:
- 2021.2.2
-
literalOf
Creates a newLiteral<?>from the givenobject.- Type Parameters:
T- The type of the literal returned- Parameters:
object- the object to represent.- Returns:
- a new
Literal<?>. - Throws:
Literal.UnsupportedLiteralException- when the object cannot be represented as a literal
-
literalTrue
- Returns:
- The true literal.
-
literalFalse
- Returns:
- The false literal.
-
literalNull
- Returns:
- The null literal.
-
union
@NotNull @Contract(pure=true) public static @NotNull Statement.UnionQuery union(Statement... statements) Creates aUNIONstatement from several other statements. No checks are applied for matching return types.- Parameters:
statements- the statements to union.- Returns:
- A union statement.
-
union
@NotNull @Contract(pure=true) public static @NotNull Statement.UnionQuery union(Collection<Statement> statements) Creates aUNIONstatement from several other statements. No checks are applied for matching return types.- Parameters:
statements- the statements to union.- Returns:
- A union statement.
- Since:
- 2021.2.2
-
unionAll
Creates aUNION ALLstatement from several other statements. No checks are applied for matching return types.- Parameters:
statements- the statements to union.- Returns:
- A union statement.
-
unionAll
@NotNull @Contract(pure=true) public static @NotNull Statement unionAll(Collection<Statement> statements) Creates aUNION ALLstatement from several other statements. No checks are applied for matching return types.- Parameters:
statements- the statements to union.- Returns:
- A union statement.
- Since:
- 2021.2.2
-
returning
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingAndReturn returning(Expression... expressions) A RETURN statement without a previous match.- Parameters:
expressions- The elements to return- Returns:
- A buildable statement
- Since:
- 1.0.1
-
returning
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingAndReturn returning(Collection<? extends Expression> expressions) A RETURN statement without a previous match.- Parameters:
expressions- The expressions to return- Returns:
- A buildable statement
- Since:
- 2021.2.2
-
listBasedOn
@NotNull @Contract(pure=true) public static @NotNull PatternComprehension.OngoingDefinitionWithPattern listBasedOn(RelationshipPattern relationshipPattern) Creates a list comprehension starting with aRelationshipor achain of relationships.- Parameters:
relationshipPattern- The relationship pattern on which the new list comprehension is based on.- Returns:
- An ongoing definition.
- Since:
- 2020.0.0
-
listBasedOn
@NotNull @Contract(pure=true) public static @NotNull PatternComprehension.OngoingDefinitionWithPattern listBasedOn(NamedPath namedPath) Creates a list comprehension starting with anamed path.- Parameters:
namedPath- The named path on which the new list comprehension is based on.- Returns:
- An ongoing definition.
- Since:
- 2020.1.1
-
listWith
@NotNull @Contract(pure=true) public static @NotNull ListComprehension.OngoingDefinitionWithVariable listWith(SymbolicName variable) Starts defining alist comprehension.- Parameters:
variable- The variable to which each element of the list is assigned.- Returns:
- An ongoing definition of a list comprehension
- Since:
- 1.0.1
-
quote
Escapes and quotes theunquotedStringfor safe usage in Neo4j-Browser and Shell.- Parameters:
unquotedString- An unquoted string- Returns:
- A quoted string with special chars escaped.
-
caseExpression
- Returns:
- generic case expression start
-
caseExpression
@NotNull @Contract(pure=true) public static @NotNull Case caseExpression(@Nullable @Nullable Expression expression) - Parameters:
expression- initial expression for the simple case statement- Returns:
- simple case expression start
-
call
@NotNull @Contract(pure=true) public static @NotNull StatementBuilder.OngoingStandaloneCallWithoutArguments call(String procedureName) Starts defining a procedure call of the procedure with the given procedureName. That procedure name might be fully qualified - that is, including a namespace - or just a simple name.- Parameters:
procedureName- The procedure name of the procedure to call. Might be fully qualified.- Returns:
- An ongoing definition of a call
-
call
@NotNull @Contract(pure=true) public static @NotNull StatementBuilder.OngoingStandaloneCallWithoutArguments call(String... namespaceAndProcedure) Starts defining a procedure call of the procedure with the given qualified name.- Parameters:
namespaceAndProcedure- The procedure name of the procedure to call.- Returns:
- An ongoing definition of a call
-
call
@NotNull @Contract(pure=true) public static @NotNull StatementBuilder.OngoingStandaloneCallWithoutArguments call(Collection<String> namespaceAndProcedure) Starts defining a procedure call of the procedure with the given qualified name.- Parameters:
namespaceAndProcedure- The procedure name of the procedure to call.- Returns:
- An ongoing definition of a call
- Since:
- 2021.2.2
-
call
@Neo4jVersion(minimum="4.0.0") @NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingWithoutWhere call(Statement subquery) Starts building a statement based on one subquery.- Parameters:
subquery- The statement representing the subquery- Returns:
- A new ongoing read without any further conditions or returns.
- Since:
- 2020.1.2
- See Also:
- Neo4j version required
- 4.0.0
-
subList
@NotNull @Contract(pure=true) public static @NotNull Expression subList(Expression targetExpression, Integer start, Integer end) Creates a closed range with given boundaries.- Parameters:
targetExpression- The target expression for the rangestart- The inclusive startend- The exclusive end- Returns:
- A range literal.
- Since:
- 2020.1.0
-
subList
@NotNull @Contract(pure=true) public static @NotNull Expression subList(Expression targetExpression, Expression start, Expression end) Creates a closed range with given boundaries.- Parameters:
targetExpression- The target expression for the rangestart- The inclusive startend- The exclusive end- Returns:
- A range literal.
- Since:
- 2020.1.0
-
subListFrom
@NotNull @Contract(pure=true) public static @NotNull Expression subListFrom(Expression targetExpression, Integer start) Creates an open range starting atstart.- Parameters:
targetExpression- The target expression for the rangestart- The inclusive start- Returns:
- A range literal.
- Since:
- 2020.1.0
-
subListFrom
@NotNull @Contract(pure=true) public static @NotNull Expression subListFrom(Expression targetExpression, Expression start) Creates an open range starting atstart.- Parameters:
targetExpression- The target expression for the rangestart- The inclusive start- Returns:
- A range literal.
- Since:
- 2020.1.0
-
subListUntil
@NotNull @Contract(pure=true) public static @NotNull Expression subListUntil(Expression targetExpression, Integer end) Creates an open range starting atstart.- Parameters:
targetExpression- The target expression for the rangeend- The exclusive end- Returns:
- A range literal.
- Since:
- 2020.1.0
-
subListUntil
@NotNull @Contract(pure=true) public static @NotNull Expression subListUntil(Expression targetExpression, Expression end) Creates an open range starting atstart.- Parameters:
targetExpression- The target expression for the rangeend- The exclusive end- Returns:
- A range literal.
- Since:
- 2020.1.0
-
valueAt
@NotNull @Contract(pure=true) public static @NotNull ListOperator valueAt(Expression targetExpression, Integer index) Creates a single valued range atindex.- Parameters:
targetExpression- The target expression for the rangeindex- The index of the range- Returns:
- A range literal.
- Since:
- 2020.1.0
-
valueAt
@NotNull @Contract(pure=true) public static @NotNull ListOperator valueAt(Expression targetExpression, Expression index) Creates a single valued range atindex.- Parameters:
targetExpression- The target expression for the rangeindex- The index of the range- Returns:
- A range literal.
- Since:
- 2020.1.0
-
raw
@NotNull @Contract(pure=true) public static @NotNull Expression raw(String format, Object... mixedArgs) Creates an expression from a raw string fragment. No validation is performed on it. If it is used as expression, you must make sure to define something that works as expression.This method expects exactly one placeholder in the form of $E for any argument passed with
mixedArgs.To use exactly the term $E escape it like this: \$E
- Parameters:
format- A raw Cypher stringmixedArgs- Args to the Cypher string- Returns:
- An expression to reuse with the builder.
- Since:
- 2021.0.2
-
returningRaw
@NotNull @Contract(pure=true) public static StatementBuilder.OngoingReadingAndReturn returningRaw(Expression rawExpression) Creates aRETURNclause from a raw Cypher expression created viaraw(String, Object...). The expression maybe aliased but it must resolve to a raw element- Parameters:
rawExpression- Must be a plain raw or an aliased raw expression. To eventually render as valid Cypher, it must contain theRETURNkeyword.- Returns:
- A match that can be build now
- Since:
- 2021.2.1
-
adapt
Provides access to the foreign DSL adapter. Please make sure you have the necessary runtime dependencies on the class path, otherwise you will see some kind ofClassNotFoundExceptionalong various classes related to the foreign DSL.- Type Parameters:
FE- The type of the expression- Parameters:
expression- The expression that should be adapted- Returns:
- A foreign adapter
- Throws:
IllegalArgumentException- in case the object cannot be adapter- Since:
- 2021.1.0
-
usingPeriodicCommit
Starts building aLOAD CSVclause by using a periodic commit. The default rate of the database will be used.- Returns:
- An ongoing definition of a
LOAD CSVclause - Since:
- 2021.2.1
-
usingPeriodicCommit
@NotNull @Contract(pure=true) public static @NotNull ExposesLoadCSV usingPeriodicCommit(@Nullable @Nullable Integer rate) Starts building aLOAD CSVclause by using a periodic commit.- Parameters:
rate- The rate to be used. No checks are done on the rate, the database will verify valid values.- Returns:
- An ongoing definition of a
LOAD CSVclause - Since:
- 2021.2.1
-
loadCSV
Starts building aLOAD CSV. No headers are assumed.- Parameters:
from- TheURIto load data from. Any uri that is resolvable by the database itself is valid.- Returns:
- An ongoing definition of a
LOAD CSVclause - Since:
- 2021.2.1
-
loadCSV
Starts building aLOAD CSV.- Parameters:
from- TheURIto load data from. Any uri that is resolvable by the database itself is valid.withHeaders- Set to true if the csv file contains header- Returns:
- An ongoing definition of a
LOAD CSVclause
-
format
Tries to format this expression into something human-readable. Not all expressions are supported- Parameters:
expression- An expression to format- Returns:
- A human-readable string
- Throws:
IllegalArgumentException- When the expression cannot be formatted- Since:
- 2021.3.2
-
use
Decorates the given statement by prepending a static USE clause.- Parameters:
target- The target. This might be a single database or a constituent of a composite database. This value will be escaped if necessary. If it contains a ., both the first and second part will be escaped individually.statement- The statement to decorate- Returns:
- The new buildable statement
- Since:
- 2023.0.0
-
use
Decorates the given statement by prepending a dynamic USE clause. A dynamic USE clause will utilizegraph.byNameto resolve the target database.- Parameters:
target- A parameter that must resolve to a Cypher string.statement- The statement to decorate- Returns:
- The new buildable statement
- Since:
- 2023.0.0
-
use
Decorates the given statement by prepending a dynamic USE clause. A dynamic USE clause will utilizegraph.byNameto resolve the target database.- Parameters:
target- A string expressionstatement- The statement to decorate- Returns:
- The new buildable statement
- Since:
- 2023.0.0
-
use
Decorates the given statement by prepending a dynamic USE clause. A dynamic USE clause will utilizegraph.byNameto resolve the target database.- Parameters:
target- The name of a variable pointing to the graph or constituentstatement- The statement to decorate- Returns:
- The new buildable statement
- Since:
- 2023.0.0
-