Search code examples
jmetersparqlrdfstardog

JMeter: SPARQL Query HTTP Request not updating DB


I have recently started working with SPARQL and JMeter. I was trying to load test Stardog. For that I used Jmeter and ran a SPARQL query which updates a value in the database, using HTTP Request. I tried running the Query in Stardog web interface and it changes the value in the DB just fine. When I run the same query using Jmeter it runs just fine but does not change the values in the DB. It would be very helpful if I knew what I am doing wrong. The query I am running is:

PREFIX info: <http://somewhere/peopleInfo#>
PREFIX vcard:<http://www.w3.org/2001/vcard-rdf/3.0#>

DELETE { ?person info:age ?age }
INSERT { ?person info:age ?nage }

WHERE {
 ?person vcard:FN 'Becky Smith' .
 ?person info:age ?age
 BIND (?age+1 AS ?nage)
}

The screenshots of Jmeter can be found here: https://onedrive.live.com/redir?resid=E29D7716CE8E7022!239767&authkey=!AEzPJtZJi-bbmjw&ithint=folder%2cpng

The rdf file I am using in Stardog can be found here (https://onedrive.live.com/redir?resid=E29D7716CE8E7022!239766&authkey=!ALBbaxM8nHhAXSw&ithint=file%2crdf).

Any help will be greatly appreciated. Thank you.

[Sorry for uploading Onedrive links, I am a new user and do not have enough reputation points to upload more than 2 links.]


Solution

  • I've not used JMeter, so I don't have any definitive answer on what precisely is wrong with your configuration, but I can see that there is some issue with it.

    The expected format for submitting a POST to Stardog's query endpoint is that the Content-Type is application/x-www-form-urlencoded and the body should be the query parameters sent to the endpoint. So, like with a GET request, it's expecting that to be query=<your query>. Looking at the second screenshot, it doesn't like that's configured correctly.

    This is confirmed by the response type of text/turtle and the response content of Stardog's SPARQL service description, which is what Stardog sends when the request is missing the query parameter.