query-fd70e46b190dd4bcb8c03c1ec4c7a056

rq turtle/ttl

Co-appearance graph

Use at

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

SELECT DISTINCT
  ?actor1 ?actor1Label
  ?actor2 ?actor2Label
WHERE {
   {
  SELECT 
    (COUNT(?film) AS ?films)
    ?actor1
    ?actor2
  WHERE {
    ?film wdt:P161 target:, ?actor1, ?actor2 .
    FILTER (target: != ?actor1)
    FILTER (target: != ?actor2)
    FILTER (?actor1 != ?actor2)
  }
  GROUP BY ?actor1 ?actor2
  HAVING (?films > 1)
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?actor1"):::projected v3("?actor2"):::projected v4("?film") v5("?films") c5(["bd:serviceParam"]):::iri c2([http://www.wikidata.org/entity/Q294647]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?films > '1^^xsd:integer'"]] f0 --> v5 f1[["?actor1 != ?actor2"]] f1 --> v2 f1 --> v3 f2[["http://www.wikidata.org/entity/Q294647 != ?actor2"]] f2 --> v3 f3[["http://www.wikidata.org/entity/Q294647 != ?actor1"]] f3 --> v2 v4 --"wdt:P161"--> c2 v4 --"wdt:P161"--> v2 v4 --"wdt:P161"--> v3 bind5[/"count(?film)"/] v4 --o bind5 bind5 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end