Skip to content

SPARQL Queries

Accurids is a powerful tool for working with datasets, and one of its most features is the ability to run SPARQL queries. In this guide, we'll go over how to run a query, navigate the results, save and export queries, and deal with query timeouts.

Running a Query

You can run SPARQL queries against datasets in Accurids. If no 'from' clause is provided, the query will run against all datasets which are currently active and visible to the logged-in user. To specify a dataset to query against, type 'from' in the editor and select a dataset from the list. The list of datasets can be filtered by typing; only datasets that start with the user's input will remain in the list.

“”

Enter a SPARQL query into the text editor and run it by clicking the 'play' icon in the top right corner of the editor panel. A limit clause will be added to all queries if not already present; the maximum limit is 10,000. Greater limits will be reduced by the query engine to 10,000. In case your query runs for a long time, it can hit a query timeout and will be interrupted. By default, this timeout is 30 seconds. Admins can change this timeout; if you require a longer timeout, ask your admin to increase it for you.

To run a query, navigate to the 'Query' page from the main menu. Once there, you'll see a text editor where you can enter your SPARQL query. If no 'from' clause is provided, the query will run against all datasets which are currently active and visible to the logged-in user. To specify a dataset to query against, type 'from' in the editor and select a dataset from the list. The list of datasets can be filtered by typing; only datasets that start with the user's input will remain in the list. When you're ready to run the query, click the 'play' icon in the top right corner of the editor panel.

Note that a limit clause will be added to all queries if not already present, and the maximum limit is 10,000. If you try to set a higher limit, the query engine will automatically reduce it to 10,000. If your query takes too long to run, it may hit a query timeout and be interrupted. Admins can change this timeout; if you require a longer timeout, ask your admin to increase it for you.

Result Navigation

Once your query has run, you'll see the results displayed in a table. The table supports sorting and pagination, so you can easily navigate through the results. You can control the page size by applying a 'limit' to your SPARQL query. At the bottom of the results table, there are options for 'next' and 'previous' pages, which let you navigate through the limited results. The query engine automatically adjusts the offset for you when using these pagination options.

To sort the results, simply click the arrow icons when hovering over a column header. The query engine will adjust the 'order by' clause of the query which is currently active, rather than just sorting the visible results.

If you want to reorder the columns in the results table, you can do so by clicking the 'left' or 'right' arrows that appear when hovering over a column header.

Saved Queries

If you frequently run the same queries, you can save them and restore them later. To save a query, click the 'disk' icon next to the 'play' icon in the top right corner of the editor. The name of the query will be displayed when you load a saved query. If you make changes to a saved query, you can choose to save these changes into a new query or update an existing saved query.

“”

Exporting Results

Finally, if you need to export the results of a SPARQL query, you can do so by clicking the menu icon above the results table and selecting an export format. Accurids supports three formats for exporting query results: JSON, XML, and CSV.

“”