VIVO Documentation
Page History
...
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
name | value | notes |
---|---|---|
email | the email address of a VIVO administrator account | |
password | the password of the VIVO administrator account | |
update | A SPARQL Update request | Optional. 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 a 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
Code | Reason |
---|---|
200 OK | SPARQL Update was successful. |
400 Bad Request | HTTP 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 Forbidden | HTTP 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 Allowed | Incorrect HTTP method; only POST is accepted. |
500 Internal Server Error | VIVO 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.
...