[tracker/wip/carlosg/sparql1.1: 71/145] libtracker-data: Implement SAMPLE



commit 8f5f79c9b35b394bef6d6f728f29a4e8290efa62
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jan 13 16:51:27 2019 +0100

    libtracker-data: Implement SAMPLE

 src/libtracker-data/tracker-sparql.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index e969cde7a..59998c67d 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -6340,7 +6340,13 @@ translate_Aggregate (TrackerSparql  *sparql,
                _append_string (sparql, ") ");
                sparql->current_state.expression_type = TRACKER_PROPERTY_TYPE_STRING;
        } else if (_accept (sparql, RULE_TYPE_LITERAL, LITERAL_SAMPLE)) {
-               _unimplemented ("SAMPLE");
+               _expect (sparql, RULE_TYPE_LITERAL, LITERAL_OPEN_PARENS);
+
+               if (_accept (sparql, RULE_TYPE_LITERAL, LITERAL_DISTINCT))
+                       _append_string (sparql, "DISTINCT ");
+
+               _call_rule (sparql, NAMED_RULE_Expression, error);
+               _expect (sparql, RULE_TYPE_LITERAL, LITERAL_CLOSE_PARENS);
        } else {
                g_assert_not_reached ();
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]