-
Notifications
You must be signed in to change notification settings - Fork 4
/
turtle_test.html
83 lines (74 loc) · 2.72 KB
/
turtle_test.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
<head>
<title>Test Your Turtle</title>
<link href="/css/huvis.css" rel="stylesheet" type="text/css">
<script src="http://d3js.org/d3.v3.js" charset="utf-8"></script>
<script src="lib/fisheye.js" charset="utf-8"></script>
<script src="lib/RDFa.min.1.2.0.js" charset="utf-8"></script>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="js/greenerturtle.js" charset="utf-8"> </script>
<script src="js/huvis.js" charset="utf-8"> </script>
<script>
var verbosity = 100;
var G = {};
var snarf = function(){
var src_str = document.getElementById('src').value;
console.log('about to parse');
//console.log(src_str);
G = GreenTurtle.implementation.parse(src_str,'text/turtle');
showGraph(G);
//console.log(G);
document.getElementById('out').value = G.toString();
}
</script>
</head>
<body>
<div id="vis" class="underneath"></div>
<P>
<p>Enter some TTL (Turtle) and then press
<span style="background-color:lightgreen"
onchange="snarf()"
onclick="snarf()">GO</span></p>
<table>
<tr><td>
<textarea id="src" cols="50" rows="20">
@prefix r: <http://orl.ca/rel/> .
@prefix o: <http://orl.ca/writer/> .
@prefix p: <http://orl.ca/people/> .
@prefix g: <http://orl.ca/geog/> .
@prefix i: <http://orl.ca/institution/> .
@prefix w: <http://orl.ca/work/> .
@prefix f: <http://xmlns.com/foaf/0.1/> .
# a 'blank node' for person without an entry
_:a f:name "Smith, Mary" .
o:abdyma f:hasMom _:a .
</textarea>
</td><td>
<textarea id="out" cols="50" rows="20">
</textarea>
</td></tr></table>
</P>
By <a href="http://smurp.com/">Shawn Murphy</a><br>
Powered by <a href="https://code.google.com/p/green-turtle/wiki/API">Green Turtle</a> and <a href="http://d3js.org/">D3</a>.
<textarea id="src" cols="50" rows="20" style="display:none">
_:c14n0 <http://xmlns.com/foaf/0.1/homepage> <http://manu.sporny.org/> .
_:c14n0 <http://xmlns.com/foaf/0.1/name> "Manu Sporny" .
</textarea>
<textarea id="dave" cols="50" rows="20" style="display:none">
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix ex: <http://example.org/stuff/1.0/> .
<http://www.w3.org/TR/rdf-syntax-grammar>
dc:title "RDF/XML Syntax Specification (Revised)" ;
ex:editor [
ex:fullname "Dave Beckett";
ex:homePage <http://purl.org/net/dajobe/>
] .
</textarea>
<textarea id="twain" cols="50" rows="20" style="display:none">
@prefix wp: <http://wikipedia.org/wiki/>.
wp:Mark_Twain wp:Huckleberry_Finn wp:Author.
</textarea>
</body>
</html>