Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-711

SPARQL UPDATE response inlines large DELETE or INSERT triple graphs

    Details

      Description

      Per [1], a SPARQL UPDATE request with a large INSERT or DELETE of triples explicitly represented in the UPDATE operation will echo those triples in the response.

      The pattern in [1] is not efficient. However, the UPDATE response should not make matters worse by sending back all of the data with the response.

      [1] http://sourceforge.net/projects/bigdata/forums/forum/676946/topic/6092294

        Activity

        beebs Brad Bebee created issue -
        Hide
        bryanthompson bryanthompson added a comment -

        My proposed change is to truncate the generated description of the Update operator. This description is produced in com.bigdata.rdf.sparql.ast.AbstractGraphDataUpdate.toString(int)

        Old code at line 131.

                    for(ISPO spo : data) {
                       
                        sb.append(spo.toString());
                        
                    }
        

        New code:

                    int i = 0;
                    
                    for(ISPO spo : data) {
                    
                        if (i >= 10) {
                            
                            /**
                             * Truncate the description.
                             * 
                             * Note: People sometimes push a LOT of data through with a
                             * DeleteData or InsertData operation. This truncates the
                             * description to avoid problems with log files or the echo
                             * of the update operations in a request by the NSS.
                             * 
                             * @see https://sourceforge.net/apps/trac/bigdata/ticket/613
                             *      (SPARQL UPDATE response inlines large DELETE or
                             *      INSERT triple graphs)
                             * 
                             * @see https
                             *      ://sourceforge.net/projects/bigdata/forums/forum
                             *      /676946/topic/6092294/index/page/1
                             */
                            
                            sb.append("... out of " + data.length + " statements\n");
        
                            // Break out of the loop.
                            break;
                            
                        }
                        
                        sb.append(spo.toString());
                        
                        i++;
                        
                    }
        
        

        Committed revision r6694.

        Show
        bryanthompson bryanthompson added a comment - My proposed change is to truncate the generated description of the Update operator. This description is produced in com.bigdata.rdf.sparql.ast.AbstractGraphDataUpdate.toString(int) Old code at line 131. for(ISPO spo : data) { sb.append(spo.toString()); } New code: int i = 0; for(ISPO spo : data) { if (i >= 10) { /** * Truncate the description. * * Note: People sometimes push a LOT of data through with a * DeleteData or InsertData operation. This truncates the * description to avoid problems with log files or the echo * of the update operations in a request by the NSS. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/613 * (SPARQL UPDATE response inlines large DELETE or * INSERT triple graphs) * * @see https * ://sourceforge.net/projects/bigdata/forums/forum * /676946/topic/6092294/index/page/1 */ sb.append("... out of " + data.length + " statements\n"); // Break out of the loop. break; } sb.append(spo.toString()); i++; } Committed revision r6694.
        Hide
        bryanthompson bryanthompson added a comment -

        Re-opened to address the same problem in DELETE+INSERT WHERE requests.

        Show
        bryanthompson bryanthompson added a comment - Re-opened to address the same problem in DELETE+INSERT WHERE requests.
        Hide
        bryanthompson bryanthompson added a comment -

        Added code to limit the #of statements in a DELETE clause or INSERT clause for a DELETE INSERT WHERE operation.

        Committed revision r6710.

        Show
        bryanthompson bryanthompson added a comment - Added code to limit the #of statements in a DELETE clause or INSERT clause for a DELETE INSERT WHERE operation. Committed revision r6710.
        Hide
        mylka mylka added a comment -

        I can confirm the fix. Tried it with r6713. My experimental queries have up to 6MB of SPARQL. The biggest one used to return a HTTP response of 13MB. Now all return a response that doesn't exceed 4KB.

        Thanks.

        Show
        mylka mylka added a comment - I can confirm the fix. Tried it with r6713. My experimental queries have up to 6MB of SPARQL. The biggest one used to return a HTTP response of 13MB. Now all return a response that doesn't exceed 4KB. Thanks.
        beebs Brad Bebee made changes -
        Field Original Value New Value
        Workflow Trac Import v2 [ 12547 ] Trac Import v3 [ 14098 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v3 [ 14098 ] Trac Import v4 [ 15427 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v4 [ 15427 ] Trac Import v5 [ 16813 ]
        beebs Brad Bebee made changes -
        Labels Issue_patch_20150625
        beebs Brad Bebee made changes -
        Status Closed - Won't Fix [ 6 ] Open [ 1 ]
        beebs Brad Bebee made changes -
        Status Open [ 1 ] Accepted [ 10101 ]
        beebs Brad Bebee made changes -
        Status Accepted [ 10101 ] In Progress [ 3 ]
        beebs Brad Bebee made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        beebs Brad Bebee made changes -
        Status Resolved [ 5 ] In Review [ 10100 ]
        beebs Brad Bebee made changes -
        Resolution Fixed [ 1 ] Done [ 10000 ]
        Status In Review [ 10100 ] Done [ 10000 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v5 [ 16813 ] Trac Import v6 [ 18030 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v6 [ 18030 ] Trac Import v7 [ 19427 ]
        beebs Brad Bebee made changes -
        Workflow Trac Import v7 [ 19427 ] Trac Import v8 [ 21048 ]

          People

          • Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: