[ 
https://issues.apache.org/jira/browse/MARMOTTA-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13878491#comment-13878491
 ] 

Sergio Fernández commented on MARMOTTA-426:
-------------------------------------------

Rob is right, SPARQL 1.1 introduced different query parameters for query and 
update operations. Further details at:
* http://www.w3.org/TR/sparql11-protocol/#query-operation
* http://www.w3.org/TR/sparql11-protocol/#update-operation

But... what Marmotta currently does out of the standard is to check for the 
'query' parameter if the 'update' is missing, in a way to allow the transition 
to legacy clients. But such feature could removed at any moment. So, please, 
*do not use it* if you are aware of the protocol change. 

> Sparql Update POST urlencoded expects wrong parameter
> -----------------------------------------------------
>
>                 Key: MARMOTTA-426
>                 URL: https://issues.apache.org/jira/browse/MARMOTTA-426
>             Project: Marmotta
>          Issue Type: Bug
>          Components: Platform, Web Services
>    Affects Versions: 3.1-incubating
>            Reporter: Francis De Brabandere
>            Assignee: Sebastian Schaffert
>              Labels: sparql, update
>             Fix For: 3.2
>
>
> According to the 1.1 Sparql protocol spec table at:
> http://www.w3.org/TR/sparql11-protocol/#query-operation
> A urlencoded post should use the "query" parameter for the query, currently 
> marmotta seems to be using the "update" parameter which is wrong.
> This causes the user to get a 400 reponse saying with the (currently 
> confusing) message "no SPARQL query specified"
> Test that reproduces this below:
> {code:java}
>     @Test
>     public void testUpdate() throws IOException, InterruptedException {
>         String insert =
>                 "PREFIX dc: <http://purl.org/dc/elements/1.1/>\n" +
>                 "INSERT DATA { <http://example/egbook3> dc:title \"This is an 
> example title\" }";
>         expect().
>             log().ifError().
>                 statusCode(200).
>                 given().
>                 contentType("application/x-www-form-urlencoded").
>                 header("Accept", "application/xml").
>                 formParameter("query", insert).
>                 when().
>                 post("/sparql/update");
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to