SPARQL Answer Lab

Quick Review

Take about three minutes. Try each question from memory, then open the explanation. Revisit any step you want to practise again.

Return to the core route

Read from the start of the arrow

BookC — written by → Sam. Say the fact in a sentence. Where does the arrow start?

Show answer: direction

It starts at BookC and points to Sam. BookC was written by Sam.

Practise reading an arrow

Reuse the same name

The first line finds ?university. Which name should the campus line reuse, and why?

Show answer: shared variable

Use ?university again. Both lines must refer to the same university.

Practise the join

Decide what to count

A query shows the University column as U1, U1, U1. How many matching rows are shown? How many different universities are there?

Show answer: count

Three matching rows and one university. DISTINCT keeps a single copy of U1 when the query reports distinct university values.

Practise choosing a count

Test an answer that looks right

Two queries show the same country on a graph where every campus is in CountryZ. How could you tell whether one used an unrelated university?

Show answer: counterexample

Move CityC, U2’s campus, to CountryY and compare the output. Alice’s link still goes to U1. A query that fills the campus line independently can bring CityC and CountryY into its result.

Try the counterexample

Use the ideas together

Revisit any question you hesitated on, then try to explain it aloud. When you can use the four ideas together, test them on the library case.

Try the library challenge