User:Inductiveload/sandbox

This page collects SPARQL queries by function and type, and includes an explanation of how they work, as opposed to presenting examples specifically based on the syntax of the SPARQL.

Simple property match
This query shows all items with the triple " →  → ". For each match,  is then presented as the result, along with its label.

The  service provides the label for   first in the your language, then falls back to English, and stores it in. The mapping from  to   is automatic.

Property match, with other mandatory properties
This query shows all items with the triple " →  → ", as well as with. For each match,  is then presented as the result, along with its label and the date.

Because not all works by Douglas Adams have a date set, this returns fewer matches than the previous query.

sorts the result by date, in ascending order (i.e. oldest first). This is the same as. Use  to reverse the order.

Property match, with other optional properties
This query shows all items with the triple " →  → ", as well as with. For each match,  is then presented as the result, along with its label and the date.

If there is no date available, it is left blank, but the result is still returned.

This query shows all items with the triple " →  → ", as well as with. For each match,  is then presented as the result, along with its label and the date.

The  statement means that if ?item has a  value, it will be stored in ?date, but if it is not, the result is still returned, but with   left blank.

Thus, this query has the same number of results as this one.

Property match, with qualifier values
This query shows all items with the triple " →  → ", as well as with. For each match,  is then presented as the result, along with the values of the  qualifier of the  statement.

Note that this returns some items twice. This is because those items have multiple official websites. Use  to collapse these:

Traversing a chain of different properties
?subclass wdt:P31/P279* wd:Q47461344.