[tracker] SPARQL: Change tracker:uri() to be the exact inverse of tracker:id()



commit ce5e93b8085ac645ace801c86464378b83420212
Author: Jürg Billeter <j bitron ch>
Date:   Tue Aug 31 15:43:22 2010 +0200

    SPARQL: Change tracker:uri() to be the exact inverse of tracker:id()

 src/libtracker-data/tracker-sparql-expression.vala |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index 7b5a391..47ef068 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -568,18 +568,12 @@ class Tracker.Sparql.Expression : Object {
 
 			return PropertyType.INTEGER;
 		} else if (uri == TRACKER_NS + "uri") {
-			
-			if (current () == SparqlTokenType.INTEGER) {
-				next ();
-				sql.append ("(SELECT Uri FROM Resource WHERE ID = ?)");
-				var binding = new LiteralBinding ();
-				binding.literal = get_last_string ();
-				query.bindings.append (binding);
-			} else {
-				throw get_error ("expected ID");
+			var type = translate_expression (sql);
+			if (type != PropertyType.INTEGER) {
+				throw get_error ("expected integer ID");
 			}
 
-			return PropertyType.STRING;
+			return PropertyType.RESOURCE;
 		} 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]