mediawiki - Wikidata query service traverse property -
i trying list of hyperonymes of given wikidata item. instance want traverse "subclass of" element https://www.wikidata.org/wiki/q4421
how sparql command https://query.wikidata.org like?
you can use property path (*) syntax.
in case wdt:p279* mention 0 or more time wdt:p279 subclass of equivalent in wikidata model.
i added few variation here include depth can order them
select ?entity ?entitylabel (count(?mid) ?depth) { wd:q4421 wdt:p279* ?mid. ?mid wdt:p279* ?entity service wikibase:label { bd:serviceparam wikibase:language "en" } } group ?entity ?entitylabel order ?depth
Comments
Post a Comment