query-515630836a6dd4771285fb2b3336d816

rq turtle/ttl

List of guests per number of appearance PREFIX xsd: http://www.w3.org/2001/XMLSchema#

SELECT DISTINCT (COUNT (?guest) as ?count) ?guestLabel WHERE { ?episode (wdt:P31/wdt:P279*) wd:Q1983062. ?episode p:P179 ?statement. OPTIONAL { ?episode wdt:P5030 ?guest. } ?statement ps:P179 wd:Q56816469. ?statement pq:P1545 ?numero_episode. SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en". ?guest rdfs:label ?guestLabel.} } GROUP BY (?guestLabel) ORDER BY DESC (?count)

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#>
#List of guests per number of appearance
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT (COUNT (?guest) as ?count) ?guestLabel 
WHERE {
  ?episode (wdt:P31/wdt:P279*) wd:Q1983062.
  ?episode p:P179 ?statement.
  OPTIONAL { ?episode wdt:P5030 ?guest. }
  ?statement ps:P179 wd:Q56816469.
  ?statement pq:P1545 ?numero_episode.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en".
                         ?guest rdfs:label ?guestLabel.}
}
GROUP BY (?guestLabel)
ORDER BY DESC (?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count") v2("?episode") v4("?guest"):::projected v6("?guestLabel"):::projected v5("?numero_episode") v3("?statement") a1((" ")) c7(["wd:Q56816469"]):::iri c3(["wd:Q1983062"]):::iri c10(["bd:serviceParam"]):::iri c12(["fr,en"]):::literal v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 v2 --"p:P179"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P5030".-> v4 end v3 --"p:statement/P179"--> c7 v3 --"p:qualifier/P1545"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 v4 --"rdfs:label"--> v6 end bind1[/"count(?guest)"/] v4 --o bind1 bind1 --as--o v7