Show / Hide Table of Contents

Class WrapperTripleStore

Abstract decorator for Triple Stores to make it easier to add new functionality on top of existing implementations.

Inheritance
object
WrapperTripleStore
Implements
ITripleStore
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class WrapperTripleStore : ITripleStore, IDisposable

Constructors

| Edit this page View Source

WrapperTripleStore(ITripleStore)

Creates a new triple store decorator around the given ITripleStore instance.

Declaration
public WrapperTripleStore(ITripleStore store)
Parameters
Type Name Description
ITripleStore store

Triple Store.

Fields

| Edit this page View Source

_store

Underlying store.

Declaration
protected readonly ITripleStore _store
Field Value
Type Description
ITripleStore

Properties

| Edit this page View Source

Graphs

Gets the Graphs of the store.

Declaration
public virtual BaseGraphCollection Graphs { get; }
Property Value
Type Description
BaseGraphCollection
| Edit this page View Source

IsEmpty

Gets whether the store is empty.

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

this[Uri]

Gets a Graph from the store.

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

Graph URI.

Property Value
Type Description
IGraph
| Edit this page View Source

this[IRefNode?]

Gets a graph from the triple store.

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

The name of the graph to be retrieved. May be null to retrieve the default (unnamed) graph.

Property Value
Type Description
IGraph
| Edit this page View Source

Quads

Gets all the Quads in the Triple Store which are currently loaded in memory.

Declaration
public virtual IEnumerable<Quad> Quads { get; }
Property Value
Type Description
IEnumerable<Quad>
Remarks

Since a Triple Store object may represent only a snapshot of the underlying Store evaluating this enumerator may only return some of the Quads in the Store and may depending on specific Triple Store return nothing.

| Edit this page View Source

Triples

Gets the triples of the store.

Declaration
public virtual IEnumerable<Triple> Triples { get; }
Property Value
Type Description
IEnumerable<Triple>
| Edit this page View Source

UriFactory

Get the preferred URI factory to use when creating URIs in this store.

Declaration
public virtual IUriFactory UriFactory { get; }
Property Value
Type Description
IUriFactory

Methods

| Edit this page View Source

Add(IGraph)

Adds a Graph to the store.

Declaration
public virtual bool Add(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

Returns
Type Description
bool
| Edit this page View Source

Add(IGraph, bool)

Adds a Graph to the store.

Declaration
public virtual bool Add(IGraph g, bool mergeIfExists)
Parameters
Type Name Description
IGraph g

Graph.

bool mergeIfExists

Whether to merge with an existing graph with the same URI.

Returns
Type Description
bool
| Edit this page View Source

Add(IRefNode?)

Adds an empty graph with the specified name to the triple store.

Declaration
public virtual bool Add(IRefNode? graphName)
Parameters
Type Name Description
IRefNode graphName
Returns
Type Description
bool

True if a new graph was added, false otherwise.

| Edit this page View Source

AddFromUri(Uri)

Adds a Graph to the store from a URI.

Declaration
public virtual bool AddFromUri(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

Returns
Type Description
bool
| Edit this page View Source

AddFromUri(Uri, bool)

Adds a Graph to the store from a URI.

Declaration
public virtual bool AddFromUri(Uri graphUri, bool mergeIfExists)
Parameters
Type Name Description
Uri graphUri

Graph URI.

bool mergeIfExists

Whether to merge with an existing graph with the same URI.

Returns
Type Description
bool
| Edit this page View Source

AddFromUri(Uri, bool, Loader)

Adds a Graph to the store from a URI.

Declaration
public virtual bool AddFromUri(Uri graphUri, bool mergeIfExists, Loader loader)
Parameters
Type Name Description
Uri graphUri

Graph URI.

bool mergeIfExists

Whether to merge with an existing graph with the same URI.

Loader loader

The loader to use for retrieving and parsing the RDF data.

Returns
Type Description
bool
| Edit this page View Source

Assert(Quad)

Assert a quad in the triple store.

Declaration
public virtual void Assert(Quad quad)
Parameters
Type Name Description
Quad quad

The quad to be added.

Remarks

If the quad's graph is not currently in the triple store, a new graph will be added.

| Edit this page View Source

Dispose()

Disposes of the Triple Store.

Declaration
public virtual void Dispose()
| Edit this page View Source

GetQuads(INode?, INode?, INode?, IRefNode?, bool)

Return an enumeration of all quads in the store that match the specified subject, predicate, object and/or graph.

Declaration
public IEnumerable<Quad> GetQuads(INode? s = null, INode? p = null, INode? o = null, IRefNode? g = null, bool allGraphs = true)
Parameters
Type Name Description
INode s

The subject node to match. Null matches all subject nodes.

INode p

The predicate node to match. Null matches all predicate nodes.

INode o

The object node to match. Null matches all object nodes.

IRefNode g

The graph to match. Null matches all graphs if allGraphs is true, or only the unnamed graph is allGraphs is false.

bool allGraphs
Returns
Type Description
IEnumerable<Quad>
| Edit this page View Source

HasGraph(Uri)

Gets whether a Graph exists in the store.

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

Graph URI.

Returns
Type Description
bool
| Edit this page View Source

HasGraph(IRefNode?)

Checks whether the graph with the given name is in this triple store.

Declaration
public virtual bool HasGraph(IRefNode? graphName)
Parameters
Type Name Description
IRefNode graphName

The name of the graph to check for.

Returns
Type Description
bool

True if this store contains a graph with the specified name, false otherwise.

Remarks

Pass null forgraphName to check for the default (unnamed) graph.

| Edit this page View Source

OnGraphAdded(object, TripleStoreEventArgs)

Event Handler which handles the Graph Added event from the underlying Graph Collection and raises the Triple Store's Graph Added event.

Declaration
protected virtual void OnGraphAdded(object sender, TripleStoreEventArgs args)
Parameters
Type Name Description
object sender

Sender.

TripleStoreEventArgs args

Graph Event Arguments.

Remarks

Override this method if your Triple Store implementation wishes to take additional actions when a Graph is added to the Store.

| Edit this page View Source

OnGraphChanged(object, TripleStoreEventArgs)

Event Handler which handles the Changed event of the contained Graphs by raising the Triple Store's Graph Changed event.

Declaration
protected virtual void OnGraphChanged(object sender, TripleStoreEventArgs args)
Parameters
Type Name Description
object sender

Sender.

TripleStoreEventArgs args

Graph Event Arguments.

| Edit this page View Source

OnGraphCleared(object, TripleStoreEventArgs)

Event Handler which handles the Cleared event of the contained Graphs by raising the Triple Stores's Graph Cleared event.

Declaration
protected virtual void OnGraphCleared(object sender, TripleStoreEventArgs args)
Parameters
Type Name Description
object sender

Sender.

TripleStoreEventArgs args

Graph Event Arguments.

| Edit this page View Source

OnGraphMerged(object, TripleStoreEventArgs)

Event Handler which handles the Merged event of the contained Graphs by raising the Triple Store's Graph Merged event.

Declaration
protected virtual void OnGraphMerged(object sender, TripleStoreEventArgs args)
Parameters
Type Name Description
object sender

Sender.

TripleStoreEventArgs args

Graph Event Arguments.

| Edit this page View Source

OnGraphRemoved(object, TripleStoreEventArgs)

Event Handler which handles the Graph Removed event from the underlying Graph Collection and raises the Triple Stores's Graph Removed event.

Declaration
protected virtual void OnGraphRemoved(object sender, TripleStoreEventArgs args)
Parameters
Type Name Description
object sender

Sender.

TripleStoreEventArgs args

Graph Event Arguments.

| Edit this page View Source

RaiseGraphAdded(GraphEventArgs)

Helper method for raising the Graph Added event manually.

Declaration
protected void RaiseGraphAdded(GraphEventArgs args)
Parameters
Type Name Description
GraphEventArgs args

Graph Event Arguments.

| Edit this page View Source

RaiseGraphAdded(IGraph)

Helper method for raising the Graph Added event manually.

Declaration
protected void RaiseGraphAdded(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

| Edit this page View Source

RaiseGraphChanged(GraphEventArgs)

Helper method for raising the Graph Changed event manually.

Declaration
protected void RaiseGraphChanged(GraphEventArgs args)
Parameters
Type Name Description
GraphEventArgs args

Graph Event Arguments.

| Edit this page View Source

RaiseGraphChanged(IGraph)

Helper method for raising the Graph Changed event manually.

Declaration
protected void RaiseGraphChanged(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

| Edit this page View Source

RaiseGraphCleared(GraphEventArgs)

Helper method for raising the Graph Cleared event manually.

Declaration
protected void RaiseGraphCleared(GraphEventArgs args)
Parameters
Type Name Description
GraphEventArgs args

Graph Event Arguments.

| Edit this page View Source

RaiseGraphMerged(GraphEventArgs)

Helper method for raising the Graph Merged event manually.

Declaration
protected void RaiseGraphMerged(GraphEventArgs args)
Parameters
Type Name Description
GraphEventArgs args

Graph Event Arguments.

| Edit this page View Source

RaiseGraphRemoved(GraphEventArgs)

Helper method for raising the Graph Removed event manually.

Declaration
protected void RaiseGraphRemoved(GraphEventArgs args)
Parameters
Type Name Description
GraphEventArgs args

Graph Event Arguments.

| Edit this page View Source

RaiseGraphRemoved(IGraph)

Helper method for raising the Graph Removed event manually.

Declaration
protected void RaiseGraphRemoved(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

| Edit this page View Source

Remove(Uri?)

Removes a Graph from the store.

Declaration
[Obsolete("Replaced by Remove(IRefNode)")]
public virtual bool Remove(Uri? graphUri)
Parameters
Type Name Description
Uri graphUri

Graph URI.

Returns
Type Description
bool
| Edit this page View Source

Remove(IRefNode?)

Removes a graph from the triple store.

Declaration
public virtual bool Remove(IRefNode? graphName)
Parameters
Type Name Description
IRefNode graphName

The name of the graph to remove.

Returns
Type Description
bool

True if the operation removed a graph, false if no matching graph was found to remove.

| Edit this page View Source

Retract(Quad)

Remove a quad from the triple store.

Declaration
public virtual void Retract(Quad quad)
Parameters
Type Name Description
Quad quad

The quad to be removed.

Remarks

If the quad's graph is not currently in the triple store, this operation will make no modification to the triple store. Otherwise it will invoke the Retract method on the graph.

Events

| Edit this page View Source

GraphAdded

Event which is raised when a graph is added

Declaration
public event TripleStoreEventHandler? GraphAdded
Event Type
Type Description
TripleStoreEventHandler
| Edit this page View Source

GraphChanged

Event which is raised when a graph is changed

Declaration
public event TripleStoreEventHandler? GraphChanged
Event Type
Type Description
TripleStoreEventHandler
| Edit this page View Source

GraphCleared

Event which is raised when a graph is cleared

Declaration
public event TripleStoreEventHandler? GraphCleared
Event Type
Type Description
TripleStoreEventHandler
| Edit this page View Source

GraphMerged

Event which is raised when a graph is merged

Declaration
public event TripleStoreEventHandler? GraphMerged
Event Type
Type Description
TripleStoreEventHandler
| Edit this page View Source

GraphRemoved

Events which is raised when a graph is removed

Declaration
public event TripleStoreEventHandler? GraphRemoved
Event Type
Type Description
TripleStoreEventHandler

Implements

ITripleStore
IDisposable

Extension Methods

Extensions.ToSafeString(object)
TripleStoreExtensions.LoadFromEmbeddedResource(ITripleStore, string)
TripleStoreExtensions.LoadFromEmbeddedResource(ITripleStore, string, IStoreReader)
TripleStoreExtensions.LoadFromFile(ITripleStore, string)
TripleStoreExtensions.LoadFromFile(ITripleStore, string, IStoreReader)
TripleStoreExtensions.LoadFromString(ITripleStore, string)
TripleStoreExtensions.LoadFromString(ITripleStore, string, IStoreReader)
TripleStoreExtensions.LoadFromUri(ITripleStore, Uri)
TripleStoreExtensions.LoadFromUri(ITripleStore, Uri, IStoreReader)
TripleStoreExtensions.LoadFromUri(ITripleStore, Uri, IStoreReader, Loader)
TripleStoreExtensions.SaveToFile(ITripleStore, string)
TripleStoreExtensions.SaveToFile(ITripleStore, string, IStoreWriter)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • WrapperTripleStore(ITripleStore)
  • Fields
    • _store
  • Properties
    • Graphs
    • IsEmpty
    • this[Uri]
    • this[IRefNode?]
    • Quads
    • Triples
    • UriFactory
  • Methods
    • Add(IGraph)
    • Add(IGraph, bool)
    • Add(IRefNode?)
    • AddFromUri(Uri)
    • AddFromUri(Uri, bool)
    • AddFromUri(Uri, bool, Loader)
    • Assert(Quad)
    • Dispose()
    • GetQuads(INode?, INode?, INode?, IRefNode?, bool)
    • HasGraph(Uri)
    • HasGraph(IRefNode?)
    • OnGraphAdded(object, TripleStoreEventArgs)
    • OnGraphChanged(object, TripleStoreEventArgs)
    • OnGraphCleared(object, TripleStoreEventArgs)
    • OnGraphMerged(object, TripleStoreEventArgs)
    • OnGraphRemoved(object, TripleStoreEventArgs)
    • RaiseGraphAdded(GraphEventArgs)
    • RaiseGraphAdded(IGraph)
    • RaiseGraphChanged(GraphEventArgs)
    • RaiseGraphChanged(IGraph)
    • RaiseGraphCleared(GraphEventArgs)
    • RaiseGraphMerged(GraphEventArgs)
    • RaiseGraphRemoved(GraphEventArgs)
    • RaiseGraphRemoved(IGraph)
    • Remove(Uri?)
    • Remove(IRefNode?)
    • Retract(Quad)
  • Events
    • GraphAdded
    • GraphChanged
    • GraphCleared
    • GraphMerged
    • GraphRemoved
  • Implements
  • Extension Methods
Back to top Generated by DocFX