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 See CaseExpression.Case.CaseEnding Specification for a renderable, complete CASE statementCase.GenericCase Extension of theCaseinterface to support generic case.Case.OngoingWhenThen Helper class to collect `when` expressions and createCaseWhenTheninstances when the `then` is provided.Case.SimpleCase Extension theCaseinterface to support simple case with an initial expression / condition.Clause This is a marker interface for top level clauses.Condition 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 severalusingmethods that are provide entry points of adding advanced query hints.ExposesLoadCSV Exposes methods to configure aLOAD CSVclause.ExposesLogicalOperators<T> A step exposing logical operatorsandandorafter awhereclause.ExposesMatch A step exposing aExposesMatch.match(PatternElement...)method.ExposesMerge A step exposing aExposesMerge.merge(PatternElement...)method.ExposesPatternLengthAccessors<T extends RelationshipPattern> This interface is used to derive new relationship patterns from existingrelationshipsorchains of relationshipswith new lengths (min, max or unbounded) configured.ExposesProperties<T extends ExposesProperties<?> & PropertyContainer> A container that exposes methods to add properties with values to nodes or relationships.ExposesRelationships<T extends RelationshipPattern & ExposesPatternLengthAccessors<?>> 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.ExposesSubqueryCall.BuildableSubquery 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.ExposesUnwind A step exposing aExposesUnwind.unwind(Expression...),ExposesUnwind.unwind(Expression),ExposesUnwind.unwind(String)and method.ExposesWhere A step exposing a severalwheremethods 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.FunctionInvocation.FunctionDefinition Defines metadata for a function.IdentifiableElement This interface represents an element that can be for example an identifiable part of theWITHclause.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.LoadCSVStatementBuilder LoadCSVStatementBuilder.OngoingLoadCSV An instance of this interface will be provided after pointing the database to a validURIof a CSV resource.Named A named thing exposesNamed.getSymbolicName(), making the thing identifiable.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 See StandaloneCall.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 forrelationshipsandchains of relationships.ResultStatement A statement that returns items from the graph.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<T extends Statement> 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 aMERGEclause.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 theWITHclause.StatementBuilder.ExposesYieldStar A trait for an ongoing standalone call to expose all of its results via an asterisk.StatementBuilder.OngoingInQueryCallWithArguments The union of an in-query call exposing yields.StatementBuilder.OngoingInQueryCallWithoutArguments The union of an in-query call exposing new arguments and yields.StatementBuilder.OngoingInQueryCallWithReturnFields An in-query call exposing where and return clauses.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.ExposesSetthat allows for further chaining of actions.StatementBuilder.OngoingOrderDefinition An intermediate step while defining the order of a with clause.StatementBuilder.OngoingReading A match that exposesreturningand 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 exposesreturningandwheremethods to add required information.StatementBuilder.OngoingReadingWithWhere A match that has a non-emptywhere-part.StatementBuilder.OngoingStandaloneCallWithArguments The union of a buildable statement and call exposing yields.StatementBuilder.OngoingStandaloneCallWithoutArguments The union of a buildable statement and call exposing new arguments and yields.StatementBuilder.OngoingStandaloneCallWithReturnFields A buildable statement exposing where and return clauses.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 multipart 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.StatementBuilder.VoidCall The result of a call to a stored procedure not having any results. -
Class Summary Class Description AliasedExpression An aliased expression, that deals with named expressions when accepting visitors.Asterisk The*.BooleanLiteral The boolean literal.Clauses Builder / factory for variousclauses.Comparison A concrete condition representing a comparision between two expressions.Conditions Builder for various conditions.ConstantCondition A constant condition that is either always true or false.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.Foreach Represents the FOREACH clause and is currently only producible via the Cypher-Parser.FunctionInvocation Functions Factory methods for creating instances offunctions.HasLabelCondition A condition checking for the presence of labels on nodes or types on relationships.Hint Visitable implementing hints.InTransactions Used for subqueries IN TRANSACTIONSKeyValueMapEntry 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.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 aMERGEclause.NamedPath Represents a named path.NestedExpression NodeBase<SELF extends Node> This is the base class for all nodes.NodeLabel Expression for a single Node label.NullLiteral Represents the literal value null.NumberLiteral Operation A binary operation.Operations A set of operations.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.PatternComprehension Predicates Factory methods for creating predicates.Properties Represents the properties of anodeor arelationshipwhen used as part of the whole pattern (inside aMATCH,CREATEorMERGEclause 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.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 BYclause 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 A literal representing a temporal value to be formatted in a way that Neo4j's Cypher understands it.UnionPart Represents a part of an union.Unwind See Unwind.Where Roughly corresponding to Where.With See With. -
Enum Summary Enum Description MergeAction.Type The type of the action.Operator An operator.Operator.Type Operatortype.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.Literal.UnsupportedLiteralException Thrown when a given object cannot be used as a Cypher-DSL-Literal. -
Annotation Types Summary Annotation Type Description Neo4jVersion 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.