Class BaseDataset
Abstract Base Class for Datasets which provides implementation of Active and Default Graph management.
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF.Query.Datasets
Assembly: dotNetRDF.dll
Syntax
public abstract class BaseDataset : ISparqlDataset
Constructors
| Improve this Doc View SourceBaseDataset()
Creates a new Dataset.
Declaration
public BaseDataset()
BaseDataset(Boolean)
Creates a new Dataset with the given Union Default Graph setting.
Declaration
public BaseDataset(bool unionDefaultGraph)
Parameters
Type | Name | Description |
---|---|---|
System. |
unionDefaultGraph | Whether to use a Union Default Graph. |
BaseDataset(Uri)
Creates a new Dataset with a fixed Default Graph and without a Union Default Graph.
Declaration
public BaseDataset(Uri defaultGraphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
defaultGraphUri |
Properties
| Improve this Doc View SourceActiveGraphUris
Gets the Active Graph URIs.
Declaration
public IEnumerable<Uri> ActiveGraphUris { get; }
Property Value
Type | Description |
---|---|
System. |
DefaultGraphUris
Gets the Default Graph URIs.
Declaration
public IEnumerable<Uri> DefaultGraphUris { get; }
Property Value
Type | Description |
---|---|
System. |
Graphs
Gets all the Graphs in the Dataset.
Declaration
public abstract IEnumerable<IGraph> Graphs { get; }
Property Value
Type | Description |
---|---|
System. |
GraphUris
Gets all the URIs of Graphs in the Dataset.
Declaration
public abstract IEnumerable<Uri> GraphUris { get; }
Property Value
Type | Description |
---|---|
System. |
HasTriples
Gets whether the Dataset has any Triples.
Declaration
public virtual bool HasTriples { get; }
Property Value
Type | Description |
---|---|
System. |
InternalDefaultGraph
Gets a reference to the actual IGraph that is currently treated as the default graph.
Declaration
protected IGraph InternalDefaultGraph { get; }
Property Value
Type | Description |
---|---|
IGraph |
Item[Uri]
Gets the Graph with the given URI from the Dataset.
Declaration
public virtual IGraph this[Uri graphUri] { get; }
Parameters
Type | Name | Description |
---|---|---|
System. |
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 Get
Triples
Gets all the Triples in the Dataset.
Declaration
public IEnumerable<Triple> Triples { get; }
Property Value
Type | Description |
---|---|
System. |
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
public bool UsesUnionDefaultGraph { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceAddGraph(IGraph)
Adds a Graph to the Dataset.
Declaration
public abstract bool AddGraph(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph. |
Returns
Type | Description |
---|---|
System. |
ContainsTriple(Triple)
Gets whether the Dataset contains a specific Triple.
Declaration
public bool ContainsTriple(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Returns
Type | Description |
---|---|
System. |
ContainsTripleInternal(Triple)
Determines whether the Dataset contains a specific Triple.
Declaration
protected abstract bool ContainsTripleInternal(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple to search for. |
Returns
Type | Description |
---|---|
System. |
Discard()
Ensures that any changes to the Dataset (if any) are discarded.
Declaration
public abstract void Discard()
Flush()
Ensures that any changes to the Dataset (if any) are flushed to the underlying Storage.
Declaration
public abstract void Flush()
GetAllTriples()
Abstract method that concrete implementations must implement to return an enumerable of all the Triples in the Dataset.
Declaration
protected abstract IEnumerable<Triple> GetAllTriples()
Returns
Type | Description |
---|---|
System. |
GetGraphInternal(Uri)
Gets the given Graph from the Dataset.
Declaration
protected abstract IGraph GetGraphInternal(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Graph URI. |
Returns
Type | Description |
---|---|
IGraph |
GetModifiableGraph(Uri)
Gets the Graph with the given URI from the Dataset.
Declaration
public abstract IGraph GetModifiableGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
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.
GetTriplesWithObject(INode)
Gets all the Triples in the Dataset with the given Object.
Declaration
public IEnumerable<Triple> GetTriplesWithObject(INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | obj | Object. |
Returns
Type | Description |
---|---|
System. |
GetTriplesWithObjectInternal(INode)
Gets all the Triples in the Dataset with the given Object.
Declaration
protected abstract IEnumerable<Triple> GetTriplesWithObjectInternal(INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | obj | Object. |
Returns
Type | Description |
---|---|
System. |
GetTriplesWithPredicate(INode)
Gets all the Triples in the Dataset with the given Predicate.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicate(INode pred)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
Returns
Type | Description |
---|---|
System. |
GetTriplesWithPredicateInternal(INode)
Gets all the Triples in the Dataset with the given Predicate.
Declaration
protected abstract IEnumerable<Triple> GetTriplesWithPredicateInternal(INode pred)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
Returns
Type | Description |
---|---|
System. |
GetTriplesWithPredicateObject(INode, INode)
Gets all the Triples in the Dataset with the given Predicate and Object.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicateObject(INode pred, INode obj)
Parameters
Returns
Type | Description |
---|---|
System. |
GetTriplesWithPredicateObjectInternal(INode, INode)
Gets all the Triples in the Dataset with the given Predicate and Object.
Declaration
protected abstract IEnumerable<Triple> GetTriplesWithPredicateObjectInternal(INode pred, INode obj)
Parameters
Returns
Type | Description |
---|---|
System. |
GetTriplesWithSubject(INode)
Gets all the Triples in the Dataset with the given Subject.
Declaration
public IEnumerable<Triple> GetTriplesWithSubject(INode subj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
Returns
Type | Description |
---|---|
System. |
GetTriplesWithSubjectInternal(INode)
Gets all the Triples in the Dataset with the given Subject.
Declaration
protected abstract IEnumerable<Triple> GetTriplesWithSubjectInternal(INode subj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
Returns
Type | Description |
---|---|
System. |
GetTriplesWithSubjectObject(INode, INode)
Gets all the Triples in the Dataset with the given Subject and Object.
Declaration
public IEnumerable<Triple> GetTriplesWithSubjectObject(INode subj, INode obj)
Parameters
Returns
Type | Description |
---|---|
System. |
GetTriplesWithSubjectObjectInternal(INode, INode)
Gets all the Triples in the Dataset with the given Subject and Object.
Declaration
protected abstract IEnumerable<Triple> GetTriplesWithSubjectObjectInternal(INode subj, INode obj)
Parameters
Returns
Type | Description |
---|---|
System. |
GetTriplesWithSubjectPredicate(INode, INode)
Gets all the Triples in the Dataset with the given Subject and Predicate.
Declaration
public IEnumerable<Triple> GetTriplesWithSubjectPredicate(INode subj, INode pred)
Parameters
Returns
Type | Description |
---|---|
System. |
GetTriplesWithSubjectPredicateInternal(INode, INode)
Gets all the Triples in the Dataset with the given Subject and Predicate.
Declaration
protected abstract IEnumerable<Triple> GetTriplesWithSubjectPredicateInternal(INode subj, INode pred)
Parameters
Returns
Type | Description |
---|---|
System. |
HasGraph(Uri)
Gets whether a Graph with the given URI is the Dataset.
Declaration
public bool HasGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Graph URI. |
Returns
Type | Description |
---|---|
System. |
HasGraphInternal(Uri)
Determines whether a given Graph exists in the Dataset.
Declaration
protected abstract bool HasGraphInternal(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Graph URI. |
Returns
Type | Description |
---|---|
System. |
RemoveGraph(Uri)
Removes a Graph from the Dataset.
Declaration
public virtual bool RemoveGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Graph URI. |
Returns
Type | Description |
---|---|
System. |
RemoveGraphInternal(Uri)
Removes a Graph from the Dataset.
Declaration
protected abstract bool RemoveGraphInternal(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Graph URI. |
Returns
Type | Description |
---|---|
System. |
ResetActiveGraph()
Sets the Active Graph for the SPARQL query to be the previous Active Graph.
Declaration
public void ResetActiveGraph()
ResetDefaultGraph()
Sets the Default Graph for the SPARQL Query to be the previous Default Graph.
Declaration
public void ResetDefaultGraph()
SetActiveGraph(IEnumerable<Uri>)
Sets the Active Graph for the SPARQL query.
Declaration
public void SetActiveGraph(IEnumerable<Uri> graphUris)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUris | URIs of the Graphs which form the Active Graph. |
Remarks
Helper function used primarily in the execution of GRAPH Clauses.
|
Improve this Doc
View Source
SetActiveGraph(Uri)
Sets the Active Graph for the SPARQL query.
Declaration
public void SetActiveGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Uri of the Active Graph. |
Remarks
Helper function used primarily in the execution of GRAPH Clauses.
|
Improve this Doc
View Source
SetDefaultGraph(IEnumerable<Uri>)
Sets the Default Graph.
Declaration
public void SetDefaultGraph(IEnumerable<Uri> graphUris)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUris | Graph URIs. |
SetDefaultGraph(Uri)
Sets the Default Graph.
Declaration
public void SetDefaultGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System. |
graphUri | Graph URI. |