Class VarUtils

java.lang.Object
org.eclipse.rdf4j.queryrender.sparql.util.VarUtils

public final class VarUtils extends Object
Shared helpers for RDF4J Var comparison and path-var recognition.
  • Field Details

  • Method Details

    • sameVar

      public static boolean sameVar(Var a, Var b)
      true if both are unbound vars with equal names.
    • sameVarOrValue

      public static boolean sameVarOrValue(Var a, Var b)
      True when both variables denote the same term: compares names if both are variables without value, or compares values if both are constants. Returns false when one has a value and the other does not.
    • isAnonPathVar

      public static boolean isAnonPathVar(Var v)
      True iff the var looks like a parser-generated anonymous path bridge variable: has the reserved prefix *and* is marked anonymous or as a variable-scope change. This guards against user-supplied vars that merely reuse the prefix.
    • isAnonPathInverseVar

      public static boolean isAnonPathInverseVar(Var v)
      True when the anonymous path var explicitly encodes inverse orientation under the same safety check.