Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Last active Aug 29, 2015
Embed
What would you like to do?
Dbpedia Ruby
# Using https://github.com/farbenmeer/dbpedia
# http://stackoverflow.com/questions/13033841/dbpedia-country-profile-query
# See also http://stackoverflow.com/questions/15610033/query-cities-and-their-country-from-dbpedia
# List of countries, including defunct countries
Dbpedia.sparql.query('select ?country where { ?country rdf:type dbpedia-owl:Country }')
# List of modern countries
select ?country where { ?country <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Member_states_of_the_United_Nations>; <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Country> } order by ?country
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment