I have a place name (e.g. city) which has a corresponding triple in Geonames dataset. I want to get the continent for that place using SPARQL query. There are two properties useful for this:
Every place type (city, country, continent) is defined with a Feature Code. The problem is how to apply a recursive condition in SPARQL to get parent feature node, until (parent)featureCode == geo:Continent?