Class VirtuosoManager
A Manager for accessing the Native Virtuoso Quad Store.
Implements
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.Data.Virtuoso.dll
Syntax
public class VirtuosoManager : VirtuosoConnectorBase, IAsyncStorageProvider, 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.
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
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.
Constructors
| Improve this Doc View SourceVirtuosoManager(String)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoManager(string connectionString)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Connection String. |
Remarks
Allows the end user to specify a customized connection string.
VirtuosoManager(String, Int32, String, String, String)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoManager(string server, int port, string db, string user, string password)
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. |
VirtuosoManager(String, Int32, String, String, String, Int32)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoManager(string server, int port, string db, string user, string password, int timeout)
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.
VirtuosoManager(String, String, String)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoManager(string db, string user, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | db | Database Name. |
System.String | user | Username. |
System.String | password | Password. |
Remarks
Assumes the Server is on the localhost and the port is the default installation port of 1111.
VirtuosoManager(String, String, String, Int32)
Creates a Manager for a Virtuoso Native Quad Store.
Declaration
public VirtuosoManager(string db, string user, string password, int timeout)
Parameters
Type | Name | Description |
---|---|---|
System.String | db | Database Name. |
System.String | user | Username. |
System.String | password | Password. |
System.Int32 | timeout | Connection Timeout in Seconds. |
Remarks
Assumes the Server is on the localhost and the port is the default installation port of 1111.
Methods
| Improve this Doc View SourceDispose()
Disposes of the Manager.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceLoadGraph(IGraph, String)
Loads a Graph from the Quad 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
| Improve this Doc View SourceLoadGraph(IGraph, Uri)
Loads a Graph from the Quad Store.
Declaration
public override void LoadGraph(IGraph g, Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
Uri | graphUri | URI of the Graph to Load. |
LoadGraph(IRdfHandler, String)
Loads a Graph from the Quad Store.
Declaration
public override void LoadGraph(IRdfHandler handler, string graphUri)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler. |
System.String | graphUri | URI of the Graph to Load. |
Overrides
| Improve this Doc View SourceSaveGraph(IGraph)
Saves a Graph into the Quad Store (Warning: Completely replaces any existing Graph with the same URI).
Declaration
public override void SaveGraph(IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to save. |
Overrides
Remarks
Completely replaces any previously saved Graph with the same Graph URI.
ToString()
Gets a String which gives details of the Connection.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Update(String)
Executes a SPARQL Update on the native Quad Store.
Declaration
public override void Update(string sparqlUpdate)
Parameters
Type | Name | Description |
---|---|---|
System.String | sparqlUpdate | SPARQL Update to execute. |
Overrides
Remarks
This method will first attempt to parse the update into a SparqlUpdateCommandSet object. If this succeeds then each command in the command set will be issued to Virtuoso.
If the parsing fails then the update will be executed anyway using Virtuoso's SPASQL (SPARQL + SQL) syntax. Parsing can fail because Virtuoso supports various SPARQL extensions which the library does not support and primarily supports SPARUL updates (the precusor to SPARQL 1.1 Update).
Exceptions
Type | Condition |
---|---|
SparqlUpdateException | Thrown if an error occurs in making the update. |