Some Sapi-nt endpoints support query explanation, which enables you to see the serialized query that Sapi-nt would issue to the data source for a given request. This feature is only available when the application is configured to enable it.
To obtain a query explanation for a request, append /explain to the request path.
For example, to explain the query for the following request:
/station?_view=mini&_limit=1
Use the following Explain API request:
/station/explain?_view=mini&_limit=1
When Sapi-nt is explains the query successfully, it returns a 200 OK response whose body is
the raw string serialization of the query, in the relevant syntax (typically SPARQL).
For example:
PREFIX ...
SELECT ?id ?label ?type
WHERE
{ { SELECT ?id
WHERE
{ ?id rdf:type metro:UndergroundStation
FILTER EXISTS { }
}
LIMIT 1
}
OPTIONAL
{ { ?id rdfs:label ?label}
UNION
{ ?id rdf:type ?type}}
}
Sapi-nt may fail to explain the query for one of the following reasons:
In these cases, it returns a 400 Bad Request response.
Note - If Sapi-nt accepts the original request but returns a 404 Not Found to the explain request,
infer that the Explain API is not enabled.