query-aae56f78f3418a850b66bc674a8b25c2

rq turtle/ttl

TODO

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 DISTINCT ?item ?itemLabel ?type1Label ?type2Label ?Pokédex
WHERE
{
  ?item wdt:P31 / wdt:P279 wd:Q3966183 .
  OPTIONAL {
    ?item p:P31 ?type1_statement .
    ?type1_statement ps:P31 ?type1 .
    ?type1_statement pq:P518 wd:Q25931659 .
  }
  OPTIONAL {
    ?item p:P31 ?type2_statement .
    ?type2_statement ps:P31 ?type2 .
    ?type2_statement pq:P518 wd:Q25931668 .
  }
  OPTIONAL {
    ?item p:P1685 ?Pokédex_statement .
    ?Pokédex_statement ps:P1685 ?Pokédex_value .
    ?Pokédex_statement pq:P972 wd:Q20005020 . # Use catalog National Pokédex
    BIND (IF(wikibase:isSomeValue(?Pokédex_value), "unknown value", ?Pokédex_value) AS ?Pokédex)
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
ORDER BY ?Pokédex

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?Pokédex"):::projected v7("?Pokédex_statement") v8("?Pokédex_value") v2("?item"):::projected v4("?type1") v3("?type1_statement") v6("?type2") v5("?type2_statement") a1((" ")) c8(["wd:Q25931668"]):::iri c12(["wd:Q20005020"]):::iri c3(["wd:Q3966183"]):::iri c14(["bd:serviceParam"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal c7(["wd:Q25931659"]):::iri v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P31".-> v3 v3 --"p:statement/P31"--> v4 v3 --"p:qualifier/P518"--> c7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P31".-> v5 v5 --"p:statement/P31"--> v6 v5 --"p:qualifier/P518"--> c8 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P1685".-> v7 v7 --"p:statement/P1685"--> v8 v7 --"p:qualifier/P972"--> c12 bind0[/"if(http://wikiba.se/ontology#isSomeValue(?Pokédex_value),'unknown value',?Pokédex_value)"/] v8 --o bind0 bind0 --as--o v9 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end