Amazon Neptune
User Guide (API Version 2017-11-29)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

SPARQL Query Cancellation

To get the status of SPARQL queries, use HTTP GET or POST to make a request to the https://your-neptune-endpoint:port/sparql/status endpoint.

SPARQL Query Cancellation Request Parameters

cancelQuery

(Required) Tells the status command to cancel a query. This parameter does not take a value.

queryId

(Required) The ID of the running SPARQL query to cancel.

silent

(Optional) If silent=true then the running query is cancelled and the HTTP response code is 200. If silent is not present or silent=false, the query is cancelled with an HTTP 500 status code.

SPARQL Query Cancellation Examples

Example 1: Cancellation with silent=false

The following is an example of the status command using curl to cancel a query with the silent parameter set to false:

curl https://your-neptune-endpoint:port/sparql/status \ -d "cancelQuery" \ -d "queryId=4d5c4fae-aa30-41cf-9e1f-91e6b7dd6f47" \ -d "silent=false"

This command would return a response like this:

{ "acceptedQueryCount": 10, "runningQueryCount": 1, "counters": { "/averageElapsedMillisPerQuery": "10163.8", "/blockedWorkQueueCount": "0", "/blockedWorkQueueRunningTotal": "0", "/bufferedChunkMessageBytesOnNativeHeap": "0", "/bufferedChunkMessageCount": "-25", "/deadlineQueueSize": "1", "/operatorActiveCount": "1", "/operatorHaltCount": "20", "/operatorStartCount": "21", "/operatorTasksPerQuery": "4.0", "/queryDoneCount": "5", "/queryErrorCount": "3", "/queryStartCount": "5" }, "queries": [] }

The cancelled query would then return an HTTP 500 code with a response like this:

{ "code": "CancelledByUserException", "requestId": "4d5c4fae-aa30-41cf-9e1f-91e6b7dd6f47", "detailedMessage": "Operation terminated (cancelled by user)" }

Example 2: Cancellation with silent=true

The following is an example of the same status command as above except with the silent parameter now set to true:

curl https://your-neptune-endpoint:port/sparql/status \ -d "cancelQuery" \ -d "queryId=4d5c4fae-aa30-41cf-9e1f-91e6b7dd6f47" \ -d "silent=true"

This command would return the same response as when silent=false, but the cancelled query would now return an HTTP 200 code with a response like this:

{ "head" : { "vars" : [ "s", "p", "o" ] }, "results" : { "bindings" : [ ] } }