[tracker/wip/garnacho/sparql1.1: 10/23] libtracker-data: Add support for the ENCODE_FOR_URI() builtin function
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/garnacho/sparql1.1: 10/23] libtracker-data: Add support for the ENCODE_FOR_URI() builtin function
- Date: Thu, 20 Aug 2015 08:53:31 +0000 (UTC)
commit d92eb74f63bb5307f22c378c2d74d1902e47ee47
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 28 22:04:16 2015 +0200
libtracker-data: Add support for the ENCODE_FOR_URI() builtin function
This function is defined in Sparql 1.1 query language recommendation,
http://www.w3.org/TR/sparql11-query/#func-encode
src/libtracker-data/tracker-sparql-expression.vala | 8 ++++++++
src/libtracker-data/tracker-sparql-scanner.vala | 5 +++++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala
b/src/libtracker-data/tracker-sparql-expression.vala
index 56aa650..41b3305 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -1184,6 +1184,14 @@ class Tracker.Sparql.Expression : Object {
var result = translate_function (sql, FN_NS + "contains");
expect (SparqlTokenType.CLOSE_PARENS);
return result;
+ case SparqlTokenType.ENCODE_FOR_URI:
+ next ();
+ expect (SparqlTokenType.OPEN_PARENS);
+ sql.append ("SparqlEncodeForUri (");
+ translate_expression_as_string (sql);
+ sql.append (")");
+ expect (SparqlTokenType.CLOSE_PARENS);
+ return PropertyType.STRING;
case SparqlTokenType.IF:
return translate_if_call (sql);
case SparqlTokenType.SAMETERM:
diff --git a/src/libtracker-data/tracker-sparql-scanner.vala b/src/libtracker-data/tracker-sparql-scanner.vala
index f23f0f3..f5e919c 100644
--- a/src/libtracker-data/tracker-sparql-scanner.vala
+++ b/src/libtracker-data/tracker-sparql-scanner.vala
@@ -431,6 +431,9 @@ public class Tracker.SparqlScanner : Object {
case 12:
if (matches (begin, "GROUP_CONCAT")) return SparqlTokenType.GROUP_CONCAT;
break;
+ case 14:
+ if (matches (begin, "ENCODE_FOR_URI")) return SparqlTokenType.ENCODE_FOR_URI;
+ break;
}
return SparqlTokenType.PN_PREFIX;
}
@@ -950,6 +953,7 @@ public enum Tracker.SparqlTokenType {
DOUBLE,
DOUBLE_CIRCUMFLEX,
DROP,
+ ENCODE_FOR_URI,
EOF,
EXISTS,
FALSE,
@@ -1057,6 +1061,7 @@ public enum Tracker.SparqlTokenType {
case DOUBLE: return "`DOUBLE'";
case DOUBLE_CIRCUMFLEX: return "`^^'";
case DROP: return "`DROP'";
+ case ENCODE_FOR_URI: return "`ENCODE_FOR_URI'";
case EOF: return "end of file";
case EXISTS: return "`EXISTS'";
case FALSE: return "`false'";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]