Volksdata 1.0b10
RDF library
Loading...
Searching...
No Matches
Collaboration diagram for RDF Dataset module:

Data Structures

struct  VOLK_Dataset
 RDF Dataset type. More...

Macros

#define VOLK_dataset_new_from_store(...)
 Non-transactional version of VOLK_dataset_new_from_store_txn().

Functions

VOLK_rc VOLK_dataset_add (VOLK_Dataset *ds, const VOLK_Graph *gr)
 Add graphs to the dataset.
bool VOLK_dataset_contains (VOLK_Dataset *ds, const VOLK_Graph *gr)
 Check if a graph is in a dataset.
void VOLK_dataset_free (VOLK_Dataset *ds)
 Free a dataset handle.
VOLK_DatasetVOLK_dataset_new (VOLK_Store *store)
 Create an empty dataset.
VOLK_DatasetVOLK_dataset_new_from_store_txn (void *txn, VOLK_Store *store)
 Create a dataset populated with a whole store.
VOLK_rc VOLK_dataset_remove (VOLK_Dataset *ds, const VOLK_Graph *gr)
 Remove graphs from the dataset.
size_t VOLK_dataset_size (VOLK_Dataset *ds)
 Number of triples in a dataset.

Detailed Description

A dataset is a set of RDF graphs, backed by a context-aware store. All graphs in a dataset belong to the same store.

The dataset is not synchronized with changes in the backing store, so that if a graph contained in a dataset is deleted from the store, its reference remains in the dataset.

Macro Definition Documentation

◆ VOLK_dataset_new_from_store

#define VOLK_dataset_new_from_store ( ...)
Value:
NULL, __VA_ARGS__)
VOLK_Dataset * VOLK_dataset_new_from_store_txn(void *txn, VOLK_Store *store)
Create a dataset populated with a whole store.
Definition dataset.c:18

Non-transactional version of VOLK_dataset_new_from_store_txn().

Definition at line 57 of file dataset.h.

Function Documentation

◆ VOLK_dataset_add()

VOLK_rc VOLK_dataset_add ( VOLK_Dataset * ds,
const VOLK_Graph * gr )
inline

Add graphs to the dataset.

Parameters
[in]dsDataset to add to.
[in]grGraph to add. It must be in the same store as the dataset.
Returns
VOLK_OK on success; VOLK_VALUE_ERR if the graph was not found in the store.

Definition at line 82 of file dataset.h.

◆ VOLK_dataset_contains()

bool VOLK_dataset_contains ( VOLK_Dataset * ds,
const VOLK_Graph * gr )
inline

Check if a graph is in a dataset.

Parameters
[in]dsDataset to check.
[in]tTerm to search for.

Definition at line 122 of file dataset.h.

◆ VOLK_dataset_free()

void VOLK_dataset_free ( VOLK_Dataset * ds)

Free a dataset handle.

Note that this destroys the graph hash map, but NOT the graphs, which remain in the store.

Parameters
[in]dsDataset handle.

Definition at line 56 of file dataset.c.

◆ VOLK_dataset_new()

VOLK_Dataset * VOLK_dataset_new ( VOLK_Store * store)

Create an empty dataset.

Note
At the moment, only the mdb store supports contexts, so data sets cannot be created from any in-memory store.
Parameters
[in]storeStore handle for the graphs in the dataset. The store MUST support the VOLK_STORE_CTX feature.

Definition at line 5 of file dataset.c.

◆ VOLK_dataset_new_from_store_txn()

VOLK_Dataset * VOLK_dataset_new_from_store_txn ( void * txn,
VOLK_Store * store )

Create a dataset populated with a whole store.

Parameters
[in]txnOpen, read-write transaction handle. If NULL, a new transaction is opened and closed within the function call.
[in]storeStore handle for the graphs in the dataset. The store MUST support the VOLK_STORE_CTX feature.

Definition at line 18 of file dataset.c.

◆ VOLK_dataset_remove()

VOLK_rc VOLK_dataset_remove ( VOLK_Dataset * ds,
const VOLK_Graph * gr )
inline

Remove graphs from the dataset.

Parameters
[in]dsDataset to remove from.
[in]grGraph to remove.
Returns
VOLK_OK on success, even if a graph URI was not found in the store. VOLK_NO_ACTION if a URI is not in the dataset.

Definition at line 101 of file dataset.h.

◆ VOLK_dataset_size()

size_t VOLK_dataset_size ( VOLK_Dataset * ds)

Number of triples in a dataset.

Parameters
[in]dsDataset to measure.
Returns
Number of triples found across all graphs of the dataset.

Definition at line 64 of file dataset.c.