query-00889d1f2300d46874c08c2ace53a38f

rq turtle/ttl

TEMPLATE={ "template":"Video games with the most nominations at the ?ceremony award ceremony","variables":{"?ceremony":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q4504495; wdt:P1269 ?award. ?award wdt:P279 wd:Q18328126. }"} } } SELECT ?item ?itemLabel ?developer (GROUP_CONCAT(?awardLabel; SEPARATOR = ", ") AS ?awards) (COUNT(?award) AS ?award_received) WHERE { BIND(wd:Q102300180 AS ?ceremony) ?item p:P166 ?statement. ?statement ps:P166 ?award; pq:P805 ?ceremony. OPTIONAL { ?item wdt:P178 ?developer. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?award rdfs:label ?awardLabel. ?item rdfs:label ?itemLabel. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?item ?itemLabel ?developer ORDER BY DESC (?award_received)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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#>
#TEMPLATE={ "template":"Video games with the most nominations at the ?ceremony award ceremony","variables":{"?ceremony":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q4504495; wdt:P1269 ?award. ?award wdt:P279 wd:Q18328126. }"} } }
SELECT ?item ?itemLabel ?developer (GROUP_CONCAT(?awardLabel; SEPARATOR = ", ") AS ?awards) (COUNT(?award) AS ?award_received) WHERE {
  BIND(wd:Q102300180 AS ?ceremony)
  ?item p:P166 ?statement.
  ?statement ps:P166 ?award;
    pq:P805 ?ceremony.
  OPTIONAL { ?item wdt:P178 ?developer. }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?award rdfs:label ?awardLabel.
    ?item rdfs:label ?itemLabel.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?developer
ORDER BY DESC (?award_received)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?award"):::projected v7("?awardLabel"):::projected v10("?award_received") v9("?awards") v2("?ceremony") v6("?developer"):::projected v3("?item"):::projected v8("?itemLabel"):::projected v4("?statement") c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/"'wd:Q102300180'"/] bind0 --as--o v2 v3 --"p:P166"--> v4 v4 --"p:statement/P166"--> v5 v4 --"p:qualifier/P805"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P178".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 v5 --"rdfs:label"--> v7 v3 --"rdfs:label"--> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind3[/"?awardLabel"/] v7 --o bind3 bind3 --as--o v9 bind4[/"count(?award)"/] v5 --o bind4 bind4 --as--o v10