[tracker] libtracker-data: Do not implicitly replace values when using blank nodes
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Do not implicitly replace values when using blank nodes
- Date: Thu, 10 Nov 2011 14:10:57 +0000 (UTC)
commit c594aa518530dd316a4721d8886ca7ae119b5c35
Author: JÃrg Billeter <j bitron ch>
Date: Thu Nov 10 14:56:28 2011 +0100
libtracker-data: Do not implicitly replace values when using blank nodes
Fixes NB#290249.
src/libtracker-data/tracker-data-update.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 5cfef9d..c7b478f 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2577,6 +2577,7 @@ handle_blank_node (const gchar *subject,
const gchar *predicate,
const gchar *object,
const gchar *graph,
+ gboolean update,
GError **error)
{
GError *actual_error = NULL;
@@ -2599,7 +2600,11 @@ handle_blank_node (const gchar *subject,
if (blank_uri != NULL) {
/* now insert statement referring to blank node */
- tracker_data_update_statement (graph, subject, predicate, blank_uri, &actual_error);
+ if (update) {
+ tracker_data_update_statement (graph, subject, predicate, blank_uri, &actual_error);
+ } else {
+ tracker_data_insert_statement (graph, subject, predicate, blank_uri, &actual_error);
+ }
g_hash_table_remove (blank_buffer.table, object);
@@ -2655,7 +2660,7 @@ tracker_data_insert_statement_with_uri (const gchar *graph,
/* subjects and objects starting with `:' are anonymous blank nodes */
if (g_str_has_prefix (object, ":")) {
- if (handle_blank_node (subject, predicate, object, graph, &actual_error)) {
+ if (handle_blank_node (subject, predicate, object, graph, FALSE, &actual_error)) {
return;
}
@@ -2873,7 +2878,7 @@ tracker_data_update_statement_with_uri (const gchar *graph,
/* subjects and objects starting with `:' are anonymous blank nodes */
if (g_str_has_prefix (object, ":")) {
- if (handle_blank_node (subject, predicate, object, graph, &actual_error)) {
+ if (handle_blank_node (subject, predicate, object, graph, TRUE, &actual_error)) {
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]