I want to get abstract from dbpedia using sparql. I want to run below query in ASP .NET in Visual Studio C#. Here is what i have done.

<script>
var query= "\
PREFIX dbpedia: <http://dbpedia.org/resource/>\
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>\
SELECT ?abstract\
 WHERE {\
 ?s dbpedia:Junagadh 
 dbpedia-owl:abstract ?abstract\
 }";


var queryUrl = url + "?query=" + encodeURIComponent(query) + "&format=json";
  $.ajax({
      dataType: "jsonp",
      url: queryUrl,
      success: function (_data) {
          var results = _data.results.bindings;

          for (var i in results) {
              var src = results[i].abstract.value;
              $('body').append(src);


          }
      }
  });

I want to get abstract to the entered search term in the browser. Here i hav entered "India". When i run this code i am not getting the output in browser.

So my question is how to execute this query from javascript and get the result in browser?

Please help me, Thank you.

Related posts

Recent Viewed