var endpointUrl = '{ENDPOINT_URL}',
    sparqlQuery = {SPARQL_QUERY},
    settings = {
        headers: { Accept: 'application/sparql-results+json' },
        data: { query: sparqlQuery }
    };

$.ajax( endpointUrl, settings ).then( function ( data ) {
    $( 'body' ).append( ( $('<pre>').text( JSON.stringify( data) ) ) );
    console.log( data );
} );
