jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1399696 - in /jena/trunk/jena-arq: Grammar/arq.jj Grammar/master.jj src/main/java/com/hp/hpl/jena/sparql/lang/ParserBase.java src/main/java/com/hp/hpl/jena/sparql/lang/arq/ARQParser.java
Date Thu, 18 Oct 2012 15:31:54 GMT
Author: andy
Date: Thu Oct 18 15:31:54 2012
New Revision: 1399696

URL: http://svn.apache.org/viewvc?rev=1399696&view=rev
Log:
Add deprecation warnings to use of SPARQL/Update (the submission) syntax forms. Not complete
coverage.

Modified:
    jena/trunk/jena-arq/Grammar/arq.jj
    jena/trunk/jena-arq/Grammar/master.jj
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserBase.java
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/arq/ARQParser.java

Modified: jena/trunk/jena-arq/Grammar/arq.jj
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/Grammar/arq.jj?rev=1399696&r1=1399695&r2=1399696&view=diff
==============================================================================
--- jena/trunk/jena-arq/Grammar/arq.jj (original)
+++ jena/trunk/jena-arq/Grammar/arq.jj Thu Oct 18 15:31:54 2012
@@ -363,7 +363,7 @@ void ValuesClause() : { Token t ; }
 void Update() : { }
 {
    Prologue()
-   ( Update1() (<SEMICOLON>)* Update() )?
+   ( Update1() (<SEMICOLON>)* Update())?
 }
 void Update1() : { Update up ; }
 {
@@ -482,6 +482,7 @@ Update ModifyOld() :
        { UpdateModify up = new UpdateModify() ; String iri ; Template template ; Element
el ; }
 {
     <MODIFY>
+    { warnDeprecation("Deprecated: MODIFY: Use SPARQL 1.1 syntax of WITH ... DELETE {...}
INSERT {...} WHERE {...}") ; }
     ( iri = iri() { Node n = createNode(iri) ; up.setWithIRI(n) ; } )?
     (DeleteClause(up))?
     (InsertClause(up))?
@@ -509,9 +510,10 @@ void InsertClause(UpdateModify up) : { Q
 }
 void OptionalIntoTarget(QuadAcc qp) : { String iri ; }
 {
-  ( (<INTO>)?
+  ( (<INTO> )?
      iri = iri()
      { Node gn = createNode(iri) ; setAccGraph(qp, gn) ; }
+     { warnDeprecation("Deprecated: INSERT INTO: Use SPARQL 1.1 syntax of INSERT { GRAPH
{...} }") ; }
    )?
 }
 void OptionalFromTarget(QuadAcc qp) : { String iri ; }
@@ -519,6 +521,7 @@ void OptionalFromTarget(QuadAcc qp) : { 
   ( (<FROM>)?
      iri = iri()
      { Node gn = createNode(iri) ; setAccGraph(qp, gn) ; }
+      { warnDeprecation("Deprecated: DELETE FROM: Use SPARQL 1.1 syntax of DELETE { GRAPH
{...} }") ; }
    )?
 }
 void UsingClause(UpdateWithUsing update) : { String iri ; Node n ; }

Modified: jena/trunk/jena-arq/Grammar/master.jj
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/Grammar/master.jj?rev=1399696&r1=1399695&r2=1399696&view=diff
==============================================================================
--- jena/trunk/jena-arq/Grammar/master.jj (original)
+++ jena/trunk/jena-arq/Grammar/master.jj Thu Oct 18 15:31:54 2012
@@ -452,7 +452,7 @@ void ValuesClause() : { Token t ; }
 void Update() : { }
 {
    Prologue()
-   ( Update1() (<SEMICOLON>)*  Update() )?
+   ( Update1() (<SEMICOLON>)*  Update())?
 }
 #else
 // Strict SPARQL 1.1 : mandatory separator, optional terminator.
@@ -608,6 +608,7 @@ Update ModifyOld() :
        { UpdateModify up = new UpdateModify() ; String iri ; Template template ; Element
el ; }
 {
     <MODIFY>
+    { warnDeprecation("Deprecated: MODIFY: Use SPARQL 1.1 syntax of WITH ... DELETE {...}
INSERT {...} WHERE {...}") ; }
     ( iri = iri() { Node n = createNode(iri) ; up.setWithIRI(n) ; } )?
     (DeleteClause(up))?
     (InsertClause(up))?
@@ -648,9 +649,10 @@ void InsertClause(UpdateModify up) : { Q
 #ifdef ARQ_UPDATE
 void OptionalIntoTarget(QuadAcc qp) : { String iri ; }
 {
-  ( (<INTO>)? 
+  ( (<INTO> )? 
      iri = iri()
      { Node gn = createNode(iri) ; setAccGraph(qp, gn) ; }
+     { warnDeprecation("Deprecated: INSERT INTO: Use SPARQL 1.1 syntax of INSERT { GRAPH
{...} }") ; }
    )?
 }
 
@@ -659,6 +661,7 @@ void OptionalFromTarget(QuadAcc qp) : { 
   ( (<FROM>)? 
      iri = iri()
      { Node gn = createNode(iri) ; setAccGraph(qp, gn) ; }
+      { warnDeprecation("Deprecated: DELETE FROM: Use SPARQL 1.1 syntax of DELETE { GRAPH
{...} }") ; }
    )?
 }
 #endif

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserBase.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserBase.java?rev=1399696&r1=1399695&r2=1399696&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserBase.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserBase.java Thu Oct
18 15:31:54 2012
@@ -22,6 +22,8 @@ import java.math.BigInteger ;
 import java.util.HashSet ;
 import java.util.Set ;
 
+import org.openjena.atlas.logging.Log ;
+
 import com.hp.hpl.jena.datatypes.RDFDatatype ;
 import com.hp.hpl.jena.datatypes.TypeMapper ;
 import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
@@ -640,6 +642,12 @@ public class ParserBase
         return sb.toString() ;
     }
     
+    
+    protected void warnDeprecation(String msg)
+    {
+        Log.warn(this, msg) ;
+    }
+    
     public static void throwParseException(String msg, int line, int column)
     {
         throw new QueryParseException("Line " + line + ", column " + column + ": " + msg,

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/arq/ARQParser.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/arq/ARQParser.java?rev=1399696&r1=1399695&r2=1399696&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/arq/ARQParser.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/arq/ARQParser.java Thu Oct
18 15:31:54 2012
@@ -1718,6 +1718,7 @@ public class ARQParser extends ARQParser
   final public Update ModifyOld() throws ParseException {
          UpdateModify up = new UpdateModify() ; String iri ; Template template ; Element
el ;
     jj_consume_token(MODIFY);
+      warnDeprecation("Deprecated: MODIFY: Use SPARQL 1.1 syntax of WITH ... DELETE {...}
INSERT {...} WHERE {...}") ;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case IRIref:
     case PNAME_NS:
@@ -1789,6 +1790,7 @@ public class ARQParser extends ARQParser
       }
       iri = iri();
        Node gn = createNode(iri) ; setAccGraph(qp, gn) ;
+       warnDeprecation("Deprecated: INSERT INTO: Use SPARQL 1.1 syntax of INSERT { GRAPH
{...} }") ;
       break;
     default:
       jj_la1[58] = jj_gen;
@@ -1813,6 +1815,7 @@ public class ARQParser extends ARQParser
       }
       iri = iri();
        Node gn = createNode(iri) ; setAccGraph(qp, gn) ;
+        warnDeprecation("Deprecated: DELETE FROM: Use SPARQL 1.1 syntax of DELETE { GRAPH
{...} }") ;
       break;
     default:
       jj_la1[60] = jj_gen;
@@ -5541,17 +5544,6 @@ public class ARQParser extends ARQParser
     finally { jj_save(3, xla); }
   }
 
-  private boolean jj_3R_128() {
-    if (jj_scan_token(LBRACKET)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_108() {
-    if (jj_scan_token(EXISTS)) return true;
-    if (jj_3R_120()) return true;
-    return false;
-  }
-
   private boolean jj_3R_124() {
     if (jj_3R_128()) return true;
     return false;
@@ -5595,13 +5587,13 @@ public class ARQParser extends ARQParser
     return false;
   }
 
-  private boolean jj_3_1() {
-    if (jj_3R_40()) return true;
+  private boolean jj_3R_98() {
+    if (jj_3R_109()) return true;
     return false;
   }
 
-  private boolean jj_3R_98() {
-    if (jj_3R_109()) return true;
+  private boolean jj_3_1() {
+    if (jj_3R_40()) return true;
     return false;
   }
 
@@ -6577,6 +6569,17 @@ public class ARQParser extends ARQParser
     return false;
   }
 
+  private boolean jj_3R_128() {
+    if (jj_scan_token(LBRACKET)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_108() {
+    if (jj_scan_token(EXISTS)) return true;
+    if (jj_3R_120()) return true;
+    return false;
+  }
+
   /** Generated Token Manager. */
   public ARQParserTokenManager token_source;
   JavaCharStream jj_input_stream;



Mime
View raw message