Click or drag to resize

ISparqlDataset Interface

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

Namespace:  VDS.RDF.Query.Datasets
Assembly:  dotNetRDF (in dotNetRDF.dll) Version:
Syntax
public interface ISparqlDataset

The ISparqlDataset type exposes the following members.

Properties
  NameDescription
Public propertyActiveGraphUris
Gets the enumeration of the Graph URIs that currently make up the active graph.
Public propertyDefaultGraphUris
Gets the enumeration of the Graph URIs that currently make up the default graph.
Public propertyGraphs
Gets all the Graphs in the Dataset.
Public propertyGraphUris
Gets all the URIs of Graphs in the Dataset.
Public propertyHasTriples
Gets whether the Dataset has any Triples.
Public propertyItem
Gets the Graph with the given URI from the Dataset.
Public propertyTriples
Gets all the Triples in the Dataset.
Public propertyUsesUnionDefaultGraph
Gets whether the Default Graph is treated as being the union of all Graphs in the dataset when no Default Graph is otherwise set.
Top
Methods
  NameDescription
Public methodAddGraph
Adds a Graph to the Dataset.
Public methodContainsTriple
Gets whether the Dataset contains a specific Triple.
Public methodDiscard
Ensures that any changes to the Dataset (if any) are discarded.
Public methodFlush
Ensures that any changes to the Dataset (if any) are flushed to the underlying Storage.
Public methodGetModifiableGraph
Gets the Graph with the given URI from the Dataset.
Public methodGetTriplesWithObject
Gets all the Triples in the Dataset with the given Object.
Public methodGetTriplesWithPredicate
Gets all the Triples in the Dataset with the given Predicate.
Public methodGetTriplesWithPredicateObject
Gets all the Triples in the Dataset with the given Predicate and Object.
Public methodGetTriplesWithSubject
Gets all the Triples in the Dataset with the given Subject.
Public methodGetTriplesWithSubjectObject
Gets all the Triples in the Dataset with the given Subject and Object.
Public methodGetTriplesWithSubjectPredicate
Gets all the Triples in the Dataset with the given Subject and Predicate.
Public methodHasGraph
Gets whether a Graph with the given URI is the Dataset.
Public methodRemoveGraph
Removes a Graph from the Dataset.
Public methodResetActiveGraph
Resets the Active Graph to the previous Active Graph.
Public methodResetDefaultGraph
Resets the Default Graph to the previous Default Graph.
Public methodSetActiveGraph(IEnumerableUri)
Sets the Active Graph to be the merge of the Graphs with the given URIs.
Public methodSetActiveGraph(Uri)
Sets the Active Graph to be the Graph with the given URI.
Public methodSetDefaultGraph(IEnumerableUri)
Sets the Default Graph to be the merge of the Graphs with the given URIs.
Public methodSetDefaultGraph(Uri)
Sets the Default Graph to be the Graph with the given URI.
Top
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.

See Also