public interface TripleStore extends Component
A TripleStore object abstracts the access to a triple store service, which efficiently
stores a bunch of triples organized in named graphs, providing support for inference of derived
triples, SPARQL queries and transactions. Access to those functionalities and to a
TripleStore contents can occur only in the scope of a transaction, which can either be
read-only or read/write, identifies a unit of work and provides atomicity, isolation and
durability guarantees. Note that a TripleStore
obeys the general contract and lifecycle
of Component
.
As a special kind of IOException, implementations of this interface may throw a
DataCorruptedException
in case a data corruption situation is detected, caused either
by any or all of the triple store files / external resources being non-existent or corrupted
for whatever reason. Throwing a DataCorruptedException when such a situation is
detected is important, as it allows external code to attempt a recovery procedure by calling
the reset()
function, which allows wiping out the content of the triple store, that
can then be re-populated again.
Modifier and Type | Method and Description |
---|---|
TripleTransaction |
begin(boolean readOnly)
Begins a new read-only / read-write triple store transaction.
|
void |
reset()
Resets the triple store contents, possibly recreating or reinitializing the external
services / files this triple store is based on.
|
TripleTransaction begin(boolean readOnly) throws DataCorruptedException, IOException
readOnly
- true if the transaction is not allowed to modify the contents of the
triple store (this allows for optimizing the access to the triple store).DataCorruptedException
- in case a transaction cannot be started due to triple store files being damaged
or non-existing; a reset()
call followed by a full triple store
re-population should be attempted to recover this situationIOException
- if another IO error occurs while starting the transaction, not implying a data
corruption situationvoid reset() throws IOException
IOException
- if an IO error occurs while resetting the triple store (this situation is not
expected to be recovered automatically via code).Copyright © 2015–2016 FBK-irst. All rights reserved.