Last active
August 29, 2015 14:03
-
-
Save ptgolden/5386feaf71cbeb5bb176 to your computer and use it in GitHub Desktop.
DBPedia SPARQL query for countries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX dbo: <http://dbpedia.org/ontology/> | |
PREFIX dbprop: <http://dbpedia.org/property/> | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX owl: <http://www.w3.org/2002/07/owl#> | |
SELECT ?place, ?label, ?geonamesURI, ?depiction WHERE { | |
?place a dbo:Country . | |
?place rdfs:label ?label . | |
?place foaf:depiction ?depiction . | |
FILTER langMatches(lang(?label), 'en') . | |
FILTER regex(str(?label), '^ge.*', 'i') . | |
OPTIONAL { | |
?place owl:sameAs ?geonamesURI . | |
FILTER regex(str(?geonamesURI), 'geonames\\.org') | |
} | |
} | |
ORDER BY DESC(?geonamesURI) | |
LIMIT 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment