Guest User

Untitled

a guest
Jun 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. var SPARQLendpoint = {
  2.  
  3. getData: function (query) {
  4.  
  5. var endpointUrl = 'http://localhost:7200/repositories/myRepo',
  6. sparqlQuery = query,
  7.  
  8. settings = {
  9. headers: { Accept: 'application/sparql-results+json'},
  10. data: { query: sparqlQuery },
  11. dataType: 'jsonp'
  12. };
  13.  
  14. $.ajax(endpointUrl, settings).then(function (data) {
  15. $('body').append(($('<pre>').text(JSON.stringify(data))));
  16. console.log(data);
  17. });
  18.  
  19. });
  20.  
  21. }
  22.  
  23. }
  24. query = 'here is the query';
  25. SPARQLendpoint.getData(query);
Add Comment
Please, Sign In to add comment