[tracker/parser] SPARQL: Support for UNION
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/parser] SPARQL: Support for UNION
- Date: Mon, 10 Aug 2009 09:47:15 +0000 (UTC)
commit 2af77e1953762fee0d5a810efa28bffd2736c5d5
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Aug 10 11:46:43 2009 +0200
SPARQL: Support for UNION
src/libtracker-data/tracker-sparql-query.vala | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index ba2e5e0..b96ab7f 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -945,7 +945,7 @@ public class Tracker.SparqlQuery : Object {
if (current () == SparqlTokenType.OPTIONAL) {
parse_optional_graph_pattern (group_graph_pattern_start);
} else if (current () == SparqlTokenType.OPEN_BRACE) {
- // parse_group_or_union_graph_pattern ();
+ parse_group_or_union_graph_pattern (group_graph_pattern_start);
} else if (current () == SparqlTokenType.GRAPH) {
// parse_graph_graph_pattern ();
}
@@ -1660,7 +1660,15 @@ public class Tracker.SparqlQuery : Object {
}
}
- void parse_optional_graph_pattern (int group_graph_pattern_start) {
+ void parse_group_or_union_graph_pattern (int group_graph_pattern_start) throws SparqlError {
+ visit_group_graph_pattern ();
+ while (accept (SparqlTokenType.UNION)) {
+ pattern_sql.append (" UNION ALL ");
+ visit_group_graph_pattern ();
+ }
+ }
+
+ void parse_optional_graph_pattern (int group_graph_pattern_start) throws SparqlError {
expect (SparqlTokenType.OPTIONAL);
pattern_sql.insert (group_graph_pattern_start, "SELECT * FROM (");
pattern_sql.append (") NATURAL LEFT JOIN (SELECT * FROM (");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]