Skip to content

Server API responses

teodormacicas edited this page Apr 25, 2013 · 13 revisions

Server-side API HTTP responses

Focus on this document over the responses that each server API method could return under different cases.

Regarding the text output, if you do not want it to be escaped, please pass the HTTP Header "Accept" with value "text/plain". Along with the HTTP errors, some short messages will be displayed as well. Their pattern is "(ERROR|OK) $URI $HTTP_CODE: $MESSAGE".

All methods would receive *406 Not Acceptable" if the mime type is not one of the following:

  • application/rdf+xml (for xml)
  • text/plain (for ntriples)
  • text/html (for html with escaped output)

Create a graph

  1. 200 OK: graph already exists, so the triples has been added to describe the graph
  2. 201 Created: successfully created
  3. 400 Bad Request: wrong parameters
  4. 500 Internal Server Error: ERS errors (any exceptions thrown while running this)
  5. 500 Internal Server Error: the graph triple could not be created (the graph itself is represented by a keyspace in Cassandra, but the triple describing the graph is stored in a different keyspace; this error refers to the insertion on the latter)

Test if a graph exists

  1. 200 OK: graph exists, return "TRUE" as part of message
  2. 200 OK: graph does not exist, return "FALSE" as part of message

Delete a graph together with all the entities stored in it

  1. 200 OK: graph does not exist, thus do nothing
  2. 200 OK: successfully deleted
  3. 400 Bad Request: wrong parameters
  4. 405 Method Not Allowed: attempting to delete a non-empty graph without passing the 'f' parameter set to 'true'
  5. 500 Internal Server Error: ERS errors

Bulkload a given graph with triples

  1. 200 OK: Bulkload successful
  2. 400 Bad Request: graph name is not given or it is empty
  3. 409 Conflict: graph does not exist; it must be created apriori

Create entity

  1. 200 OK: quad created
  2. 400 Bad Request: wrong parameters
  3. 409 Conflict: graph does not exist; it must be created apriori

Test if entity exists

  1. 200 OK: graph exists, return "TRUE" as part of message
  2. 200 OK: graph does not exist, return "FALSE" as part of message
  3. 400 Bad Request: wrong parameters
  4. 409 Conflict: graph does not exist (only if this is passed as input)

Update a given entity

  1. 200 OK: a successful update
  2. 400 Bad Request: wrong parameters
  3. 409 Conflict: graph does not exist

Delete an entity

  1. 200 OK: a successful delete
  2. 400 Bad Request: wrong parameters
  3. 409 Conflict: graph does not exist (only if this is passed as input)

Query an entity

  1. 200 OK: a successful query, return the quads if any
  2. 400 Bad Request: wrong parameters
  3. 409 Conflict: graph does not exist (only if this is passed as input)

Query entire graph

  1. 200 OK: a successful run of query, return the quads
  2. 200 OK: if given graph is empty
  3. 400 Bad Request: wrong parameters
  4. 403 Forbidden: query non-allowed keyspaces
  5. 409 Conflict: graph does not exist
  6. 500 Internal Server Error: ERS errors (any exceptions thrown while running this)

Query all graphs

  1. 200 OK: a successful run of query, return the quads if any
  2. 400 Bad Request: wrong parameters
Clone this wiki locally