Help:SPARQLStore/Exception/BadHttpDatabaseResponseException

From semantic-mediawiki.org
< SPARQLStore‎ | Exception
Using SPARQL and RDF storesSPARQLStoreSPARQLStore/ExceptionHelp:SPARQLStore/Exception/BadHttpDatabaseResponseException

In cases where the response from a triple-store could not be interpret a BadHttpDatabaseResponseException is raised by the SPARQLStore.

The BadHttpResponseMapper matches response according to the received Http code which in case of a CURLE_HTTP_RETURNED_ERROR is matched to BadHttpDatabaseResponseException with

  • ERROR_MALFORMED a possible "Malformed query" caused by an unsupported query construct (e.g property paths in Virtuoso 6.1 etc.) therefore it is best the copy the generated query into the SPARQL query endpoint and view the error response (details of the error vary with the specific endpoint interface).
  • ERROR_REFUSED a refused query
  • ERROR_NOSERVICE unable to reach the endpoint or a specific setting is missing 1

How to debug a "Malformed query"[edit]

Using |format=debug in a #ask query will output something similar to and use the input the execute the query directly.

PREFIX wiki: <http://example.org/id/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX swivt: <http://semantic-mediawiki.org/swivt/1.0#>
PREFIX property: <http://example.org/id/Property-3A>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?result WHERE {
?result swivt:wikiPageSortKey ?resultsk .
?result property:Has_page wiki:Foo .
}
ORDER BY ASC(?resultsk) 
OFFSET 0
LIMIT 51

See also[edit]