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

SPARQL Update parser fails on invalid numeric literals

    XMLWordPrintable

    Details

      Description

      Original issue when running the updater:

      Caused by: java.lang.NumberFormatException
              at java.math.BigDecimal.<init>(BigDecimal.java:545)
              at java.math.BigDecimal.<init>(BigDecimal.java:739)
              at com.bigdata.rdf.internal.IVUtility.decode(IVUtility.java:988)
              at
      com.bigdata.rdf.sail.sparql.ASTDeferredIVResolutionInitializer.getBigdataValue(ASTDeferredIVResolutionInitializer.java:344)
              at
      com.bigdata.rdf.sail.sparql.ASTDeferredIVResolutionInitializer.process(ASTDeferredIVResolutionInitializer.java:209)
              at
      com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser.parseUpdate2(Bigdata2ASTSPARQLParser.java:279)
              at
      com.bigdata.rdf.sail.webapp.QueryServlet$SparqlUpdateTask.call(QueryServlet.java:521)
              at
      com.bigdata.rdf.sail.webapp.QueryServlet$SparqlUpdateTask.call(QueryServlet.java:460)
              at
      com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:68)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              at
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              ... 1 more
      
      

      The full log is here:
      https://gist.githubusercontent.com/smalyshev/6f710f93d8831143f6eb/raw/421e409b9e79d1a4de55eef105d1e1706ae38d9f/gistfile1.txt

      Bryan: It seems likely that this is about an illegal value (in the specific UPDATE request). However, it also seems that the option for xsd validation might not be consistently respected. Two different issues. Finally, we need better error messages for rejected values.

      Root cause details:
      After SPARQL Parsers refactoring (https://jira.blazegraph.com/browse/BLZG-1176), this portion of SPARQL Update processing does not have any access to journal and namespace configurations.

      Also, a typed literal consists of a lexical form and a datatype, which restricts 'value space' and 'lexical space' of the corresponding values according to XML Schema Datatypes, and does not seem to be allowing an empty string as a lexical form.

      Subtasks:

      • allow invalid literals in ASTDeferredIVResolutionInitializer.getBigdataValue() and provide FullyInlineTypedLiteralIV with an empty value without calling IVUtility.decode() to avoid NumberFormatException
      • check for INLINE_XSD_DATATYPE_LITERALS and REJECT_INVALID_XSD_VALUES while executing an update and fail if invalid literals should be rejected.
      • handle SPARQL type error during query evaluation, providing comprehensible error message.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igorkim igorkim
              Reporter:
              igorkim igorkim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: