Class GroupValuesAndNpsInUnionBranchTransform

java.lang.Object
org.eclipse.rdf4j.queryrender.sparql.ir.util.transform.BaseTransform
org.eclipse.rdf4j.queryrender.sparql.ir.util.transform.GroupValuesAndNpsInUnionBranchTransform

public final class GroupValuesAndNpsInUnionBranchTransform extends BaseTransform
Stabilize rendering for UNION branches that combine a top-level VALUES clause with a negated property set path triple by preserving an extra grouping block around the branch content. Rationale: path/NPS rewrites often eliminate an intermediate FILTER or JOIN that caused the RDF4J algebra to mark a new variable scope. Tests expecting textual stability want the extra braces to persist (e.g., "{ { VALUES ... ?s !(...) ?o . } } UNION { ... }"). Heuristic (conservative): inside an explicit UNION branch (new scope), if the branch has a top-level IrValues and also a top-level negated-path triple (IrPathTriple with path starting with '!' or '!^'), wrap the entire branch lines in an inner IrBGP, resulting in double braces when printed by IrUnion.
  • Method Details