java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.graph.internal.PathSearchResult
Record Components:
paths - the minimal paths, all of equal size; empty when disconnected. Deterministically ordered.
unreachableTerminals - terminals not connected to the rest; empty unless disconnected

public record PathSearchResult(List<JoinPath> paths, List<RelationSymbol> unreachableTerminals) extends Record
The outcome of a SchemaGraphSearch over a set of terminal relations, one of three shapes:
  • Unique (unique()) — exactly one minimal path spans the terminals, and no terminal was unreachable. The common case: mechanical join assembly, no model judgment (§3 step 4).
  • Ambiguous (ambiguous()) — several equally minimal paths exist (parallel relationships, or a cycle). The engine cannot pick; the enumerated paths() — distinguished by relationship name — are surfaced as a "did you mean?" (§3(a)).
  • Disconnected (disconnected()) — the terminals do not all lie in one connected component of the (nomination-filtered) graph, so no single join spans them. paths() is empty and unreachableTerminals() names the terminals stranded from the first.

All enumerated paths() share the same minimal size (edge count); choosing among several is a policy question left to the caller.

  • Constructor Details

    • PathSearchResult

      public PathSearchResult(List<JoinPath> paths, List<RelationSymbol> unreachableTerminals)
      Creates an instance of a PathSearchResult record class.
      Parameters:
      paths - the value for the paths record component
      unreachableTerminals - the value for the unreachableTerminals record component
  • Method Details

    • unique

      public boolean unique()
      Exactly one minimal path, every terminal reachable — assemble it mechanically.
    • ambiguous

      public boolean ambiguous()
      More than one equally minimal path — surface as "did you mean?".
    • disconnected

      public boolean disconnected()
      No single join spans the terminals — some are stranded in another component.
    • single

      public Optional<JoinPath> single()
      The single path when unique(), else empty.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • paths

      public List<JoinPath> paths()
      Returns the value of the paths record component.
      Returns:
      the value of the paths record component
    • unreachableTerminals

      public List<RelationSymbol> unreachableTerminals()
      Returns the value of the unreachableTerminals record component.
      Returns:
      the value of the unreachableTerminals record component