Store Multisparql Service
From n² wiki
This is the Platform API documentation for the multi-graph SPARQL service associated with a Platform Store.
This variation of the SPARQL endpoint provides clients with more control over the data sets that are queried by the SPARQL query. This allows queries to be written against both the Metabox and the Private Graphs Collection.
Contents |
[edit] URI Pattern
Each item in the store has its own URI based on its unique identifier:
http://api.talis.com/stores/{storename}/services/multisparql
[edit] Resource Operations
| URI Pattern | Method | Request Body | Semantics | Capability required |
|---|---|---|---|---|
| /services/multisparql | GET | Retrieve a simple query form | None | |
| /services/multisparql?query= | GET | Perform a SPARQL search | None | |
| POST | application/x-www-form-urlencoded parameters | Perform a SPARQL search | None |
[edit] Request Parameters
| Parameter | Required? | Description | Values |
|---|---|---|---|
| query | Yes | The SPARQL query to perform | A SPARQL query |
| output | No | Specify the output format | See below |
[edit] Additional Options & Restrictions
[edit] Specifying the Data Set
The Store Sparql Service provides the ability to query only a fixed default (background) graph. That graph is the contents of the Metabox.
The Multisparql service does not support specification of the graph using SPARQL protocol parameters (default-graph-uri, named-graph-uri) or specifying of named graphs using FROM NAMED.
The Multisparql service does allow the default (background) graph to be specified using FROM clauses in the query. The graph URIs must correspond to either the URI of the Metabox or any graph in the Private Graphs Collection.
[edit] Output Formats
The following table summarizes the different output formats supported by the SPARQL service. The output types can be selected using Content Negotiation using either the Accept header or the output parameter.
| SPARQL Query Type | Output Param Value | Mime Type | Schema |
|---|---|---|---|
| SELECT | xml | application/sparql-results+xml | SPARQL Query Results XML Format |
| json | application/sparql-results+json | Serializing SPARQL Query Results in JSON Format | |
| ASK | xml | application/sparql-results+xml | SPARQL Query Results XML Format |
| json | application/sparql-results+json | Serializing SPARQL Query Results in JSON Format | |
| CONSTRUCT | xml or rdf | application/rdf+xml | RDF/XML Syntax |
| json | application/json | RDF/JSON Syntax | |
| ntriples | text/plain | N-Triples | |
| turtle | text/turtle | Turtle | |
| DESCRIBE | xml or rdf | application/rdf+xml | RDF/XML Syntax |
| json | application/json | RDF/JSON Syntax | |
| ntriples | text/plain | N-Triples | |
| turtle | text/turtle | Turtle |
Note: for backwards compatibility, where the text/turtle media type is listed, the deprecated application/x-turtle media type is also supported, though it is given a lower weighting during Content Negotiation
[edit] Restrictions on Query Times
The Multi SPARQL service endpoint enforces a maximum execution time for all SPARQL queries. This is to ensure that long-running queries do not degrade the service for other users. Queries that exceed the maximum allowable time will be terminated and a 500 Internal Server error response returned.
[edit] Sparql Extensions
The SPARQL service endpoint includes support for some extensions to the SPARQL query language. The full list of SPARQL Extensions are documented separately.
[edit] Further Reading
The official SPARQL protocol specification has additional information on specifying queries, response formats and error conditions.
Read the n2 SPARQL page for additional pointers to resources and some useful SPARQL recipes.

