0/7
Module 6

Querying with SPARQL

Run live queries against the Bushfire Risk vocabulary directly in the browser.

What is SPARQL?

SPARQL is the standard query language for RDF data — think SQL for linked data. It uses the same triple pattern (subject predicate object) as RDF itself, but you replace known values with variables (prefixed with ?) that the engine binds by searching the graph.

Anatomy of a SELECT Query

basic-select.sparql
# 1. Declare prefixes (same as Turtle)
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

# 2. List the variables you want back
SELECT ?concept ?label

# 3. Triple patterns — ?var matches anything
WHERE {
    ?concept a            skos:Concept ;
             skos:prefLabel ?label .
}
ORDER BY ?label

The Live Graph

The SPARQL runner below is connected to an in-browser triple store loaded with the Bushfire Risk Levels vocabulary from Module 3. Run any query and see live results.

SPARQL Runner
Quick templates:
SPARQL
Run a query to see results here.

Common Query Patterns

OPTIONAL — handle missing values

Use OPTIONAL when a property might not exist on every concept:

optional.sparql
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT ?concept ?label ?scopeNote
WHERE {
    ?concept a skos:Concept ;
             skos:prefLabel ?label .
    # scopeNote is optional — rows without it still appear
    OPTIONAL { ?concept skos:scopeNote ?scopeNote }
}
ORDER BY ?label
Where to run SPARQL in production Against a live Prez instance, use the SPARQL endpoint at /sparql. The Kurrawong demo endpoint is at data.kurrawong.ai/sparql. For local RDF files, the Kurra Python package lets you run SPARQL without a server.

Browsing the Same Data with Prez

SPARQL is great for ad-hoc questions, but most users won't write queries — they'll click around. Prez is Kurrawong's web front-end for RDF: it reads the same vocabulary you'd query with SPARQL and renders it as browsable concept pages with proper labels, hierarchies, and provenance.

🔭 Mock Prez Browser — Bushfire Risk Levels
Bushfire Risk Levels

Concepts

Select a concept from the tree →
← Module 5