query-326a63c16bad1f476aa1b3bbd0789b7b

rq turtle/ttl

: Nicereddy@: This might also be of interest - Dipsacus fullonum, Nicereddy@

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?position ?positionLabel (count (distinct ?item) as ?count)
{
  { ?item wdt:P106 wd:Q11631 } union { ?item wdt:P106 wd:Q13188567 } union { ?item wdt:P450 ?mission } 
  # three ways to say "went to space" - occupation astronaut, occupation cosmonaut, was on a spaceflight
  # 
  ?item p:P39 ?ps. ?ps ps:P39 ?position . ?item wdt:P31 wd:Q5
  # they held some kind of position and also were a real person
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
} group by ?position ?positionLabel order by desc(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count") v2("?item"):::projected v3("?mission") v5("?position"):::projected v4("?ps") c3(["wd:Q13188567"]):::iri c10(["bd:serviceParam"]):::iri c8(["wd:Q5"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q11631"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P450"--> v3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P106"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P106"--> c2 end union0r <== or ==> union0l end v2 --"p:P39"--> v4 v4 --"p:statement/P39"--> v5 v2 --"p:direct/P31"--> c8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end bind1[/"count(?item)"/] v2 --o bind1 bind1 --as--o v6