[tracker/parser] SPARQL: Add type information for variables
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/parser] SPARQL: Add type information for variables
- Date: Wed, 12 Aug 2009 14:14:58 +0000 (UTC)
commit e5663c4b53fd0d06862807bdebb2d3fa073f1783
Author: Jürg Billeter <j bitron ch>
Date: Wed Aug 12 16:09:21 2009 +0200
SPARQL: Add type information for variables
src/libtracker-data/tracker-sparql-query.vala | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index 2792186..8142d44 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -1190,7 +1190,19 @@ public class Tracker.SparqlQuery : Object {
next ();
string variable_name = get_last_string ().substring (1);
sql.append_printf ("\"%s_u\"", variable_name);
- return DataType.UNKNOWN;
+
+ var binding = var_map.lookup (variable_name);
+ if (binding == null) {
+ return DataType.UNKNOWN;
+ } else if (binding.is_uri) {
+ return DataType.RESOURCE;
+ } else if (binding.is_boolean) {
+ return DataType.BOOLEAN;
+ } else if (binding.is_datetime) {
+ return DataType.DATETIME;
+ } else {
+ return DataType.UNKNOWN;
+ }
case SparqlTokenType.STR:
translate_str (sql);
return DataType.STRING;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]