Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1589

POST query with comments fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: Jena 3.8.0
    • Fix Version/s: None
    • Component/s: Fuseki
    • Labels:
      None

      Description

      With a query file /tmp/test.rq
      ---------------
      select *
      where

      { ?s ?p ?o } limit 10
      ---------------

      curl -X POST -H "Content-type: application/sparql-query" --data @/tmp/test.rq http://localhost:3030/stw/query

      works nicely, whereas
      ---------------
      # test query
      select *
      where { ?s ?p ?o }

      limit 10
      ---------------

      fails with the message:

      Error 400: Parse error:

      1. test queryselect *where {?s ?p ?o} limit 10
        Encountered "<EOF>" at line 1, column 45.
        Was expecting one of:
        "\ufeff" ...
        "base" ...
        "prefix" ...
        "select" ...
        "json" ...
        "describe" ...
        "construct" ...
        "ask" ...

      Fuseki - version 3.8.0 (Build date: 2018-06-25T11:00:34+0000)

      The spec (https://www.w3.org/TR/sparql11-protocol/#query-via-post-direct) says “When using this approach, clients must include the SPARQL query string, unencoded, and nothing else as the message body of the request”. I’d hope “nothing else” does not preclude comment lines. Rather I'd suspect that the concatination "# test queryselect " causes the error.

      Cheers, Joachim

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jneubert Joachim Neubert
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: