query-f3d5130a05a552edb2ed87e7e98f7b75

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)characters (P674)sexual orientation (P91)

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#>
SELECT ?item ?itemLabel ?character ?characterLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?item (wdt:P31/(wdt:P279*)) wd:Q7889;
    wdt:P674 ?character.
  ?character wdt:P91/wdt:P279* wd:Q17884.
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?character"):::projected v1("?item"):::projected a1((" ")) a2((" ")) c2(["bd:serviceParam"]):::iri c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal c7(["wd:Q7889"]):::iri c10(["wd:Q17884"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c7 v1 --"wdt:P674"--> v2 v2 --"wdt:P91"--> a2 a2 --"wdt:P279"--> c10