VIVO Documentation
Page History
Table of Contents |
---|
Purpose
Permits external applications to obtain data from the VIVO data model.
...
Note |
---|
By default, the SPARQL Query API is disabled in VIVO, for security reasons. See Enabling the API |
Use Cases
Reusing data from VIVO
...
The API supports HTTP GET or POST calls.
Parameters
name | value |
---|---|
email | the email address of a VIVO administrator account |
password | the password of the VIVO administrator account |
query | A SPARQL query |
The syntax of the SPARQL query is described on the World Wide Web Consortium site at http://www.w3.org/TR/2013/REC-sparql11-query-20130321/
Response Codes
Code | Reason |
---|---|
200 OK | SPARQL query was successful. |
400 Bad Request | HTTP request did not include a query parameter. |
The SPARQL query was syntactically incorrect. | |
The type of the SPARQL query was not SELECT , ASK , CONSTRUCT , or DESCRIBE | |
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 Query API. | |
406 Not Acceptable | The Accept header does not include any available content types. |
500 Internal Server Error | VIVO could not execute the request; internal code threw an exception. |
Available content types
The request may include an Accept
header, to specify the preferred content type of the response. If no Accept
header is provided, the preferred content type is assumed to be text/plain
.
...
ASK
queries return a single result, which is either true
or false
.
MIME type in the Accept header | Response format | Format description |
---|---|---|
text/plain | text |
text/csv | CSV | http://www.w3.org/TR/2013/REC-sparql11-results-csv-tsv-20130321 |
text/tab-separated-values | TSV | |
application/sparql-results+xml | XML | http://www.w3.org/TR/2013/REC-rdf-sparql-XMLres-20130321 |
application/sparql-results+json | JSON | http://www.w3.org/TR/2013/REC-sparql11-results-json-20130321 |
For CONSTRUCT
or DESCRIBE queries
CONSTRUCT
and DESCRIBE
queries return RDF.
MIME type in the Accept header | Response format | Format description |
---|---|---|
text/plain | N-Triples | http://www.w3.org/2001/sw/RDFCore/ntriples/ |
application/rdf+xml | RDF/XML | http://www.w3.org/TR/rdf-syntax-grammar/ |
text/n3 | N3 | http://www.w3.org/TeamSubmission/n3/ |
text/turtle | Turtle | http://www.w3.org/TeamSubmission/turtle/ |
application/json | JSON-LD | http://www.w3.org/TR/json-ld/ |
Limitation
Queries can be performed against specific graphs. However, the graphs that hold application data are not accessible to the API. "Application data" means data that controls the functioning of the VIVO application, such as user accounts, page definitions, or display parameters.
...
After editing this file you need to restart tomcat.