var yasqe = YASQE(document.getElementById("yasqe"), { sparql: { showQueryButton: true } }); var yasr = YASR(document.getElementById("yasr"), { //this way, the URLs in the results are prettified using the defined prefixes in the query getUsedPrefixes: yasqe.getPrefixesFromQuery }); /** * Set some of the hooks to link YASR and YASQE */ yasqe.options.sparql.handlers.success = function(data, textStatus, xhr) { yasr.setResponse({response: data, contentType: xhr.getResponseHeader("Content-Type")}); }; yasqe.options.sparql.handlers.error = function(xhr, textStatus, errorThrown) { var exceptionMsg = textStatus + " (response status code " + xhr.status + ")"; if (errorThrown && errorThrown.length) exceptionMsg += ": " + errorThrown; yasr.setResponse({exception: exceptionMsg}); };