java.lang.Object
org.apache.jena.sparql.engine.Rename
Support for renaming all the variables in an algebra expression. This is primarily
in support of renaming variables based on sub-query scope where renaming
?x
-> ?/x
happens to stop global clashes of scoped
usages.
For syntax-base renaming, see QueryTransformOps
and UpdateTransformOps
.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Var
chooseVarName
(Var var, Collection<Var> inUse, String prefix) Given an old name, and some names already in use, pick a fresh, new namestatic Op
renameNode
(Op op, org.apache.jena.graph.Node oldName, org.apache.jena.graph.Node newName) Rename one node to anotherstatic Op
Rename one variable to anotherstatic Op
renameVars
(Op op, Collection<Var> constants) Rename all variables in a pattern, EXCEPT for those named as constantstatic ExprList
renameVars
(ExprList exprList, Set<Var> constants) Rename all variables in an expression, EXCEPT for those named as constantstatic Expr
renameVars
(Expr expr, Set<Var> constants) static org.apache.jena.graph.Node
reverseVarRename
(org.apache.jena.graph.Node node) Undo the effect of the rename operation, once or repeatedly.static Op
reverseVarRename
(Op op, boolean repeatedly) Undo the effect of the rename operation, once or repeatedly.
-
Constructor Details
-
Rename
public Rename()
-
-
Method Details
-
chooseVarName
Given an old name, and some names already in use, pick a fresh, new name -
renameNode
public static Op renameNode(Op op, org.apache.jena.graph.Node oldName, org.apache.jena.graph.Node newName) Rename one node to another -
renameVar
Rename one variable to another -
renameVars
Rename all variables in a pattern, EXCEPT for those named as constant -
renameVars
Rename all variables in an expression, EXCEPT for those named as constant -
renameVars
-
reverseVarRename
Undo the effect of the rename operation, once or repeatedly. This assumes the op was renamed by VarRename.rename -
reverseVarRename
public static org.apache.jena.graph.Node reverseVarRename(org.apache.jena.graph.Node node) Undo the effect of the rename operation, once or repeatedly. This assumes the node was renamed by VarRename.rename
-