|
@@ -86,7 +86,7 @@ BACKEND_TBL
|
|
LSUP_rc
|
|
LSUP_rc
|
|
LSUP_graph_bool_op(
|
|
LSUP_graph_bool_op(
|
|
const LSUP_bool_op op, const LSUP_Graph *gr1, const LSUP_Graph *gr2,
|
|
const LSUP_bool_op op, const LSUP_Graph *gr1, const LSUP_Graph *gr2,
|
|
- void *txn, LSUP_Graph *res)
|
|
|
|
|
|
+ LSUP_Graph *res)
|
|
{
|
|
{
|
|
LSUP_rc rc = LSUP_NOACTION;
|
|
LSUP_rc rc = LSUP_NOACTION;
|
|
if (UNLIKELY (
|
|
if (UNLIKELY (
|
|
@@ -116,16 +116,16 @@ LSUP_graph_bool_op(
|
|
LSUP_BufferTriple *sspo = BTRP_DUMMY;
|
|
LSUP_BufferTriple *sspo = BTRP_DUMMY;
|
|
size_t ct;
|
|
size_t ct;
|
|
|
|
|
|
- add_it = res->store->sif->add_init_fn (res->store->data, res_sc, txn);
|
|
|
|
|
|
+ add_it = res->store->sif->add_init_fn (res->store->data, res_sc, gr1->txn);
|
|
|
|
|
|
if (op == LSUP_BOOL_XOR) {
|
|
if (op == LSUP_BOOL_XOR) {
|
|
// Add triples from gr2 if not found in gr1.
|
|
// Add triples from gr2 if not found in gr1.
|
|
lu2_it = gr2->store->sif->lookup_fn (
|
|
lu2_it = gr2->store->sif->lookup_fn (
|
|
- gr2->store->data, NULL, NULL, NULL, gr2_sc, NULL, txn);
|
|
|
|
|
|
+ gr2->store->data, NULL, NULL, NULL, gr2_sc, NULL, gr1->txn);
|
|
while (gr2->store->sif->lu_next_fn (lu2_it, sspo, NULL) == LSUP_OK) {
|
|
while (gr2->store->sif->lu_next_fn (lu2_it, sspo, NULL) == LSUP_OK) {
|
|
lu1_it = gr1->store->sif->lookup_fn (
|
|
lu1_it = gr1->store->sif->lookup_fn (
|
|
gr1->store->data, sspo->s, sspo->p, sspo->o, gr1_sc,
|
|
gr1->store->data, sspo->s, sspo->p, sspo->o, gr1_sc,
|
|
- txn, &ct);
|
|
|
|
|
|
+ gr1->txn, &ct);
|
|
if (ct > 0)
|
|
if (ct > 0)
|
|
res->store->sif->add_iter_fn (add_it, sspo);
|
|
res->store->sif->add_iter_fn (add_it, sspo);
|
|
gr1->store->sif->lu_free_fn (lu1_it);
|
|
gr1->store->sif->lu_free_fn (lu1_it);
|
|
@@ -134,10 +134,11 @@ LSUP_graph_bool_op(
|
|
}
|
|
}
|
|
|
|
|
|
lu1_it = gr1->store->sif->lookup_fn (
|
|
lu1_it = gr1->store->sif->lookup_fn (
|
|
- gr1->store->data, NULL, NULL, NULL, gr1_sc, txn, NULL);
|
|
|
|
|
|
+ gr1->store->data, NULL, NULL, NULL, gr1_sc, gr1->txn, NULL);
|
|
while (gr1->store->sif->lu_next_fn (lu1_it, sspo, NULL) == LSUP_OK) {
|
|
while (gr1->store->sif->lu_next_fn (lu1_it, sspo, NULL) == LSUP_OK) {
|
|
lu2_it = gr2->store->sif->lookup_fn (
|
|
lu2_it = gr2->store->sif->lookup_fn (
|
|
- gr2->store->data, sspo->s, sspo->p, sspo->o, gr2_sc, txn, &ct);
|
|
|
|
|
|
+ gr2->store->data, sspo->s, sspo->p, sspo->o, gr2_sc,
|
|
|
|
+ gr1->txn, &ct);
|
|
// For XOR and subtraction, add if not found.
|
|
// For XOR and subtraction, add if not found.
|
|
// For intersection, add if found.
|
|
// For intersection, add if found.
|
|
if ((ct == 0) ^ (op == LSUP_BOOL_INTERSECTION))
|
|
if ((ct == 0) ^ (op == LSUP_BOOL_INTERSECTION))
|
|
@@ -219,7 +220,7 @@ bool
|
|
LSUP_graph_equals (const LSUP_Graph *gr1, const LSUP_Graph *gr2)
|
|
LSUP_graph_equals (const LSUP_Graph *gr1, const LSUP_Graph *gr2)
|
|
{
|
|
{
|
|
LSUP_Graph *res = LSUP_graph_new (NULL, LSUP_STORE_HTABLE, NULL, NULL, 0);
|
|
LSUP_Graph *res = LSUP_graph_new (NULL, LSUP_STORE_HTABLE, NULL, NULL, 0);
|
|
- LSUP_graph_bool_op (LSUP_BOOL_XOR, gr1, gr2, gr1->txn, res);
|
|
|
|
|
|
+ LSUP_graph_bool_op (LSUP_BOOL_XOR, gr1, gr2, res);
|
|
bool ret = (LSUP_graph_size (res) == 0);
|
|
bool ret = (LSUP_graph_size (res) == 0);
|
|
|
|
|
|
LSUP_graph_free (res);
|
|
LSUP_graph_free (res);
|