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 IStorageProvider allowing it to be used with any of the general classes that support this interface as well as the Virtuoso specific classes.
This class supports user-controlled transactions via to ITransactionalStorage interface. Calls to methods outside of a user-controlled transaction will take place in their own transaction which will be auto-committed on success if required.
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 UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>) method which deal with how insertion and deletion of triples containing blank nodes into existing graphs operates.
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: SaveGraph(IGraph),
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.String | 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.String | server | Server. |
System.Int32 | port | Port. |
System.String | db | Database Name. |
System.String | user | Username. |
System.String | password | Password. |
System.Int32 | 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.String | db | Database Name. |
System.String | user | Username. |
System.String | password | Password. |
System.Int32 | 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.String | 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 |
---|---|---|
IRdfHandler | handler | Handler to load with. |
System.String | 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.String |
Update(String)
Processes a SPARQL Update command against the underlying Store.
Declaration
public override void Update(string sparqlUpdate)
Parameters
Type | Name | Description |
---|---|---|
System.String | sparqlUpdate | SPARQL Update. |