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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • KiWi Triple Store
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: