query-604dc6b2eeee77e89c75f62f7e175f5d

rq turtle/ttl

Co-appearances

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX target: <http://www.wikidata.org/entity/Q294647>

SELECT
  ?coappearances

  ?actor ?actorLabel
  (CONCAT("#actor/", SUBSTR(STR(?actor), 32)) AS ?actorUrl)
  ?actorDescription

  ?example_film ?example_filmLabel
  (CONCAT("#film/", SUBSTR(STR(?example_film), 32)) AS ?example_filmUrl)
WHERE {
   {
  SELECT
    (COUNT(?film) AS ?coappearances)
    ?actor
    (SAMPLE(?film) AS ?example_film)
  WHERE {
    ?film wdt:P161 ?actor, target: .
    FILTER (target: != ?actor)
  }
  GROUP BY ?actor
  ORDER BY DESC(?coappearances)
  LIMIT 500
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?coappearances)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?actor"):::projected v5("?actorUrl") v4("?coappearances"):::projected v4("?example_film"):::projected v6("?example_filmUrl") v3("?film") c4(["bd:serviceParam"]):::iri c1([http://www.wikidata.org/entity/Q294647]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["http://www.wikidata.org/entity/Q294647 != ?actor"]] f0 --> v2 v3 --"wdt:P161"--> v2 v3 --"wdt:P161"--> c1 bind3[/"count(?film)"/] v3 --o bind3 bind3 --as--o v4 bind4[/"sample(?film)"/] v3 --o bind4 bind4 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end bind5[/"concat('#actor/',substring(str(?actor),'32^^xsd:integer'))"/] v2 --o bind5 bind5 --as--o v5 bind6[/"concat('#film/',substring(str(?example_film),'32^^xsd:integer'))"/] v4 --o bind6 bind6 --as--o v6