Class FusePathPlusTailAlternationUnionTransform
java.lang.Object
org.eclipse.rdf4j.queryrender.sparql.ir.util.transform.BaseTransform
org.eclipse.rdf4j.queryrender.sparql.ir.util.transform.FusePathPlusTailAlternationUnionTransform
Fuse a path triple followed by a UNION of two single-step tail triples into a single path with an alternation tail.
Shape: - Input: PT: ?s P ?mid . UNION of two branches that each connect ?mid to the same end variable via constant
predicates in opposite directions (forward/inverse), optionally GRAPH-wrapped with the same graph ref. - Output: ?s
P/(p|^p) ?end .
Notes: - Does not fuse across UNIONs marked as new scope (explicit user UNIONs). - Requires the bridge variable
(?mid) to be an
_anon_path_* var so we never eliminate user-visible vars.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
Fields inherited from class BaseTransform
ANON_PATH_INVERSE_PREFIX, ANON_PATH_PREFIX -
Method Summary
Modifier and TypeMethodDescriptionstatic IrBGPapply(IrBGP bgp, TupleExprIRRenderer r) classifyTailJoin(FusePathPlusTailAlternationUnionTransform.BranchTriple bt, Var midVar, TupleExprIRRenderer r) static booleancompatibleGraphs(Var a, Var b) getSingleBranchSp(IrBGP branch) Methods inherited from class BaseTransform
bgpWithLines, branchHasAnonPathBridge, copyAllExcept, fuseAdjacentPtThenPt, fuseAdjacentSpThenPt, fuseAltInverseTailBGP, fusePtSpPtSequence, invertNegatedPropertySet, iri, isAnonPathInverseVar, isAnonPathVar, isConstantIriPredicate, joinPathWithLaterSp, mergeNpsMembers, normalizeCompactNps, orientBareNpsForNext, rewriteContainers, sameVar, sameVarOrValue, unionBranchesAllHaveAnonPathBridge, unionBranchesShareAnonPathVarWithAllowedRoleMapping, unionBranchesShareCommonAnonPathVarName, unionIsExplicitAndAllBranchesScoped, varOrValue
-
Method Details
-
apply
-
compatibleGraphs
-
classifyTailJoin
public static FusePathPlusTailAlternationUnionTransform.TripleJoin classifyTailJoin(FusePathPlusTailAlternationUnionTransform.BranchTriple bt, Var midVar, TupleExprIRRenderer r) -
getSingleBranchSp
public static FusePathPlusTailAlternationUnionTransform.BranchTriple getSingleBranchSp(IrBGP branch)
-