query-682264ff4805c9695d662cd38ba8e8ef

rq turtle/ttl

...aggregated numbers of applicants, co-applicants and participants of the individual consortia

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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?pLabel ?affiliationType ?affiliationTypeLabel (COUNT(DISTINCT(?w)) AS ?number)
WHERE 
{
  ?p wdt:P31 wd:Q98270496 .
  ?p p:P1416 ?statement .
  ?statement ps:P1416 ?w .
  #?statement ?affiliationType wd:Q105906738 .  # Show only co-applicants
  #?statement ?affiliationType wd:Q105906860 .  # Show only participants
  OPTIONAL { ?statement pq:P3831 ?affiliationType .}  
  OPTIONAL { ?p wdt:P571 ?inception }
  OPTIONAL { ?p wdt:P488 ?speaker }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" . }
} GROUP BY ?affiliationType ?affiliationTypeLabel ?pLabel
ORDER BY ASC(?pLabel) DESC(?affiliationTypeLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?affiliationType"):::projected v2("?affiliationTypeLabel"):::projected v7("?inception") v9("?number") v3("?p") v1("?pLabel"):::projected v8("?speaker") v4("?statement") v5("?w"):::projected c9(["bd:serviceParam"]):::iri c11(["de,en"]):::literal c2(["wd:Q98270496"]):::iri v3 --"p:direct/P31"--> c2 v3 --"p:P1416"--> v4 v4 --"p:statement/P1416"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:qualifier/P3831".-> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P571".-> v7 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P488".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind1[/"count(?w)"/] v5 --o bind1 bind1 --as--o v9