Class GenericUpdateProcessor
SPARQL Update Processor which processes commands against a generic underlying store represented by an IStorageProvider implementation.
Implements
Inherited Members
Namespace: VDS.RDF.Update
Assembly: dotNetRdf.dll
Syntax
public class GenericUpdateProcessor : ISparqlUpdateProcessor
Remarks
If the provided manager also implements the IUpdateableStorage interface then the managers native SPARQL Update implementation will be used for the non-type specific calls i.e. ProcessCommand() and ProcessCommandSet(). At all other times the SPARQL Update commands will be processed by approximating their behaviour through calls to SaveGraph(), LoadGraph() and UpdateGraph() in addition to local in-memory manipulation of the data. Some commands such as INSERT and DELETE can only be processed when the manager is also a IQueryableStorage since they rely on making a query and performing actions based on the results of that query.
The performance of this processor is somewhat dependent on the underlying IStorageProvider. If the underlying manager supports triple level updates as indicated by the UpdateSupported property then operations can be performed quite efficiently, if this is not the case then any operation which modifies a Graph will need to load the existing Graph from the store, make the modifications locally in-memory and then save the resulting Graph back to the Store.
Constructors
| Edit this page View SourceGenericUpdateProcessor(IStorageProvider, Loader)
Creates a new Generic Update Processor.
Declaration
public GenericUpdateProcessor(IStorageProvider manager, Loader loader = null)
Parameters
Type | Name | Description |
---|---|---|
IStorageProvider | manager | Generic IO Manager. |
Loader | loader | The loader to use when retrieving RDF data for a LOAD command. |
Properties
| Edit this page View SourceLoader
Get the loader configured for this processor.
Declaration
public Loader Loader { get; }
Property Value
Type | Description |
---|---|
Loader |
Methods
| Edit this page View SourceDiscard()
Discards any outstanding changes.
Declaration
public virtual void Discard()
Flush()
Flushes any outstanding changes to the underlying store.
Declaration
public virtual void Flush()
ProcessAddCommand(AddCommand)
Processes an ADD command.
Declaration
public void ProcessAddCommand(AddCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
AddCommand | cmd | Add Command. |
ProcessClearCommand(ClearCommand)
Processes a CLEAR command.
Declaration
public void ProcessClearCommand(ClearCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
ClearCommand | cmd | Clear Command. |
Remarks
Implemented by replacing the Graph with an empty Graph.
ProcessCommand(SparqlUpdateCommand)
Processes a command.
Declaration
public virtual void ProcessCommand(SparqlUpdateCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
SparqlUpdateCommand | cmd | Command. |
Remarks
If the provided manager also implements the IUpdateableStorage interface then the managers native SPARQL Update implementation will be used.
ProcessCommandSet(SparqlUpdateCommandSet)
Processes a command set.
Declaration
public virtual void ProcessCommandSet(SparqlUpdateCommandSet commands)
Parameters
Type | Name | Description |
---|---|---|
SparqlUpdateCommandSet | commands | Command Set. |
Remarks
If the provided manager also implements the IUpdateableStorage interface then the managers native SPARQL Update implementation will be used.
ProcessCopyCommand(CopyCommand)
Processes a COPY command.
Declaration
public void ProcessCopyCommand(CopyCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
CopyCommand | cmd | Copy Command. |
ProcessCreateCommand(CreateCommand)
Processes a CREATE command.
Declaration
public void ProcessCreateCommand(CreateCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
CreateCommand | cmd | Create Command. |
Remarks
Implemented by adding an empty Graph to the Store.
Warning: As the IStorageProvider interface does not allow checking whether a Graph exists processing CREATE commands can result in overwriting existing Graphs.
ProcessDeleteCommand(DeleteCommand)
Processes a DELETE command.
Declaration
public void ProcessDeleteCommand(DeleteCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
DeleteCommand | cmd | Delete Command. |
Remarks
Note: The underlying manager must implement the IQueryableStorage interface in order for DELETE commands to be processed.
ProcessDeleteDataCommand(DeleteDataCommand)
Processes a DELETE DATA command.
Declaration
public void ProcessDeleteDataCommand(DeleteDataCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
DeleteDataCommand | cmd | DELETE Data Command. |
ProcessDropCommand(DropCommand)
Processes a DROP command.
Declaration
public void ProcessDropCommand(DropCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
DropCommand | cmd | Drop Command. |
ProcessInsertCommand(InsertCommand)
Processes an INSERT command.
Declaration
public void ProcessInsertCommand(InsertCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
InsertCommand | cmd | Insert Command. |
Remarks
Note: The underlying manager must implement the IQueryableStorage interface in order for INSERT commands to be processed.
ProcessInsertDataCommand(InsertDataCommand)
Processes an INSERT DATA command.
Declaration
public void ProcessInsertDataCommand(InsertDataCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
InsertDataCommand | cmd | Insert Data Command. |
ProcessLoadCommand(LoadCommand)
Processes a LOAD command.
Declaration
public void ProcessLoadCommand(LoadCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
LoadCommand | cmd | Load Command. |
ProcessModifyCommand(ModifyCommand)
Processes an INSERT/DELETE command.
Declaration
public void ProcessModifyCommand(ModifyCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
ModifyCommand | cmd | Insert/Delete Command. |
ProcessMoveCommand(MoveCommand)
Processes a MOVE command.
Declaration
public void ProcessMoveCommand(MoveCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
MoveCommand | cmd | Move Command. |