query-ec2dc9d7fd83aa7cf16130e99f8d4db1
Propertiesinstance of (P31)sex or gender (P21)country of citizenship (P27)
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#>
PREFIX schema: <http://schema.org/>
PREFIX hint: <http://www.bigdata.com/queryHints#>
SELECT ?item ?itemLabel ?itemDescription (COUNT(DISTINCT ?article) AS ?count) WHERE {
{
SELECT ?item WHERE {
{
hint:Query hint:optimizer "None".
?item wdt:P31 wd:Q5. # all humans
?item wdt:P21 wd:Q6581072.
?item wdt:P27 wd:Q668.
MINUS {
?sitelinkhy schema:about ?item.
?sitelinkhy schema:isPartOf <https://or.wikipedia.org/>.
}
}
?article schema:about ?item.
{ ?article schema:isPartOf <https://en.wikipedia.org/>. }
}
}
?article schema:about ?item.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?itemDescription
ORDER BY DESC(?count)
LIMIT 123
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?article"):::projected
v5("?count")
v2("?item"):::projected
v3("?sitelinkhy")
c7(["wd:Q6581072"]):::iri
c12([https://or.wikipedia.org/]):::iri
c13([https://en.wikipedia.org/]):::iri
c15(["bd:serviceParam"]):::iri
c9(["wd:Q668"]):::iri
c1([http://www.bigdata.com/queryHints#Query]):::iri
c5(["wd:Q5"]):::iri
c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["None"]):::literal
c1 --http://www.bigdata.com/queryHints#optimizer--> c3
v2 --"wdt:P31"--> c5
v2 --"wdt:P21"--> c7
v2 --"wdt:P27"--> c9
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c12
end
v4 --"schema:about"--> v2
v4 --"schema:isPartOf"--> c13
v4 --"schema:about"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c15 --"wikibase:language"--> c17
end
bind2[/"count(?article)"/]
v4 --o bind2
bind2 --as--o v5