Last active
April 27, 2016 16:12
-
-
Save labra/0a33892da624b30b614f8553799b6c4f to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
</head> | |
<body> | |
<h1>Values</h1> | |
<ol id="valores"></ol> | |
</body> | |
<script type="text/javascript"> | |
var url = "http://dbpedia.org/sparql"; | |
var query = "\ | |
PREFIX dbr: <http://dbpedia.org/resource/>\ | |
PREFIX dbo: <http://dbpedia.org/ontology/>\ | |
SELECT ?x\ | |
WHERE {\ | |
?x dbo:birthPlace dbr:Spain .\ | |
}"; | |
var queryUrl = encodeURI( url+"?query="+query+"&format=json" ); | |
$.ajax({ | |
dataType: "jsonp", | |
url: queryUrl, | |
success: function( _data ) { | |
var results = _data.results.bindings; | |
for ( var i in results ) { | |
var objectValue = results[i].x.value; | |
$('#valores').append( '<li>'+objectValue+'</li>' ); | |
} | |
} | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment