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

Macros

#define VOLK_graph_add(...)
 Non-transactional version of VOLK_graph_add_txn.
#define VOLK_graph_add_init(...)
 Non-transactional version of VOLK_graph_add_init_txn().
#define VOLK_graph_bool_op(...)
 Non-transactional version of VOLK_graph_bool_op_txn.
#define VOLK_graph_connections(...)
 Non-transactional version of VOLK_graph_connections_txn.
#define VOLK_graph_contains(...)
 Non-transactional version of VOLK_graph_contains_txn().
#define VOLK_graph_copy(src, dest)
#define VOLK_graph_copy_contents(...)
#define VOLK_graph_equals(...)
 Non-transactional version of VOLK_graph_equals_txn.
#define VOLK_graph_get(...)
 Non-transactional version of VOLK_graph_get_txn().
#define VOLK_graph_lookup(...)
 Non-transactional version of VOLK_graph_lookup_txn.
#define VOLK_graph_remove(...)
 Non-transactional version of VOLK_graph_remove_txn.
#define VOLK_graph_set_uri(...)
 Non-transactional version of VOLK_graph_set_uri_txn().
#define VOLK_graph_size(...)
 Non-transactional version of VOLK_graph_size_txn().
#define VOLK_graph_term_set(...)
 Non-transactional version of VOLK_graph_term_set_txn.
#define VOLK_graph_unique_terms(...)
 Non-transactional version of VOLK_graph_unique_terms_txn.

Functions

VOLK_TermVOLK_bnode_add_collection (VOLK_GraphIterator *it, VOLK_TermSet *ts)
 Add triples for an anonymous collection to a graph.
VOLK_GraphIterator * VOLK_graph_add_init_txn (void *txn, VOLK_Graph *gr)
 Initialize an iterator to add triples.
VOLK_rc VOLK_graph_add_iter (VOLK_GraphIterator *it, const VOLK_Triple *spo)
 Add a single triple to the store.
size_t VOLK_graph_add_link_map (VOLK_GraphIterator *it, VOLK_LinkMap *lm)
 Add triples for a term and related link map to a graph.
VOLK_rc VOLK_graph_add_txn (void *txn, VOLK_Graph *gr, VOLK_Triple *const *trp, size_t *ct)
 Add triples to a graph.
VOLK_rc VOLK_graph_bool_op_txn (void *txn, const VOLK_bool_op op, const VOLK_Graph *gr1, const VOLK_Graph *gr2, VOLK_Graph *res)
VOLK_LinkMapVOLK_graph_connections_txn (void *txn, const VOLK_Graph *gr, const VOLK_Term *t, const VOLK_LinkType type)
 Get term pairs connected to a term in a graph.
bool VOLK_graph_contains_txn (void *txn, const VOLK_Graph *gr, const VOLK_Triple *spo)
 Whether a graph contains a triple.
VOLK_rc VOLK_graph_copy_contents_txn (void *txn, const VOLK_Graph *src, VOLK_Graph *dest, const VOLK_Term *s, const VOLK_Term *p, const VOLK_Term *o)
 Copy triples from a source graph into a destination one.
bool VOLK_graph_equals_txn (void *txn, const VOLK_Graph *gr1, const VOLK_Graph *gr2)
 Compare two graphs.
void VOLK_graph_free (VOLK_Graph *gr)
 Free a graph.
VOLK_Graph * VOLK_graph_get_txn (void *txn, VOLK_Store *store, const VOLK_Term *uri, size_t *ct)
 Create a temp graph from stored triples.
void VOLK_graph_iter_free (VOLK_GraphIterator *it)
 Free a graph iterator.
const VOLK_Graph * VOLK_graph_iter_graph (VOLK_GraphIterator *it)
 Return the graph related to an iterator.
VOLK_rc VOLK_graph_iter_next (VOLK_GraphIterator *it, VOLK_Triple **spo)
 Advance a cursor obtained by a lookup and return a matching triple.
VOLK_GraphIterator * VOLK_graph_lookup_txn (void *txn, const VOLK_Graph *gr, const VOLK_Term *s, const VOLK_Term *p, const VOLK_Term *o, size_t *ct)
 Look up triples by a matching pattern and yield an iterator.
VOLK_Graph * VOLK_graph_new (VOLK_Store *store, const char *uri_str)
 Create new graph.
VOLK_Graph * VOLK_graph_new_ns (VOLK_Store *store, const char *ns_str)
 Create an empty graph using a namespace-prefixed string for its URI.
void VOLK_graph_print (const VOLK_Graph *gr)
 Print graph information and triples to stdout.
VOLK_rc VOLK_graph_remove_txn (void *txn, VOLK_Graph *gr, const VOLK_Term *s, const VOLK_Term *p, const VOLK_Term *o, size_t *ct)
 Delete triples by a matching pattern.
VOLK_rc VOLK_graph_set_uri_txn (void *txn, VOLK_Graph *gr, const char *uri_str)
size_t VOLK_graph_size_txn (void *txn, const VOLK_Graph *gr)
 Number of triples in a graph.
VOLK_StoreVOLK_graph_store (const VOLK_Graph *gr)
 Underlying graph store handle.
VOLK_TermSetVOLK_graph_term_set_txn (void *txn, const VOLK_Graph *gr, const VOLK_Term *t1, const VOLK_TriplePos t1_pos, const VOLK_Term *t2, const VOLK_TriplePos t2_pos)
 Get a list of terms related to a term pair in a graph.
VOLK_TermSetVOLK_graph_unique_terms_txn (void *txn, const VOLK_Graph *gr, VOLK_TriplePos pos)
 Get all unique subjcts, predicates, or objects in a graph.
const VOLK_TermVOLK_graph_uri (const VOLK_Graph *gr)
 Read-only graph URI.

Detailed Description

Macro Definition Documentation

◆ VOLK_graph_add

#define VOLK_graph_add ( ...)
Value:
VOLK_graph_add_txn (NULL, __VA_ARGS__)
VOLK_rc VOLK_graph_add_txn(void *txn, VOLK_Graph *gr, VOLK_Triple *const *trp, size_t *ct)
Add triples to a graph.
Definition graph.c:484

Non-transactional version of VOLK_graph_add_txn.

Definition at line 365 of file graph.h.

◆ VOLK_graph_add_init

#define VOLK_graph_add_init ( ...)
Value:
VOLK_graph_add_init_txn (NULL, __VA_ARGS__)
VOLK_GraphIterator * VOLK_graph_add_init_txn(void *txn, VOLK_Graph *gr)
Initialize an iterator to add triples.
Definition graph.c:410

Non-transactional version of VOLK_graph_add_init_txn().

Definition at line 328 of file graph.h.

◆ VOLK_graph_bool_op

#define VOLK_graph_bool_op ( ...)
Value:
VOLK_graph_bool_op_txn (NULL, __VA_ARGS__)
VOLK_rc VOLK_graph_bool_op_txn(void *txn, const VOLK_bool_op op, const VOLK_Graph *gr1, const VOLK_Graph *gr2, VOLK_Graph *res)
Definition graph.c:111

Non-transactional version of VOLK_graph_bool_op_txn.

Definition at line 208 of file graph.h.

◆ VOLK_graph_connections

#define VOLK_graph_connections ( ...)
Value:
VOLK_graph_connections_txn (NULL, __VA_ARGS__)
VOLK_LinkMap * VOLK_graph_connections_txn(void *txn, const VOLK_Graph *gr, const VOLK_Term *t, const VOLK_LinkType type)
Get term pairs connected to a term in a graph.
Definition graph.c:763

Non-transactional version of VOLK_graph_connections_txn.

Definition at line 483 of file graph.h.

◆ VOLK_graph_contains

#define VOLK_graph_contains ( ...)
Value:
VOLK_graph_contains_txn (NULL, __VA_ARGS__)
bool VOLK_graph_contains_txn(void *txn, const VOLK_Graph *gr, const VOLK_Triple *spo)
Whether a graph contains a triple.
Definition graph.c:717

Non-transactional version of VOLK_graph_contains_txn().

Definition at line 309 of file graph.h.

◆ VOLK_graph_copy

#define VOLK_graph_copy ( src,
dest )
Value:
VOLK_graph_copy_contents_txn (NULL, src, dest, NULL, NULL, NULL)
VOLK_rc VOLK_graph_copy_contents_txn(void *txn, const VOLK_Graph *src, VOLK_Graph *dest, const VOLK_Term *s, const VOLK_Term *p, const VOLK_Term *o)
Copy triples from a source graph into a destination one.
Definition graph.c:549

Definition at line 173 of file graph.h.

◆ VOLK_graph_copy_contents

#define VOLK_graph_copy_contents ( ...)
Value:
VOLK_graph_copy_contents_txn (NULL, __VA_ARGS__)

Definition at line 157 of file graph.h.

◆ VOLK_graph_equals

#define VOLK_graph_equals ( ...)
Value:
VOLK_graph_equals_txn (NULL, __VA_ARGS__)
bool VOLK_graph_equals_txn(void *txn, const VOLK_Graph *gr1, const VOLK_Graph *gr2)
Compare two graphs.
Definition graph.c:354

Non-transactional version of VOLK_graph_equals_txn.

Definition at line 234 of file graph.h.

◆ VOLK_graph_get

#define VOLK_graph_get ( ...)
Value:
VOLK_graph_get_txn (NULL, __VA_ARGS__)
VOLK_Graph * VOLK_graph_get_txn(void *txn, VOLK_Store *store, const VOLK_Term *uri, size_t *ct)
Create a temp graph from stored triples.
Definition graph.c:67

Non-transactional version of VOLK_graph_get_txn().

Definition at line 114 of file graph.h.

◆ VOLK_graph_lookup

#define VOLK_graph_lookup ( ...)
Value:
VOLK_graph_lookup_txn (NULL, __VA_ARGS__)
VOLK_GraphIterator * VOLK_graph_lookup_txn(void *txn, const VOLK_Graph *gr, const VOLK_Term *s, const VOLK_Term *p, const VOLK_Term *o, size_t *ct)
Look up triples by a matching pattern and yield an iterator.
Definition graph.c:599

Non-transactional version of VOLK_graph_lookup_txn.

Definition at line 414 of file graph.h.

◆ VOLK_graph_remove

#define VOLK_graph_remove ( ...)
Value:
VOLK_graph_remove_txn (NULL, __VA_ARGS__)
VOLK_rc VOLK_graph_remove_txn(void *txn, VOLK_Graph *gr, const VOLK_Term *s, const VOLK_Term *p, const VOLK_Term *o, size_t *ct)
Delete triples by a matching pattern.
Definition graph.c:518

Non-transactional version of VOLK_graph_remove_txn.

Definition at line 385 of file graph.h.

◆ VOLK_graph_set_uri

#define VOLK_graph_set_uri ( ...)
Value:
VOLK_graph_set_uri_txn (NULL, __VA_ARGS__)
VOLK_rc VOLK_graph_set_uri_txn(void *txn, VOLK_Graph *gr, const char *uri_str)
Definition graph.c:287

Non-transactional version of VOLK_graph_set_uri_txn().

Definition at line 276 of file graph.h.

◆ VOLK_graph_size

#define VOLK_graph_size ( ...)
Value:
VOLK_graph_size_txn (NULL, __VA_ARGS__)
size_t VOLK_graph_size_txn(void *txn, const VOLK_Graph *gr)
Number of triples in a graph.
Definition graph.c:328

Non-transactional version of VOLK_graph_size_txn().

Definition at line 291 of file graph.h.

◆ VOLK_graph_term_set

#define VOLK_graph_term_set ( ...)
Value:
VOLK_graph_term_set_txn (NULL, __VA_ARGS__)
VOLK_TermSet * VOLK_graph_term_set_txn(void *txn, const VOLK_Graph *gr, const VOLK_Term *t1, const VOLK_TriplePos t1_pos, const VOLK_Term *t2, const VOLK_TriplePos t2_pos)
Get a list of terms related to a term pair in a graph.
Definition graph.c:829

Non-transactional version of VOLK_graph_term_set_txn.

Definition at line 510 of file graph.h.

◆ VOLK_graph_unique_terms

#define VOLK_graph_unique_terms ( ...)
Value:
VOLK_graph_unique_terms_txn (NULL, __VA_ARGS__)
VOLK_TermSet * VOLK_graph_unique_terms_txn(void *txn, const VOLK_Graph *gr, VOLK_TriplePos pos)
Get all unique subjcts, predicates, or objects in a graph.
Definition graph.c:864

Non-transactional version of VOLK_graph_unique_terms_txn.

Definition at line 526 of file graph.h.

Function Documentation

◆ VOLK_bnode_add_collection()

VOLK_Term * VOLK_bnode_add_collection ( VOLK_GraphIterator * it,
VOLK_TermSet * ts )

Add triples for an anonymous collection to a graph.

The rdf:first, rdf:rest, etc. terms are automatically added and the term for the first item in the list is returned.

Parameters
[in]itGraph iterator to use for insertion.
[in]tsSource term set.
Returns
Blank node representing the first list item.

Definition at line 904 of file graph.c.

◆ VOLK_graph_add_init_txn()

VOLK_GraphIterator * VOLK_graph_add_init_txn ( void * txn,
VOLK_Graph * gr )

Initialize an iterator to add triples.

Parameters
[in]txnTransaction handle. If provided, the handle MUST be a valid, open read/write transaction. If NULL, a new transaction is opened and will be closed with VOLK_graph_iter_free(). This is ignored by graphs with non-transactional back ends.
[in]grGraph to add to. It is added to the iterator state.
Returns
Iterator handle. This should be passed to VOLK_graph_add_iter() and must be freed with VOLK_graph_iter_free().

Definition at line 410 of file graph.c.

◆ VOLK_graph_add_iter()

VOLK_rc VOLK_graph_add_iter ( VOLK_GraphIterator * it,
const VOLK_Triple * spo )

Add a single triple to the store.

Parameters
[in]itIterator obtained with VOLK_graph_add_init_txn().
[in]spoTriple to add. The terms are copied and the caller retains ownership.
Note
the triple subject and object, if IRIRefs, are stored as relative to the graph URI.

Definition at line 427 of file graph.c.

◆ VOLK_graph_add_link_map()

size_t VOLK_graph_add_link_map ( VOLK_GraphIterator * it,
VOLK_LinkMap * lm )

Add triples for a term and related link map to a graph.

The link map can be of inbound, outbound, or edge type; depending on that, triples are added with the given term as the subject, the predicate, or the object.

Parameters
[in]itGraph iterator obtained with VOLK_graph_add_init_txn().
[in]lmLink map.
Returns
Number of triples parsed on success, or <0 (VOLK_*_ERR) on error.

Definition at line 885 of file graph.c.

◆ VOLK_graph_add_txn()

VOLK_rc VOLK_graph_add_txn ( void * txn,
VOLK_Graph * gr,
VOLK_Triple *const * trp,
size_t * ct )

Add triples to a graph.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]grGraph to add triples to.
[in]trpNULL-terminated array of triple handles to add. The terms are copied and the caller retains ownership.
[out]ctThis will be filled with the total number of triples inserted.
Note
the triple subject and object, if IRIRefs, are stored as relative to the graph URI.

Definition at line 484 of file graph.c.

◆ VOLK_graph_bool_op_txn()

VOLK_rc VOLK_graph_bool_op_txn ( void * txn,
const VOLK_bool_op op,
const VOLK_Graph * gr1,
const VOLK_Graph * gr2,
VOLK_Graph * res )

Perform a boolean operation between two graphs.

This method populates an initialized graph with the result of the operation between two other graphs. The resulting graph may be of any store type and may be the result of graphs of different store types.

Parameters
[in]txnR/W transaction handle for the destination store. It may be NULL, or an open transaction within which the operation is performed. Read-only transactions are automatically opened for the source graphs if they are not in the same store as the destination.
[in]opOperation to perform. One of VOLK_bool_op.
[in]gr1First operand.
[in]gr2Second operand.
[out]resResult graph. The handle should be initialized via VOLK_graph_new() or equivalent. Any preexisting contents are not removed. If an unrecoverable error occurs, this graph is freed, and any preexisting triples are lost. Therefore, reusing a result graph handle should only be done in tightly controlled loops or sequences.
Returns
VOLK_OK on success; <0 on error.

Definition at line 111 of file graph.c.

◆ VOLK_graph_connections_txn()

VOLK_LinkMap * VOLK_graph_connections_txn ( void * txn,
const VOLK_Graph * gr,
const VOLK_Term * t,
const VOLK_LinkType type )

Get term pairs connected to a term in a graph.

This returns a VOLK_LinkMap extracted from a graph for a given term. The map can generate triples using VOLK_link_map_triples().

Depending on the type requested (VOLK_CONN_*), the term can be leveraged as a subject, predicate, or object.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]grGraph to extract the connection list from.
[in]tTerm to query for connections.
[in]typeType of connections to look up.
Returns
Link map for the requested term. It should be freed with VOLK_link_map_free().

Definition at line 763 of file graph.c.

◆ VOLK_graph_contains_txn()

bool VOLK_graph_contains_txn ( void * txn,
const VOLK_Graph * gr,
const VOLK_Triple * spo )

Whether a graph contains a triple.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]grGraph to look up into.
[in]spoTriple to look up.
Returns
1 if the triple is found, 0 if not found.

Definition at line 717 of file graph.c.

◆ VOLK_graph_copy_contents_txn()

VOLK_rc VOLK_graph_copy_contents_txn ( void * txn,
const VOLK_Graph * src,
VOLK_Graph * dest,
const VOLK_Term * s,
const VOLK_Term * p,
const VOLK_Term * o )

Copy triples from a source graph into a destination one.

The destination graph is not initialized here, so the copy is cumulative.

A 3-term pattern may be provided to filter triples to be extracted from the source graph. If all terms are NULL, all triples are copied.

Parameters
[in]txnTransaction handle. It may be NULL, or an open transaction handle, in which case the copy is done within the specified transaction.
[in]srcSource graph.
[in]destDestination graph.
[in]s,p,oTerms to look up for filtering. Any and all terms can be NULL, which indicate unbound terms.
Returns
VOLK_OK on success; VOLK_NOACTION if no triples were copied; <0 if an error occurred.

Definition at line 549 of file graph.c.

◆ VOLK_graph_equals_txn()

bool VOLK_graph_equals_txn ( void * txn,
const VOLK_Graph * gr1,
const VOLK_Graph * gr2 )

Compare two graphs.

Note that if any of the two graphs has an open transaction, the function is performed in the first graph's transaction.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]gr1First operand.
[in]gr2Second operand.
Returns
True if the graphs are topologically equal, false otherwise.

Definition at line 354 of file graph.c.

◆ VOLK_graph_free()

void VOLK_graph_free ( VOLK_Graph * gr)

Free a graph.

Definition at line 263 of file graph.c.

◆ VOLK_graph_get_txn()

VOLK_Graph * VOLK_graph_get_txn ( void * txn,
VOLK_Store * store,
const VOLK_Term * uri,
size_t * ct )

Create a temp graph from stored triples.

The new graph is stored in a hash map and is made up of all the triples found in the store with the given context URI. The new graph URI is the same as the given context.

Parameters
[in]txnTransaction handle. If not NULL, new child transaction will be opened under the one provided.
[in]storeBack end store handle.
[in]uriURI of the graph to retrieve.
[out]ctIf not NULL, it will be populated with the number of triples found. TODO deprecate. VOLK_graph_size() does the same.
Returns
New graph handle. It must be freed by the caller. If no matching context URI was found, NULL is returned.

Definition at line 67 of file graph.c.

◆ VOLK_graph_iter_free()

void VOLK_graph_iter_free ( VOLK_GraphIterator * it)

Free a graph iterator.

DO NOT USE with iterators obtained with VOLK_graph_add_init_txn(). Use VOLK_graph_iter_free() with those.

Parameters
[in]itIterator to finalize.

Definition at line 688 of file graph.c.

◆ VOLK_graph_iter_graph()

const VOLK_Graph * VOLK_graph_iter_graph ( VOLK_GraphIterator * it)

Return the graph related to an iterator.

Definition at line 678 of file graph.c.

◆ VOLK_graph_iter_next()

VOLK_rc VOLK_graph_iter_next ( VOLK_GraphIterator * it,
VOLK_Triple ** spo )

Advance a cursor obtained by a lookup and return a matching triple.

Parameters
[in]itIterator handle obtained through VOLK_graph_lookup_txn.
[out]spoTriple handle pointer to be populated with the next result. If not NULL, it will allocate a new triple and new terms, and should be freed with VOLK_triple_free().
Returns
VOLK_OK if a result was found; VOLK_END if the end of the match list was reached.

Definition at line 658 of file graph.c.

◆ VOLK_graph_lookup_txn()

VOLK_GraphIterator * VOLK_graph_lookup_txn ( void * txn,
const VOLK_Graph * gr,
const VOLK_Term * s,
const VOLK_Term * p,
const VOLK_Term * o,
size_t * ct )

Look up triples by a matching pattern and yield an iterator.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]grGraph to look up.
[in]sSubject to look for. It can be NULL, which indicates an unbound term.
[in]pPredicate to look for. It can be NULL, which indicates an unbound term.
[in]oObject to look for. It can be NULL, which indicates an unbound term.
[out]ctIf not NULL, this handle is populated with the number of entries found.
Returns
Pointer to a VOLK_GraphIterator to be generated. It must be freed with VOLK_graph_iter_free() after use.

Definition at line 599 of file graph.c.

◆ VOLK_graph_new()

VOLK_Graph * VOLK_graph_new ( VOLK_Store * store,
const char * uri_str )

Create new graph.

This operation does not perform any access to the back end store (unless store is NULL, in which case a non-transactional store is created at this time), hence it is non-transactional.

Parameters
[in]storeBack end store handle. It may be the result of VOLK_store_new(), or NULL; in the latter case, it defaults to a temporary HTable store that is freed together with the graph.
[in]uri_strURI string of the new graph. It MUST be a non-prefixed URI. For a namespace-prefixed URI, use VOLK_graph_new_ns(). If NULL, a UUID4 URN is generated.
Returns
New graph, or NULL on error. Must be freed with VOLK_graph_free().

Definition at line 45 of file graph.c.

◆ VOLK_graph_new_ns()

VOLK_Graph * VOLK_graph_new_ns ( VOLK_Store * store,
const char * ns_str )
inline

Create an empty graph using a namespace-prefixed string for its URI.

Parameters
[in]storeBack end store handle. It may be the result of VOLK_store_new(), or NULL; in the latter case, it defaults to a temporary HTable store that is freed together with the graph.
[in]ns_strURI string of the new graph. It MUST be a namespace- prefixed URI registered in the global namespace map. It cannot be NULL.
Returns
New graph, or NULL on error. Must be freed with VOLK_graph_free().

Definition at line 75 of file graph.h.

◆ VOLK_graph_print()

void VOLK_graph_print ( const VOLK_Graph * gr)

Print graph information and triples to stdout.

Parameters
[in]grGraph handle to display.

Definition at line 733 of file graph.c.

◆ VOLK_graph_remove_txn()

VOLK_rc VOLK_graph_remove_txn ( void * txn,
VOLK_Graph * gr,
const VOLK_Term * s,
const VOLK_Term * p,
const VOLK_Term * o,
size_t * ct )

Delete triples by a matching pattern.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]grGraph to delete triples from.
[in]s,p,oMatching pattern. Any and all of s, p, o can be NULL.
[out]ctIf not NULL it is populated with the number of triples deleted.

Definition at line 518 of file graph.c.

◆ VOLK_graph_set_uri_txn()

VOLK_rc VOLK_graph_set_uri_txn ( void * txn,
VOLK_Graph * gr,
const char * uri_str )

Set the URI of a graph.

Note that by changing the URI of a graph backed by a context-sensitive store (i.e. VOLK_STORE_MDB*) effectively changes the underlying context that the triples are bound to. Triples are looked up in, and added to, the context that the graph URI represents. A non-context graph retains the same triple set when a graph URI changes, and relative URI lookups are resolved in real-time against the current graph URI.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]grGraph handle.
[in]uri_strNew URI string. If namespace-prefixed, it will be resolved according to the graph's namespace map.
Returns
VOLK_OK on success; <0 on error.

Definition at line 287 of file graph.c.

◆ VOLK_graph_size_txn()

size_t VOLK_graph_size_txn ( void * txn,
const VOLK_Graph * gr )

Number of triples in a graph.

Parameters
[in]txnTransaction handle. It may be NULL.
grGraph handle.
Returns
Number of triples, or a negative value on error.

Definition at line 328 of file graph.c.

◆ VOLK_graph_store()

VOLK_Store * VOLK_graph_store ( const VOLK_Graph * gr)

Underlying graph store handle.

Definition at line 282 of file graph.c.

◆ VOLK_graph_term_set_txn()

VOLK_TermSet * VOLK_graph_term_set_txn ( void * txn,
const VOLK_Graph * gr,
const VOLK_Term * t1,
const VOLK_TriplePos t1_pos,
const VOLK_Term * t2,
const VOLK_TriplePos t2_pos )

Get a list of terms related to a term pair in a graph.

Parameters
[in]txnTransaction handle. It may be NULL.
[in]grGraph to extract terms from.
[in]t1First term.
[in]t1_posPosition of the first term in the triples to look up.
[in]t2Second term.
[in]t2_posPosition of the second term in the triples to look up.
Returns
Term set of results.

Definition at line 829 of file graph.c.

◆ VOLK_graph_unique_terms_txn()

VOLK_TermSet * VOLK_graph_unique_terms_txn ( void * txn,
const VOLK_Graph * gr,
VOLK_TriplePos pos )

Get all unique subjcts, predicates, or objects in a graph.

Parameters
[in]txnTransaction handle to work in. It may be NULL.
[in]grGraph handle.
[in]posPosition in the triples of the terms to look for.

Definition at line 864 of file graph.c.

◆ VOLK_graph_uri()

const VOLK_Term * VOLK_graph_uri ( const VOLK_Graph * gr)

Read-only graph URI.

Note that, while VOLK_graph_new() and VOLK_graph_set_uri() expect a string, this function returns the complete VOLK_Term structure.

To change the graph URI, use VOLK_graph_set_uri.

Definition at line 278 of file graph.c.