Querying Data¶
What’s in this document?
To manage and query your data, go to the SPARQL menu tab. The SPARQL view integrates the YASGUI query editor plus some additional features, which are described below.
Hint
SPARQL is a SQL-like query language for RDF graph databases with the following types:
SELECT
- returns tabular results;CONSTRUCT
- creates a new RDF graph based on query results;ASK
- returns “YES” if the query has a solution, otherwise “NO”;DESCRIBE
- returns RDF data about a resource; useful when you do not know the RDF data structure in the data source;INSERT
- inserts triples into a graph;DELETE
- deletes triples from a graph.
The SPARQL editor offers two viewing/editing modes - horizontal and vertical.

Use the vertical mode switch to show the editor and the results next to each other, which is particularly useful on wide screen. Click the switch again to return to horizontal mode.

Both in horizontal and vertical mode, you can also hide the editor or the results to focus on query editing or result viewing. Click the buttons Editor only, Editor and results, or Results only to switch between the different modes.
Manage your data by writing queries in the text area. It offers syntax highlighting and namespace autocompletion for easy reading and writing.
Tip
To add/remove namespaces, go to
.Include or exclude inferred statements in the results by clicking the >> icon. When inferred statements are included, both elements of the arrow icon are a solid line (ON), otherwise the left element is a solid line and the right one is a dotted line. (OFF).
Enable or disable the expanding of the results over owl:sameAs by clicking the last icon above the Run button. Similarly to the one above it, the setting is ON when all its three circles are a solid line, and OFF when two of them are a dotted one.
Execute the query by clicking the Run button or use Ctrl/Cmd + Enter.
Tip
You can find other useful shortcuts in the keyboard shortcuts link in the lower right corner of the SPARQL editor.
The results can be viewed in different formats corresponding to the type of the query. By default, they are displayed as a table. Other options are Raw response, Pivot table and Google Charts. You can order the results by column values and filter them by table values. The total number of results and the query execution time are displayed in the query results header.
Note
The total number of results is obtained by an async request with a
default-graph-uri
parameter and the valuehttp://www.ontotext.com/count
.Navigate through all results by using pagination (SPARQL view can only show a limited number of results at a time). Each page executes the query again with query limit and offset for
SELECT
queries. For graph queries (CONSTRUCT
andDESCRIBE
), all results are fetched by the server and only the page of interest is gathered from the results iterator and sent to the client.The query results are limited to 1,000, since your browser cannot handle an infinite number of results. Obtain all results by using Download As and select the required format for the data (JSON, XML, CSV, TSV and Binary RDF for
SELECT
queries and all RDF formats for Graph query results).
Interrupt queries¶
You can use the Abort query button in the SPARQL editor to manually interrupt any query.
