SPARQL is a flexible query language for extracting data from RDF data stores. Kasabi supports provision of a fully-compliant SPARQL 1.0 endpoint against hosted datasets.
Overview
The SPARQL Endpoints exposed by Kasabi all conform to the SPARQL HTTP protocol. This specifies that queries are submitted to a SPARQL endpoint via a query parameter, as follows:
http://api.kasabi.com/dataset/nasa/apis/sparql?apikey=...&query=...The SPARQL query, which should conform to the SPARQL 1.0 query language, should be URL encoded before constructing the request URL
Response formats from the endpoint will depend on the type of query being submitted. SPARQL supports 4 forms of query. Two of these (SELECT and ASK) can be returned in standard XML and JSON formats. The remaining two (CONSTRUCT and DESCRIBE) can be returned in any of the available RDF serializations supported by Kasabi: RDF/XML, RDF/JSON, Turtle, and Ntriples.
Further Reading
Quick Examples
Basic API Reference
Endpoint URL
The base URI of a Lookup API will be displayed on the homepage for the API itself.
Authentication
To access the API will require use of your API key. For more information on Kasabi authentication options read the authentication documentation.
Parameters
As defined in the SPARQL HTTP Protocol, all SPARQL endpoints accept a query parameter whose value is a url-encoded SPARQL query:
HTTP Response Codes
Clients should be prepared to receive any valid HTTP response code. The following table lists the most frequently used codes
| Code | Meaning |
|---|---|
| 202 Accepted | Request to update data has been accepted |
| 400 Bad Request | E.g an invalid SPARQL query |
| 401 Not Authorized | API key is not authorized to access the data |
Please also review our additional notes on response codes and error reporting.
Response Formats
Responses are a available in a range of different formats. The specific formats available depend on the type of SPARQL query being executed. SPARQL defines four different types of query: CONSTRUCT, DESCRIBE, SELECT and ASK.
CONSTRUCT and DESCRIBE queries both return RDF graphs and so the usual range of RDF serializations are available, including RDF/XML, RDF/JSON, Turtle, etc.
SELECT queries return a tabular result set, while ASK queries return a boolean value. Results from both of these query types can be returned in either SPARQL XML Results Format or SPARQL JSON Results Format.
These formats can be requested using the usual content negotiation options.