[tracker/parser] SPARQL: Support DROP GRAPH
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/parser] SPARQL: Support DROP GRAPH
- Date: Mon, 10 Aug 2009 09:14:04 +0000 (UTC)
commit ed7463acabe061f526ce1683116af4ea13cc3276
Author: Jürg Billeter <j bitron ch>
Date: Mon Aug 10 11:11:31 2009 +0200
SPARQL: Support DROP GRAPH
src/libtracker-data/tracker-sparql-query.vala | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index 68f469b..659c4a9 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -459,7 +459,7 @@ public class Tracker.SparqlQuery : Object {
} else if (current () == SparqlTokenType.DELETE) {
execute_delete ();
} else if (current () == SparqlTokenType.DROP) {
- // Data.delete_resource_description (operation.get_data_graph (0).name_uri.as_string ());
+ execute_drop_graph ();
} else {
throw new SparqlError.PARSE ("SELECT, CONSTRUCT, DESCRIBE, and ASK are not supported in update mode");
}
@@ -817,6 +817,16 @@ public class Tracker.SparqlQuery : Object {
}
}
+ void execute_drop_graph () throws Error {
+ expect (SparqlTokenType.DROP);
+ expect (SparqlTokenType.GRAPH);
+
+ bool is_var;
+ string uri = parse_var_or_term (out is_var);
+
+ Data.delete_resource_description (uri);
+ }
+
string parse_var_or_term (out bool is_var) throws SparqlError {
string result = "";
is_var = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]