Closed tobiasschweizer closed 3 years ago
Hi @tobiasschweizer , Which version of Nexus Delta store are you using/hitting ? v1.4 or greater ?
If you are Nexus Delta 1.4 then set the following SPARQL endpoint config (within the store config section):
searchendpoints:
sparql:
endpoint: "https://bluebrain.github.io/nexus/vocabulary/defaultSparqlIndex"
Content-Type: application/sparql-query
Accept: application/ld+json
From Nexus Delta 1.5 the content-type and Accept headers for SPARQL have changed. You also might want to adapt the endpoint to be the SPARQL view URL you want to target.
Hi @MFSY
Thanks a lot for your reply.
It's
Nexus Delta v Nexus Fusion v1.5.1
Here's my config:
Store:
name: BlueBrainNexus
searchendpoints:
sparql:
endpoint: "https://bluebrain.github.io/nexus/vocabulary/defaultSparqlIndex"
From the Nexus admin web interface (SPARQL query editor), my SPARQL queries work fine. The URL is identical: https://server/v1/views/org/proj/https%3A%2F%2Fbluebrain.github.io%2Fnexus%2Fvocabulary%2FdefaultSparqlIndex/sparql
.
Still I am getting a 400 when trying it with forge.search
or forge.sparql
.
Anything I should change in the config? Thanks a lot!
Hi @tobiasschweizer !
You could try either removing the LIMIT
from the query itself and instead provide it as separate argument or set the limit
argument of the forge.sparql()
method to None
:
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)
To see the query that is being run, you can use debug=True
on forge.sparql()
:
forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o}", limit=20, debug=True)
We have opened an issue to allow the LIMIT
on the query itself without having to set the limit
argument to None
: https://github.com/BlueBrain/nexus-forge/issues/189
Hi @annakristinkaufmann
Great, forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o}", limit=20, debug=True)
works!
Magically, forge.search
also works now :-)
Many thanks!
Hi
I encountered a problem when using forge.search / forge.sparql. The request is rejected and the following errors are returned:
HTTPError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql
andQueryingError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql
.The URL seems valid: it consists of the server URL, the projects, and contains the endpoint config from the yml file (url encoded). From the admin interface, I am able to run the queries without any problem and they are sent to the same endpoint.
Example:
forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o} LIMIT 20")
Version used: nexusforge 0.6.2
I'd be grateful for any hint. Thanks a lot!