|
Volksdata 1.0b7
RDF library
|

Data Structures | |
| struct | VOLK_StoreInt |
| Store interface. More... | |
Typedefs | |
| typedef VOLK_rc(* | store_setup_fn_t) (const char *id, bool clear) |
| Prototype: create any environment necessary for the store to work. | |
| typedef void *(* | store_new_fn_t) (const char *id, size_t size) |
| Prototype: create a new store. | |
| typedef void(* | store_free_fn_t) (void *store) |
| Prototype: free store handle. | |
| typedef size_t(* | store_size_fn_t) (const void *store) |
| Prototype: get store size. | |
| typedef char *(* | store_id_fn_t) (const void *store) |
| Prototype: get the store ID. | |
| typedef VOLK_rc(* | store_txn_begin_fn_t) (void *store, int flags, void **txn) |
| Begin a transaction. | |
| typedef VOLK_rc(* | store_txn_commit_fn_t) (void *txn) |
| Commit a transaction. | |
| typedef void(* | store_txn_abort_fn_t) (void *txn) |
| Abort a transaction. | |
| typedef VOLK_rc(* | store_update_ctx_fn_t) (void *store, const VOLK_Buffer *old_c, const VOLK_Buffer *new_c, void *udata) |
| Update the context of triples in a context-aware store. | |
| typedef void *(* | store_add_init_fn_t) (void *store, const VOLK_Buffer *sc, void *udata) |
| Initialize bulk triple load. | |
| typedef VOLK_rc(* | store_add_iter_fn_t) (void *it, const VOLK_BufferTriple *sspo) |
| Add one triple into the store. | |
| typedef void(* | store_add_abort_fn_t) (void *it) |
| Abort an add loop and free iterator. | |
| typedef VOLK_rc(* | store_add_done_fn_t) (void *it) |
| Finalize an add loop and free iterator. | |
| typedef VOLK_rc(* | store_add_term_fn_t) (void *store, const VOLK_Buffer *sterm, void *udata) |
| Add a single term to the store. | |
| typedef void *(* | store_lookup_fn_t) (void *store, const VOLK_Buffer *ss, const VOLK_Buffer *sp, const VOLK_Buffer *so, const VOLK_Buffer *sc, void *udata, size_t *ct) |
| Prototype: look up triples by pattern matching. | |
| typedef bool(* | store_trp_exist_fn_t) (void *store, const VOLK_BufferTriple *sspo, const VOLK_Buffer *sc) |
| Prototype: check for existence of a triple (T/F). | |
| typedef VOLK_rc(* | iter_next_fn_t) (void *it, VOLK_BufferTriple *sspo, VOLK_Buffer **ctx) |
| Prototype: yield the matching triples and advance the iterator. | |
| typedef void(* | iter_free_fn_t) (void *it) |
| Prototype: free an iterator allocated by a lookup. | |
| typedef void *(* | iter_txn_fn_t) (void *it) |
| Prototype: get iterator active transaction handle. | |
| typedef VOLK_rc(* | store_remove_fn_t) (void *store, const VOLK_Buffer *ss, const VOLK_Buffer *sp, const VOLK_Buffer *so, const VOLK_Buffer *sc, void *udata, size_t *ct) |
| Prototype: delete triples by pattern matching. | |
| typedef VOLK_Buffer **(* | store_ctx_list_fn_t) (void *store, void *txn) |
| Prototype: Get index of all graph (context) URIs in a store. | |
Enumerations | |
| enum | VOLK_StoreFeature { VOLK_STORE_PERM = 1<<0 , VOLK_STORE_CTX = 1<<1 , VOLK_STORE_IDX = 1<<2 , VOLK_STORE_TXN = 1<<3 , VOLK_STORE_COW = 1<<4 , VOLK_STORE_EMBED = 1<<5 } |
| Store feature flags. More... | |
| typedef VOLK_rc(* store_setup_fn_t) (const char *id, bool clear) |
Prototype: create any environment necessary for the store to work.
VOLK_store_new() calls this function before creating the store handle.
This function should be idempotent on separate calls to the same id, unless the clear option is set to true.
| [in,out] | id | Identifier to use for the store. This should be a URI that uniquely identifies a back end for the implementation using it, e.g. a SQL connection string, file path for an embedded store, the URL of a REST API endpoint, etc. It may also be NULL, in which case it will be set to the default identifier set by the implementation. It can be retrieved from an existing store via store_id_fn_t() . |
| [in] | clear | Whether to remove an existing environment with the same ID. |
Definition at line 108 of file store_interface.h.
| typedef void *(* store_new_fn_t) (const char *id, size_t size) |
Prototype: create a new store.
| [in] | id | Identifier for the new store. How this is interpreted, and whether it is even used, depends on the implementation, which should provide documentation on how to pass and interpret this parameter. |
| [in] | size | Initial size for the store. It may be 0. Only meaningful for stores that may preallocate memory, such as HTStore. |
Definition at line 122 of file store_interface.h.
| typedef void(* store_free_fn_t) (void *store) |
Prototype: free store handle.
| [in] | store | Store handle. |
Definition at line 130 of file store_interface.h.
| typedef size_t(* store_size_fn_t) (const void *store) |
Prototype: get store size.
| [in] | store | The store to calculate size of. |
Definition at line 139 of file store_interface.h.
| typedef char *(* store_id_fn_t) (const void *store) |
Prototype: get the store ID.
| [in] | store | Store handle. |
Definition at line 148 of file store_interface.h.
| typedef VOLK_rc(* store_txn_begin_fn_t) (void *store, int flags, void **txn) |
Begin a transaction.
Only for VOLK_STORE_TXN stores.
The transaction handle is managed by the store implementation and can be any data type.
| [in] | store | Store handle. |
| [in] | flags | Transaction flags. These vary with each implementation. |
| [out] | txn | Will point to the new open transaction on success, or to undefined content on failure. |
Definition at line 178 of file store_interface.h.
| typedef VOLK_rc(* store_txn_commit_fn_t) (void *txn) |
Commit a transaction.
Only for VOLK_STORE_TXN stores.
| [in] | txn | Transaction handle initialized by store_txn_begin_fn_t(). |
Definition at line 189 of file store_interface.h.
| typedef void(* store_txn_abort_fn_t) (void *txn) |
Abort a transaction.
Only for VOLK_STORE_TXN stores.
| [in] | txn | Transaction handle initialized by store_txn_begin_fn_t(). |
Definition at line 198 of file store_interface.h.
| typedef VOLK_rc(* store_update_ctx_fn_t) (void *store, const VOLK_Buffer *old_c, const VOLK_Buffer *new_c, void *udata) |
Update the context of triples in a context-aware store.
Only defined in stores with the VOLK_STORE_CTX feature.
Definition at line 207 of file store_interface.h.
| typedef void *(* store_add_init_fn_t) (void *store, const VOLK_Buffer *sc, void *udata) |
Initialize bulk triple load.
Definition at line 216 of file store_interface.h.
| typedef VOLK_rc(* store_add_iter_fn_t) (void *it, const VOLK_BufferTriple *sspo) |
Add one triple into the store.
Definition at line 224 of file store_interface.h.
| typedef void(* store_add_abort_fn_t) (void *it) |
Abort an add loop and free iterator.
Only available for stores with the VOLK_STORE_TXN feature.
Definition at line 234 of file store_interface.h.
| typedef VOLK_rc(* store_add_done_fn_t) (void *it) |
Finalize an add loop and free iterator.
Definition at line 241 of file store_interface.h.
| typedef VOLK_rc(* store_add_term_fn_t) (void *store, const VOLK_Buffer *sterm, void *udata) |
Add a single term to the store.
Definition at line 248 of file store_interface.h.
| typedef void *(* store_lookup_fn_t) (void *store, const VOLK_Buffer *ss, const VOLK_Buffer *sp, const VOLK_Buffer *so, const VOLK_Buffer *sc, void *udata, size_t *ct) |
Prototype: look up triples by pattern matching.
Definition at line 260 of file store_interface.h.
| typedef bool(* store_trp_exist_fn_t) (void *store, const VOLK_BufferTriple *sspo, const VOLK_Buffer *sc) |
Prototype: check for existence of a triple (T/F).
| [in] | store | Store to be queried. |
| [in] | sspo | Triple to look up. All members must not be NULL. |
| [in] | sc | Optional context to look into. It may be NULL. It is disregarded by stores without the VOLK_STORE_CTX feature. |
Definition at line 279 of file store_interface.h.
| typedef VOLK_rc(* iter_next_fn_t) (void *it, VOLK_BufferTriple *sspo, VOLK_Buffer **ctx) |
Prototype: yield the matching triples and advance the iterator.
Definition at line 287 of file store_interface.h.
| typedef void(* iter_free_fn_t) (void *it) |
Prototype: free an iterator allocated by a lookup.
Definition at line 295 of file store_interface.h.
| typedef void *(* iter_txn_fn_t) (void *it) |
Prototype: get iterator active transaction handle.
Definition at line 302 of file store_interface.h.
| typedef VOLK_rc(* store_remove_fn_t) (void *store, const VOLK_Buffer *ss, const VOLK_Buffer *sp, const VOLK_Buffer *so, const VOLK_Buffer *sc, void *udata, size_t *ct) |
Prototype: delete triples by pattern matching.
Definition at line 309 of file store_interface.h.
| typedef VOLK_Buffer **(* store_ctx_list_fn_t) (void *store, void *txn) |
Prototype: Get index of all graph (context) URIs in a store.
Definition at line 319 of file store_interface.h.
| enum VOLK_StoreFeature |
Store feature flags.
| Enumerator | |
|---|---|
| VOLK_STORE_PERM | Store is on a permanent support. @note need only be set by an
implementation based on whether the data
may be cleared after the after a graph
that uses it is freed. It is the
client's responsibility to guarantee
permanence beyond the lifespan of the
program.
A store featuring VOLK_STORE_PERM
MUST guarantee that the data remain
available on storage for the user to
further handle them.
|
| VOLK_STORE_CTX | Store supports contexts (quads). @note Only stores with this feature MAY
be used with multiple graphs and MUST
be freed explicitly.
|
| VOLK_STORE_IDX | Store is fully SPO(C)-indexed. |
| VOLK_STORE_TXN | Supports transaction handling. |
| VOLK_STORE_COW | Copy on write.
|
| VOLK_STORE_EMBED | Embedded store. Stores with this feature are exclusive
to one graph and are freed with it.
Therefore, something like
`VOLK_Graph *g1 = VOLK_graph_new
< (VOLK_store_new (VOLK_STORE_HTABLE,
< ...), NULL);
< VOLK_Graph *g2 = VOLK_graph_new
< (g1->store, NULL);` MUST be avoided.
|
Definition at line 47 of file store_interface.h.