Commit e48de2e8 authored by Carlos Garnacho's avatar Carlos Garnacho

libtracker-sparql: Print resources referenced in cardinality>1 properties

Those were not being printed, just referenced in the parent resource.
Fixes properties like slo:location being lost on newly indexed photos.

https://bugzilla.gnome.org/show_bug.cgi?id=776723
parent 7ef71db2
......@@ -1290,6 +1290,32 @@ generate_sparql_relation_inserts_foreach (gpointer key,
return;
if (g_list_find_custom (data->done_list, relation, (GCompareFunc) tracker_resource_compare) == NULL) {
generate_sparql_insert_pattern (relation, data);
data->done_list = g_list_prepend (data->done_list, relation);
}
} else if (G_VALUE_HOLDS (value, G_TYPE_PTR_ARRAY)) {
GPtrArray *array = g_value_get_boxed (value);
const GValue *array_value;
TrackerResource *relation;
gint i;
for (i = 0; i < array->len; i++) {
array_value = g_ptr_array_index (array, i);
if (!G_VALUE_HOLDS (array_value, TRACKER_TYPE_RESOURCE))
continue;
relation = g_value_get_object (array_value);
/* We don't need to produce inserts for builtin classes */
if (is_builtin_class (tracker_resource_get_identifier (relation),
data->namespaces))
continue;
if (g_list_find_custom (data->done_list, relation,
(GCompareFunc) tracker_resource_compare) != NULL)
continue;
generate_sparql_insert_pattern (relation, data);
data->done_list = g_list_prepend (data->done_list, relation);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment