123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #ifndef _LSUP_GRAPH_H
- #define _LSUP_GRAPH_H
- #include "triple.h"
- typedef enum LSUP_store_type {
- LSUP_STORE_MEM,
- LSUP_STORE_MDB
- } LSUP_store_type;
- typedef struct Graph LSUP_Graph;
- typedef int (*keyset_match_fn_t)(LSUP_Graph *src, LSUP_Graph *dest, void *ctx);
- int
- LSUP_graph_init(
- LSUP_Graph *gr, size_t capacity, char *uri_str,
- LSUP_store_type store_type);
- LSUP_Graph *
- LSUP_graph_new(size_t capacity, char *uri_str, LSUP_store_type store_type);
- int
- LSUP_graph_copy(LSUP_Graph *src, LSUP_Graph *dest);
- size_t
- LSUP_graph_capacity(LSUP_Graph *gr);
- size_t
- LSUP_graph_size(LSUP_Graph *gr);
- char *
- LSUP_graph_uri(LSUP_Graph *gr);
- bool
- LSUP_graph_contains(const LSUP_Graph *gr, const LSUP_Triple *t);
- int LSUP_graph_match_callback(
- LSUP_Graph *gr, LSUP_Graph *res, const LSUP_Triple *spo,
- keyset_match_fn_t callback_fn, bool match_cond, void *ctx);
- int
- LSUP_graph_add(LSUP_Graph *gr, const LSUP_Triple data[], size_t data_size);
- int LSUP_graph_lookup(LSUP_Graph *gr, LSUP_Graph *res, const LSUP_Triple *spo);
- int LSUP_graph_join(LSUP_Graph *gr1, LSUP_Graph *gr2, LSUP_Graph *res);
- int LSUP_graph_subtract(LSUP_Graph *gr1, LSUP_Graph *gr2, LSUP_Graph *res);
- int LSUP_graph_intersect(LSUP_Graph *gr1, LSUP_Graph *gr2, LSUP_Graph *res);
- int LSUP_graph_xor(LSUP_Graph *gr1, LSUP_Graph *gr2, LSUP_Graph *res);
- void
- LSUP_graph_free(LSUP_Graph *gr);
- #endif
|