Versions Compared

Key

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

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

namevalue
emailthe email address of a VIVO administrator account
passwordthe password of the VIVO administrator account
queryA 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

CodeReason
200 OKSPARQL query was successful.
400 Bad RequestHTTP request did not include a query parameter.
The SPARQL query was syntactically incorrect.
The type of the SPARQL query was not SELECTASKCONSTRUCT, or DESCRIBE
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 Query API.
406 Not AcceptableThe Accept header does not include any available content types.
500 Internal Server ErrorVIVO 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 headerResponse formatFormat description
text/plaintext
 

text/csvCSVhttp://www.w3.org/TR/2013/REC-sparql11-results-csv-tsv-20130321 
text/tab-separated-valuesTSV
application/sparql-results+xmlXMLhttp://www.w3.org/TR/2013/REC-rdf-sparql-XMLres-20130321
application/sparql-results+jsonJSONhttp://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 headerResponse formatFormat description
text/plainN-Triples http://www.w3.org/2001/sw/RDFCore/ntriples/
application/rdf+xmlRDF/XMLhttp://www.w3.org/TR/rdf-syntax-grammar/
text/n3N3http://www.w3.org/TeamSubmission/n3/
text/turtleTurtlehttp://www.w3.org/TeamSubmission/turtle/
application/jsonJSON-LDhttp://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.