0

I want to list pokemons. I am able to reach to a list(wd:Q106036966) from the Pokemon entity(Q864) on Wikidata.

But I can't find the way to retrieve the data on that list.

At first I thought that maybe the data wasn't added, but if I search for Charmander(Q3178753), I am able to get to the list going upwards in the hierarchy.

Does anyone know what am I missing?

Pascalco
  • 2,481
  • 2
  • 15
  • 31
  • 1
    You should share the query you currently have, just so people can see what you are doing wrong. – Valerio Cocchi Apr 29 '21 at 16:12
  • if you already open a page of a Pokemon, you should have seen that "part of" is the relation between Pokemon and a list: `select ?list ?listLabel ?pokemon ?pokemonLabel { ?list wdt:P31 wd:Q106036966 . ?pokemon wdt:P361 ?list SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }` – UninformedUser Apr 30 '21 at 06:45
  • with subtypes of "list":`select ?list ?listLabel ?pokemon ?pokemonLabel {VALUES ?pokemon {wd:Q3178753} ?list wdt:P31/wdt:P279* wd:Q106036966 . ?pokemon wdt:P361 ?list SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }` – UninformedUser Apr 30 '21 at 06:47

1 Answers1

0

If you start at Q3178753 (Charmander), you can see that it is an instance of Q25930490 (fire-type Pokémon) which is a subclass of Q3966183 (Pokémon species).

To list all Pokémon species you need to go backwards: Get all subclasses of Pokémon species and then all instances of these subclasses. Translated into SPARQL this will read like

SELECT ?item ?itemLabel {
  ?item wdt:P31/wdt:P279* wd:Q3966183                                                                                     
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} 

If you want more than just the names of the Pokémons you can extend this query to get e.g. height, weight, Pokédex etc.

Pascalco
  • 2,481
  • 2
  • 15
  • 31