[tracker] rasqal: Complete INSERT and DELETE support in SPARQL parser
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker] rasqal: Complete INSERT and DELETE support in SPARQL parser
- Date: Thu, 16 Apr 2009 10:17:56 -0400 (EDT)
commit 0e80ade928bf1dce5d9766be4f75cacac647c1fe
Author: Jürg Billeter <j bitron ch>
Date: Tue Feb 17 17:39:46 2009 +0100
rasqal: Complete INSERT and DELETE support in SPARQL parser
---
src/rasqal/sparql_parser.y | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/rasqal/sparql_parser.y b/src/rasqal/sparql_parser.y
index 2782cf8..c78b181 100644
--- a/src/rasqal/sparql_parser.y
+++ b/src/rasqal/sparql_parser.y
@@ -194,7 +194,7 @@ static void sparql_query_error_full(rasqal_query *rq, const char *message, ...)
%token <name> IDENTIFIER "identifier"
-%type <seq> SelectQuery ConstructQuery DescribeQuery
+%type <seq> SelectQuery ConstructQuery DescribeQuery DeleteQuery InsertQuery
%type <seq> SelectExpressionList VarOrIRIrefList ArgList ConstructTriplesOpt
%type <seq> ConstructTemplate OrderConditionList
%type <seq> GraphNodeListNotEmpty SelectExpressionListTail
@@ -369,10 +369,12 @@ ReportFormat: SelectQuery
}
| DeleteQuery
{
+ ((rasqal_query*)rq)->constructs=$1;
((rasqal_query*)rq)->verb=RASQAL_QUERY_VERB_DELETE;
}
| InsertQuery
{
+ ((rasqal_query*)rq)->constructs=$1;
((rasqal_query*)rq)->verb=RASQAL_QUERY_VERB_INSERT;
}
;
@@ -737,25 +739,29 @@ AskQuery: ASK
/* LAQRS */
-DeleteQuery: DELETE
+DeleteQuery: DELETE ConstructTemplate
DatasetClauseListOpt WhereClauseOpt
{
rasqal_sparql_query_language* sparql=(rasqal_sparql_query_language*)(((rasqal_query*)rq)->context);
if(!sparql->extended)
sparql_syntax_error((rasqal_query*)rq, "DELETE cannot be used with SPARQL");
+
+ $$=$2;
}
;
/* LAQRS */
-InsertQuery: INSERT
+InsertQuery: INSERT ConstructTemplate
DatasetClauseListOpt WhereClauseOpt
{
rasqal_sparql_query_language* sparql=(rasqal_sparql_query_language*)(((rasqal_query*)rq)->context);
if(!sparql->extended)
sparql_syntax_error((rasqal_query*)rq, "INSERT cannot be used with SPARQL");
+
+ $$=$2;
}
;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]