Interface RelationshipPattern

All Superinterfaces:
ExposesRelationships<RelationshipChain>, PatternElement, Visitable
All Known Subinterfaces:
Relationship
All Known Implementing Classes:
RelationshipBase, RelationshipChain

@API(status=STABLE, since="1.0") public interface RelationshipPattern extends PatternElement, ExposesRelationships<RelationshipChain>
A shared, public interface for relationships and chains of relationships. This interface reassembles the RelationshipPattern.

This interface can be used synonymous with the concept of a Path Pattern.

Since:
1.0
Author:
Michael J. Simons
  • Method Details

    • named

      Turns the pattern into a named chain of relationships.
      Parameters:
      name - The name to be used.
      Returns:
      A named relationship that can be chained with more relationship definitions.
    • named

      Turns the pattern into a named chain of relationships.
      Parameters:
      name - The name to be used.
      Returns:
      A named relationship that can be chained with more relationship definitions.
    • asCondition

      @NotNull @Contract(pure=true) @NotNull Condition asCondition()
      Transform this pattern into a condition. All names of the patterns must be known upfront in the final statement, as PatternExpressions are not allowed to introduce new variables.
      Returns:
      A condition based on this pattern.
      Since:
      2021.0.0
    • quantifyRelationship

      @NotNull @Contract(pure=true) default @NotNull PatternElement quantifyRelationship(@Nullable QuantifiedPathPattern.Quantifier quantifier)
      Quantifies the relationship.
      Parameters:
      quantifier - the quantifier to use
      Returns:
      a quantified relationship
      Since:
      2023.9.0
    • quantify

      @NotNull @Contract(pure=true) default @NotNull PatternElement quantify(@Nullable QuantifiedPathPattern.Quantifier quantifier)
      Quantifies the pattern.
      Parameters:
      quantifier - the quantifier to use
      Returns:
      a quantified path pattern
      Since:
      2023.9.0