query-50bdcf1d53ff51d671ebd15e88602534
Sample to query all values of a property
Property talk pages on Wikidata include basic queries adapted to each property
SELECT ?item ?itemLabel ?value ?valueLabel ?whatLabel
valueLabel is only useful for properties with item-datatype
WHERE { ?item wdt:P10040 ?value . ?item wdt:P31 ?what # change P10040 to another property SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
remove or change limit for more results
LIMIT 10
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Sample to query all values of a property
# Property talk pages on Wikidata include basic queries adapted to each property
SELECT
?item ?itemLabel
?value ?valueLabel
?whatLabel
# valueLabel is only useful for properties with item-datatype
WHERE
{
?item wdt:P10040 ?value .
?item wdt:P31 ?what
# change P10040 to another property
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
# remove or change limit for more results
LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?value"):::projected
v3("?what")
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wdt:P10040"--> v2
v1 --"wdt:P31"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end