Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The API supports only HTTP POST calls. GET, HEAD, and other methods are not supported, and will return a response code of 405 Method Not Allowed.

Parameters

namevaluenotes
emailthe email address of a VIVO administrator account
passwordthe password of the VIVO administrator account
updateA SPARQL Update requestOptional. If used, request content type must be set to application/x-www-form-urlencoded and the update data must be URL-encoded.

The syntax for a SPARQL Update request is described on the World Wide Web Consortium site at http://www.w3.org/TR/2013/REC-sparql11-update-20130321/

Limitation

Note

The API requires that you specify

...

GRAPH in your SPARQL update request. Insertions or deletions to the default (unnamed) graph are not supported, as VIVO displays only the triples that exist in named graphs.  While you may insert into or delete from any named graph, the examples below specify the graph http://vitro.mannlib.cornell.edu/default/vitro-kb-2.  Use this graph to allow the triples you insert to be editable through the VIVO application's web interface.

Sending data via the POST body vs the 'update' parameter

The API supports sending data via an 'update' parameter. Prior to v1.13.0, this was the only method of sending SPARQL update data. Since 1.13.0, VIVO also supports sending data via the POST message body. To use this method, you must set the request content type to application/sparql-update. This method parses the data as an input stream and may offer a performance improvement for large amounts of data. 

Response Codes

CodeReason
200 OKSPARQL Update was successful.
400 Bad RequestHTTP request content type was set to application/x-www-form-urlencoded and did not include an update parameter.
The SPARQL Update request did not specify a GRAPH.
The SPARQL Update request was syntactically incorrect.
403 ForbiddenHTTP request did not include an email parameter.
HTTP request did not include a password parameter.
The combination of email and password is not valid.
The selected VIVO account is not authorized to use the SPARQL Update API.
405 Method Not AllowedIncorrect HTTP method; only POST is accepted.
500 Internal Server ErrorVIVO could not execute the request; internal code threw an exception.

Examples

These examples use the UNIX curl command to insert and delete data using the API.

...