|
@@ -252,8 +252,8 @@ LSR_desc_store (const LSR_Desc *rsrc)
|
|
|
if (UNLIKELY (rc < 0)) return rc;
|
|
|
|
|
|
// Remove all existing user graphs.
|
|
|
- if (old_rsrc) {
|
|
|
- LSUP_Term *main_data_urn = LSUP_graph_uri (old_rsrc->main_data);
|
|
|
+ if (rc == LSUP_OK) {
|
|
|
+ //LSUP_Term *main_data_urn = LSUP_graph_uri (old_rsrc->main_data);
|
|
|
for (size_t i = 0; old_rsrc->user_data[i] != NULL; i++) {
|
|
|
LSUP_Term *gr_uri = LSUP_graph_uri (old_rsrc->user_data[i]);
|
|
|
size_t ct;
|
|
@@ -265,12 +265,13 @@ LSR_desc_store (const LSR_Desc *rsrc)
|
|
|
LSUP_graph_remove (old_rsrc->main_data, gr_uri, NULL, NULL, NULL);
|
|
|
LSUP_graph_remove (old_rsrc->main_data, NULL, NULL, gr_uri, NULL);
|
|
|
}
|
|
|
- }
|
|
|
+ } else rc = LSUP_OK;
|
|
|
|
|
|
// Add new triples.
|
|
|
for (size_t i = 0; rsrc->user_data[i] != NULL; i++) {
|
|
|
- LSUP_Term *gr_uri = LSUP_graph_uri (rsrc->user_data[i]);
|
|
|
+ //LSUP_Term *gr_uri = LSUP_graph_uri (rsrc->user_data[i]);
|
|
|
|
|
|
+ log_trace ("Storing data graph #%lu", i);
|
|
|
LSUP_graph_store (rsrc->user_data[i], NULL, NULL);
|
|
|
}
|
|
|
|
|
@@ -278,17 +279,22 @@ LSR_desc_store (const LSR_Desc *rsrc)
|
|
|
LSUP_graph_store (rsrc->admin_data, NULL, NULL);
|
|
|
// Update graph metadata.
|
|
|
LSUP_graph_store (rsrc->main_data, NULL, NULL);
|
|
|
+
|
|
|
+ return rc;
|
|
|
}
|
|
|
|
|
|
|
|
|
LSUP_rc
|
|
|
LSUP_desc_update (LSR_id id, LSUP_Term **remove, LSUP_Triple *add)
|
|
|
{
|
|
|
+ LSUP_rc rc = LSUP_OK;
|
|
|
+
|
|
|
+ return rc;
|
|
|
}
|
|
|
|
|
|
|
|
|
LSUP_rc
|
|
|
-LSR_desc_get (const uuid_t id, LSR_Desc **rsrc)
|
|
|
+LSR_desc_get (const uuid_t id, LSR_Desc **rsrc_p)
|
|
|
{
|
|
|
LSUP_rc rc = LSUP_OK;
|
|
|
|
|
@@ -307,7 +313,8 @@ LSR_desc_get (const uuid_t id, LSR_Desc **rsrc)
|
|
|
LSUP_term_free (p);
|
|
|
LSUP_term_free (o);
|
|
|
|
|
|
- if (rsrc && rc == LSUP_OK) {
|
|
|
+ if (rsrc_p)
|
|
|
+ if(rc == LSUP_OK) {
|
|
|
p = LSUP_iriref_new ("foaf:primaryTopic", LSUP_DEF_NSM);
|
|
|
size_t ct = 0, i = 0;
|
|
|
|
|
@@ -320,7 +327,7 @@ LSR_desc_get (const uuid_t id, LSR_Desc **rsrc)
|
|
|
}
|
|
|
LSUP_graph_iter_free (it);
|
|
|
|
|
|
- rc = LSR_desc_new_multi (data, rsrc);
|
|
|
+ rc = LSR_desc_new_multi (data, rsrc_p);
|
|
|
|
|
|
i = 0;
|
|
|
while (i < ct) LSUP_graph_free (data[i++]);
|