Created
November 4, 2013 05:15
-
-
Save s-mage/7298347 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env ruby | |
require 'sparql/client' | |
sparql = SPARQL::Client.new("http://dbpedia.org/sparql") | |
query = "prefix dbpprop: <http://dbpedia.org/property/> | |
prefix dbpedia-owl: <http://dbpedia.org/ontology/> | |
select ?name, ?hdi | |
where { | |
?country a dbpedia-owl:Country . | |
?country dbpprop:commonName ?name . | |
?country dbpprop:hdi ?hdi | |
} | |
" | |
sparql.query(query).each { |r| r.each_binding { |x, y| puts "#{x}: #{y}" } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment