Class VariableSubstitutionTransformer
An optimiser for walking algebra and expression trees and replacing a Variable with another Variable or a Constant.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF.Query.Optimisation
Assembly: dotNetRDF.dll
Syntax
public class VariableSubstitutionTransformer : PrimaryExpressionSubstituter, IExpressionTransformer, IAlgebraOptimiser
Constructors
| Improve this Doc View SourceVariableSubstitutionTransformer(String, String)
Create a transform that replaces one variable with another.
Declaration
public VariableSubstitutionTransformer(string findVar, string replaceVar)
Parameters
Type | Name | Description |
---|---|---|
System.String | findVar | Find Variable. |
System.String | replaceVar | Replace Variable. |
VariableSubstitutionTransformer(String, INode)
Create a transform that replaces a variable with a constant.
Declaration
public VariableSubstitutionTransformer(string findVar, INode replaceTerm)
Parameters
Type | Name | Description |
---|---|---|
System.String | findVar | Find Variable. |
INode | replaceTerm | Replace Constant. |
Properties
| Improve this Doc View SourceCanReplaceObjects
Gets/Sets whethe the Transformer is allowed to replace objects.
Declaration
public bool CanReplaceObjects { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
The transformer will intelligently select this depending on whether it is replacing with a constant (defaults to true) or a variable (defaults to false), when replacing a variable the behaviour changes automatically. If you set it explicitly the transformer will respect your setting regardless.
Methods
| Improve this Doc View SourceIsApplicable(SparqlQuery)
Returns false because this optimiser is never globally applicable.
Declaration
public bool IsApplicable(SparqlQuery q)
Parameters
Type | Name | Description |
---|---|---|
SparqlQuery | q | Query. |
Returns
Type | Description |
---|---|
System.Boolean |
IsApplicable(SparqlUpdateCommandSet)
Returns false because this optimiser is never globally applicable.
Declaration
public bool IsApplicable(SparqlUpdateCommandSet cmds)
Parameters
Type | Name | Description |
---|---|---|
SparqlUpdateCommandSet | cmds | Update Commands. |
Returns
Type | Description |
---|---|
System.Boolean |
Optimise(ISparqlAlgebra)
Attempts to do variable substitution within the given algebra.
Declaration
public ISparqlAlgebra Optimise(ISparqlAlgebra algebra)
Parameters
Type | Name | Description |
---|---|---|
ISparqlAlgebra | algebra | Algebra. |
Returns
Type | Description |
---|---|
ISparqlAlgebra |
SubstitutePrimaryExpression(ISparqlExpression)
Tries to substitute variables within primary expressions.
Declaration
protected override ISparqlExpression SubstitutePrimaryExpression(ISparqlExpression expr)
Parameters
Type | Name | Description |
---|---|---|
ISparqlExpression | expr | Expression. |
Returns
Type | Description |
---|---|
ISparqlExpression |