query-04554807aecc84335d6fe412fd26a406
Airon90
Use at
- https://query.wikidata.org/sparql
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 pq:P518 wd:Q25931659 .
?type1_statement ps:P31 / wdt:P279 ?type1 .
?type1 wdt:P279 wd:Q1266830 .
}
OPTIONAL {
?item p:P31 ?type2_statement .
?type2_statement pq:P518 wd:Q25931668 .
?type2_statement ps:P31 / wdt:P279 ?type2 .
?type2 wdt:P279 wd:Q1266830 .
}
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((" "))
a2((" "))
a3((" "))
c8(["wd:Q1266830"]):::iri
c9(["wd:Q25931668"]):::iri
c13(["wd:Q20005020"]):::iri
c3(["wd:Q3966183"]):::iri
c15(["bd:serviceParam"]):::iri
c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["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:qualifier/P518"--> c6
v3 --"p:statement/P31"--> a2
a2 --"p:direct/P279"--> v4
v4 --"p:direct/P279"--> c8
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P31".-> v5
v5 --"p:qualifier/P518"--> c9
v5 --"p:statement/P31"--> a3
a3 --"p:direct/P279"--> v6
v6 --"p:direct/P279"--> 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"--> c13
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;
c15 --"wikibase:language"--> c17
end