Class PersistentTripleStore
Represents an in-memory view of a triple store provided by an IStorage
Implements
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public sealed class PersistentTripleStore : BaseTripleStore, INativelyQueryableStore, IUpdateableTripleStore, ITransactionalStore, ITripleStore, IDisposable
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
Constructors
| Improve this Doc View SourcePersistentTripleStore(IStorageProvider, IUriFactory)
Creates a new in-memory view of some underlying store represented by the IStorage
Declaration
public PersistentTripleStore(IStorageProvider manager, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
IStorage |
manager | IO Manager. |
IUri |
uriFactory | The preferred URI factory to use when creating URIs for this store. |
Remarks
Please see the remarks for this class for notes on exact behaviour of this class.
PersistentTripleStore(IStorageProvider)
Creates a new in-memory view of some underlying store represented by the IStorage
Declaration
public PersistentTripleStore(IStorageProvider manager)
Parameters
Type | Name | Description |
---|---|---|
IStorage |
manager | IO Manager. |
Remarks
Please see the remarks for this class for notes on exact behaviour of this class.
Properties
| Improve this Doc View SourceUnderlyingStore
Gets the underlying store.
Declaration
public IStorageProvider UnderlyingStore { get; }
Property Value
Type | Description |
---|---|
IStorage |
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
UriFactory
Get the preferred URI factory to use when creating URIs in this store.
Declaration
public override IUriFactory UriFactory { get; }
Property Value
Type | Description |
---|---|
IUri |
Overrides
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
Methods
| Improve this Doc View SourceDiscard()
Discards any outstanding changes returning the in-memory view of the store to the state it was in after the last Flush/Discard operation.
Declaration
public void Discard()
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
Dispose()
Disposes of the Triple Store flushing any outstanding changes to the underlying store.
Declaration
public override void Dispose()
Overrides
Remarks
If you do not want to persist changes you have please ensure you call Discard() prior to disposing of the instance.
ExecuteQuery(string)
Executes a SPARQL Query on the Triple Store.
Declaration
public object ExecuteQuery(string query)
Parameters
Type | Name | Description |
---|---|---|
string | query | Sparql Query as unparsed String. |
Returns
Type | Description |
---|---|
System. |
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
ExecuteQuery(IRdfHandler, ISparqlResultsHandler, string)
Executes a SPARQL Query on the Triple Store processing the results using an appropriate handler from those provided.
Declaration
public void ExecuteQuery(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string query)
Parameters
Type | Name | Description |
---|---|---|
IRdf |
rdfHandler | RDF Handler. |
ISparql |
resultsHandler | Results Handler. |
string | query | SPARQL Query as unparsed String. |
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
ExecuteUpdate(string)
Executes an Update against the Triple Store.
Declaration
public void ExecuteUpdate(string update)
Parameters
Type | Name | Description |
---|---|---|
string | update | SPARQL Update Command(s). |
Remarks
As per the SPARQL 1.1 Update specification the command string may be a sequence of commands.
ExecuteUpdate(SparqlUpdateCommand)
Executes a single Update Command against the Triple Store.
Declaration
public void ExecuteUpdate(SparqlUpdateCommand update)
Parameters
Type | Name | Description |
---|---|---|
Sparql |
update | SPARQL Update Command. |
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
ExecuteUpdate(SparqlUpdateCommandSet)
Executes a set of Update Commands against the Triple Store.
Declaration
public void ExecuteUpdate(SparqlUpdateCommandSet updates)
Parameters
Type | Name | Description |
---|---|---|
Sparql |
updates | SPARQL Update Command Set. |
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent
~PersistentTripleStore()
Finalizer which ensures that the instance is properly disposed of thereby persisting any outstanding changes to the underlying store
Declaration
protected ~PersistentTripleStore()
Remarks
If you do not wish to persist your changes you must call Discard() prior to disposing of this instance or allowing it to go out of scope such that the finalizer gets called
Flush()
Flushes any outstanding changes to the underlying store.
Declaration
public void Flush()
Remarks
Persistence Behaviour
Note: This is a transactional implementation - this means that changes made are not persisted until you either call Flush() or you dispose of the instance. Alternatively you may invoke the Discard() method to throw away changes made to the in-memory state.
The actual level of persistence provided will vary according to the IStorage
The Contains() method of the underlying Base
SPARQL Query Behaviour
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorage
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a Not
SPARQL Update Behaviour
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorage
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a Sparql
Other Notes
It is possible for the in-memory view of the triple store to get out of sync with the underlying store if that store is being modified by other processes or other code not utilising the Persistent