How to call stardog stored queries from http API?

The stardog manual represents functionality of stored querries which can be saved in stardog and then can be revoked. Though it works fine from commapnd line, I am bit unsure about calling this through http API.

Passing the stored query name instead of the query string should work.

Cheers,
Pavel

Thanks Pavel.

In case if we want to create stored query from API and check the list of available store queries, then how can we proceed with this?

Thanks,
Vijay

a GET request to /admin/queries/stored should return the list of stored queries in JSON.

We’ll extend the docs to cover this in more detail.

Thanks,
Pavel

Thanks, Pavel, that worked.
Is there any way of requesting only the queries that apply to a specific database (including those that apply to any database) since we’ll generally have a specific database in mind. Or do we have to retrieve them all and filter the JSON?

Thnaks Pavel. This works but creating of new stored query via http is not documented so can you please address this here?

Hi Pete,

At this point you’d have to filter on the client side. But this is something we can improve in the future (it’s a relatively new feature and we haven’t gotten much feedback yet).

Thanks,
Pavel

Hi Vijay,

Yes, the docs are lacking and we’re working on this and other missing bits for 5.0-final. You should send a POST with a JSON in the body to /admin/queries/stored (same format as the server returned for GET).

Cheers,
Pavel

Thanks Pavel.

I have also tried updating the sparql query of already stored query by passing the similar json with same query name but with different sparql query. This is giving the error and not updating the query.

On the other hand, I have tried removing the stored query from http API by passing the json through DELETE verb. This also is not working.

You can delete a stored query by sending a DELETE request to /admin/queries/stored/{name}.

Cheers,
Pavel

Thanks Pavel, It works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.