[tracker/wip/carlosg/sparql1.1: 78/80] libtracker-data: Implement ISBLANK()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/sparql1.1: 78/80] libtracker-data: Implement ISBLANK()
- Date: Sun, 7 Jul 2019 23:56:16 +0000 (UTC)
commit 0384b446bb355c11bde0d0e454917809ad3b172c
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jul 7 21:32:00 2019 +0200
libtracker-data: Implement ISBLANK()
src/libtracker-data/tracker-sparql.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index e60629d7a..89e02352f 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -6978,7 +6978,23 @@ translate_BuiltInCall (TrackerSparql *sparql,
_append_string (sparql, "== \"" RDFS_NS "Resource\" ");
sparql->current_state.expression_type = TRACKER_PROPERTY_TYPE_BOOLEAN;
} else if (_accept (sparql, RULE_TYPE_LITERAL, LITERAL_ISBLANK)) {
- _unimplemented ("ISBLANK");
+ _expect (sparql, RULE_TYPE_LITERAL, LITERAL_OPEN_PARENS);
+ node = _skip_rule (sparql, NAMED_RULE_Expression);
+ _expect (sparql, RULE_TYPE_LITERAL, LITERAL_CLOSE_PARENS);
+
+ _append_string (sparql, "CASE ");
+
+ if (!helper_datatype (sparql, node, error))
+ return FALSE;
+
+ _append_string (sparql, "== \"" RDFS_NS "Resource\" ");
+ _append_string (sparql, "WHEN 1 THEN (SELECT BlankNode FROM Resource WHERE ID = ");
+
+ if (!_postprocess_rule (sparql, node, NULL, error))
+ return FALSE;
+
+ _append_string (sparql, ") ELSE NULL END ");
+ sparql->current_state.expression_type = TRACKER_PROPERTY_TYPE_BOOLEAN;
} else if (_accept (sparql, RULE_TYPE_LITERAL, LITERAL_ISLITERAL)) {
_expect (sparql, RULE_TYPE_LITERAL, LITERAL_OPEN_PARENS);
node = _skip_rule (sparql, NAMED_RULE_Expression);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]