query-6226a3c938d051c52f21ff6ae3c60916
)?(Q1248784)airport Something like this (ie. all subclasses of ) at 8. 8. 2018, 15:49 (UTC).contribs • talk (Bouzinac comment was added byunsignedThe preceding – I meant the items linked as p31 (not airports, but what kind of sub-items are linked/apparented to "airports" ? 12:07, 8 August 2018 (UTC)) talk (Matěj SuchánekHow would you recognize an airport when you cannot query after one of those classes? By Wikimedia categories? : Edit conflict, but here's a similar query - Matěj Suchánek, Bouzinac@
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#>
SELECT ?type ?typeLabel ?count where {
{
SELECT ?type (count(?item) as ?count) where
{ ?type wdt:P279* wd:Q20977775 . # all things that are a subclass of air transport infrastructure
?item wdt:P31 ?type . } group by ?type }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by desc(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count"):::projected
v3("?item")
v2("?type"):::projected
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q20977775"]):::iri
v2 --"wdt:P279"--> c2
v3 --"wdt:P31"--> v2
bind1[/"count(?item)"/]
v3 --o bind1
bind1 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end