How to Use the SPARQL Endpoint

Currently, the SPARQL endpoint can be accessed via a web interface linked from every project's frontend page.

Additional to that, it can be used as an HTTP web service. By posting required parameters to the endpoint it will return the result of the SPARQL query in a specified format.


You can use POST and GET for posting queries to the SPARQL endpoint. For longer queries POST should be used.

See HTTP Web Services Based on the SPARQL Endpoint for details.

See below for a detailed description:






contains the entire SPARQL query. See here for details.

limitations: only SELECT and DESCRIBE/CONSTRUCT queries are allowed at the moment.


yes, if query is null

the name of a named query that is defined in the SesameSetup.xml

If a query name AND a query parameter is given, the named query is preferred.

Either the query OR the query name parameter have to be set.



A parameter that is used when a named query is specified with 'queryname' that requires parameters.



specifies the content type of the returned data.

If no content-type is passed, text/xml will be used.



name of a local Velocity template or URL to a velocity template located on

an openly accessible server.

For these content-types there is already a predefined way of rendering the results:

  • application/xml (rendered and returned as XML)

  • application/json (rendered and returned as JSON)

  • html/table


Only SELECT queries can be formatted with velocity templates. When the template parameter is used you also have to specify the content-type parameter. The content type has to be set to the content type produced by the velocity template.


If an error occurs, either the HTTP status code 400 or 500 will be returned, an error message is provided to identify the exact problem.

Common errors are listed below:


Status Code


Template Error

400 Bad Request

The template specified in the template parameter could not be found or contains errors.

See error message or log files for specific information.

Invalid Query

400 Bad Request

The query was malformed or could not be evaluated.

See error message or log files for specific information.

Internal Error

500 Internal Server Error

An exception occured while processing the request.

See error message or log files for specific information.


  • The query timeout is set to 300 sec (=5 min). Queries that take longer than that will be aborted after 300 sec to ensure availability and performance of the system services.

  • SELECT query results are limited to 500. Although you can send multiple queries and split up the results with the LIMIT and OFFSET modifiers (see SPARQL specification).





content-type application/x-www-form-urlencoded

query=SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 50 OFFSET 0&content-type=application/json

Example With Query Parameter

As described here queries defined in the SesameSetup.xml can have parameters (defined as %%%URI%%% in this example).

                        PREFIX skos: &lt;;
                        PREFIX rdf: &lt;;
                        SELECT ?Predicate ?Object
                                %%%URI%%% ?Predicate ?Object
                                FILTER ( ?Predicate != rdf:type &amp;&amp; ?Predicate != skos:semanticRelation)

The call to the SPARQL endpoint using this query and the providing the query parameter would look like this:<>

In the REST Console browser extension this can be tested in the following way.

Define the URL of the API call and the method POST:


Set the Content-Type of the body to 'application/x-www-form-urlencoded' and pass the SPARQL query in the body:


Don´t forget that the PoolParty API requires authentication (Basic Auth):