query-e8afd6aeb8ec3ac1a95fd52760475072
Golf tournament winners. en:List of men's major championships winning golfersEven better: duplicated table at
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?person ?personLabel (COUNT(?tournament) AS ?count) WHERE {
# tournament is a men's major
# e.g., 2019 Masters Tournament Q55316366 is P31 of Masters Tournament Q280275
# P279 of golf tournament Q15061650 (argh! inappropriate subclass)
# P279 of men's major golf championships Q268554
# P279 of golf tournament Q15061650
?tournament wdt:P31/wdt:P279* wd:Q268554 .
# just a golf tournament
# ?tournament wdt:P31/wdt:P279* wd:Q15061650 .
# the winner of the tournament
?tournament wdt:P1346 ?person .
# person is human
# ?person wdt:P31 wd:Q5 .
# occupation is a golfer (not required for an Open winner)
# ?person wdt:P106 wd:Q11303721 .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
GROUP BY ?person ?personLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v3("?person"):::projected
v2("?tournament"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
c3(["wd:Q268554"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P1346"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind1[/"count(?tournament)"/]
v2 --o bind1
bind1 --as--o v4