OpenUpLabs Sparql Services

The datasets are available as linked data - that is in RDF (Resource Description Framework). If you want to directly access this data you can use the SPARQL endpoints that we are exposing. SPARQL is a query language for RDF. Full details on SPARQL can be found on the W3C website at http://www.w3.org/TR/rdf-sparql-query/.

(If you would like to access the data but SPARQL isn't your thing have a look at the APIs page.)

Getting Started With Querying Using SPARQL

Currently there are endpoints for the following datasets:

If you follow the links above you will find some more information on how to query the individual datasets and some sample queries, along with sandboxes to try out your own queries.

Results Formats

The results of a SELECT query can be returned in one of the following formats:

The results of a CONSTRUCT query can be returned in one of the following formats:

SPARQL service descriptions are available in the formats in the above list, and additionally in XHTML+RDFa when the accept header specifies text/html.

How Do You Query an Endpoint?

To actually query one of the SPARQL endpoints you simply need to do one of the following requests.

HTTP Method Parameter Name Purpose Notes
GET query Contains the text of the SPARQL query The text needs to be encoded using application/x-www-form-urlencoded format
output Contains the details on the required return format Valid values are: text, sparql, json, rdfxml, turtle
POST query Contains the text of the SPARQL query The text needs to be encoded using application/x-www-form-urlencoded format
output Contains the details on the required return format Valid values are: text, sparql, json, rdfxml, turtle

Content Negotiation

The system utilises content negotiation by default. The available formats are RDF/XML, JSON, Turtle and XML.

Required Format Accept Header MIME type
Plan text text/plain
RDF/XML application/rdf+xml
JSON application/sparql-results+json
Turtle application/turtle
SPARQL-XML application/sparql-results+xml
XHTML+RDFa text/html

SPARQL Service Description

SPARQL Service Descriptions provide a machine-readable specification of the endpoints in accordance with W3C working draft SPARQL 1.1 Service Descriptions. The description is in RDF and uses the Service Description Vocabulary. The service descriptions are available from the URI of the endpoint, and is returned by default if no query is sent. The description can be returned in RDF+XML, Turtle, Ntriples, or HTML by content negotiation. If HTML is requested, the returned page is XHTML+RDFa - i.e. a page which can be rendered in the browser, from which the RDF service descrption can be automatically extracted using appropriate tools.

voiD Description

The voiD (vocabulary of interlinked Datasets) description gives details about the contents of each dataset. This includes the information about where the data came from, the subject of the dataset, the vocabularies which are used, and any known links to other datasets. This is intended to aid discovery and usage of the datasets.