SPARQL Query Panel
The SPARQL Query Panel can be used to enter and execute SPARQL queries. SPARQL is a W3C standard specifically designed to query RDF-based graphs, and provides rich expressiveness for many use cases.
Note
While SPARQL queries of type ASK, CONSTRUCT and SELECT can be executed by everyone, the execution of SPARQL UPDATEs (e.g., INSERT/DELETE) is disabled by default. These need to first be activated for the system by an administrator using the System Configuration Parameters Admin Page. Even when activated, it is possible to fine-tune which governance roles are allowed to execute SPARQL UPDATEs using the Governance Roles Configuration Section.
Toolbar Buttons
Execute query runs the current query and display its results when done.
Preview is visible when the currently entered query is an UPDATE, and can be used to preview the changes that would be made if the query got executed, using the Preview Dialog. Like all similar Preview buttons, this will execute the update against a sandbox only.
Save query to library… can be used to save the current query to the SPARQL Library Panel, either for yourself or team members.
Reset to empty SELECT query replaces the currently edited query with an empty SELECT query that declares the namespace prefixes of the current asset collection. The arrow next to the button opens a menu with further options:
Reset to empty ASK query, Reset to empty CONSTRUCT query, Reset to empty DELETE update, Reset to empty INSERT update and Reset to empty DELETE + INSERT update replace the query with an empty query or update of that type. The update options are only available if SPARQL UPDATEs have been activated for the system (see the note above).
Update namespace prefixes replaces only the PREFIX declarations of the current query with those of the current asset collection, keeping the rest of the query as it is. This is useful after a query has been pasted from elsewhere, or after prefixes have been added to the collection. Prefixes that the collection does not declare are removed from the query.
Undo last query edit reverses the latest query edit, including a query replacement made by Copilot Chat. It has the same effect as Ctrl+Z (Cmd+Z on Mac) in the query editor and is disabled when there is nothing to undo. If you edit a generated query, those edits are undone before the replacement itself. Undo changes the query text; it does not reverse the effects of a query or update that has already been executed.
Display SPARQL Algebra this is an advanced feature for users who want to understand what happens in the SPARQL query engine under the hood.
Hint
Many users are surprised when their SPARQL queries have unexpectedly bad performance. Some understanding of how the SPARQL engine works is often beneficial. Always keep in mind that the engine may internally change the order in which parts of a query are executed. For example, FILTERs are often moved to the end of their block. The SPARQL Algebra can be helpful to confirm this.
- List of SPARQL functions
opens a new browser tab with a list of all (relevant) globally defined SPARQL functions in TQ Data Foundation. Data Foundation has hundreds of extra functions that go beyond what the SPARQL standard offers. Not all of them are documented here, and not all of them are considered “stable”.
Settings
Return local results only performs the query against the base graph only, not the union of base graph and included graphs.
See Also
Further Reading on SPARQL
Further Reading on TQ Data Foundation