You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@marmotta.apache.org by "Jakob Frank (JIRA)" <ji...@apache.org> on 2018/06/18 19:32:06 UTC

[jira] [Closed] (MARMOTTA-618) CONSTRUCT Sparql Command fails with "no result format specified ..."

     [ https://issues.apache.org/jira/browse/MARMOTTA-618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakob Frank closed MARMOTTA-618.
--------------------------------

Marmotta 3.4.0 released: https://s.apache.org/oBw2

> CONSTRUCT Sparql Command fails with "no result format specified ..."
> --------------------------------------------------------------------
>
>                 Key: MARMOTTA-618
>                 URL: https://issues.apache.org/jira/browse/MARMOTTA-618
>             Project: Marmotta
>          Issue Type: Bug
>          Components: KiWi Triple Store
>    Affects Versions: 3.4.0
>         Environment: marmotta-3.4.0-SNAPSHOT; Tomcat7 - executed with: mvn tomcat7:run
> Operating System: Linux
>            Reporter: Dietmar Glachs
>            Assignee: Dietmar Glachs
>            Priority: Trivial
>             Fix For: 3.4.0
>
>
> 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 
> {code:java}
>  List<String> acceptHeaders = EnumerationUtils.toList(request.getHeaders(ACCEPT));
> {code}
> 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:
> {code:java}
> "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"
> {code}
> This string is then further parsed with 
> {code:java}
> List<ContentType> acceptedTypes = HttpMarmottaUtils.parseAcceptHeaders(List<String>) 
> {code}
> 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.
> {code:java}
> String mt[] = c.trim().split(";");
> {code}
> Just provided the patch to "develop" branch 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)