Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Combining #YASQE and #YASR

A simple example on how to combine YASQE and YASR. Any SPARQL result received via YASQE are passed on to YASR. YASR, uses any prefixes defined in YASQE to prettify the SPARQL results.

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
//link both together
yasqe.options.sparql.callbacks.complete = yasr.setResponse;
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Glueing YASQE and YASR</title>
<link href=',yasr@2.4(yasr.min.css)' rel='stylesheet' type='text/css'/>
<div id="yasqe"></div>
<div id="yasr"></div>
<script src=''></script>
<script src=''></script>
<script src="glue.js"></script>

This comment has been minimized.

Copy link

semanticfire commented Sep 24, 2014

When I copy this example I have to reload the page to get my query results to show
I use the YASQE-1.4 and YASR-1.2

In the debugger I see that the query gets performed on the backend


This comment has been minimized.

Copy link
Owner Author

LaurensRietveld commented Oct 13, 2014

Ah, I missed this comment, sorry about that. Could you try the latest version of YASR (1.2.1)? There was an issue related to the new DataTables programming interface, which made the results table unable to update on new query results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.