query-953df297a671aef5e581266c88e8cf9f

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)characters (P674)IMDb ID (P345)from narrative universe (P1080)cast member (P161)present in work (P1441)character role (P453)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?f ?fLabel ?work ?workLabel WHERE {
  ?f wdt:P31/wdt:P279* wd:Q95074 .
  FILTER NOT EXISTS {?f p:P1080 ?fu} .
  FILTER NOT EXISTS {?f wdt:P31/wdt:P279* wd:Q12405827} .
  FILTER NOT EXISTS {?f wdt:P31/wdt:P279* wd:Q4271324} .
  #
  FILTER NOT EXISTS {
    ?work p:P161 ?cast_stm .
    ?cast_stm pq:P453 ?f .
  } .
  #
  FILTER NOT EXISTS {?f     p:P1441 ?work2}
  FILTER NOT EXISTS {?work3 wdt:P674  ?f}
  # debug
  #?f wdt:P345 "ch0465384"
  #
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en".}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?cast_stm") v2("?f"):::projected v6("?fu") v4("?work"):::projected v3("?work2") v1("?work3") a3((" ")) a2((" ")) a1((" ")) c14(["en"]):::literal c10(["wd:Q95074"]):::iri c12(["bd:serviceParam"]):::iri c7(["wd:Q4271324"]):::iri c8(["wd:Q12405827"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:direct/P674"--> e0v2 e0v2("?f"):::projected e0v1("?work3"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"p:direct/P674"--> v2 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"p:P1441"--> e1v2 e1v1("?f"):::projected e1v2("?work2"):::projected end f1--EXISTS--> f1e1 f1 --> v2 f1 --> c2 f1 --> v3 v2 --"p:P1441"--> v3 f2[["not "]] subgraph f2e2["Exists Clause"] e2v1 --"p:P161"--> e2v2 e2v2 --"p:qualifier/P453"--> e2v3 e2v2("?cast_stm"):::projected e2v3("?f"):::projected e2v1("?work"):::projected end f2--EXISTS--> f2e2 f2 --> v4 f2 --> c3 f2 --> v5 f2 --> c4 f2 --> v2 v4 --"p:P161"--> v5 v5 --"p:qualifier/P453"--> v2 f3[["not "]] subgraph f3e3["Exists Clause"] e3v1 --"p:direct/P31"--> e3a1 e3a1 --"p:direct/P279"--> e3c3 e3v1("?f"):::projected e3a1((" ")):::projected e3c3(["wd:Q4271324"]):::iri end f3--EXISTS--> f3e3 f3 --> v2 f3 --> c5 f3 --> a1 f3 --> c6 f3 --> c7 v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c7 f4[["not "]] subgraph f4e4["Exists Clause"] e4v1 --"p:direct/P31"--> e4a1 e4a1 --"p:direct/P279"--> e4c3 e4v1("?f"):::projected e4a1((" ")):::projected e4c3(["wd:Q12405827"]):::iri end f4--EXISTS--> f4e4 f4 --> v2 f4 --> c5 f4 --> a2 f4 --> c6 f4 --> c8 v2 --"p:direct/P31"--> a2 a2 --"p:direct/P279"--> c8 f5[["not "]] subgraph f5e5["Exists Clause"] e5v1 --"p:P1080"--> e5v2 e5v1("?f"):::projected e5v2("?fu"):::projected end f5--EXISTS--> f5e5 f5 --> v2 f5 --> c9 f5 --> v6 v2 --"p:P1080"--> v6 v2 --"p:direct/P31"--> a3 a3 --"p:direct/P279"--> c10 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end