Show / Hide Table of Contents

Class DynamicSparqlResult

Provides read/write dictionary and dynamic functionality for SPARQL results.

Inheritance
object
DynamicSparqlResult
Implements
IDictionary<string, object>
ICollection<KeyValuePair<string, object>>
IEnumerable<KeyValuePair<string, object>>
IEnumerable
IDynamicMetaObjectProvider
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Dynamic
Assembly: dotNetRdf.Dynamic.dll
Syntax
public class DynamicSparqlResult : IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, IDynamicMetaObjectProvider

Constructors

| Edit this page View Source

DynamicSparqlResult(ISparqlResult)

Initializes a new instance of the DynamicSparqlResult class.

Declaration
public DynamicSparqlResult(ISparqlResult original)
Parameters
Type Name Description
ISparqlResult original

The SPARQL result to wrap.

Exceptions
Type Condition
ArgumentNullException

When original is null.

Properties

| Edit this page View Source

Count

Gets the number of variables in the result.

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

IsReadOnly

Gets a value indicating whether this SPARQL result dictionary is read only (always false).

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

this[string]

Gets or sets values equivalent to bindings in the result.

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

The binding converted to a native object.

Exceptions
Type Condition
ArgumentNullException

When variable is null.

| Edit this page View Source

Keys

Gets the variable names in the SPARQL result.

Declaration
public ICollection<string> Keys { get; }
Property Value
Type Description
ICollection<string>
| Edit this page View Source

Values

Gets native values equivalent to bindings in the result.

Declaration
public ICollection<object> Values { get; }
Property Value
Type Description
ICollection<object>

Methods

| Edit this page View Source

Add(string, object)

Binds a variable to a node equivalent to value.

Declaration
public void Add(string variable, object value)
Parameters
Type Name Description
string variable

The name of the variable to bind.

object value

An object that is converted to an equivalent node and bound to the variable.

Exceptions
Type Condition
ArgumentNullException

When variable is null.

| Edit this page View Source

Clear()

Removes all variables in the result.

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

ContainsKey(string)

Checks whether a variable exists in the result.

Declaration
public bool ContainsKey(string variable)
Parameters
Type Name Description
string variable

The name of the variable to check.

Returns
Type Description
bool

Whether a variable exists in the result.

| Edit this page View Source

GetEnumerator()

Returns an enumerator that iterates through pairs of variable names and native values equivalent to bindings in the result.

Declaration
public IEnumerator GetEnumerator()
Returns
Type Description
IEnumerator

An enumerator that iterates through pairs of variable names and native values equivalent to bindings in the result.

| Edit this page View Source

Remove(string)

Unbinds a variable from the result.

Declaration
public bool Remove(string variable)
Parameters
Type Name Description
string variable

The variable to unbind.

Returns
Type Description
bool

Whether a variable was removed.

| Edit this page View Source

TryGetValue(string, out object)

Tries to get a native value equivalent to a binding from the result.

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

The name of the variable to try.

object value

A native value equivalent to the binding.

Returns
Type Description
bool

Whether value was set.

Implements

IDictionary<TKey, TValue>
ICollection<T>
IEnumerable<T>
IEnumerable
IDynamicMetaObjectProvider

Extension Methods

Extensions.ChunkBy<T>(IEnumerable<T>, int)
Extensions.IsDisjoint<T>(IEnumerable<T>, IEnumerable<T>)
Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • DynamicSparqlResult(ISparqlResult)
  • Properties
    • Count
    • IsReadOnly
    • this[string]
    • Keys
    • Values
  • Methods
    • Add(string, object)
    • Clear()
    • ContainsKey(string)
    • GetEnumerator()
    • Remove(string)
    • TryGetValue(string, out object)
  • Implements
  • Extension Methods
Back to top Generated by DocFX