query-3e419ff8d712396a46dc1a124a8c6332
people who won an Emmy, Grammy, Oscar, and Tony Award (“EGOT”)
(may include non-competitive awards)
SELECT ?item ?itemLabel WITH { SELECT DISTINCT ?item WHERE { ?item wdt:P31 wd:Q5; p:P166/ps:P166/(wdt:P31|wdt:P279)* wd:Q123737, wd:Q41254, wd:Q19020, wd:Q191874. } } AS %results WHERE { INCLUDE %results. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# people who won an Emmy, Grammy, Oscar, and Tony Award (“EGOT”)
# (may include non-competitive awards)
SELECT ?item ?itemLabel WHERE {
{
SELECT DISTINCT ?item WHERE {
?item wdt:P31 wd:Q5;
p:P166/ps:P166/(wdt:P31|wdt:P279)* wd:Q123737, wd:Q41254, wd:Q19020, wd:Q191874.
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
- https://www.wikidata.org/wiki/Template:Query_page/sandbox
- https://www.wikidata.org/wiki/Template_talk:Query_page/sandbox
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
a1((" "))
a2((" "))
c8(["wd:Q19020"]):::iri
c7(["wd:Q41254"]):::iri
c11(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q123737"]):::iri
c9(["wd:Q191874"]):::iri
v1 --"p:direct/P31"--> c2
v1 --"p:P166"--> a1
a1 --"p:statement/P166"--> a2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P279"--> c5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P31"--> c5
end
union0r <== or ==> union0l
end
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P279"--> c7
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P31"--> c7
end
union1r <== or ==> union1l
end
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P279"--> c8
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P31"--> c8
end
union2r <== or ==> union2l
end
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P279"--> c9
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P31"--> c9
end
union3r <== or ==> union3l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end