SPARQL.Service = function(endpoint) {    //---------------    // private fields    var _endpoint = endpoint;    var _default_graphs = [];    var _named_graphs = [];    var _prefix_map = {};    var _method = 'POST';    var _output = 'json';    //----------    // accessors    this.endpoint = function() { return _endpoint; };    this.defaultGraphs = function() { return _default_graphs; };    this.namedGraphs = function() { return _named_graphs; };    this.prefixes = function() { return _prefix_map; };    this.method = function() { return _method; };    this.output = function() { return _output; };        //---------    // mutators    function _add_graphs(toAdd, arr) {        if (toAdd instanceof Array)            for (var i = 0; i < toAdd.length; i++) arr.push(toAdd[i]);        else            arr.push(toAdd);    }    this.addDefaultGraph = function(g) { _add_graphs(g, this.defaultGraphs()); };    this.addNamedGraph = function(g) { _add_graphs(g, this.namedGraphs()); };    this.setPrefix = function(p, u) { this.prefixes()[p] = u; };    this.createQuery = function() { return new SPARQL.Query(this); };    this.setMethod = function(m) {        if (m != 'GET' && m != 'POST') throw("HTTP methods other than GET and POST are not supported.");        _method = m;    };    this.setOutput = function(o) { _output = o; }    //---------------    // public methods    // use our varied transformations to create the various shortcut methods of actually     // issuing queries without explicitly creating a query object    for (var query_form in SPARQL._query_transformations) {        // need the extra function to properly scope query_form (qf)        this[query_form] = (function(qf) {            return function(queryString, callback) {                var q = this.createQuery();                q._doQuery(queryString, callback, SPARQL._query_transformations[qf]);            };        })(query_form);    }        //------------    // constructor        if (!_endpoint)        return null;        return this;}
5494	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5494/25b1b2b216fb933dbfb9f0b23e0ee134af098779/sparql.js/buggy/webapps/joseki/snorql/sparql.js