Class FuseUnionOfNpsBranchesTransform

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

public final class FuseUnionOfNpsBranchesTransform extends BaseTransform
Fuse a UNION whose branches are each a single bare-NPS path triple (optionally inside the same GRAPH) into a single NPS triple that combines members, preserving forward orientation and inverting members from inverse-oriented branches (using '^') when needed. Scope/safety rules: - No new scope (u.isNewScope() == false): merge only when each branch contains an _anon_path_* bridge var (see BaseTransform.unionBranchesAllHaveAnonPathBridge). This ensures we do not collapse user-visible variables. - New scope (u.isNewScope() == true): by default do not merge. Special exception: merge when the branches share a common _anon_path_* variable name (see BaseTransform.unionBranchesShareCommonAnonPathVarName). In that case we preserve explicit grouping by wrapping the fused result in a grouped IrBGP. Additional constraints: - Each branch must be a single IrPathTriple, optionally GRAPH-wrapped with an identical graph ref. - Each path must be a bare NPS '!(...)' (no '/', no quantifiers). Orientation is aligned by inverting members when the branch is reversed. - Member order is kept stable; duplicates are removed while preserving first occurrence.