Just to provide a clear live example with some intuitive context, one of the examples currently available on the Query Service is this which lists "Humans born in New York City":
#Humans born in New York City
#title: Humans born in New York City
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?sitelinks
WHERE {
?item wdt:P31 wd:Q5; # Any instance of a human
wdt:P19/wdt:P131* wd:Q60; # Who was born in any value (eg. a hospital)
# that has the property of 'administrative area of' New York City or New York City itself.
# Note that using wdt:P19 wd:Q60; # Who was born in New York City.
# Doesn't include humans with the birth place listed as a hospital
# or an administrative area or other location of New York City.
wikibase:sitelinks ?sitelinks.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
ORDER BY DESC(?sitelinks)
So the line:
wdt:P19/wdt:P131* wd:Q60
breaks down as:
wdt:P19
: place of birth
wdt:P131
: located in the administrative territorial entity
wd:Q60
: New York city
Therefore, we understand that it means:
(place of birth) is (located in the administrative territorial entity) of (New York city)
As a bonus, the *
which is also explained at: What the asterisk mean in this SPARQL query? means: "do /wdt:P131
" zero or more times. This way, we find all humans that are marked as born e.g. in either of:
- New York city itself
- a borough of New York city (
/wdt:P131
once)
- a hospital in a borough of New York city (
/wdt:P131
twice)
Without *
the query is equivalent to this one with an intermediate variable ?x
:
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?sitelinks
WHERE {
?item wdt:P31 wd:Q5;
wdt:P19 ?x;
wikibase:sitelinks ?sitelinks.
?x wdt:P131 wd:Q60
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
ORDER BY DESC(?sitelinks)
TODO come up with the equivalent one with *
.
=
. E.g., langMatches(lang(?x), "en"). – Cordeiro