query-80e73622d3fc671b60d3227b57e1bca9
Well-distributed random sample with Blazegraph
SELECT ?item ?itemLabel
WHERE {
SERVICE bd:sample {
?item wdt:P31 wd:Q5 .
#bd:serviceParam bd:sample.seed 0 .
bd:serviceParam bd:sample.limit 1000 .
bd:serviceParam bd:sample.sampleType "RANDOM" .
}
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 bd: <http://www.bigdata.com/rdf#>
# Well-distributed random sample with Blazegraph
SELECT ?item ?itemLabel
WHERE {
SERVICE bd:sample {
?item wdt:P31 wd:Q5 .
#bd:serviceParam bd:sample.seed 0 .
bd:serviceParam bd:sample.limit 1000 .
bd:serviceParam bd:sample.sampleType "RANDOM" .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
c4(["bd:serviceParam"]):::iri
c8(["RANDOM"]):::literal
c3(["wd:Q5"]):::iri
c6(["1000^^xsd:integer"]):::literal
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["http://www.bigdata.com/rdf#sample"]
style s1 stroke-width:4px;
v1 --"wdt:P31"--> c3
c4 --"bd:sample.limit"--> c6
c4 --"bd:sample.sampleType"--> c8
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c11
end