query-900f970b5429ba20f8f0488be26b7a99

rq turtle/ttl

How to randomly select 100 male persons?It seems most examples of randomisation in SPARQL use RAND with ORDER BY, so I tried the following two queries, but I always get timeout. I guess there are too many people in Wikidata and the use of ORDER BY cannot handle. Any idea how to get the list of random 100 male persons (with Wikipedia links)? Many thanks!

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT 
DISTINCT ?person ?sitelink ?random 
WHERE{
?person wdt:P31 wd:Q5 .
  ?person wdt:P21 wd:Q6581097 .
  ?sitelink schema:about ?person .
  ?sitelink schema:inLanguage "en" .     
  ?sitelink schema:isPartOf <https://en.wikipedia.org/> .
  BIND(RAND() AS ?random) .
}
ORDER BY ?random
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?person"):::projected v4("?random"):::projected v3("?sitelink"):::projected c9([https://en.wikipedia.org/]):::iri c2(["wd:Q5"]):::iri c4(["wd:Q6581097"]):::iri c7(["en"]):::literal v2 --"wdt:P31"--> c2 v2 --"wdt:P21"--> c4 v3 --"schema:about"--> v2 v3 --"schema:inLanguage"--> c7 v3 --"schema:isPartOf"--> c9 bind0[/"RAND()"/] bind0 --as--o v4