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

Fix the SPARQL grammar to accept ASK in combination with GROUP BY

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Bigdata RDF Database
    • Labels:
      None

      Description

      This query (ticket-618g.rq) fails:

      PREFIX ex: http://example.org/
      ASK

      { ?x ex:r ?y . ?y ex:q ?z }

      GROUP BY ?x ?y
      ORDER BY DESC(max(?z)) ?x (count(?z)) DESC(?y)

      Apparently, the current grammar does not allow GROUP BY with ASK:

      > org.openrdf.query.MalformedQueryException: Encountered " "group" "GROUP ""
      > at line 10, column 1.
      > Was expecting one of:
      >
      > "bindings" ...
      > "values" ...
      >
      > at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.generateParseException(SyntaxTreeBuilder.java:9718)
      > at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.jj_consume_token(SyntaxTreeBuilder.java:9585)
      > at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.QueryContainer(SyntaxTreeBuilder.java:213)
      > at com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder.parseQuery(SyntaxTreeBuilder.java:32)
      > at com.bigdata.rdf.sail.sparql.Bigdata2ASTSPARQLParser.parseQuery2(Bigdata2ASTSPARQLParser.java:336)
      > at com.bigdata.rdf.sparql.ast.eval.AbstractDataDrivenSPARQLTestCase$TestHelper.<init>(AbstractDataDrivenSPARQLTestCase.java:268)
      > at com.bigdata.rdf.sparql.ast.eval.AbstractDataDrivenSPARQLTestCase$TestHelper.<init>(AbstractDataDrivenSPARQLTestCase.java:200)
      > at com.bigdata.rdf.sparql.ast.eval.AbstractDataDrivenSPARQLTestCase$TestHelper.<init>(AbstractDataDrivenSPARQLTestCase.java:181)
      > at com.bigdata.rdf.sparql.ast.eval.TestTickets.test_ticket_618g(TestTickets.java:152)

      The official SPARQL 1.1 grammar seems to allow combining ASK with any SolutionModifier
      (see https://www.w3.org/TR/sparql11-query/#rAskQuery), and it makes some sense from the application point of view (query debugging).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              beebs Brad Bebee
              Reporter:
              alexr Alexandre Riazanov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: