Show / Hide Table of Contents

Class VariableSubstitutionTransformer

An optimiser for walking algebra and expression trees and replacing a Variable with another Variable or a Constant.

Inheritance
object
PrimaryExpressionSubstituter
VariableSubstitutionTransformer
Implements
IExpressionTransformer
IAlgebraOptimiser
Inherited Members
PrimaryExpressionSubstituter.Transform(ISparqlExpression)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Query.Optimisation
Assembly: dotNetRdf.dll
Syntax
public class VariableSubstitutionTransformer : PrimaryExpressionSubstituter, IExpressionTransformer, IAlgebraOptimiser

Constructors

| Edit this page View Source

VariableSubstitutionTransformer(string, string)

Create a transform that replaces one variable with another.

Declaration
public VariableSubstitutionTransformer(string findVar, string replaceVar)
Parameters
Type Name Description
string findVar

Find Variable.

string replaceVar

Replace Variable.

| Edit this page View Source

VariableSubstitutionTransformer(string, INode)

Create a transform that replaces a variable with a constant.

Declaration
public VariableSubstitutionTransformer(string findVar, INode replaceTerm)
Parameters
Type Name Description
string findVar

Find Variable.

INode replaceTerm

Replace Constant.

Properties

| Edit this page View Source

CanReplaceObjects

Gets/Sets whethe the Transformer is allowed to replace objects.

Declaration
public bool CanReplaceObjects { get; set; }
Property Value
Type Description
bool
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.

| Edit this page View Source

UnsafeOptimisation

Determines whether an Optimiser will perform algebra optimizations that are potentially unsafe at execution time.

Declaration
public bool UnsafeOptimisation { get; set; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

IsApplicable(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
bool
| Edit this page View Source

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
bool
| Edit this page View Source

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
| Edit this page View Source

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
Overrides
PrimaryExpressionSubstituter.SubstitutePrimaryExpression(ISparqlExpression)

Implements

IExpressionTransformer
IAlgebraOptimiser

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • VariableSubstitutionTransformer(string, string)
    • VariableSubstitutionTransformer(string, INode)
  • Properties
    • CanReplaceObjects
    • UnsafeOptimisation
  • Methods
    • IsApplicable(SparqlQuery)
    • IsApplicable(SparqlUpdateCommandSet)
    • Optimise(ISparqlAlgebra)
    • SubstitutePrimaryExpression(ISparqlExpression)
  • Implements
  • Extension Methods
Back to top Generated by DocFX