query-6df91daf31ba9d17da08a674782668b1

rq turtle/ttl

Airon90(Q13099447)Houndour (P31)instance of (Q25931659)first type (Q25931668)second type

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?type ?typeLabel
WHERE
{
  ?item p:P31 ?instance_of_statement .
  ?instance_of_statement a wikibase:BestRank .
  ?instance_of_statement ps:P31 ?type .
  ?type wdt:P279 + wd:Q1266830 . # ?type is subclass of Pokémon type
  FILTER NOT EXISTS {
    VALUES ?allowed_P518_qualifier_value { wd:Q25931659 wd:Q25931668 }
    ?instance_of_statement pq:P518 ?allowed_P518_qualifier_value .
  }
  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; v1("?allowed_P518_qualifier_value") v2("?instance_of_statement") v3("?item"):::projected v4("?type"):::projected c7(["wd:Q1266830"]):::iri c9(["bd:serviceParam"]):::iri c4(["wikibase:BestRank"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] bind0[/VALUES ?allowed_P518_qualifier_value/] bind0-->e0v1 bind00(["wd:Q25931659"]) bind00 --> bind0 bind01(["wd:Q25931668"]) bind01 --> bind0 e0v2 --"p:qualifier/P518"--> e0v1 e0v1("?allowed_P518_qualifier_value"):::projected e0v2("?instance_of_statement"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v1 bind1[/VALUES ?allowed_P518_qualifier_value/] bind1-->v1 bind10(["wd:Q25931659"]) bind10 --> bind1 bind11(["wd:Q25931668"]) bind11 --> bind1 v2 --"p:qualifier/P518"--> v1 v3 --"p:P31"--> v2 v2 --"a"--> c4 v2 --"p:statement/P31"--> v4 v4 --"p:direct/P279"--> c7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end