Class GroupUnionOfSameGraphBranchesTransform

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

public final class GroupUnionOfSameGraphBranchesTransform extends BaseTransform
Rewrite a UNION whose multiple branches are each a single GRAPH block with the same graph reference into a single GRAPH whose body contains a UNION of the inner branch bodies. This preserves user-intended grouping like "GRAPH ?g { { A } UNION { B } }" instead of rendering as "{ GRAPH ?g { A } } UNION { GRAPH ?g { B } }". Safety: - Only rewrites when two or more UNION branches are single GRAPHs with identical graph refs. - Preserves branch order by collapsing the first encountered group into a single GRAPH and skipping subsequent branches belonging to the same group.
  • Method Details