Uploaded image for project: 'Marmotta'
  1. Marmotta
  2. MARMOTTA-618

CONSTRUCT Sparql Command fails with "no result format specified ..."

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.0
    • Component/s: KiWi Triple Store
    • Labels:
      None
    • Environment:

      marmotta-3.4.0-SNAPSHOT; Tomcat7 - executed with: mvn tomcat7:run
      Operating System: Linux

      Description

      CONSTRUCT-Sparql-Request fails with "no result format specified or unsupported format".

      In SparqlWebService.select an extensive request header parsing is done to determine the best content type to use for the response.

      Reason: in the above environment - the method

       List<String> acceptHeaders = EnumerationUtils.toList(request.getHeaders(ACCEPT));
      

      does not produce a list with each requested accept header, instead a list with a single entry containing all accept headers is created - example below:

      "application/n-triples;q=0.7, text/plain;q=0.7, application/rdf+xml;q=0.8, application/xml;q=0.8, text/turtle, application/x-turtle, application/trig;q=0.8, application/x-trig;q=0.8"
      

      This string is then further parsed with

      List<ContentType> acceptedTypes = HttpMarmottaUtils.parseAcceptHeaders(List<String>) 
      

      where the string is split into tokens. Problem: the leading space after each comma (",") is not stripped!!

      Solution: in MarmottaHttpUtils.java, method "parseContentType", each token should be trimmed - line 132.

      String mt[] = c.trim().split(";");
      

      Just provided the patch to "develop" branch

        Attachments

          Activity

            People

            • Assignee:
              dglachs Dietmar Glachs
              Reporter:
              dglachs Dietmar Glachs
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: