Class VirtuosoConnector
A connector for accessing the native Virtuoso Quad Store.
Implements
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.Data.Virtuoso.dll
Syntax
public class VirtuosoConnector : VirtuosoConnectorBase, IAsyncStorageProvider, ITransactionalStorage, IUpdateableStorage, IQueryableStorage, IStorageProvider, IStorageCapabilities, IConfigurationSerializable
Remarks
This class implements IStorage
This class supports user-controlled transactions via to ITransactional
Although this class takes a Database Name to ensure compatibility with any Virtuoso installation (i.e. this allows for the Native Quad Store to be in a non-standard database) generally you should always specify DB as the Database Name parameter.
Virtuoso automatically assigns IDs to Blank Nodes input into it, these IDs are not based on
the actual Blank Node ID so inputting a Blank Node with the same ID multiple times will result in multiple
Nodes being created in Virtuoso. This means that data containing Blank Nodes which is stored to Virtuoso and
then retrieved will have different Blank Node IDs to those input. In addition there is no guarantee that when
you save a Graph containing Blank Nodes into Virtuoso that retrieving it will give the same Blank Node IDs
even if the Graph being saved was originally retrieved from Virtuoso. Finally please see the remarks on the
Update
You can use a null Uri or an empty String as a Uri to indicate that operations should affect the Default Graph. Where the argument is only a Graph a null Name property indicates that the Graph affects the Default Graph.
The bulk update operations on a graph: Save
Constructors
| Improve this Doc View SourceVirtuosoConnector(String)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoConnector(string connectionString)
Parameters
| Type | Name | Description |
|---|---|---|
| System. |
connectionString | Connection String. |
Remarks
Allows the end user to specify a customized connection string.
VirtuosoConnector(String, Int32, String, String, String, Int32)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoConnector(string server, int port, string db, string user, string password, int timeout = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| System. |
server | Server. |
| System. |
port | Port. |
| System. |
db | Database Name. |
| System. |
user | Username. |
| System. |
password | Password. |
| System. |
timeout | Connection Timeout in Seconds. |
Remarks
Timeouts less than equal to zero are ignored and treated as using the default timeout which is dictated by the underlying Virtuoso ADO.Net provider.
VirtuosoConnector(String, String, String, Int32)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoConnector(string db, string user, string password, int timeout = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| System. |
db | Database Name. |
| System. |
user | Username. |
| System. |
password | Password. |
| System. |
timeout | Connection Timeout in Seconds. |
Methods
| Improve this Doc View SourceBegin()
Begins a transaction.
Declaration
public void Begin()
Commit()
Commits a transaction.
Declaration
public void Commit()
Dispose()
Disposes of the Store.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceLoadGraph(IGraph, String)
Loads a Graph from the Store.
Declaration
public override void LoadGraph(IGraph g, string graphUri)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph | g | Graph to load into. |
| System. |
graphUri | URI of the Graph to load. |
Overrides
Remarks
If the Graph being loaded into is Empty then it's Base Uri should become the Uri of the Graph being loaded, otherwise it should be merged into the existing non-empty Graph whose Base Uri should be unaffected.
Behaviour of this method with regards to non-existent Graphs is up to the implementor, an empty Graph may be returned or an error thrown. Implementors should state in the XML comments for their implementation what behaviour is implemented.
LoadGraph(IGraph, Uri)
Declaration
public override void LoadGraph(IGraph g, Uri graphUri)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph | g | |
| Uri | graphUri |
LoadGraph(IRdfHandler, String)
Loads a Graph from the Store.
Declaration
public override void LoadGraph(IRdfHandler handler, string graphUri)
Parameters
| Type | Name | Description |
|---|---|---|
| IRdf |
handler | Handler to load with. |
| System. |
graphUri | URI of the Graph to load. |
Overrides
Remarks
Behaviour of this method with regards to non-existent Graphs is up to the implementor, an empty Graph may be returned or an error thrown. Implementors should state in the XML comments for their implementation what behaviour is implemented.
Rollback()
Rolls back a transaction.
Declaration
public void Rollback()
SaveGraph(IGraph)
Saves a Graph to the Store.
Declaration
public override void SaveGraph(IGraph g)
Parameters
| Type | Name | Description |
|---|---|---|
| IGraph | g | Graph to save. |
Overrides
Remarks
This implementation of this method uses Virtuoso's row auto-commit feature to allow loading large graphs. This means that the graph will be committed to the Virtuoso server, regardless of the use of Begin() and Commit() or Rollback() to control the transaction.
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System. |
Update(String)
Processes a SPARQL Update command against the underlying Store.
Declaration
public override void Update(string sparqlUpdate)
Parameters
| Type | Name | Description |
|---|---|---|
| System. |
sparqlUpdate | SPARQL Update. |