PersistentTripleStore Class |
Namespace: VDS.RDF
The PersistentTripleStore type exposes the following members.
Name | Description | |
---|---|---|
PersistentTripleStore |
Creates a new in-memory view of some underlying store represented by the IStorageProvider instance.
|
Name | Description | |
---|---|---|
Graphs |
Gets the Collection of Graphs that comprise this Triple Store.
(Inherited from BaseTripleStore.) | |
IsEmpty |
Gets whether the Triple Store is empty.
(Inherited from BaseTripleStore.) | |
Item |
Gets the Graph with the given URI.
(Inherited from BaseTripleStore.) | |
Triples |
Gets all the Triples in the Triple Store.
(Inherited from BaseTripleStore.) | |
UnderlyingStore |
Gets the underlying store.
|
Name | Description | |
---|---|---|
Add(IGraph) |
Adds a Graph into the Triple Store.
(Inherited from BaseTripleStore.) | |
Add(IGraph, Boolean) |
Adds a Graph into the Triple Store using the chosen Merging Behaviour.
(Inherited from BaseTripleStore.) | |
AddFromUri(Uri) |
Adds a Graph into the Triple Store which is retrieved from the given Uri.
(Inherited from BaseTripleStore.) | |
AddFromUri(Uri, Boolean) |
Adds a Graph into the Triple Store which is retrieved from the given Uri using the chosen Merging Behaviour.
(Inherited from BaseTripleStore.) | |
Discard |
Discards any outstanding changes returning the in-memory view of the store to the state it was in after the last Flush/Discard operation.
| |
Dispose |
Disposes of the Triple Store flushing any outstanding changes to the underlying store.
(Overrides BaseTripleStoreDispose.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
ExecuteQuery(String) |
Executes a SPARQL Query on the Triple Store.
| |
ExecuteQuery(IRdfHandler, ISparqlResultsHandler, String) |
Executes a SPARQL Query on the Triple Store processing the results using an appropriate handler from those provided.
| |
ExecuteUpdate(String) |
Executes an Update against the Triple Store.
| |
ExecuteUpdate(SparqlUpdateCommand) |
Executes a single Update Command against the Triple Store.
| |
ExecuteUpdate(SparqlUpdateCommandSet) |
Executes a set of Update Commands against the Triple Store.
| |
Finalize |
Finalizer which ensures that the instance is properly disposed of thereby persisting any outstanding changes to the underlying store
(Overrides ObjectFinalize.) | |
Flush |
Flushes any outstanding changes to the underlying store.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HasGraph |
Checks whether a Graph with the given Base Uri exists in the Triple Store.
(Inherited from BaseTripleStore.) | |
Remove |
Removes a Graph from the Triple Store.
(Inherited from BaseTripleStore.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
GraphAdded |
Event which is raised when a Graph is added
(Inherited from BaseTripleStore.) | |
GraphChanged |
Event which is raised when a Graphs contents changes
(Inherited from BaseTripleStore.) | |
GraphCleared |
Event which is raised when a Graph is cleared
(Inherited from BaseTripleStore.) | |
GraphMerged |
Event which is raised when a Graph has a merge operation performed on it
(Inherited from BaseTripleStore.) | |
GraphRemoved |
Event which is raised when a Graph is removed
(Inherited from BaseTripleStore.) |
Name | Description | |
---|---|---|
LoadFromEmbeddedResource(String) | Overloaded.
Loads an RDF dataset from an Embedded Resource into a Triple Store.
(Defined by TripleStoreExtensions.) | |
LoadFromEmbeddedResource(String, IStoreReader) | Overloaded.
Loads an RDF dataset from an Embedded Resource into a Triple Store.
(Defined by TripleStoreExtensions.) | |
LoadFromFile(String) | Overloaded.
Loads an RDF dataset from a file into a Triple Store.
(Defined by TripleStoreExtensions.) | |
LoadFromFile(String, IStoreReader) | Overloaded.
Loads an RDF dataset from a file into a Triple Store.
(Defined by TripleStoreExtensions.) | |
LoadFromString(String) | Overloaded.
Loads an RDF dataset from a String into a Triple Store.
(Defined by TripleStoreExtensions.) | |
LoadFromString(String, IStoreReader) | Overloaded.
Loads an RDF dataset from a String into a Triple Store.
(Defined by TripleStoreExtensions.) | |
LoadFromUri(Uri) | Overloaded.
Loads an RDF dataset from a URI into a Triple Store.
(Defined by TripleStoreExtensions.) | |
LoadFromUri(Uri, IStoreReader) | Overloaded.
Loads an RDF dataset from a URI into a Triple Store.
(Defined by TripleStoreExtensions.) | |
SaveToFile(String) | Overloaded.
Saves a Triple Store to a file.
(Defined by TripleStoreExtensions.) | |
SaveToFile(String, IStoreWriter) | Overloaded.
Saves a Triple Store to a file.
(Defined by TripleStoreExtensions.) |
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 IStorageProvider instance you use. For example if the DeleteGraph() method is not supported then Graph removals won't persist in the underlying store. Similarily an instance which is read-only will allow you to pull out existing graphs from the store but won't persist any changes.
The Contains() method of the underlying BaseGraphCollection has been overridden so that invoking Contains causes the Graph from the underlying store to be loaded if it exists, this means that operations like HasGraph() may be slower than expected or cause applications to stop while they wait to load data from the store.
The exact SPARQL Query behaviour will depend on the capabilities of the underlying IStorageProvider instance. If it also implements the IQueryableStorage interface then its own SPARQL implementation will be used, note that if you try and make a SPARQL query but the in-memory view has not been synced (via a Flush() or Discard() call) prior to the query then an RdfQueryException will be thrown. If you want to make the query regardless you can do so by invoking the query method on the underlying store directly by accessing it via the UnderlyingStore property.
If the underlying store does not support SPARQL itself then SPARQL queries cannot be applied and a NotSupportedException will be thrown.
Similarly to SPARQL Query support the SPARQL Update behaviour depends on whether the underlying IStorageProvider instance also implements the IUpdateableStorage interface. If it does then its own SPARQL implementation is used, otherwise a GenericUpdateProcessor will be used to approximate the SPARQL Update.
Please be aware that as with SPARQL Query if the in-memory view is not synced with the underlying store a SparqlUpdateException will be thrown.
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 PersistentTripleStore instance that you have created. Currently there is no means to resync the in-memory view with the underlying view so you should be careful of using this class in scenarios where your underlying store may be modified.