[tracker/parser] SPARQL: Add type information for relative expressions
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/parser] SPARQL: Add type information for relative expressions
- Date: Wed, 12 Aug 2009 12:49:15 +0000 (UTC)
commit 75542f0cd87ac959541725f36a1c3d3a537045bd
Author: Jürg Billeter <j bitron ch>
Date: Wed Aug 12 14:17:27 2009 +0200
SPARQL: Add type information for relative expressions
src/libtracker-data/tracker-sparql-query.vala | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index fbe30f4..bef39eb 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -1324,40 +1324,47 @@ public class Tracker.SparqlQuery : Object {
return translate_additive_expression (sql);
}
- void translate_relational_expression (StringBuilder sql) throws SparqlError {
+ DataType translate_relational_expression (StringBuilder sql) throws SparqlError {
long begin = sql.len;
- translate_numeric_expression (sql);
+ var optype = translate_numeric_expression (sql);
if (accept (SparqlTokenType.OP_GE)) {
sql.insert (begin, "(");
sql.append (" >= ");
translate_numeric_expression (sql);
sql.append (")");
+ return DataType.BOOLEAN;
} else if (accept (SparqlTokenType.OP_EQ)) {
sql.insert (begin, "(");
sql.append (" = ");
translate_numeric_expression (sql);
sql.append (")");
+ return DataType.BOOLEAN;
} else if (accept (SparqlTokenType.OP_NE)) {
sql.insert (begin, "(");
sql.append (" <> ");
translate_numeric_expression (sql);
sql.append (")");
+ return DataType.BOOLEAN;
} else if (accept (SparqlTokenType.OP_LT)) {
sql.insert (begin, "(");
sql.append (" < ");
translate_numeric_expression (sql);
sql.append (")");
+ return DataType.BOOLEAN;
} else if (accept (SparqlTokenType.OP_LE)) {
sql.insert (begin, "(");
sql.append (" <= ");
translate_numeric_expression (sql);
sql.append (")");
+ return DataType.BOOLEAN;
} else if (accept (SparqlTokenType.OP_GT)) {
sql.insert (begin, "(");
sql.append (" > ");
translate_numeric_expression (sql);
sql.append (")");
+ return DataType.BOOLEAN;
}
+ return optype;
}
void translate_value_logical (StringBuilder sql) throws SparqlError {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]