query-1ff8c0f0231892b9ac1844ec1f2ec472
TODO
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?sportLabel ?twitter_username ?subscribers WHERE
{
{
SELECT ?item ?twitter_username ?subscribers ?sport
WHERE
{
?item p:P2002 ?stat . # they have a twitter username property
?stat ps:P2002 ?twitter_username. # with this value
?stat pq:P3744 ?subscribers. # and this number of subscribers
?item wdt:P106 ?sport . # they have an occuption
?sport wdt:P279 wd:Q2066131. # the occupation is a subclass of athlete
?item wdt:P21 wd:Q6581097. # they're male
}
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
# get labels only of qualifying items to save time.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v5("?sport")
v2("?stat")
v4("?subscribers"):::projected
v3("?twitter_username"):::projected
c10(["bd:serviceParam"]):::iri
c8(["wd:Q6581097"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q2066131"]):::iri
v1 --"p:P2002"--> v2
v2 --"p:statement/P2002"--> v3
v2 --"p:qualifier/P3744"--> v4
v1 --"p:direct/P106"--> v5
v5 --"p:direct/P279"--> c6
v1 --"p:direct/P21"--> c8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end