query-5cbe58dd30d8537bb38ee5d5be33a748

rq turtle/ttl

persons appearing as (voice) actors in both given television shows SELECT ?personLabel with { select distinct ?person where { bind(wd:Q886 as ?show1) . ?ep1 wdt:P179 ?show1. ?ep1 wdt:P31 wd:Q21191270. ?ep1 wdt:P161|wdt:P725 ?person. } } as %i WITH { select distinct ?person where { bind(wd:Q79784 as ?show2) . ?ep2 wdt:P179 ?show2. ?ep2 wdt:P31 wd:Q21191270. ?ep2 wdt:P161|wdt:P725 ?person. } } as %j WHERE { INCLUDE %i INCLUDE %j SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# persons appearing as (voice) actors in both given television shows
SELECT ?personLabel WHERE
{
   {
  select distinct ?person where
  {
    bind(wd:Q886 as ?show1) .
    ?ep1 wdt:P179 ?show1.
    ?ep1 wdt:P31 wd:Q21191270.
    ?ep1 wdt:P161|wdt:P725 ?person.
} }   { 
  select distinct ?person where
  {
    bind(wd:Q79784 as ?show2) .
    ?ep2 wdt:P179 ?show2.
    ?ep2 wdt:P31 wd:Q21191270.
    ?ep2 wdt:P161|wdt:P725 ?person.
} }  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("?ep1") v5("?ep2") v3("?person") v1("?show1") v4("?show2") c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q21191270"]):::iri bind0[/"'wd:Q886'"/] bind0 --as--o v1 v2 --"wdt:P179"--> v1 v2 --"wdt:P31"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P725"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P161"--> v3 end union0r <== or ==> union0l end bind1[/"'wd:Q79784'"/] bind1 --as--o v4 v5 --"wdt:P179"--> v4 v5 --"wdt:P31"--> c3 subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P725"--> v3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P161"--> v3 end union1r <== or ==> union1l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end