Running SPARQL Queries¶
The SPARQL Query Editor lets you run queries against any configured TriplyDB endpoint and explore results as a table or interactive graph. Queries are sent through the Linked Data Explorer's backend, which runs them against the endpoint you chose.
Running a query¶
- Click the search icon in the left sidebar to open the Query Editor.
- The editor pane contains a sample query by default. You can modify it or select a different query from the library in the left panel.
- Click Run Query (top right).
- Results appear in the table below the editor.
Selecting from the query library¶
The left panel lists pre-built queries for common DMN discovery tasks. Click any entry to load it into the editor without executing immediately, so you can review or adapt it first. The library includes:
- Find All DMNs โ retrieves all
cprmv:DecisionModelresources with titles and identifiers - Input/Output Details โ lists all input and output variables for every DMN
- Find Chains โ finds DMN pairs where an output of one matches an input of another
- Chain Paths โ traces multi-hop chains across the dataset
- Complete Metadata โ retrieves the full metadata graph for a specific DMN
- Service Rules Metadata โ retrieves
cprmv:Ruleโeli:LegalResourceโcpsv:PublicServicerelationships
Switching endpoints¶
The endpoint selector at the top of the configuration panel shows the active TriplyDB dataset URL. To switch:
- Open the configuration panel (gear icon).
- Select a preset endpoint or type a custom SPARQL endpoint URL.
- Click Apply.
The active endpoint applies to both the Query Editor and the Chain Builder. Switching it reloads the DMN list in the Chain Builder.
A custom endpoint must be an https: address on a public host, without a username or password in the URL. If it is not, the query is refused and the editor shows why โ for example, that the address points to an internal network. The Local Jena preset for a Jena server on your own machine is only available when running the application locally in development.
Exporting results¶
Click Export CSV below the results table to download a .csv file. The filename is timestamped (e.g., sparql-results-2026-02-06.csv). Values with commas, quotes, or newlines are escaped correctly.
Graph view¶
If your query returns ?s ?p ?o triple patterns, a Graph button appears alongside the Table button. The graph view renders an interactive D3.js force-directed diagram. Drag nodes to reposition them; use scroll to zoom. Semantic links appear as dashed green edges.
Writing queries¶
The endpoint follows SPARQL 1.1. Key prefixes for DMN discovery:
PREFIX cprmv: <https://cprmv.open-regels.nl/0.3.0/>
PREFIX cpsv: <http://www.w3.org/ns/regorg#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX ronl: <https://regels.overheid.nl/ontology#>
PREFIX schema: <http://schema.org/>
Example โ find all DMNs with their input variable counts:
PREFIX cprmv: <https://cprmv.open-regels.nl/0.3.0/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX cpsv: <http://www.w3.org/ns/regorg#>
SELECT ?identifier ?title (COUNT(?input) AS ?inputCount)
WHERE {
?dmn a cprmv:DecisionModel ;
dct:identifier ?identifier ;
dct:title ?title .
OPTIONAL {
?input a cpsv:Input ;
cpsv:isRequiredBy ?dmn .
}
}
GROUP BY ?identifier ?title
ORDER BY ?identifier