You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2012/08/15 22:27:08 UTC

svn commit: r1373613 - in /jena/trunk/jena-fuseki: ReleaseNotes.txt src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java

Author: andy
Date: Wed Aug 15 20:27:08 2012
New Revision: 1373613

URL: http://svn.apache.org/viewvc?rev=1373613&view=rev
Log:
JENA-295 completed (using-graph-uri= using-named-graph-uri=).

Modified:
    jena/trunk/jena-fuseki/ReleaseNotes.txt
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java

Modified: jena/trunk/jena-fuseki/ReleaseNotes.txt
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/ReleaseNotes.txt?rev=1373613&r1=1373612&r2=1373613&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/ReleaseNotes.txt (original)
+++ jena/trunk/jena-fuseki/ReleaseNotes.txt Wed Aug 15 20:27:08 2012
@@ -2,6 +2,8 @@
 
 == Fuseki 0.2.4
 
++ JENA-295 - Implement using-graph-uri= and using-named-graph-uri=
+
 == Fuseki 0.2.3
 
 + Add a script to support running Fuseki as a service (JENA-268)

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java?rev=1373613&r1=1373612&r2=1373613&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_Update.java Wed Aug 15 20:27:08 2012
@@ -42,7 +42,6 @@ import org.apache.jena.fuseki.http.HttpS
 import org.apache.jena.fuseki.server.DatasetRef ;
 import org.apache.jena.iri.IRI ;
 import org.openjena.atlas.io.IO ;
-import org.openjena.atlas.lib.Bytes ;
 import org.openjena.atlas.web.MediaType ;
 import org.openjena.riot.WebContent ;
 import org.openjena.riot.system.IRIResolver ;
@@ -108,16 +107,7 @@ public class SPARQL_Update extends SPARQ
             else
                 ctStr = incoming.getContentType() ;
         }
-        // ----
-        // using-graph-uri
-        // using-named-graph-uri
-        // then modify the parsed query - find all UpdateWithUsing and .
-        
-        /* [It is an error to supply the using-graph-uri or using-named-graph-uri parameters 
-         * when using this protocol to convey a SPARQL 1.1 Update request that contains an 
-         * operation that uses the USING, USING NAMED, or WITH clause.]
-         */
-        
+
         if (WebContent.contentTypeSPARQLUpdate.equals(ctStr))
         {
             executeBody(action) ;
@@ -202,11 +192,10 @@ public class SPARQL_Update extends SPARQ
             if ( super.verbose_debug || action.verbose )
             {
                 // Verbose mode only .... capture request for logging (does not scale). 
-                // Content-Length.
-                //String requestStr = IO.readWholeFileAsUTF8(action.request.getInputStream()) ;
-                // (fixed)Bug in atlas.IO
-                byte[] b = IO.readWholeFile(input) ;
-                String requestStr = Bytes.bytes2string(b) ;
+                String requestStr = null ;
+                try { requestStr = IO.readWholeFileAsUTF8(action.request.getInputStream()) ; }
+                catch (IOException ex) { IO.exception(ex) ; }
+
                 String requestStrLog = formatForLog(requestStr) ;
                 requestLog.info(format("[%d] Update = %s", action.id, requestStrLog)) ;
                 req = UpdateFactory.create(requestStr, Syntax.syntaxARQ) ;
@@ -253,6 +242,11 @@ public class SPARQL_Update extends SPARQ
         finally { action.endWrite() ; }
     }
 
+    /* [It is an error to supply the using-graph-uri or using-named-graph-uri parameters 
+     * when using this protocol to convey a SPARQL 1.1 Update request that contains an 
+     * operation that uses the USING, USING NAMED, or WITH clause.]
+     */
+    
     private void processProtocol(HttpServletRequest request, UpdateRequest updateRequest)
     {
         String[] usingArgs = request.getParameterValues(paramUsingGraphURI) ;
@@ -281,9 +275,6 @@ public class SPARQL_Update extends SPARQ
                     upu.addUsingNamed(createNode(a)) ;
             }
         }
-        
-//        String x = formatForLog(updateRequest.toString()) ;
-//        requestLog.info("Processed: "+x) ;
     }
     
     private static Node createNode(String x)