[tracker/parser] SPARQL: support for PN_PREFIX and COLON
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/parser] SPARQL: support for PN_PREFIX and COLON
- Date: Wed, 12 Aug 2009 12:24:45 +0000 (UTC)
commit 5ef2e55f97e11a52c690389f803193859ce06683
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Aug 12 14:24:08 2009 +0200
SPARQL: support for PN_PREFIX and COLON
src/libtracker-data/tracker-sparql-query.vala | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index 659d4b9..7edb90b 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -1213,6 +1213,22 @@ public class Tracker.SparqlQuery : Object {
case SparqlTokenType.REGEX:
translate_regex (sql);
return DataType.BOOLEAN;
+ case SparqlTokenType.PN_PREFIX:
+ next ();
+ string ns = get_last_string ();
+ expect (SparqlTokenType.COLON);
+ sql.append ("(SELECT ID FROM \"rdfs:Resource\" WHERE Uri = ?)");
+ var binding = new LiteralBinding ();
+ binding.literal = prefix_map.lookup (ns) + get_last_string ().substring (1);
+ bindings.append (binding);
+ return DataType.BOOLEAN;
+ case SparqlTokenType.COLON:
+ next ();
+ sql.append ("(SELECT ID FROM \"rdfs:Resource\" WHERE Uri = ?)");
+ var binding = new LiteralBinding ();
+ binding.literal = prefix_map.lookup ("") + get_last_string ().substring (1);
+ bindings.append (binding);
+ return DataType.BOOLEAN;
default:
throw new SparqlError.PARSE ("expected primary expression");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]