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.
Last active
September 14, 2018 02:44
-
-
Save LaurensRietveld/7d8beca5dbeb6b909b6f to your computer and use it in GitHub Desktop.
Combining #YASQE and #YASR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Glueing YASQE and YASR</title> | |
<link href='http://cdn.jsdelivr.net/g/[email protected](yasqe.min.css),[email protected](yasr.min.css)' rel='stylesheet' type='text/css'/> | |
</head> | |
<body> | |
<div id="yasqe"></div> | |
<div id="yasr"></div> | |
<script src='http://cdn.jsdelivr.net/yasr/2.4/yasr.bundled.min.js'></script> | |
<script src='http://cdn.jsdelivr.net/yasqe/2.2/yasqe.bundled.min.js'></script> | |
<script src="glue.js"></script> | |
</body> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.