Class WrapperDataset
An abstract dataset wrapper that can be used to wrap another dataset and just modify some functionality i.e. provides a decorator over an existing dataset.
Inherited Members
Namespace: VDS.RDF.Query.Datasets
Assembly: dotNetRdf.dll
Syntax
public abstract class WrapperDataset : IConfigurationSerializable, IThreadSafeDataset, ISparqlDataset, ITripleIndex
Constructors
| Improve this Doc View SourceWrapperDataset(ISparqlDataset)
Creates a new wrapped dataset.
Declaration
protected WrapperDataset(ISparqlDataset dataset)
Parameters
Type | Name | Description |
---|---|---|
ISparqlDataset | dataset | Dataset. |
Fields
| Improve this Doc View Source_dataset
Underlying Dataset.
Declaration
protected ISparqlDataset _dataset
Field Value
Type | Description |
---|---|
ISparqlDataset |
Properties
| Improve this Doc View SourceActiveGraphNames
Gets the enumeration of the names of the graphs that currently make up the active graph.
Declaration
public virtual IEnumerable<IRefNode> ActiveGraphNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><IRefNode> |
ActiveGraphUris
Gets the Active Graph URIs.
Declaration
[Obsolete("Replaced by ActiveGraphNames")]
public virtual IEnumerable<Uri> ActiveGraphUris { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><System.Uri> |
DefaultGraphNames
Gets the enumeration of the names of the graphs that currently make up the default graph.
Declaration
public virtual IEnumerable<IRefNode> DefaultGraphNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><IRefNode> |
DefaultGraphUris
Gets the Default Graph URIs.
Declaration
[Obsolete("Replaced by DefaultGraphNames")]
public virtual IEnumerable<Uri> DefaultGraphUris { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><System.Uri> |
GraphNames
Gets an enumeration of the names of all graphs in the dataset.
Declaration
public virtual IEnumerable<IRefNode> GraphNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><IRefNode> |
Graphs
Gets the Graphs in the dataset.
Declaration
public virtual IEnumerable<IGraph> Graphs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><IGraph> |
GraphUris
Gets the URIs of Graphs in the dataset.
Declaration
[Obsolete("Replaced by GraphNames")]
public virtual IEnumerable<Uri> GraphUris { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><System.Uri> |
HasTriples
Gets whether the dataset has any triples.
Declaration
public virtual bool HasTriples { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
this[Uri]
Gets a Graph from the dataset.
Declaration
[Obsolete("Replaced by this[IRefNode]")]
public virtual IGraph this[Uri graphUri] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph URI. |
Property Value
Type | Description |
---|---|
IGraph |
this[IRefNode]
Gets the graph with the given name from the dataset.
Declaration
public virtual 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.
Lock
Gets the Lock used to ensure MRSW concurrency on the dataset when available.
Declaration
public ReaderWriterLockSlim Lock { get; }
Property Value
Type | Description |
---|---|
System.Threading.ReaderWriterLockSlim |
QuotedTriples
Gets all the quoted triples in teh dataset.
Declaration
public IEnumerable<Triple> QuotedTriples { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><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.
Triples
Gets all triples from the dataset.
Declaration
public virtual IEnumerable<Triple> Triples { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
UnderlyingDataset
Gets the underlying dataset.
Declaration
public ISparqlDataset UnderlyingDataset { get; }
Property Value
Type | Description |
---|---|
ISparqlDataset |
UsesUnionDefaultGraph
Gets whether the default graph is the union of all graphs.
Declaration
public virtual bool UsesUnionDefaultGraph { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceAddGraph(IGraph)
Adds a Graph to the dataset.
Declaration
public virtual bool AddGraph(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph. |
Returns
Type | Description |
---|---|
System.Boolean |
ContainsQuotedTriple(Triple)
Gets whether the dataset contains a specific quoted triple.
Declaration
public virtual bool ContainsQuotedTriple(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Returns
Type | Description |
---|---|
System.Boolean | True if the dataset contains |
ContainsTriple(Triple)
Gets whether the dataset contains a given triple.
Declaration
public virtual bool ContainsTriple(Triple t)
Parameters
Type | Name | Description |
---|---|---|
Triple | t | Triple. |
Returns
Type | Description |
---|---|
System.Boolean |
Discard()
Discards any changes to the dataset.
Declaration
public virtual void Discard()
Flush()
Flushes any changes to the dataset.
Declaration
public virtual void Flush()
GetModifiableGraph(Uri)
Gets a modifiable graph from the dataset.
Declaration
[Obsolete("Replaced by GetModifiableGraph(IRefNode)")]
public virtual IGraph GetModifiableGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph URI. |
Returns
Type | Description |
---|---|
IGraph |
GetModifiableGraph(IRefNode)
Gets the Graph with the given name from the Dataset.
Declaration
public virtual 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 |
---|---|
System.NotSupportedException | May be thrown if the Dataset is immutable i.e. Updates not supported. |
GetQuoted(Uri)
Selects all quoted triples which have a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetQuoted(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuoted(INode)
Selects all quoted triples which contain the given Node.
Declaration
public IEnumerable<Triple> GetQuoted(INode n)
Parameters
Type | Name | Description |
---|---|---|
INode | n | Node. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithObject(Uri)
Selects all quoted triples where the Object is a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetQuotedWithObject(Uri u)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | u | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithObject(INode)
Selects all quoted triples where the Object is a given Node.
Declaration
public IEnumerable<Triple> GetQuotedWithObject(INode n)
Parameters
Type | Name | Description |
---|---|---|
INode | n | Node. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithPredicate(Uri)
Selects all quoted triples where the Predicate is a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetQuotedWithPredicate(Uri u)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | u | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithPredicate(INode)
Selects all quoted triples where the Predicate is a given Node.
Declaration
public IEnumerable<Triple> GetQuotedWithPredicate(INode n)
Parameters
Type | Name | Description |
---|---|---|
INode | n | Node. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithPredicateObject(INode, INode)
Selects all quoted triples with the given Predicate and Object.
Declaration
public IEnumerable<Triple> GetQuotedWithPredicateObject(INode pred, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithSubject(Uri)
Selects all quoted triples where the Subject is a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetQuotedWithSubject(Uri u)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | u | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithSubject(INode)
Selects all quoted triples where the Subject is a given Node.
Declaration
public IEnumerable<Triple> GetQuotedWithSubject(INode n)
Parameters
Type | Name | Description |
---|---|---|
INode | n | Node. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithSubjectObject(INode, INode)
Selects all quoted triples with the given Subject and Object.
Declaration
public IEnumerable<Triple> GetQuotedWithSubjectObject(INode subj, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetQuotedWithSubjectPredicate(INode, INode)
Selects all quoted triples with the given Subject and Predicate.
Declaration
public IEnumerable<Triple> GetQuotedWithSubjectPredicate(INode subj, INode pred)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | pred | Predicate. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriples(Uri)
Selects all Triples which have a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetTriples(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriples(INode)
Selects all Triples which contain the given Node.
Declaration
public IEnumerable<Triple> GetTriples(INode n)
Parameters
Type | Name | Description |
---|---|---|
INode | n | Node. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithObject(Uri)
Selects all Triples where the Object is a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetTriplesWithObject(Uri u)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | u | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithObject(INode)
Gets triples with a given object.
Declaration
public virtual IEnumerable<Triple> GetTriplesWithObject(INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithPredicate(Uri)
Selects all Triples where the Predicate is a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicate(Uri u)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | u | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithPredicate(INode)
Gets triples with a given predicate.
Declaration
public virtual IEnumerable<Triple> GetTriplesWithPredicate(INode pred)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithPredicateObject(INode, INode)
Gets triples with a given predicate and object.
Declaration
public virtual IEnumerable<Triple> GetTriplesWithPredicateObject(INode pred, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | pred | Predicate. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithSubject(Uri)
Selects all Triples where the Subject is a Uri Node with the given Uri.
Declaration
public IEnumerable<Triple> GetTriplesWithSubject(Uri u)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | u | Uri. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithSubject(INode)
Gets triples with a given subject.
Declaration
public virtual IEnumerable<Triple> GetTriplesWithSubject(INode subj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithSubjectObject(INode, INode)
Gets triples with a given subject and object.
Declaration
public virtual IEnumerable<Triple> GetTriplesWithSubjectObject(INode subj, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
GetTriplesWithSubjectPredicate(INode, INode)
Gets triples with a given subject and predicate.
Declaration
public virtual IEnumerable<Triple> GetTriplesWithSubjectPredicate(INode subj, INode pred)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | pred | Predicate. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Triple> |
HasGraph(Uri)
Gets whether the dataset contains a given Graph.
Declaration
[Obsolete("Replaced by HasGraph(IRefNode)")]
public virtual bool HasGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph URI. |
Returns
Type | Description |
---|---|
System.Boolean |
HasGraph(IRefNode)
Gets whether a Graph with the given name is the Dataset.
Declaration
public virtual bool HasGraph(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName | Graph name. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveGraph(Uri)
Removes a Graph from the dataset.
Declaration
[Obsolete("Replaced by RemoveGraph(IRefNode)")]
public virtual bool RemoveGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph URI. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveGraph(IRefNode)
Removes a Graph from the Dataset.
Declaration
public virtual bool RemoveGraph(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName | Graph name. |
Returns
Type | Description |
---|---|
System.Boolean |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | May be thrown if the Dataset is immutable i.e. Updates not supported. |
ResetActiveGraph()
Resets the Active Graph.
Declaration
public virtual void ResetActiveGraph()
ResetDefaultGraph()
Resets the Default Graph.
Declaration
public virtual void ResetDefaultGraph()
SerializeConfiguration(ConfigurationSerializationContext)
Serializes the Configuration of the Dataset.
Declaration
public virtual void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationSerializationContext | context | Serialization Context. |
SetActiveGraph(IEnumerable<Uri>)
Sets the Active Graph for the dataset.
Declaration
[Obsolete("Replaced by SetActiveGraph(IList<IRefNode>)")]
public virtual void SetActiveGraph(IEnumerable<Uri> graphUris)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><System.Uri> | graphUris | Graph URIs. |
SetActiveGraph(IList<IRefNode>)
Sets the active graph to be the union of the graphs with the given names.
Declaration
public virtual void SetActiveGraph(IList<IRefNode> graphNames)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T><IRefNode> | graphNames |
SetActiveGraph(Uri)
Sets the Active Graph for the dataset.
Declaration
[Obsolete("Replaced by SetActiveGraph(IRefNode)")]
public virtual void SetActiveGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph URI. |
SetActiveGraph(IRefNode)
Sets the active graph to be the graph with the given name.
Declaration
public virtual void SetActiveGraph(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName | Graph name. |
SetDefaultGraph(IEnumerable<Uri>)
Sets the Default Graph for the dataset.
Declaration
[Obsolete("Replaced by SetDefaultGraph(IList<IRefNode>)")]
public virtual void SetDefaultGraph(IEnumerable<Uri> graphUris)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><System.Uri> | graphUris | Graph URIs. |
SetDefaultGraph(IList<IRefNode>)
Sets the default graph to be the union of the graphs with the given names.
Declaration
public virtual void SetDefaultGraph(IList<IRefNode> graphNames)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T><IRefNode> | graphNames | Graph names. |
SetDefaultGraph(Uri)
Sets the Default Graph for the dataset.
Declaration
[Obsolete("Replaced by SetDefaultGraph(IRefNode)")]
public virtual void SetDefaultGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph URI. |
SetDefaultGraph(IRefNode)
Sets the default graph to be the graph with the given name.
Declaration
public virtual void SetDefaultGraph(IRefNode graphName)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | graphName |