BlueBrain / nexus-forge

Building and Using Knowledge Graphs made easy
https://nexus-forge.readthedocs.io
GNU Lesser General Public License v3.0
39 stars 19 forks source link

forge.sparql(): Allow `LIMIT` on the query itself #189

Closed annakristinkaufmann closed 2 years ago

annakristinkaufmann commented 3 years ago

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:

the following work:

A user should be allowed to provide the LIMIT in the query string itself without having to set the limit argument to None

The limit default value is set here:

The query string is being built here:

tobiasschweizer commented 3 years ago

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).