4#define ENTRY(a, b) case VOLK_STORE_##a: return &b;
18#define ENTRY(a, b) case VOLK_STORE_##a: return "STORE_" #a;
29 const VOLK_StoreType store_type,
const char *store_id,
size_t size,
34 "Environment is not initialized. Did you call VOLK_init()?");
39 log_error (
"Not a valid store type: %d", store_type);
46 store->
type = store_type;
57 else store->
id = store_id ?
strdup (store_id) : NULL;
75 if (store->
id) free (store->
id);
179 "Store does not support contexts. Ignoring passed context.");
192 "Store does not support contexts. Ignoring passed context.");
209 log_warn (
"Store does not support transactions.");
229 log_error (
"Store does not support contexts.");
bool VOLK_env_is_init
Whether the environment is initialized.
#define MALLOC_GUARD(var, rc)
Allocate one pointer with malloc and return rc if it fails.
#define NLCHECK(exp, marker)
Log error and jump to marker if exp is NULL.
#define PCHECK(exp, marker)
Jump to marker if exp returns a negative value (skip warnings).
char * strdup(const char *src)
Replacement for GNU strdup.
#define VOLK_NOT_IMPL_ERR
Functionality is not implemented.
VOLK_StoreFeature
Store feature flags.
@ VOLK_STORE_TXN
Supports transaction handling.
VOLK_rc VOLK_store_begin(VOLK_Store *store, int flags, void **txn)
Begin a transaction.
void * VOLK_store_add_init_txn(VOLK_Store *store, void *txn, const VOLK_Buffer *sc)
Initialize bulk triple load.
VOLK_rc VOLK_store_add_done(VOLK_Store *store, void *it)
Finalize an add loop and free iterator.
void VOLK_store_add_abort(VOLK_Store *store, void *it)
Abort an add loop and free iterator.
const VOLK_StoreInt * VOLK_store_int(VOLK_StoreType type)
Return store interface for a specific type.
VOLK_rc VOLK_store_add_iter(VOLK_Store *store, void *it, const VOLK_BufferTriple *sspo)
Add one triple into the store.
VOLK_StoreFeature VOLK_store_features(const VOLK_Store *store)
Feature flags belonging to the store interface.
VOLK_rc VOLK_store_add_term_txn(VOLK_Store *store, void *txn, VOLK_Buffer *sterm)
Add a single term to the store.
void * VOLK_store_lookup_txn(const VOLK_Store *store, void *txn, const VOLK_Buffer *ss, const VOLK_Buffer *sp, const VOLK_Buffer *so, const VOLK_Buffer *sc, size_t *ct)
Look up triples by pattern matching.
VOLK_rc VOLK_store_iter_next(VOLK_Store *store, void *it, VOLK_BufferTriple *sspo, VOLK_Buffer **ctx)
Yield the matching triples and advance the iterator.
char * VOLK_store_id(const VOLK_Store *store)
Store identifier.
VOLK_Buffer ** VOLK_store_ctx_list_txn(VOLK_Store *store, void *txn)
get index of all graph (context) URIs in a store.
VOLK_StoreType
Store types. All prefixed with VOLK_STORE_.
void VOLK_store_iter_free(VOLK_Store *store, void *it)
Free an iterator allocated by a lookup.
const char * VOLK_store_type_label(VOLK_StoreType type)
Return the store type label.
size_t VOLK_store_size(const VOLK_Store *store)
Store size in triples.
VOLK_Store * VOLK_store_new(const VOLK_StoreType store_type, const char *store_id, size_t size, bool clear)
Create a new store.
void * VOLK_store_iter_txn(const VOLK_Store *store, void *it)
Get iterator active transaction handle.
VOLK_rc VOLK_store_commit(VOLK_Store *store, void *txn)
Commit a transaction.
VOLK_rc VOLK_store_remove_txn(VOLK_Store *store, void *txn, const VOLK_Buffer *ss, const VOLK_Buffer *sp, const VOLK_Buffer *so, const VOLK_Buffer *sc, size_t *ct)
Delete triples by pattern matching.
void VOLK_store_abort(VOLK_Store *store, void *txn)
Abort (roll back) a transaction.
void VOLK_store_free(VOLK_Store *store)
Free a store created with VOLK_store_new().
VOLK_rc VOLK_store_update_ctx_txn(VOLK_Store *store, void *txn, const VOLK_Buffer *old_c, const VOLK_Buffer *new_c)
Update the context of triples in a context-aware store.
Generic store dependency.
General-purpose data buffer.
store_size_fn_t size_fn
Number of triples in the store.
VOLK_StoreFeature features
Feature flags.
store_txn_abort_fn_t txn_abort_fn
Abort transaction.
store_new_fn_t new_fn
Create a new store instance.
iter_free_fn_t lu_free_fn
Free the lookup iterator.
store_txn_commit_fn_t txn_commit_fn
Commit transaction.
store_remove_fn_t remove_fn
Remove triples by pattern.
store_add_abort_fn_t add_abort_fn
store_add_iter_fn_t add_iter_fn
Add one triple.
store_add_term_fn_t add_term_fn
store_update_ctx_fn_t update_ctx_fn
store_free_fn_t free_fn
Free the store.
store_txn_begin_fn_t txn_begin_fn
Begin transaction.
store_setup_fn_t setup_fn
Called before store_new_fn_t.
store_ctx_list_fn_t ctx_list_fn
store_add_init_fn_t add_init_fn
Initialize add iteration.
iter_txn_fn_t iter_txn_fn
Get iterator's transaction.
iter_next_fn_t lu_next_fn
Advance the lookup iterator.
store_id_fn_t id_fn
Get store ID.
store_lookup_fn_t lookup_fn
Look up triples by pattern.
store_add_done_fn_t add_done_fn
Complete the add process.
void * data
Store back end data.
const VOLK_StoreInt * sif
Store interface.
VOLK_StoreType type
Store type.