[tracker/tracker-0.8] SPARQL: Add tracker:id function
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] SPARQL: Add tracker:id function
- Date: Thu, 20 May 2010 15:30:54 +0000 (UTC)
commit 9742b6d4acafbfd380597827072d39ae4268b49f
Author: Jürg Billeter <j bitron ch>
Date: Wed May 19 13:50:34 2010 +0200
SPARQL: Add tracker:id function
This returns the internal integer ID to be used as last sort key in
queries. This helps retrieving results in stable order which is
important for paged queries.
src/libtracker-data/tracker-sparql-expression.vala | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index 94adfda..95b70c4 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -548,6 +548,13 @@ class Tracker.Sparql.Expression : Object {
sql.append_printf ("\"%s_u_offsets\"", v);
return PropertyType.STRING;
+ } else if (uri == TRACKER_NS + "id") {
+ var type = translate_expression (sql);
+ if (type != PropertyType.RESOURCE) {
+ throw get_error ("expected resource");
+ }
+
+ return PropertyType.INTEGER;
} else if (uri == TRACKER_NS + "cartesian-distance") {
sql.append ("SparqlCartesianDistance(");
translate_expression (sql);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]