SemWeb.Query.QueryResultSink

SemWeb : SemWeb.Query Namespace
QueryResultSink Class

A class that receives the results of a query.

public abstract class QueryResultSink

#### Remarks

This is an abstract base class. SemWeb.Query.SparqlXmlQuerySink is an implementation that writes out the results of a query in SPARQL XML Results Format.

## Members

See Also: Inherited members from object.

### Protected Constructors

QueryResultSink () The protected no-arg constructor used by inherited classes.

### Methods

abstract | Add (VariableBindings) : bool Called to add a new result row.
| AddComments (string) Adds comments about how the query has been processed.
| Finished () This method is called by a Query object after the last variable binding is added.
| Init (SemWeb.Variable[]) Called by the Query to initialize the result sink.

## Member Details

### QueryResultSink Constructor

protected QueryResultSink ()

The protected no-arg constructor used by inherited classes.

#### Remarks

None.

### Finished Method

public virtual void Finished ()

This method is called by a Query object after the last variable binding is added.

#### Remarks

None.

### AddComments Method

public virtual void AddComments (string comments)

Adds comments about how the query has been processed.

#### Parameters

comments
  Arbitrary comments.

#### Remarks

This method may be called at any time, before, during, and after all bindings have been written.

### Add Method

public abstract bool Add (VariableBindings result)

Called to add a new result row.

#### Parameters

result
  The variable bindings to values in this row.

#### Returns

Return `true` to have the caller continue streaming results, otherwise the caller will abort the query.

#### Remarks

None.

### Init Method

public virtual void Init (SemWeb.Variable[] variables)

Called by the Query to initialize the result sink.

#### Parameters

variables
  An array of variables whose bindings will be reported. The order of the variables here will match that in the bindings provided in Add.

#### Remarks

None.