Details

    • Type: Bug
    • Status: Accepted
    • Resolution: Unresolved
    • Affects Version/s: BIGDATA_RELEASE_1_4_0
    • Fix Version/s: None
    • Component/s: Bigdata RDF Database
    • Labels:
      None

      Description

      We picked up a number of negative parser test failures with openrdf 2.7. These include:

       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-BINDscope6.rq"	15 ms	1
       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-BINDscope7.rq"	85 ms	1
       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-BINDscope8.rq"	15 ms	1
       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-SELECTscope2"	15 ms	1
       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-update-25.ru"	16 ms	1
       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-update-31.ru"	17 ms	1
       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-update-bad-12.ru"	14 ms	1
       com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQL11SyntaxTest."syntax-update-54.ru"
      

      These tests should be fixed.

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        I have conditionally disabled these tests by filtering the data driven test suite for known bad tests.

        Show
        bryanthompson bryanthompson added a comment - I have conditionally disabled these tests by filtering the data driven test suite for known bad tests.
        Hide
        bryanthompson bryanthompson added a comment -

        I've managed to clean up 3 of the syntax errors in CI. The rest will have to wait a bit longer.

        Show
        bryanthompson bryanthompson added a comment - I've managed to clean up 3 of the syntax errors in CI. The rest will have to wait a bit longer.
        Hide
        bryanthompson bryanthompson added a comment -

        syntax-update-54.ru: I am not sure why this request should be illegal. We evaluate this update request and insert two triples each time it is run. The triples have distinct blank nodes. A review of http://www.w3.org/TR/sparql11-update/#insertData does not provide an explanation of why this is considered an invalid request.

        PREFIX : <http://www.example.org/>
        
        INSERT DATA { _:b1 :p :o }
        ;
        INSERT DATA { _:b1 :p :o } 
        
        Show
        bryanthompson bryanthompson added a comment - syntax-update-54.ru: I am not sure why this request should be illegal. We evaluate this update request and insert two triples each time it is run. The triples have distinct blank nodes. A review of http://www.w3.org/TR/sparql11-update/#insertData does not provide an explanation of why this is considered an invalid request. PREFIX : <http://www.example.org/> INSERT DATA { _:b1 :p :o } ; INSERT DATA { _:b1 :p :o }
        Hide
        bryanthompson bryanthompson added a comment -

        Blank nodes are not allowed in DELETE DATA. Again, this is about when we process the QUADS DATA block. However, this update request is actually executed, which is an error. It MUST be rejected when we process the QUADS DATA block.

        syntax-update-bad-12

        # BNode in DELETE DATA
        DELETE DATA { _:a <p> <o> }
        

        Fixed in 2d26a1a06926a88fa4f9a922671f08b0b5349fb6
        - See BLZG-1186

        Show
        bryanthompson bryanthompson added a comment - Blank nodes are not allowed in DELETE DATA. Again, this is about when we process the QUADS DATA block. However, this update request is actually executed, which is an error. It MUST be rejected when we process the QUADS DATA block. syntax-update-bad-12 # BNode in DELETE DATA DELETE DATA { _:a <p> <o> } Fixed in 2d26a1a06926a88fa4f9a922671f08b0b5349fb6 - See BLZG-1186
        Hide
        bryanthompson bryanthompson added a comment -

        syntax-update-25.ru

        INSERT DATA { 
          <s1> <p1> <o1>
          GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> } 
          GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> } 
          <s1> <p1> <o1>
        }
        

        Since the QUADS DATA block is not parsed until later, we do not report this error when the parser runs. However, we do report the error when the update request is executed. It is an open question how we could force the parse of this QUADS DATA block early in order to pass this test yet defer it until execution for more scalable INSERT DATA / DELETE DATA requests.

        ERROR: 17514      qtp1215321913-21 com.bigdata.rdf.sail.webapp.BigdataRDFServlet.launderThrowable(BigdataRDFServlet.java:191): cause=java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13], query=SPARQL-UPDATE: updateStr=
        INSERT DATA { 
          <s1> <p1> <o1>
          GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> } 
          GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> } 
          <s1> <p1> <o1>
        }
        
        java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13]
        	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        	at java.util.concurrent.FutureTask.get(FutureTask.java:188)
        	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:261)
        	at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlUpdate(QueryServlet.java:359)
        	at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:165)
        	at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:237)	at com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doPost(MultiTenancyServlet.java:137)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
        	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
        	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
        	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
        	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
        	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
        	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
        	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
        	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        	at org.eclipse.jetty.server.Server.handle(Server.java:497)
        	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
        	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
        	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
        	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
        	at java.lang.Thread.run(Thread.java:745)
        Caused by: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13]
        	at com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser.parseUpdate2(Bigdata2ASTSPARQLParser.java:330)
        	at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlUpdateTask.call(QueryServlet.java:430)
        	at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlUpdateTask.call(QueryServlet.java:1)
        	at com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:68)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        	at com.bigdata.rdf.task.AbstractApiTask.submitApiTask(AbstractApiTask.java:365)
        	at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:258)
        	... 26 more
        Caused by: com.bigdata.rdf.sail.sparql.ast.VisitorException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13]
        	at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.doUnparsedQuadsDataBlock(UpdateExprBuilder.java:768)
        	at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.visit(UpdateExprBuilder.java:153)
        	at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.visit(UpdateExprBuilder.java:1)
        	at com.bigdata.rdf.sail.sparql.ast.ASTInsertData.jjtAccept(ASTInsertData.java:23)
        	at com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser.parseUpdate2(Bigdata2ASTSPARQLParser.java:301)
        	... 32 more
        Caused by: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13]
        	at org.openrdf.rio.helpers.RDFParserHelper.reportFatalError(RDFParserHelper.java:441)
        	at org.openrdf.rio.helpers.RDFParserBase.reportFatalError(RDFParserBase.java:671)
        	at org.openrdf.rio.turtle.TurtleParser.reportFatalError(TurtleParser.java:1306)
        	at org.openrdf.rio.turtle.TurtleParser.verifyCharacterOrFail(TurtleParser.java:1185)
        	at org.openrdf.rio.turtle.TurtleParser.parseQNameOrBoolean(TurtleParser.java:1035)
        	at org.openrdf.rio.turtle.TurtleParser.parseValue(TurtleParser.java:618)
        	at org.openrdf.rio.turtle.TurtleParser.parseSubject(TurtleParser.java:449)
        	at org.openrdf.rio.turtle.TurtleParser.parseTriples(TurtleParser.java:383)
        	at org.openrdf.repository.sail.helpers.SPARQLUpdateDataBlockParser.parseGraph(SPARQLUpdateDataBlockParser.java:166)
        	at org.openrdf.rio.trig.TriGParser.parseStatement(TriGParser.java:119)
        	at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:216)
        	at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.doUnparsedQuadsDataBlock(UpdateExprBuilder.java:765)
        	... 36 more
        

        The same analysis applies to: syntax-update-31.ru. We report the error when we parse the QUADS_DATA block (java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [13|line])

        DELETE DATA { 
          <s1> <p1> <o1>
          GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> } 
          GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> } 
          <s1> <p1> <o1>
        }
        
        Show
        bryanthompson bryanthompson added a comment - syntax-update-25.ru INSERT DATA { <s1> <p1> <o1> GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> } GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> } <s1> <p1> <o1> } Since the QUADS DATA block is not parsed until later, we do not report this error when the parser runs. However, we do report the error when the update request is executed. It is an open question how we could force the parse of this QUADS DATA block early in order to pass this test yet defer it until execution for more scalable INSERT DATA / DELETE DATA requests. ERROR: 17514 qtp1215321913-21 com.bigdata.rdf.sail.webapp.BigdataRDFServlet.launderThrowable(BigdataRDFServlet.java:191): cause=java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13], query=SPARQL-UPDATE: updateStr= INSERT DATA { <s1> <p1> <o1> GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> } GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> } <s1> <p1> <o1> } java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:188) at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:261) at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlUpdate(QueryServlet.java:359) at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:165) at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:237) at com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doPost(MultiTenancyServlet.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:497) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539) at java.lang.Thread.run(Thread.java:745) Caused by: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13] at com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser.parseUpdate2(Bigdata2ASTSPARQLParser.java:330) at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlUpdateTask.call(QueryServlet.java:430) at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlUpdateTask.call(QueryServlet.java:1) at com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at com.bigdata.rdf.task.AbstractApiTask.submitApiTask(AbstractApiTask.java:365) at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:258) ... 26 more Caused by: com.bigdata.rdf.sail.sparql.ast.VisitorException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13] at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.doUnparsedQuadsDataBlock(UpdateExprBuilder.java:768) at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.visit(UpdateExprBuilder.java:153) at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.visit(UpdateExprBuilder.java:1) at com.bigdata.rdf.sail.sparql.ast.ASTInsertData.jjtAccept(ASTInsertData.java:23) at com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser.parseUpdate2(Bigdata2ASTSPARQLParser.java:301) ... 32 more Caused by: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [line 13] at org.openrdf.rio.helpers.RDFParserHelper.reportFatalError(RDFParserHelper.java:441) at org.openrdf.rio.helpers.RDFParserBase.reportFatalError(RDFParserBase.java:671) at org.openrdf.rio.turtle.TurtleParser.reportFatalError(TurtleParser.java:1306) at org.openrdf.rio.turtle.TurtleParser.verifyCharacterOrFail(TurtleParser.java:1185) at org.openrdf.rio.turtle.TurtleParser.parseQNameOrBoolean(TurtleParser.java:1035) at org.openrdf.rio.turtle.TurtleParser.parseValue(TurtleParser.java:618) at org.openrdf.rio.turtle.TurtleParser.parseSubject(TurtleParser.java:449) at org.openrdf.rio.turtle.TurtleParser.parseTriples(TurtleParser.java:383) at org.openrdf.repository.sail.helpers.SPARQLUpdateDataBlockParser.parseGraph(SPARQLUpdateDataBlockParser.java:166) at org.openrdf.rio.trig.TriGParser.parseStatement(TriGParser.java:119) at org.openrdf.rio.turtle.TurtleParser.parse(TurtleParser.java:216) at com.bigdata.rdf.sail.sparql.UpdateExprBuilder.doUnparsedQuadsDataBlock(UpdateExprBuilder.java:765) ... 36 more The same analysis applies to: syntax-update-31.ru. We report the error when we parse the QUADS_DATA block (java.util.concurrent.ExecutionException: org.openrdf.query.MalformedQueryException: org.openrdf.rio.RDFParseException: Expected ':', found ' ' [13|line] ) DELETE DATA { <s1> <p1> <o1> GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> } GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> } <s1> <p1> <o1> }
        Hide
        bryanthompson bryanthompson added a comment -

        All of these have the same underlying issue. The test suite wants us to reject these in the parser based on the variables that are maybe bound by the query. Such variables may not be bound by a BIND in the same scope.

        syntax-BINDscope6.rq: this should be failed because ?o1 is bound by a statement pattern so it can not be the bound by BIND (SPARQL does not really do unification for BIND).

         PREFIX : <http://www.example.org>
         SELECT *
         WHERE {
            :s :p ?o .
            :s :q ?o1 .
            BIND((1+?o) AS ?o1)
         }  
        

        syntax-BINDscope7.rq: this is the same thing but ?o1 becomes bound in a child join group.

        PREFIX : <http://www.example.org>
         SELECT *
         WHERE {
            {
            :s :p ?o .
            :s :q ?o1 .
            }
            BIND((1+?o) AS ?o1)
         }  
        

        syntax-BINDscope8.rq: ?Y becomes bound inside of the UNION.

        PREFIX : <http://www.example.org>
        SELECT *
          {
            {
               { :s :p ?Y }
               UNION
               { :s :p ?Z }
            }
           BIND (1 AS ?Y) 
         }
        

        syntax-SELECTscope2: This is another example of a BIND of a variable that is already bound. Just in this case the assignment node is used rather than an explicit BIND

        SELECT (1 AS ?X ) 
          {
            SELECT (2 AS ?X ) {} 
          }
        
        Show
        bryanthompson bryanthompson added a comment - All of these have the same underlying issue. The test suite wants us to reject these in the parser based on the variables that are maybe bound by the query. Such variables may not be bound by a BIND in the same scope. syntax-BINDscope6.rq: this should be failed because ?o1 is bound by a statement pattern so it can not be the bound by BIND (SPARQL does not really do unification for BIND). PREFIX : <http://www.example.org> SELECT * WHERE { :s :p ?o . :s :q ?o1 . BIND((1+?o) AS ?o1) } syntax-BINDscope7.rq: this is the same thing but ?o1 becomes bound in a child join group. PREFIX : <http://www.example.org> SELECT * WHERE { { :s :p ?o . :s :q ?o1 . } BIND((1+?o) AS ?o1) } syntax-BINDscope8.rq: ?Y becomes bound inside of the UNION. PREFIX : <http://www.example.org> SELECT * { { { :s :p ?Y } UNION { :s :p ?Z } } BIND (1 AS ?Y) } syntax-SELECTscope2: This is another example of a BIND of a variable that is already bound. Just in this case the assignment node is used rather than an explicit BIND SELECT (1 AS ?X ) { SELECT (2 AS ?X ) {} }

          People

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

            Dates

            • Created:
              Updated: