'Wikidata Query Service traverse property

I am trying to get a list of all hyperonymes of a given Wikidata item. For instance I want to traverse the "subclass of" element for https://www.wikidata.org/wiki/Q4421.

How would the SPARQL command for https://query.wikidata.org look like?



Solution 1:[1]

Just found a tool which tackles exactly my problem. https://angryloki.github.io/wikidata-graph-builder/?property=P279&item=Q4421

Solution 2:[2]

you can use SPARQL recursion syntax *:

SELECT ?entity WHERE {
  wd:Q4421 wdt:P279* ?entity.
}

see on query.wikidata.org

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lunatech
Solution 2 maxlath