2

How do you execute a saved (shared) graphDB-SPARQL-Query with curl?

$ curl http://192.168.188.23:7200/repositories/01?savedQueryName=myquery

does not work, graphdb asks for the query (Missing parameter: query)

thank you for your efforts

mr_sol
  • 241
  • 1
  • 3
  • 7

2 Answers2

1

The REST API for the saved queries is GET /rest/sparql/saved-queries. Your request should look like this.

curl http://localhost:7200/rest/sparql/saved-queries?name=myquery

You can check all endpoints at /webapi in the Workbench.

Konstantin Petrov
  • 1,058
  • 6
  • 11
0

Queries are saved per Workbench instance, not per GraphDB repository.

So you also need to set the default repo, so that GDB query knows against which repo to run the query. See

curl -X POST <base_url>/rest/locations/default-repository -H 'Content-Type:application/json' -d '
{
    "repository": "<repo_id>"
}'

mr_sol, what exactly doesn't work for you?

Vladimir Alexiev
  • 2,477
  • 1
  • 20
  • 31