Show / Hide Table of Contents

Class SparqlEvaluationContext

Stores information about the Evaluation of a Query during it's evaluation.

Inheritance
object
SparqlEvaluationContext
Implements
IPatternEvaluationContext
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Query
Assembly: dotNetRdf.dll
Syntax
public class SparqlEvaluationContext : IPatternEvaluationContext

Constructors

| Edit this page View Source

SparqlEvaluationContext(SparqlQuery, ISparqlDataset, ISparqlQueryAlgebraProcessor<BaseMultiset, SparqlEvaluationContext>, LeviathanQueryOptions)

Creates a new Evaluation Context for the given Query over the given Dataset using a specific processor.

Declaration
public SparqlEvaluationContext(SparqlQuery q, ISparqlDataset data, ISparqlQueryAlgebraProcessor<BaseMultiset, SparqlEvaluationContext> processor, LeviathanQueryOptions options)
Parameters
Type Name Description
SparqlQuery q

Query.

ISparqlDataset data

Dataset.

ISparqlQueryAlgebraProcessor<BaseMultiset, SparqlEvaluationContext> processor

Query Processor.

LeviathanQueryOptions options

The query processor options to use.

| Edit this page View Source

SparqlEvaluationContext(SparqlQuery, ISparqlDataset, LeviathanQueryOptions)

Creates a new Evaluation Context for the given Query over the given Dataset.

Declaration
public SparqlEvaluationContext(SparqlQuery q, ISparqlDataset data, LeviathanQueryOptions options)
Parameters
Type Name Description
SparqlQuery q

Query.

ISparqlDataset data

Dataset.

LeviathanQueryOptions options

The query processor options to use.

| Edit this page View Source

SparqlEvaluationContext(SparqlResultBinder, LeviathanQueryOptions)

Creates a new Evaluation Context which is a Container for the given Result Binder.

Declaration
public SparqlEvaluationContext(SparqlResultBinder binder, LeviathanQueryOptions options)
Parameters
Type Name Description
SparqlResultBinder binder
LeviathanQueryOptions options

The query processor options to use.

Properties

| Edit this page View Source

Binder

Gets/Sets the Results Binder.

Declaration
public SparqlResultBinder Binder { get; set; }
Property Value
Type Description
SparqlResultBinder
| Edit this page View Source

Data

Gets the Dataset the query is over.

Declaration
public ISparqlDataset Data { get; }
Property Value
Type Description
ISparqlDataset
| Edit this page View Source

InputMultiset

Gets/Sets the Input Multiset.

Declaration
public BaseMultiset InputMultiset { get; set; }
Property Value
Type Description
BaseMultiset
| Edit this page View Source

this[string]

Gets/Sets a Object that should be persisted over the entire Evaluation Context.

Declaration
public object this[string key] { get; set; }
Parameters
Type Name Description
string key

Key.

Property Value
Type Description
object
Remarks

May be used by parts of the Evaluation Process that need to ensure a persistent state across the entire Evaluation Query (e.g. the implementation of the BNODE() function).

| Edit this page View Source

NodeComparer

Get the comparer to use when ordering nodes during query processing.

Declaration
public ISparqlNodeComparer NodeComparer { get; }
Property Value
Type Description
ISparqlNodeComparer
| Edit this page View Source

Options

Get the configured query options for this evaluation context.

Declaration
public LeviathanQueryOptions Options { get; }
Property Value
Type Description
LeviathanQueryOptions
| Edit this page View Source

OrderingComparer

Get the comparer to use when sorting query results.

Declaration
public SparqlOrderingComparer OrderingComparer { get; }
Property Value
Type Description
SparqlOrderingComparer
| Edit this page View Source

OutputMultiset

Gets/Sets the Output Multiset.

Declaration
public BaseMultiset OutputMultiset { get; set; }
Property Value
Type Description
BaseMultiset
| Edit this page View Source

Processor

Gets the custom query processor that is in use (if any).

Declaration
public ISparqlQueryAlgebraProcessor<BaseMultiset, SparqlEvaluationContext> Processor { get; }
Property Value
Type Description
ISparqlQueryAlgebraProcessor<BaseMultiset, SparqlEvaluationContext>
| Edit this page View Source

Query

Gets the Query that is being evaluated.

Declaration
public SparqlQuery Query { get; }
Property Value
Type Description
SparqlQuery
| Edit this page View Source

QueryTime

Retrieves the Time in milliseconds the query took to evaluate.

Declaration
public long QueryTime { get; }
Property Value
Type Description
long
| Edit this page View Source

QueryTimeTicks

Retrieves the Time in ticks the query took to evaluate.

Declaration
public long QueryTimeTicks { get; }
Property Value
Type Description
long
| Edit this page View Source

QueryTimeout

Gets the Query Timeout used for the Query.

Declaration
public long QueryTimeout { get; }
Property Value
Type Description
long
Remarks

This is taken either from the Timeout property of the SparqlQuery to which this evaluation context pertains (if any) or from the the processor-defined timeout value passed as a parameter to StartExecution(long) method. You cannot set the Query Timeout to be higher than the processor-defined timeout unless the processor-defined timeout is set to zero (i.e. no processor-defined timeout).

| Edit this page View Source

RemainingTimeout

Gets the Remaining Timeout i.e. the Timeout taking into account time already elapsed.

Declaration
public long RemainingTimeout { get; }
Property Value
Type Description
long
Remarks

If there is no timeout then this is always zero, if there is a timeout this is always >= 1 since any operation that wants to respect the timeout must have a non-zero timeout to actually timeout properly.

| Edit this page View Source

RigorousEvaluation

Gets whether pattern evaluation should use rigorous evaluation mode.

Declaration
public bool RigorousEvaluation { get; }
Property Value
Type Description
bool
| Edit this page View Source

TrimTemporaryVariables

Gets/Sets whether BGPs should trim temporary variables.

Declaration
public bool TrimTemporaryVariables { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

UriFactory

Get the factory to use when creating URI instances.

Declaration
public IUriFactory UriFactory { get; }
Property Value
Type Description
IUriFactory

Methods

| Edit this page View Source

CalculateTimeout(long)

Return the execution timeout to be applied to this evaluation context given the specified processor-defined maximum execution timeout.

Declaration
public long CalculateTimeout(long maxTimeout)
Parameters
Type Name Description
long maxTimeout
Returns
Type Description
long

The execution timeout for the query in this context (if any).

| Edit this page View Source

CheckTimeout()

Checks whether Execution should Time out.

Declaration
public void CheckTimeout()
Exceptions
Type Condition
RdfQueryTimeoutException

Thrown if the Query has exceeded the Execution Timeout.

| Edit this page View Source

ContainsValue(string, INode)

Gets whether the evaluation context contains a binding of the specified value to the specified variable.

Declaration
public bool ContainsValue(string varName, INode value)
Parameters
Type Name Description
string varName

The name of the variable to look for.

INode value

The expected value.

Returns
Type Description
bool

True if the evaluation context contains a binding for varName to value, false otherwise.

| Edit this page View Source

ContainsVariable(string)

Get whether the specified variable is found in the evaluation context.

Declaration
public bool ContainsVariable(string varName)
Parameters
Type Name Description
string varName

The name of the variable to look for.

Returns
Type Description
bool

True if the evaluation context contains a whose name matches varName, false otherwise.

| Edit this page View Source

EndExecution()

Ends the Execution Timer.

Declaration
public void EndExecution()
| Edit this page View Source

Evaluate(ISparqlAlgebra)

Evaluates an Algebra Operator in this Context using the current Query Processor (if any) or the default query processor.

Declaration
public BaseMultiset Evaluate(ISparqlAlgebra algebra)
Parameters
Type Name Description
ISparqlAlgebra algebra

Algebra.

Returns
Type Description
BaseMultiset
| Edit this page View Source

Evaluate(TriplePattern)

Evaluate a triple pattern.

Declaration
public void Evaluate(TriplePattern triplePattern)
Parameters
Type Name Description
TriplePattern triplePattern
| Edit this page View Source

GetHttpClient(Uri)

Return an HttpClient instance to use when connecting to a specific URI endpoint.

Declaration
public HttpClient GetHttpClient(Uri endpointUri)
Parameters
Type Name Description
Uri endpointUri

The endpoint to connect to.

Returns
Type Description
HttpClient

An HttpClient instance to use for connections to the specified endpoint.

| Edit this page View Source

GetQuotedTriples(QuotedTriplePattern)

Return all quoted triples in the dataset that match the specified pattern.

Declaration
public IEnumerable<ITripleNode> GetQuotedTriples(QuotedTriplePattern qtp)
Parameters
Type Name Description
QuotedTriplePattern qtp
Returns
Type Description
IEnumerable<ITripleNode>
| Edit this page View Source

GetTriples(IMatchTriplePattern)

Gets the Enumeration of Triples that should be assessed for matching the pattern.

Declaration
public IEnumerable<Triple> GetTriples(IMatchTriplePattern triplePattern)
Parameters
Type Name Description
IMatchTriplePattern triplePattern

The pattern to be matched.

Returns
Type Description
IEnumerable<Triple>
| Edit this page View Source

StartExecution(long)

Starts the Execution Timer.

Declaration
public void StartExecution(long maxTimeout)
Parameters
Type Name Description
long maxTimeout

The maximum time (in milliseconds) to allow the query to run for. This may be overridden by the timeout specified in the query itself.

Remarks

A value of zero or less for maxTimeout indicates no timeout. If a finite timeout is specified both by maxTimeout and in the query, then the shorter of these two timeout values will be used.

Implements

IPatternEvaluationContext

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • SparqlEvaluationContext(SparqlQuery, ISparqlDataset, ISparqlQueryAlgebraProcessor<BaseMultiset, SparqlEvaluationContext>, LeviathanQueryOptions)
    • SparqlEvaluationContext(SparqlQuery, ISparqlDataset, LeviathanQueryOptions)
    • SparqlEvaluationContext(SparqlResultBinder, LeviathanQueryOptions)
  • Properties
    • Binder
    • Data
    • InputMultiset
    • this[string]
    • NodeComparer
    • Options
    • OrderingComparer
    • OutputMultiset
    • Processor
    • Query
    • QueryTime
    • QueryTimeTicks
    • QueryTimeout
    • RemainingTimeout
    • RigorousEvaluation
    • TrimTemporaryVariables
    • UriFactory
  • Methods
    • CalculateTimeout(long)
    • CheckTimeout()
    • ContainsValue(string, INode)
    • ContainsVariable(string)
    • EndExecution()
    • Evaluate(ISparqlAlgebra)
    • Evaluate(TriplePattern)
    • GetHttpClient(Uri)
    • GetQuotedTriples(QuotedTriplePattern)
    • GetTriples(IMatchTriplePattern)
    • StartExecution(long)
  • Implements
  • Extension Methods
Back to top Generated by DocFX