Modifying your results

Modifying your results

In all the queries we have seen until now, all items that matched certain patterns were selected and shown in the results. But quite often we are only interested in certain results, or some aspect of them. In this section you will learn a few keywords and functions that will help you get more out of your data.

Our queries so far had two clauses: the SELECT clause where we stated the variables that will be shown in the results, and the WHERE clause in which the patterns for matching were given.

#Star Wars Films
SELECT ?item  
WHERE 
{
  ?item wdt:P179 wd:Q22092344.
}

In the next section you will learn to modify your query results by adding keywords and functions to the SELECT clause, to the WHERE clause, or after the WHERE clause. In fact, you may have already encountered such an element in previous sections – the DISTINCT modifier which can be added to the SELECT clause to remove duplicates from the results.

Skip to content