When using forge.sparql(), one cannot provide the LIMIT in the query string itself without setting the limit argument on the method to None.
While this throws a HTTPError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql and QueryingError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql error:
forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o} LIMIT 20")
the following work:
forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o}", limit=20)
Would it be possible to improve the error message too? I assume that the reason for the rejection is invalid SPARQL (None maybe ends up in the query string).
When using
forge.sparql()
, one cannot provide theLIMIT
in the query string itself without setting thelimit
argument on the method toNone
.While this throws a
HTTPError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql and QueryingError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql
error:forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o} LIMIT 20")
the following work:
forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o}", limit=20)
forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o} LIMIT 20", limit=None)
A user should be allowed to provide the
LIMIT
in the query string itself without having to set thelimit
argument toNone
The limit default value is set here:
The query string is being built here: