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
-
Interface Summary Interface Description Aliased An element with an alias.Case.CaseEnding Specification for a renderable, complete CASE statementCondition Shared interface for all conditions.ExposesCall<T> Entrypoint for building procedure calls.ExposesCall.AsFunction Interface to allow creating an expression instead of a statement from an ongoing definition.ExposesCall.ExposesWithArgs<T> Used to provide arguments to procedure calls.ExposesCall.ExposesYield<T> Used to yield procedure result fields.ExposesCreate A step exposing aExposesCreate.create(PatternElement...)
method.ExposesHints A step exposing a severalusing
methods that are provide entry points of adding advanced query hints.ExposesLogicalOperators<T> A step exposing logical operatorsand
andor
after awhere
clause.ExposesMatch A step exposing aExposesMatch.match(PatternElement...)
method.ExposesMerge A step exposing aExposesMerge.merge(PatternElement...)
method.ExposesProperties<T extends ExposesProperties<?> & PropertyContainer> A container that exposes methods to add properties with values to nodes or relationships.ExposesRelationships<T extends RelationshipPattern> A marker interface for things that expose methods to create new relationships to other elements.ExposesReturning Return part of a statement.ExposesSubqueryCall This exposes a call method taking in a statement that represents a valid, correlated subquery.ExposesUnwind A step exposing aExposesUnwind.unwind(Expression...)
,ExposesUnwind.unwind(Expression)
,ExposesUnwind.unwind(String)
and method.ExposesWhere A step exposing a severalwhere
methods that are provide entry points of adding conditions.Expression An expression can be used in many places, i.e.ForeignAdapter<FE> Represents an adapter that allows to turn foreign expressions into Cypher-DSLexpressions
.ListComprehension.OngoingDefinitionWithList Allows to add a where clause into the definition of the list.ListComprehension.OngoingDefinitionWithoutReturn Provides the final step of defining a list comprehension.ListComprehension.OngoingDefinitionWithVariable ListComprehension.OngoingDefinitionWithVariable.in(Expression)
must be used to define the source list.Literal<T> Represents a literal with an optional content.Named A named thing exposes an optionalsymbolic name
.NamedPath.OngoingDefinitionWithName Partial path that has a name (p =
).NamedPath.OngoingShortestPathDefinitionWithName Partial path that has a name (p =
) and is based on a graph algorithm function.Node See NodePattern.PatternComprehension.OngoingDefinitionWithoutReturn Provides the final step of defining a pattern comprehension.PatternComprehension.OngoingDefinitionWithPattern Allows to add a where clause into the definition of the pattern.PatternComprehension.OngoingDefinitionWithPatternAndWhere Intermediate step that allows expressing additional, logical operators.PatternElement See PatternElement.Predicates.OngoingListBasedPredicateFunction Allows to define the source of the list predicate.Predicates.OngoingListBasedPredicateFunctionWithList Allows to specify the where condition for the list based predicate.ProcedureCall.OngoingInQueryCallWithArguments The union of an in-query call exposing yields.ProcedureCall.OngoingInQueryCallWithoutArguments The union of an in-query call exposing new arguments and yields.ProcedureCall.OngoingInQueryCallWithReturnFields An in-query call exposing where and return clauses.ProcedureCall.OngoingStandaloneCallWithArguments The union of a buildable statement and call exposing yields.ProcedureCall.OngoingStandaloneCallWithoutArguments The union of a buildable statement and call exposing new arguments and yields.ProcedureCall.OngoingStandaloneCallWithReturnFields A buildable statement exposing where and return clauses.Property A property.PropertyContainer A container having properties.Reduction.OngoingDefinitionWithInitial Step 4b: Define the initial valueReduction.OngoingDefinitionWithList Step 3: Define the map expressionReduction.OngoingDefinitionWithReducer Step 4a: Define the accumulatorReduction.OngoingDefinitionWithVariable Step 2: Define the listRelationship See RelationshipPattern.RelationshipPattern A shared, public interface forrelationships
andchains of relationships
.Statement Shall be the common interfaces for queries that we support.Statement.RegularQuery RepresentsRegularQuery
.Statement.SingleQuery Represents aSingleQuery
.StatementBuilder StatementBuilder.BuildableMatchAndUpdate A buildable ongoing MATCH and UPDATE.StatementBuilder.BuildableOngoingMergeAction An interface combining a buildable MATCH and UPDATE with the possibility to add actions after a MERGE clause.StatementBuilder.BuildableStatement A statement that has all information required to be build and exposes a build method.StatementBuilder.ExposesDelete A step that exposes only the delete clause.StatementBuilder.ExposesExistentialSubqueryCall A shared marker interface for things that can be turned into a subquery to be used inside the WHERE clause.StatementBuilder.ExposesLimit A step that exposes theStatementBuilder.ExposesLimit.limit(Number)
method.StatementBuilder.ExposesMergeAction Provides a way to specify an action that happens after aMERGE
clause.StatementBuilder.ExposesOrderBy SeeStatementBuilder.TerminalExposesOrderBy
, but on a with clause.StatementBuilder.ExposesSet Set part of a statement.StatementBuilder.ExposesSetAndRemove A step that exposes the set clause.StatementBuilder.ExposesSkip A step that exposes theStatementBuilder.ExposesSkip.skip(Number)
method.StatementBuilder.ExposesUpdatingClause A step providing all the supported updating clauses (DELETE, SET)StatementBuilder.ExposesWith A step that exposes theWITH
clause.StatementBuilder.OngoingMatchAndReturnWithOrder Combines the capabilities of skip, limit and adds additional expressions to the order-by items.StatementBuilder.OngoingMatchAndUpdate 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.StatementBuilder.OngoingMerge 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.StatementBuilder.OngoingMergeAction A variant ofStatementBuilder.ExposesSet
that allows for further chaining of actions.StatementBuilder.OngoingOrderDefinition An intermediate step while defining the order of a with clause.StatementBuilder.OngoingReading A match that exposesreturning
and for which it is not decided whether the optional where part has been used or note.StatementBuilder.OngoingReadingAndReturn A match that knows what to return and which is ready to be build.StatementBuilder.OngoingReadingAndWith Represents a reading statement ending in a with clause, potentially already having an order and not exposing order methods.StatementBuilder.OngoingReadingAndWithWithSkip The union type of an ongoing reading with a WITH and a SKIP clause.StatementBuilder.OngoingReadingAndWithWithWhereAndOrder Combines the capabilities of skip, limit and adds additional expressions to the order-by items.StatementBuilder.OngoingReadingWithoutWhere A match that exposesreturning
andwhere
methods to add required information.StatementBuilder.OngoingReadingWithWhere A match that has a non-emptywhere
-part.StatementBuilder.OngoingUnwind Builder part for unwinding.StatementBuilder.OngoingUpdate An ongoing update statement that can be used to chain more update statements or add a with or return clause.StatementBuilder.OrderableOngoingReadingAndWith StatementBuilder.OrderableOngoingReadingAndWithWithoutWhere A match that knows what to pipe to the next part of a multi part query.StatementBuilder.OrderableOngoingReadingAndWithWithWhere StatementBuilder.TerminalExposesLimit A step that exposes theStatementBuilder.TerminalExposesLimit.limit(Number)
method.StatementBuilder.TerminalExposesOrderBy A step that exposes several methods to specify ordering.StatementBuilder.TerminalExposesSkip A step that exposes theStatementBuilder.TerminalExposesSkip.skip(Number)
method.StatementBuilder.TerminalOngoingOrderDefinition An intermediate step while defining the order of a result set.StatementContext Context for while rendering a statement. -
Class Summary Class Description AliasedExpression An aliased expression, that deals with named expressions when accepting visitors.Arguments Specialized list of expressions that represents the arguments of a procedure call.Asterisk The*
.BooleanLiteral The boolean literal.Case See CaseExpression.Case.GenericCase Implementation of theCase
class to support generic case.Case.GenericCase.EndingGenericCase The renderable implementation ofCase.GenericCase
.Case.SimpleCase Special implementation of theCase
class to support simple case with an initial expression / condition.Case.SimpleCase.EndingSimpleCase The renderable implementation ofCase.SimpleCase
.Comparison A concrete condition representing a comparision between two expressions.CompoundCondition A condition that consists of one or twoconditions
connected by a Logical connective (operator).Conditions Builder for various conditions.ConstantCondition A constant condition that is either always true or false.ConstantParameterHolder An internal holder for a constant value that might be rendered as a parameter.Create See Create.Cypher The main entry point into the Cypher DSL.Delete See Delete.ExistentialSubquery An existential subquery can only be used in a where clause.FunctionInvocation Functions Factory methods for creating instances offunctions
.HasLabelCondition A condition checking for the presence of labels on nodes.Hint Visitable implementing hints.Hint.IndexProperties Internal helper class to wrap up the properties used inside an index.KeyValueMapEntry Helper class, only for internal use.Limit ListComprehension ListExpression Represents a list expression as in[expression1, expression2, ..., expressionN]
ListLiteral A list of literals.ListOperator Represents a range literal applied to another expression.ListOperator.Details This is not a public API and just used internally for structuring the tree.MapExpression A dedicated map expression.MapProjection Represents a map projection as described here.Match See Match.Merge See Create.MergeAction An action or event that happens after aMERGE
clause.NamedPath Represents a named path.Namespace NestedExpression NodeBase<SELF extends Node> This is the base class for all nodes.NodeLabel Expression for a single Node label.NotCondition A negated version of the condition passed during construction of this condition.NullLiteral Represents the literal value null.NumberLiteral Operation A binary operation.Order 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.Pattern A pattern is something that can be matched.PatternComprehension Predicates Factory methods for creating predicates.ProcedureCall See StandaloneCall.ProcedureName Properties 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}
.PropertyLookup See PropertyLookupReduction A typed subtree representing the arguments of a call to thereduce()
function.Relationship.Details See RelationshipDetail.RelationshipBase<S extends NodeBase<?>,E extends NodeBase<?>,SELF extends RelationshipBase<S,E,SELF>> This is the base class for all relationships.RelationshipChain Represents a chain of relationships.RelationshipLength Expresses the length of a relationship.RelationshipTypes Remove See Remove.Return See Return.ReturnBody The container or "body" for return items, order and optional skip and things.Set See Set.Skip SortItem A sort item can be used in anORDER BY
clause and changes the order of the items being returned from a query.StringLiteral The string representation of a string literal will be a quoted Cypher string in single tickmarks with escaped reserved characters.Subquery Represents a "callable" subquery.SymbolicName A symbolic name to identify nodes, relationships and aliased items.TemporalLiteral Thrown when a QueryDSL operator cannot be used with the Cypher-DSL predicate converter.UnionPart Represents a part of an union.Unwind See Unwind.Where Roughly corresponding to Where.With See With.YieldItems Items yielded by a stand alone or in query call. -
Enum Summary Enum Description Distinct AST representation of the DISTINCT keyword.MergeAction.Type The type of the action.Operator An operator.Operator.Type Operator
type.Relationship.Direction While the direction in the schema package is centered around the node, the direction here is the direction between two nodes.SortItem.Direction Sort direction. -
Exception Summary Exception Description ConflictingParametersException Exception thrown when extracting parameters from a statement leads to one parameter with a given name appearing with different values.