query-55142595196aad63395c7da23503640d
Finding classes of items with time zone specified
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#>
SELECT DISTINCT ?class ?classLabel ?zones ?items WHERE {
{
SELECT DISTINCT ?class (COUNT(DISTINCT ?zone) AS ?zones) (COUNT(DISTINCT ?item) AS ?items) WHERE {
?item wdt:P421 ?zone.
?item wdt:P31 ?class.
}
GROUP BY ?class
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?items)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?class"):::projected
v2("?item")
v6("?items"):::projected
v3("?zone")
v5("?zones"):::projected
c4(["bd:serviceParam"]):::iri
c6(["en"]):::literal
v2 --"wdt:P421"--> v3
v2 --"wdt:P31"--> v4
bind2[/"count(?zone)"/]
v3 --o bind2
bind2 --as--o v5
bind3[/"count(?item)"/]
v2 --o bind3
bind3 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end