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

Line numbers are incorrect in SPARQL UPDATE error messages

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: BLAZEGRAPH_RELEASE_1_5_3
    • Component/s: None
    • Labels:
      None

      Description

      The line numbers reported in a SPARQL UPDATE error messages are incorrect if the operation uses an INSERT DATA or DELETE DATA block.

      This issue was introduced when the PrefixDeclProcessor was modified to automatically introduce all "well known" prefix declarations into SPARQL queries as part of updating the SPARQL UPDATE grammar during the migration to openrdf 2.7.

      See PrefixDeclProcessor.createPrefixesInSPARQLFormat().

      The following SPARQL UPDATE request reports an error in line 13. This is because 12 PREFIX declarations have been injected into the SPARQL UPDATE request that are "well-known" and not explicitly referenced by the query (it used to be done conditionally).

      INSERT DATA { GRAPH <a> { <a> <a> <a> <a> } }
      

      The error message follows. Clearly the query above has no line 13!

               ERROR: SPARQL-UPDATE: updateStr=INSERT DATA { GRAPH  {     } }
      java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found '>' [line 13]
      

        Issue Links

          Activity

          Hide
          maria.krokhaleva maria.krokhaleva added a comment -

          12 PREFIX declarations, which have been injected into the SPARQL UPDATE request, are not the only reason of the incorrect error message. If it fixed, an error message will always report [line 1] instead of [line 13]. It takes place because of all the new_line chars are removed from the original query during the parsing. Therefore we had to change SPARQL grammar definitions files (jj, jjt) to keep new_line chars as a part of syntax tree.

          Show
          maria.krokhaleva maria.krokhaleva added a comment - 12 PREFIX declarations, which have been injected into the SPARQL UPDATE request, are not the only reason of the incorrect error message. If it fixed, an error message will always report [line 1] instead of [line 13] . It takes place because of all the new_line chars are removed from the original query during the parsing. Therefore we had to change SPARQL grammar definitions files (jj, jjt) to keep new_line chars as a part of syntax tree.
          Hide
          bryanthompson bryanthompson added a comment -

          Assigned to Brad to figure out the fix version and close,.

          Show
          bryanthompson bryanthompson added a comment - Assigned to Brad to figure out the fix version and close,.
          Hide
          igorkim igorkim added a comment - - edited
          Show
          igorkim igorkim added a comment - - edited PR was merged to master on Aug 27: https://github.com/SYSTAP/bigdata/pull/140#event-394245821

            People

            • Assignee:
              beebs Brad Bebee
              Reporter:
              bryanthompson bryanthompson
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: