Skip to content
Permalink
eb8776981c
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
<!doctype html>
<!-- ©2014 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Linked Data Fragments client</title>
<script src="../deps/jquery-2.1.0.js"></script>
<script src="../deps/ldf-client-browser.js"></script>
<script src="../deps/prefixes.js"></script>
</head>
<body>
<h1>Pull-based query evaluation</h1>
<p>
New results are pulled upon request.
Fragment pages are only fetched as needed.
</p>
<textarea id=query style="height:200px;width:400px">
SELECT ?p ?c WHERE {
?p a &lt;http://dbpedia.org/ontology/Artist&gt;.
?p &lt;http://dbpedia.org/ontology/birthPlace&gt; ?c.
}
</textarea>
<p><button id="next">Next result</button></p>
<pre id="result"></pre>
<script>
// Create the client that will fetch the fragments
var startFragment = 'http://data.linkeddatafragments.org/dbpedia',
fragmentsClient = new ldf.FragmentsClient(startFragment), results;
$('#next').click(function () {
// Initialize the results iterator on first call
if (!results) {
var query = $('#query').prop('disabled', true).val();
results = new ldf.SparqlIterator(query, { fragmentsClient: fragmentsClient, });
}
// Show the next result
(function showNext() {
var result = results.read();
if (result === null)
results.once('readable', showNext);
else
$('#result').text(JSON.stringify(result));
})();
});
</script>
</body>
</html>