Show / Hide Table of Contents

Interface ISparqlDataset

Interfaces for Datasets that SPARQL Queries and Updates can be applied to.

Inherited Members
ITripleIndex.GetTriples(Uri)
ITripleIndex.GetTriples(INode)
ITripleIndex.GetTriplesWithObject(Uri)
ITripleIndex.GetTriplesWithObject(INode)
ITripleIndex.GetTriplesWithPredicate(INode)
ITripleIndex.GetTriplesWithPredicate(Uri)
ITripleIndex.GetTriplesWithSubject(INode)
ITripleIndex.GetTriplesWithSubject(Uri)
ITripleIndex.GetTriplesWithSubjectPredicate(INode, INode)
ITripleIndex.GetTriplesWithSubjectObject(INode, INode)
ITripleIndex.GetTriplesWithPredicateObject(INode, INode)
ITripleIndex.GetQuoted(Uri)
ITripleIndex.GetQuoted(INode)
ITripleIndex.GetQuotedWithObject(Uri)
ITripleIndex.GetQuotedWithObject(INode)
ITripleIndex.GetQuotedWithPredicate(INode)
ITripleIndex.GetQuotedWithPredicate(Uri)
ITripleIndex.GetQuotedWithSubject(INode)
ITripleIndex.GetQuotedWithSubject(Uri)
ITripleIndex.GetQuotedWithSubjectPredicate(INode, INode)
ITripleIndex.GetQuotedWithSubjectObject(INode, INode)
ITripleIndex.GetQuotedWithPredicateObject(INode, INode)
Namespace: VDS.RDF.Query.Datasets
Assembly: dotNetRdf.dll
Syntax
public interface ISparqlDataset : ITripleIndex
Remarks

Note: For all operations that take a Graph URI a null Uri should be considered to refer to the Default Graph of the dataset.

Default and Active Graph

Leviathan expects that a Query operates over the Dataset in the following order:

  1. If an Active Graph is set then Queries operate over that
  2. Otherwise if a Default Graph is set then Queries operate over that
  3. Finally the Queries operate over the all triples, the notion of all triples may be dataset implementation specific i.e. may be union of all graphs, the default unnamed graph only or something else entirely
Please note that the Query may change the Active and Default Graph over the course of the query depending on the Query e.g. FROM, FROM NAMED and GRAPH all can potentially change these.

You can limit your queries to use specific portions of your dataset by using the SetActiveGraph() and SetDefaultGraph() methods on your dataset instance before then passing it to the LeviathanQueryProcessor.

Note: By default the InMemoryDataset uses the Union of all Graphs in the Dataset if no Active/Default Graph is otherwise specified. Use the UsesUnionDefaultGraph property to see whether a Dataset implementation behaves in this way.

Properties

| Edit this page View Source

ActiveGraphNames

Gets the enumeration of the names of the graphs that currently make up the active graph.

Declaration
IEnumerable<IRefNode> ActiveGraphNames { get; }
Property Value
Type Description
IEnumerable<IRefNode>
| Edit this page View Source

ActiveGraphUris

Gets the enumeration of the Graph URIs that currently make up the active graph.

Declaration
[Obsolete("Replaced by ActiveGraphNames. This implementation will NOT report graphs with blank node names.")]
IEnumerable<Uri> ActiveGraphUris { get; }
Property Value
Type Description
IEnumerable<Uri>
| Edit this page View Source

DefaultGraphNames

Gets the enumeration of the names of the graphs that currently make up the default graph.

Declaration
IEnumerable<IRefNode> DefaultGraphNames { get; }
Property Value
Type Description
IEnumerable<IRefNode>
| Edit this page View Source

DefaultGraphUris

Gets the enumeration of the Graph URIs that currently make up the default graph.

Declaration
[Obsolete("Replaced by DefaultGraphNames. This implementation will NOT report graphs with blank node names.")]
IEnumerable<Uri> DefaultGraphUris { get; }
Property Value
Type Description
IEnumerable<Uri>
| Edit this page View Source

GraphNames

Gets an enumeration of the names of all graphs in the dataset.

Declaration
IEnumerable<IRefNode> GraphNames { get; }
Property Value
Type Description
IEnumerable<IRefNode>
| Edit this page View Source

GraphUris

Gets all the URIs of Graphs in the Dataset.

Declaration
[Obsolete("Replaced by GraphNames. This property will not include graphs named with a blank node.")]
IEnumerable<Uri> GraphUris { get; }
Property Value
Type Description
IEnumerable<Uri>
| Edit this page View Source

Graphs

Gets all the Graphs in the Dataset.

Declaration
IEnumerable<IGraph> Graphs { get; }
Property Value
Type Description
IEnumerable<IGraph>
| Edit this page View Source

HasTriples

Gets whether the Dataset has any Triples.

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

this[Uri]

Gets the Graph with the given URI from the Dataset.

Declaration
[Obsolete("Replaced by this[IRefNode]")]
IGraph this[Uri graphUri] { get; }
Parameters
Type Name Description
Uri graphUri

Graph URI.

Property Value
Type Description
IGraph
Remarks

This property need only return a read-only view of the Graph, code which wishes to modify Graphs should use the GetModifiableGraph() method to guarantee a Graph they can modify and will be persisted to the underlying storage.

| Edit this page View Source

this[IRefNode]

Gets the graph with the given name from the dataset.

Declaration
IGraph this[IRefNode graphName] { get; }
Parameters
Type Name Description
IRefNode graphName

Graph name.

Property Value
Type Description
IGraph
Remarks

This property need only return a read-only view of the Graph, code which wishes to modify Graphs should use the GetModifiableGraph() method to guarantee a Graph they can modify and will be persisted to the underlying storage.

| Edit this page View Source

QuotedTriples

Gets all the quoted triples in teh dataset.

Declaration
IEnumerable<Triple> QuotedTriples { get; }
Property Value
Type Description
IEnumerable<Triple>
Remarks

Note: The Triples returned from the method should be limited to those in the current Active Graph if present, otherwise those in the current Default Graph if present and finally the entire Dataset.

| Edit this page View Source

Triples

Gets all the Triples in the Dataset.

Declaration
IEnumerable<Triple> Triples { get; }
Property Value
Type Description
IEnumerable<Triple>
Remarks

Note: The Triples returned from the method should be limited to those in the current Active Graph if present, otherwise those in the current Default Graph if present and finally the entire Dataset.

| Edit this page View Source

UsesUnionDefaultGraph

Gets whether the Default Graph is treated as being the union of all Graphs in the dataset when no Default Graph is otherwise set.

Declaration
bool UsesUnionDefaultGraph { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

AddGraph(IGraph)

Adds a Graph to the Dataset.

Declaration
bool AddGraph(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

Returns
Type Description
bool
Exceptions
Type Condition
NotSupportedException

May be thrown if the Dataset is immutable i.e. Updates not supported.

NotSupportedException

May be thrown if the Dataset is immutable.

| Edit this page View Source

ContainsQuotedTriple(Triple)

Gets whether the dataset contains a specific quoted triple.

Declaration
bool ContainsQuotedTriple(Triple t)
Parameters
Type Name Description
Triple t

Triple.

Returns
Type Description
bool

True if the dataset contains t as a quoted triple, false otherwise.

| Edit this page View Source

ContainsTriple(Triple)

Gets whether the Dataset contains a specific Triple.

Declaration
bool ContainsTriple(Triple t)
Parameters
Type Name Description
Triple t

Triple.

Returns
Type Description
bool
| Edit this page View Source

Discard()

Ensures that any changes to the Dataset (if any) are discarded.

Declaration
void Discard()
Remarks

Primarily intended for use in implementations which support transactions though other implementations may wish to use this to ensure that changes to the dataset are persisted properly.

| Edit this page View Source

Flush()

Ensures that any changes to the Dataset (if any) are flushed to the underlying Storage.

Declaration
void Flush()
Remarks

While partly intended for use in implementations which support transactions though other implementations may wish to use this to ensure that changes to the dataset are persisted properly.

| Edit this page View Source

GetModifiableGraph(Uri)

Gets the Graph with the given URI from the Dataset.

Declaration
[Obsolete("Replaced by GetModifiableGraph(IRefNode)")]
IGraph GetModifiableGraph(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

Returns
Type Description
IGraph
Remarks

Graphs returned from this method must be modifiable and the Dataset must guarantee that when it is Flushed or Disposed of that any changes to the Graph are persisted.

Exceptions
Type Condition
NotSupportedException

May be thrown if the Dataset is immutable i.e. Updates not supported.

NotSupportedException

May be thrown if the Dataset is immutable.

| Edit this page View Source

GetModifiableGraph(IRefNode)

Gets the Graph with the given name from the Dataset.

Declaration
IGraph GetModifiableGraph(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph name.

Returns
Type Description
IGraph
Remarks

Graphs returned from this method must be modifiable and the Dataset must guarantee that when it is Flushed or Disposed of that any changes to the Graph are persisted.

Exceptions
Type Condition
NotSupportedException

May be thrown if the Dataset is immutable i.e. Updates not supported.

| Edit this page View Source

HasGraph(Uri)

Gets whether a Graph with the given URI is the Dataset.

Declaration
[Obsolete("Replaced by HasGraph(IRefNode)")]
bool HasGraph(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

Returns
Type Description
bool
| Edit this page View Source

HasGraph(IRefNode)

Gets whether a Graph with the given name is the Dataset.

Declaration
bool HasGraph(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph name.

Returns
Type Description
bool
| Edit this page View Source

RemoveGraph(Uri)

Removes a Graph from the Dataset.

Declaration
[Obsolete("Replaced by RemoveGraph(IRefNode)")]
bool RemoveGraph(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

Returns
Type Description
bool
Exceptions
Type Condition
NotSupportedException

May be thrown if the Dataset is immutable i.e. Updates not supported.

NotSupportedException

May be thrown if the Dataset is immutable.

| Edit this page View Source

RemoveGraph(IRefNode)

Removes a Graph from the Dataset.

Declaration
bool RemoveGraph(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph name.

Returns
Type Description
bool
Exceptions
Type Condition
NotSupportedException

May be thrown if the Dataset is immutable i.e. Updates not supported.

| Edit this page View Source

ResetActiveGraph()

Resets the Active Graph to the previous Active Graph.

Declaration
void ResetActiveGraph()
| Edit this page View Source

ResetDefaultGraph()

Resets the Default Graph to the previous Default Graph.

Declaration
void ResetDefaultGraph()
| Edit this page View Source

SetActiveGraph(IEnumerable<Uri>)

Sets the Active Graph to be the merge of the Graphs with the given URIs.

Declaration
[Obsolete("Replaced by SetActiveGraph(IList<IRefNode>)")]
void SetActiveGraph(IEnumerable<Uri> graphUris)
Parameters
Type Name Description
IEnumerable<Uri> graphUris

Graph URIs.

| Edit this page View Source

SetActiveGraph(IList<IRefNode>)

Sets the active graph to be the union of the graphs with the given names.

Declaration
void SetActiveGraph(IList<IRefNode> graphNames)
Parameters
Type Name Description
IList<IRefNode> graphNames
| Edit this page View Source

SetActiveGraph(Uri)

Sets the Active Graph to be the Graph with the given URI.

Declaration
[Obsolete("Replaced by SetActiveGraph(IRefNode)")]
void SetActiveGraph(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

| Edit this page View Source

SetActiveGraph(IRefNode)

Sets the active graph to be the graph with the given name.

Declaration
void SetActiveGraph(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph name.

| Edit this page View Source

SetDefaultGraph(IEnumerable<Uri>)

Sets the Default Graph to be the merge of the Graphs with the given URIs.

Declaration
[Obsolete("Replaced by SetDefaultGraph(IList<IRefNode>)")]
void SetDefaultGraph(IEnumerable<Uri> graphUris)
Parameters
Type Name Description
IEnumerable<Uri> graphUris

Graph URIs.

| Edit this page View Source

SetDefaultGraph(IList<IRefNode>)

Sets the default graph to be the union of the graphs with the given names.

Declaration
void SetDefaultGraph(IList<IRefNode> graphNames)
Parameters
Type Name Description
IList<IRefNode> graphNames

Graph names.

| Edit this page View Source

SetDefaultGraph(Uri)

Sets the Default Graph to be the Graph with the given URI.

Declaration
[Obsolete("Replaced by SetDefaultGraph(IRefNode)")]
void SetDefaultGraph(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

| Edit this page View Source

SetDefaultGraph(IRefNode)

Sets the default graph to be the graph with the given name.

Declaration
void SetDefaultGraph(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Properties
    • ActiveGraphNames
    • ActiveGraphUris
    • DefaultGraphNames
    • DefaultGraphUris
    • GraphNames
    • GraphUris
    • Graphs
    • HasTriples
    • this[Uri]
    • this[IRefNode]
    • QuotedTriples
    • Triples
    • UsesUnionDefaultGraph
  • Methods
    • AddGraph(IGraph)
    • ContainsQuotedTriple(Triple)
    • ContainsTriple(Triple)
    • Discard()
    • Flush()
    • GetModifiableGraph(Uri)
    • GetModifiableGraph(IRefNode)
    • HasGraph(Uri)
    • HasGraph(IRefNode)
    • RemoveGraph(Uri)
    • RemoveGraph(IRefNode)
    • ResetActiveGraph()
    • ResetDefaultGraph()
    • SetActiveGraph(IEnumerable<Uri>)
    • SetActiveGraph(IList<IRefNode>)
    • SetActiveGraph(Uri)
    • SetActiveGraph(IRefNode)
    • SetDefaultGraph(IEnumerable<Uri>)
    • SetDefaultGraph(IList<IRefNode>)
    • SetDefaultGraph(Uri)
    • SetDefaultGraph(IRefNode)
  • Extension Methods
Back to top Generated by DocFX