jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1393120 - in /jena/trunk/jena-arq: ReleaseNotes.txt src/main/java/com/hp/hpl/jena/sparql/lang/ParserBase.java src/main/java/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java
Date Tue, 02 Oct 2012 19:23:53 GMT
Author: andy
Date: Tue Oct  2 19:23:53 2012
New Revision: 1393120

URL: http://svn.apache.org/viewvc?rev=1393120&view=rev
Log:
Blank node labels can not be reused across different INSERT DATA operations in the same SPARQL
Update Request (spec clarification)

Modified:
    jena/trunk/jena-arq/ReleaseNotes.txt
    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/ParserQueryBase.java

Modified: jena/trunk/jena-arq/ReleaseNotes.txt
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/ReleaseNotes.txt?rev=1393120&r1=1393119&r2=1393120&view=diff
==============================================================================
--- jena/trunk/jena-arq/ReleaseNotes.txt (original)
+++ jena/trunk/jena-arq/ReleaseNotes.txt Tue Oct  2 19:23:53 2012
@@ -4,10 +4,12 @@ ChangeLog for ARQ
 
 ==== ARQ 2.9.4
 
++ Blank node labels can not be reused across different INSERT DATA operations in the same
SPARQL Update Request
+  (spec clarification) 
 + JENA-322 : Make jcl-over-slf4 a required dependency
 + JENA-321 : Remove GraphStore.(start|finish)Request() (was previosuly deprecated)
 + Remove deprecated QueryExecutionBase.cancelAllowDrain (see JENA-93)
-+ Implement WG decision on BIND : use original semantics. 
++ Implement SPARQL-WG decision on BIND : use original semantics. 
 + JENA-294 : improved optimization of sequeneces of OPTIONALs where the grouois only OPTIONAL
and an equality filter
 + JENA-302 Add URIs for all XQuery/Xpath F&O functions for duration accessors
 + JENA-303 Add URIs for all XQuery/Xpath F&O functions where there are SPARQL functions

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=1393120&r1=1393119&r2=1393120&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 Tue Oct
 2 19:23:53 2012
@@ -297,9 +297,7 @@ public class ParserBase
     // -------- Basic Graph Patterns and Blank Node label scopes
     
     // A BasicGraphPattern is any sequence of TripleBlocks, separated by filters,
-    // but not by other graph patterns 
-    
-    // SPARQL does not have a straight syntactic unit for BGPs - but prefix does. 
+    // but not by other graph patterns. 
     
     protected void startBasicGraphPattern()
     { activeLabelMap.clear() ; }

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java?rev=1393120&r1=1393119&r2=1393120&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java Tue
Oct  2 19:23:53 2012
@@ -18,10 +18,7 @@
 
 package com.hp.hpl.jena.sparql.lang;
 
-import java.util.ArrayDeque ;
-import java.util.ArrayList ;
-import java.util.Deque ;
-import java.util.List ;
+import java.util.* ;
 
 import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.query.Query ;
@@ -78,6 +75,12 @@ public class ParserQueryBase extends Par
     protected void startQuery() {}
     protected void finishQuery() {}
 
+//    protected void startBasicGraphPattern()
+//    { activeLabelMap.clear() ; }
+//
+//    protected void endBasicGraphPattern()
+//    { oldLabels.addAll(activeLabelMap.getLabels()) ; }
+    
     // Move down to SPARQL 1.1 or rename as ParserBase
     protected void startUpdateOperation() {}
     protected void finishUpdateOperation() {}
@@ -90,9 +93,13 @@ public class ParserQueryBase extends Par
     {
         oldBNodesAreVariables = getBNodesAreVariables() ;
         setBNodesAreVariables(false) ;
+        activeLabelMap.clear() ;
     } 
+    
     protected void finishDataInsert(QuadDataAcc qd, int line, int col)
     {
+        oldLabels.addAll(activeLabelMap.getLabels()) ;
+        activeLabelMap.clear() ;
         setBNodesAreVariables(oldBNodesAreVariables) ;
     }
     
@@ -109,15 +116,23 @@ public class ParserQueryBase extends Par
         setBNodesAreAllowed(oldBNodesAreAllowed) ;
     }
     
+    Set<String> oldLabels2 = null ;
+    
     protected void startInsertTemplate(QuadAcc qd, int line, int col)
     {
         oldBNodesAreVariables = getBNodesAreVariables() ;
         setBNodesAreVariables(false) ;
+        // Hide used labels (INSERT DATA)
+        oldLabels2 = oldLabels ;
+        oldLabels = new HashSet<String>() ;
+        activeLabelMap.clear() ;
     }
     
     protected void finishInsertTemplate(QuadAcc qd, int line, int col)
     {
         setBNodesAreVariables(oldBNodesAreVariables) ;
+        oldLabels = oldLabels2 ;
+        activeLabelMap.clear() ;
     }
     
     protected void startDeleteTemplate(QuadAcc qd, int line, int col)



Mime
View raw message