How to get the terminal leaves of a Wikipedia root category <p>I want to get only the leaves a wikipedia category but not sure how. I can get all the leaves by</p> <pre><code>SELECT ?subcat WHERE { ?subcat skos:broader* category:Buildings_and_structures_in_France_by_city . } </code></pre> <p>This gives me all intermediate leaves (such as Category:Buildings_and_structures_in_Antibes) but I want to get just the last/bottom leaves of the tree. Leaves that can not be split anymore. How can I do this?</p>