[tracker/wip/carlosg/issue-56: 2/2] libtracker-data: Also set up blank node map on InsertData
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/issue-56: 2/2] libtracker-data: Also set up blank node map on InsertData
- Date: Tue, 13 Nov 2018 22:33:57 +0000 (UTC)
commit 4755e78cec764a395dced9f8ee3188dbc725758b
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 13 23:26:04 2018 +0100
libtracker-data: Also set up blank node map on InsertData
The blank node map must be set up there, both for the URN storage
aspect and the GVariant generation one.
Closes: https://gitlab.gnome.org/GNOME/tracker/issues/56
src/libtracker-data/tracker-sparql.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index 3f1ead05f..a45eb4a17 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -2609,9 +2609,23 @@ translate_InsertData (TrackerSparql *sparql,
_expect (sparql, RULE_TYPE_LITERAL, LITERAL_INSERT);
_expect (sparql, RULE_TYPE_LITERAL, LITERAL_DATA);
+ if (sparql->blank_nodes) {
+ g_variant_builder_open (sparql->blank_nodes, G_VARIANT_TYPE ("a{ss}"));
+ }
+
+ sparql->current_state.blank_node_map =
+ g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
sparql->current_state.type = TRACKER_SPARQL_TYPE_INSERT;
_call_rule (sparql, NAMED_RULE_QuadData, error);
+ if (sparql->blank_nodes) {
+ g_variant_builder_close (sparql->blank_nodes);
+ }
+
+ g_clear_pointer (&sparql->current_state.blank_node_map,
+ g_hash_table_unref);
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]