Show / Hide Table of Contents

Interface ISparqlResult

Inherited Members
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, VDS.RDF.INode>>.GetEnumerator()
System.Collections.IEnumerable.GetEnumerator()
System.IEquatable<VDS.RDF.Query.ISparqlResult>.Equals(VDS.RDF.Query.ISparqlResult)
Namespace: VDS.RDF.Query
Assembly: dotNetRdf.dll
Syntax
public interface ISparqlResult : IEnumerable<KeyValuePair<string, INode>>, IEnumerable, IEquatable<ISparqlResult>

Properties

| Improve this Doc View Source

Count

Gets the number of Variables for which this Result contains Bindings.

Declaration
int Count { get; }
Property Value
Type Description
int
| Improve this Doc View Source

IsGroundResult

Gets whether a Result is a Ground Result.

Declaration
bool IsGroundResult { get; }
Property Value
Type Description
System.Boolean
Remarks

A Ground Result is a result which is considered to be a fixed fact. In practise this means it contains no Blank Nodes.

| Improve this Doc View Source

this[int]

Gets the Value that is bound at the given Index.

Declaration
INode this[int index] { get; }
Parameters
Type Name Description
int index

Index whose Value you wish to retrieve.

Property Value
Type Description
INode
Remarks

As of 1.0.0 the order of variables in a result may/may not vary depending on the original query. If a specific variable list was declared dotNetRDF tries to preserve that order but this may not always happen depending on how results are received.

Exceptions
Type Condition
System.IndexOutOfRangeException

Thrown if there is nothing bound at the given Index.

| Improve this Doc View Source

this[string]

Gets the Value that is bound to the given Variable.

Declaration
INode this[string variable] { get; }
Parameters
Type Name Description
string variable

Variable whose Value you wish to retrieve.

Property Value
Type Description
INode
Exceptions
Type Condition
RdfException

Thrown if there is nothing bound to the given Variable Name for this Result.

| Improve this Doc View Source

Variables

Gets the set of Variables that are bound in this Result.

Declaration
IEnumerable<string> Variables { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><string>

Methods

| Improve this Doc View Source

HasBoundValue(string)

Checks whether a given Variable has a non-null value for this result.

Declaration
bool HasBoundValue(string variable)
Parameters
Type Name Description
string variable

Variable Name.

Returns
Type Description
System.Boolean

True if the variable is present and has a non-null value, false otherwise.

| Improve this Doc View Source

HasValue(string)

Checks whether a given Variable has a value (which may be null) for this result.

Declaration
bool HasValue(string variable)
Parameters
Type Name Description
string variable

Variable Name.

Returns
Type Description
System.Boolean

True if the variable is present, false otherwise.

Remarks

Returns true even if the value is null, use HasBoundValue(string) instead to see whether a non-null value is present for a variable.

| Improve this Doc View Source

SetValue(string, INode)

Sets the value bound to the specified variable, adding that variable to the result if necessary.

Declaration
void SetValue(string variable, INode value)
Parameters
Type Name Description
string variable

Variable name.

INode value

Value to bind to the variable.

| Improve this Doc View Source

ToString(INodeFormatter)

Displays the Result as a comma separated string of paris of the form ?var = value where values are formatted using the given Node Formatter.

Declaration
string ToString(INodeFormatter formatter)
Parameters
Type Name Description
INodeFormatter formatter

Node Formatter.

Returns
Type Description
string
| Improve this Doc View Source

Trim()

Removes all Variables Bindings where the Variable is Unbound.

Declaration
void Trim()
| Improve this Doc View Source

TryGetBoundValue(string, out INode)

Tries to get a non-null value for the variable.

Declaration
bool TryGetBoundValue(string variable, out INode value)
Parameters
Type Name Description
string variable

Variable.

INode value

Value.

Returns
Type Description
System.Boolean

True if the variable was present and bound, false otherwise.

| Improve this Doc View Source

TryGetValue(string, out INode)

Tries to get a value (which may be null) for the variable.

Declaration
bool TryGetValue(string variable, out INode value)
Parameters
Type Name Description
string variable

Variable.

INode value

Value.

Returns
Type Description
System.Boolean

True if the variable was present (even it was unbound) and false otherwise.

| Improve this Doc View Source

Value(string)

Gets the Value that is bound to the given Variable.

Declaration
INode Value(string variable)
Parameters
Type Name Description
string variable

Variable whose Value you wish to retrieve.

Returns
Type Description
INode
Exceptions
Type Condition
RdfException

Thrown if there is nothing bound to the given Variable Name for this Result.

Extension Methods

Extensions.ChunkBy<T>(IEnumerable<T>, int)
Extensions.IsDisjoint<T>(IEnumerable<T>, IEnumerable<T>)
Extensions.ToSafeString(object)
DynamicExtensions.AsDynamic(ISparqlResult)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Properties
    • Count
    • IsGroundResult
    • this[int]
    • this[string]
    • Variables
  • Methods
    • HasBoundValue(string)
    • HasValue(string)
    • SetValue(string, INode)
    • ToString(INodeFormatter)
    • Trim()
    • TryGetBoundValue(string, out INode)
    • TryGetValue(string, out INode)
    • Value(string)
  • Extension Methods
Back to top Generated by DocFX