forked from ktym/d3sparql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d3sparql.html
45 lines (45 loc) · 2.54 KB
/
d3sparql.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<script src="lib/jquery/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="lib/google-code-prettify/prettify.css"/>
<link rel="stylesheet" type="text/css" href="lib/google-code-prettify/prettify-desert.css"/>
<script src="lib/google-code-prettify/prettify.js"></script>
<script>
$.get("d3sparql.js", function(data) {
$("#code").text(data);
prettyPrint();
})
</script>
</head>
<body>
<div id="query" style="margin: 10px">
<h1>d3sparql.js</h1>
<p>
<span class="label label-info">Info</span><br>
JavaScript natually fits for querying a <a href="http://sparqles.okfn.org/">SPARQL endpoint</a> which provides a REST service returning the result in the JSON format. The <a href="d3sparql.js">d3sparql.js</a> library provides functions executing a SPARQL query by <a href="http://en.wikipedia.org/wiki/Ajax_(programming)">Ajax</a> call (XMLHttpRequest) and visulaizing results by the <a href="http://d3js.org/">D3 library</a>. Basically, this library transforms the <a href="http://www.w3.org/TR/sparql11-results-json/">SPARQL Query Results JSON Format</a> (aka. application/sparql-results+json) into several JSON formats which major D3 layouts can accept. Many of the examples are borrowed from <a href="http://bl.ocks.org/">bl.ocks.org</a> and <a href="http://bost.ocks.org/mike/">bost.ocks.org</a>. The d3sparql.js library is distributed under the same license as D3.js's (<a href="http://opensource.org/licenses/BSD-3-Clause">BSD license</a>).
</p>
<p>
<span class="label label-success">Demo</span><br>
You can try out some examples from the menu on the top of this page.
</p>
<p>
<span class="label label-warning">Note</a></span>
<ul>
<li> This library is still under development.</li>
<li> The <a href="https://code.google.com/p/sgvizler/">sgvizler</a> project provides similar functionality based on the <a href="https://developers.google.com/chart/">Google Chart Tools</a>.</li>
</ul>
</p>
<p>
<span class="label label-important">Todos</span>
<ul>
<li>Rewrite option handling based on the <a href="http://bost.ocks.org/mike/chart/">D3 convention</a>.</li>
<li>Add more exciting examples.</li>
</ul>
</p>
<pre class="prettyprint"><code class="language-js" id="code"></code></pre>
</div>
</body>
</html>