Given an entity that is an instance of X, there is a Wikidata API that allows to view the tree of all X sub instances and/or subclasses. Example: New York is an instance of city of the United States (Q1093829). Can I know through a single call to an API if Q1093829 is a subclass of something or instance of something and so on until the end of the relationship is reached?
Asked
Active
Viewed 171 times
3
-
[In SPARQL](https://query.wikidata.org/#select%20%3Fs%20%3FsLabel%20%7B%20wd%3AQ1093829%20%28wdt%3AP31%7Cwdt%3AP279%29%2B%20%3Fs%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%20%7D.%20%7D) – Stanislav Kralin Oct 05 '18 at 16:17
-
Could you provide more details about who that SPARQL query works? Which portion causes the search to be recursive? – Paul Wintz Jul 25 '20 at 03:53