|
@@ -252,6 +252,8 @@ LSUP_graph_size (const Graph *gr)
|
|
return LSUP_mdbstore_size (gr->mdb_store);
|
|
return LSUP_mdbstore_size (gr->mdb_store);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// TODO Add add_stream_init, add_stream_iter and add_stream_done for streaming
|
|
|
|
+// functions.
|
|
|
|
|
|
LSUP_rc
|
|
LSUP_rc
|
|
LSUP_graph_add(
|
|
LSUP_graph_add(
|
|
@@ -261,7 +263,7 @@ LSUP_graph_add(
|
|
{
|
|
{
|
|
LSUP_rc rc;
|
|
LSUP_rc rc;
|
|
|
|
|
|
- *inserted = 0;
|
|
|
|
|
|
+ if (inserted) *inserted = 0;
|
|
|
|
|
|
/*
|
|
/*
|
|
* NOTE It is possible to pass both sets of RDF triples and buffer triples.
|
|
* NOTE It is possible to pass both sets of RDF triples and buffer triples.
|
|
@@ -290,7 +292,7 @@ LSUP_graph_add(
|
|
LSUP_rc db_rc = LSUP_htstore_add (gr->ht_store, &sspo);
|
|
LSUP_rc db_rc = LSUP_htstore_add (gr->ht_store, &sspo);
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
rc = LSUP_OK;
|
|
rc = LSUP_OK;
|
|
- (*inserted) ++;
|
|
|
|
|
|
+ if (inserted) (*inserted) ++;
|
|
}
|
|
}
|
|
|
|
|
|
LSUP_striple_done (&sspo);
|
|
LSUP_striple_done (&sspo);
|
|
@@ -306,7 +308,7 @@ LSUP_graph_add(
|
|
|
|
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
rc = LSUP_OK;
|
|
rc = LSUP_OK;
|
|
- (*inserted) ++;
|
|
|
|
|
|
+ if (inserted) (*inserted) ++;
|
|
}
|
|
}
|
|
if (UNLIKELY (db_rc < 0)) return db_rc;
|
|
if (UNLIKELY (db_rc < 0)) return db_rc;
|
|
}
|
|
}
|
|
@@ -322,8 +324,7 @@ LSUP_graph_add(
|
|
|
|
|
|
// Serialize and insert RDF triples.
|
|
// Serialize and insert RDF triples.
|
|
if (trp_ct > 0) {
|
|
if (trp_ct > 0) {
|
|
- LSUP_SerTriple *sspo = LSUP_striple_new(
|
|
|
|
- BUF_DUMMY, BUF_DUMMY, BUF_DUMMY);
|
|
|
|
|
|
+ LSUP_SerTriple *sspo = STRP_DUMMY;
|
|
|
|
|
|
for (size_t i = 0; i < trp_ct; i++) {
|
|
for (size_t i = 0; i < trp_ct; i++) {
|
|
TRACE ("Inserting triple #%lu\n", i);
|
|
TRACE ("Inserting triple #%lu\n", i);
|
|
@@ -333,7 +334,7 @@ LSUP_graph_add(
|
|
|
|
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
rc = LSUP_OK;
|
|
rc = LSUP_OK;
|
|
- (*inserted) ++;
|
|
|
|
|
|
+ if (inserted) (*inserted) ++;
|
|
}
|
|
}
|
|
|
|
|
|
if (UNLIKELY (db_rc < 0)) return db_rc;
|
|
if (UNLIKELY (db_rc < 0)) return db_rc;
|
|
@@ -349,7 +350,7 @@ LSUP_graph_add(
|
|
|
|
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
if (LIKELY (db_rc == LSUP_OK)) {
|
|
rc = LSUP_OK;
|
|
rc = LSUP_OK;
|
|
- (*inserted) ++;
|
|
|
|
|
|
+ if (inserted) (*inserted) ++;
|
|
}
|
|
}
|
|
if (UNLIKELY (db_rc < 0)) return db_rc;
|
|
if (UNLIKELY (db_rc < 0)) return db_rc;
|
|
}
|
|
}
|
|
@@ -430,7 +431,7 @@ LSUP_rc
|
|
LSUP_graph_iter_next (GraphIterator *it, LSUP_Triple *spo)
|
|
LSUP_graph_iter_next (GraphIterator *it, LSUP_Triple *spo)
|
|
{
|
|
{
|
|
LSUP_SerTriple *sspo = NULL;
|
|
LSUP_SerTriple *sspo = NULL;
|
|
- if (spo) sspo = LSUP_striple_new(BUF_DUMMY, BUF_DUMMY, BUF_DUMMY);
|
|
|
|
|
|
+ if (spo) sspo = STRP_DUMMY;
|
|
|
|
|
|
LSUP_rc rc = graph_iter_next_buffer (it, sspo);
|
|
LSUP_rc rc = graph_iter_next_buffer (it, sspo);
|
|
|
|
|