[tracker/wip/carlosg/sparql1.1: 67/80] libtracker-data: Add object_type column to tracker_triples
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/sparql1.1: 67/80] libtracker-data: Add object_type column to tracker_triples
- Date: Sun, 7 Jul 2019 23:55:20 +0000 (UTC)
commit 24cbe04e318b54af5970dd39da132caf3d3836fc
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Jul 6 13:13:54 2019 +0200
libtracker-data: Add object_type column to tracker_triples
This column contains the TrackerPropertyType of the triple object.
Will be useful for datatype queries.
src/libtracker-data/tracker-vtab-triples.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-vtab-triples.c b/src/libtracker-data/tracker-vtab-triples.c
index ddb5fee1c..1d4872be7 100644
--- a/src/libtracker-data/tracker-vtab-triples.c
+++ b/src/libtracker-data/tracker-vtab-triples.c
@@ -37,6 +37,7 @@ enum {
COL_SUBJECT,
COL_PREDICATE,
COL_OBJECT,
+ COL_OBJECT_TYPE,
N_COLS
};
@@ -140,7 +141,8 @@ triples_connect (sqlite3 *db,
" graph INTEGER,"
" subject INTEGER, "
" predicate INTEGER, "
- " object INTEGER"
+ " object INTEGER, "
+ " object_type INTEGER"
")");
if (rc == SQLITE_OK) {
@@ -180,7 +182,8 @@ triples_best_index (sqlite3_vtab *vtab,
/* We let object be matched in upper layers, where proper
* translation to strings can be done.
*/
- if (info->aConstraint[i].iColumn == COL_OBJECT)
+ if (info->aConstraint[i].iColumn == COL_OBJECT ||
+ info->aConstraint[i].iColumn == COL_OBJECT_TYPE)
continue;
if (info->aConstraint[i].iColumn == COL_ROWID)
@@ -365,11 +368,13 @@ init_stmt (TrackerTriplesCursor *cursor)
g_string_append_printf (sql,
"SELECT t.graph, t.ID, "
" (SELECT ID From Resource WHERE Uri = \"%s\"), "
- " %s "
+ " %s, "
+ " %d "
"FROM \"unionGraph_%s\" AS t "
"WHERE 1 ",
tracker_property_get_uri (property),
string_expr,
+ tracker_property_get_data_type (property),
tracker_property_get_table_name (property));
if (cursor->match.graph) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]