Class: Request

sgvizler. Request


new Request()

Important class. Runs SPARQL query against SPARQL endpoints.

Dependencies:

  • sgvizler.util
  • sgvizler.namespace
  • sgvizler.registry
  • sgvizler.parser
  • sgvizler.loader
  • sgvizler.logger
  • sgvizler.defaults
  • jQuery
  • google.visualization

Example of how to use the Query class:

var sparqlQueryString = "SELECT * {?s ?p ?o} LIMIT 10",
    containerID = "myElementID",
    Q = new sgvizler.Query();

// Note that default values may be set in the sgvizler object.
Q.query(sparqlQueryString)
    .endpointURL("http://dbpedia.org/sparql")
    .endpointOutputFormat("json")                    // Possible values 'xml', 'json', 'jsonp'.
    .chartFunction("google.visualization.BarChart")  // The name of the function to draw the chart.
    .draw(containerID);                              // Draw the chart in the designated HTML element.