Show / Hide Table of Contents

Class SparqlEvaluationContext

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

Inheritance
System.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

| Improve this Doc 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.

| Improve this Doc 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.

| Improve this Doc 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

| Improve this Doc View Source

Binder

Gets/Sets the Results Binder.

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

Data

Gets the Dataset the query is over.

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

InputMultiset

Gets/Sets the Input Multiset.

Declaration
public BaseMultiset InputMultiset { get; set; }
Property Value
Type Description
BaseMultiset
| Improve this Doc 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
System.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).

| Improve this Doc View Source

NodeComparer

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

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

Options

Get the configured query options for this evaluation context.

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

OrderingComparer

Get the comparer to use when sorting query results.

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

OutputMultiset

Gets/Sets the Output Multiset.

Declaration
public BaseMultiset OutputMultiset { get; set; }
Property Value
Type Description
BaseMultiset
| Improve this Doc 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>
| Improve this Doc View Source

Query

Gets the Query that is being evaluated.

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

QueryTime

Retrieves the Time in milliseconds the query took to evaluate.

Declaration
public long QueryTime { get; }
Property Value
Type Description
long
| Improve this Doc 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).

| Improve this Doc View Source

QueryTimeTicks

Retrieves the Time in ticks the query took to evaluate.

Declaration
public long QueryTimeTicks { get; }
Property Value
Type Description
long
| Improve this Doc 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.

| Improve this Doc View Source

RigorousEvaluation

Gets whether pattern evaluation should use rigorous evaluation mode.

Declaration
public bool RigorousEvaluation { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

TrimTemporaryVariables

Gets/Sets whether BGPs should trim temporary variables.

Declaration
public bool TrimTemporaryVariables { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

UriFactory

Get the factory to use when creating URI instances.

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

Methods

| Improve this Doc 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).

| Improve this Doc 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.

| Improve this Doc 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
System.Boolean

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

| Improve this Doc 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
System.Boolean

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

| Improve this Doc View Source

EndExecution()

Ends the Execution Timer.

Declaration
public void EndExecution()
| Improve this Doc View Source

Evaluate(ISparqlAlgebra)

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

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

Algebra.

Returns
Type Description
BaseMultiset
| Improve this Doc View Source

Evaluate(TriplePattern)

Declaration
public void Evaluate(TriplePattern triplePattern)
Parameters
Type Name Description
TriplePattern triplePattern
| Improve this Doc 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
System.Uri endpointUri

The endpoint to connect to.

Returns
Type Description
System.Net.Http.HttpClient

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

| Improve this Doc View Source

GetQuotedTriples(QuotedTriplePattern)

Declaration
public IEnumerable<ITripleNode> GetQuotedTriples(QuotedTriplePattern qtp)
Parameters
Type Name Description
QuotedTriplePattern qtp
Returns
Type Description
System.Collections.Generic.IEnumerable<T><ITripleNode>
| Improve this Doc 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
System.Collections.Generic.IEnumerable<T><Triple>
| Improve this Doc 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)
  • Improve this Doc
  • 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
    • QueryTimeout
    • QueryTimeTicks
    • 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