Interface IVirtualRdfProvider<TNodeID, TGraphID>
A Virtual RDF Provider is a provider that transforms materialised values into virtual ID values. These virtual values can be used to do much faster term equality checking and to minimise memory usage when accessing out of memory data.
Namespace: VDS.RDF.Storage.Virtualisation
Assembly: dotNetRdf.dll
Syntax
public interface IVirtualRdfProvider<TNodeID, TGraphID>
Type Parameters
| Name | Description |
|---|---|
| TNodeID | Node ID Type. |
| TGraphID | Graph ID Type. |
Remarks
An implementation of this is typically in addition to a more general RDF store implementation (such as an IStorageProvider) and was originally designed and intended for use in creating ISparqlDataset instances which allow out of memory data to be queried more efficiently.
It is expected that most implementations will use a cache to ensure that repeated transformations are as fast as possible.
Important Note re: Blank Nodes
In order for code that uses this class to function correctly it must be ensured that IDs issued for Blank Nodes are graph scoped, as such a specific method for converting Blank Nodes into Virtual Node IDs is given.
Properties
| Edit this page View SourceNullID
Gets the Node ID that is used to indicate that a Node does not exist in the underlying storage.
Declaration
TNodeID NullID { get; }
Property Value
| Type | Description |
|---|---|
| TNodeID |
Methods
| Edit this page View SourceGetBlankNodeID(IBlankNode)
Given a Blank Node returns a Graph scoped Node ID.
Declaration
TNodeID GetBlankNodeID(IBlankNode value)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlankNode | value | Blank Node. |
Returns
| Type | Description |
|---|---|
| TNodeID |
Remarks
Should function as equivalent to the two argument version with the createIfNotExists parameter set to false.
GetBlankNodeID(IBlankNode, bool)
Given a Blank Node returns a Graph scoped Node ID.
Declaration
TNodeID GetBlankNodeID(IBlankNode value, bool createIfNotExists)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlankNode | value | Blank Node. |
| bool | createIfNotExists | Determines whether to create a new Node ID if there is not already one for the given value. |
Returns
| Type | Description |
|---|---|
| TNodeID |
GetGraphID(Uri)
Gets the Graph ID for a Graph URI.
Declaration
TGraphID GetGraphID(Uri graphUri)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | graphUri | Graph URI. |
Returns
| Type | Description |
|---|---|
| TGraphID |
Remarks
Should function as equivalent to the two argument version with the createIfNotExists parameter set to false.
GetGraphID(Uri, bool)
Gets the Graph ID for a Graph URI.
Declaration
TGraphID GetGraphID(Uri graphUri, bool createIfNotExists)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | graphUri | Graph URI. |
| bool | createIfNotExists | Determines whether to create a new Graph ID if there is not already one for the given Graph URI. |
Returns
| Type | Description |
|---|---|
| TGraphID |
GetGraphID(IGraph)
Gets the Graph ID for a Graph.
Declaration
TGraphID GetGraphID(IGraph g)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph | g | Graph. |
Returns
| Type | Description |
|---|---|
| TGraphID |
Remarks
Should function as equivalent to the two argument version with the createIfNotExists parameter set to false.
GetGraphID(IGraph, bool)
Gets the Graph ID for a Graph creating it if necessary.
Declaration
TGraphID GetGraphID(IGraph g, bool createIfNotExists)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph | g | Graph. |
| bool | createIfNotExists | Determines whether to create a new Graph ID if there is not already one for the given Graph. |
Returns
| Type | Description |
|---|---|
| TGraphID |
GetGraphUri(TGraphID)
Given a Graph ID returns the value of the Graph URI.
Declaration
Uri GetGraphUri(TGraphID id)
Parameters
| Type | Name | Description |
|---|---|---|
| TGraphID | id | Graph ID. |
Returns
| Type | Description |
|---|---|
| Uri |
GetID(INode)
Given a non-blank Node returns the Node ID.
Declaration
TNodeID GetID(INode value)
Parameters
| Type | Name | Description |
|---|---|---|
| INode | value | Node. |
Returns
| Type | Description |
|---|---|
| TNodeID |
Remarks
Should function as equivalent to the two argument version with the createIfNotExists parameter set to false.
GetID(INode, bool)
Given a non-blank Node returns the Node ID.
Declaration
TNodeID GetID(INode value, bool createIfNotExists)
Parameters
| Type | Name | Description |
|---|---|---|
| INode | value | Node. |
| bool | createIfNotExists | Determines whether to create a new Node ID if there is not already one for the given value. |
Returns
| Type | Description |
|---|---|
| TNodeID |
GetValue(IGraph, TNodeID)
Given a Node ID returns the materialised value in the given Graph.
Declaration
INode GetValue(IGraph g, TNodeID id)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph | g | Graph to create the Node in. |
| TNodeID | id | Node ID. |
Returns
| Type | Description |
|---|---|
| INode |
LoadGraphVirtual(IGraph, Uri)
Loads a Graph creating all the Triples with virtual node values.
Declaration
void LoadGraphVirtual(IGraph g, Uri graphUri)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph | g | Graph to load into. |
| Uri | graphUri | URI of the Graph to load. |