-
Notifications
You must be signed in to change notification settings - Fork 12
/
test.html
64 lines (54 loc) · 2.16 KB
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Woql Client</title>
</head>
<body>
<script type="text/javascript" src="lib/htmlViewers.js"></script>
<script src="http://localhost/terminus-client/dist/terminus-client.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script type="text/javascript">
var WOQL = TerminusClient.WOQL;
function showTerminus(doc){
document.getElementById('dvterm').appendChild(document.createTextNode(doc.subjid));
const lab = doc.first("rdfs:label") || doc.subjid;
document.getElementById('dvlab').appendChild(document.createTextNode(lab))
}
var arules = [
WOQL.rule().renderer("object").json(),
WOQL.rule().renderer("property").json(),
WOQL.rule().renderer("data").json(),
WOQL.rule().renderer("data").property("rdfs:comment").render(false).json()
];
var tdb = "http://localhost:6363/terminus";
var dbClient = new TerminusClient.WOQLClient();
var connection=dbClient.connect("http://localhost:6363/", "root");
connection.then((response)=>{
dbClient.connectionConfig.setDB("terminus");
var whtml = new TerminusHTMLViewer(dbClient);
var tab = whtml.table(WOQL.from(tdb).limit(100).getEverything());
var chooser = whtml.chooser(WOQL.from(tdb).classMetadata());
var d2 = whtml.document("admin", { rules: arules});
whtml.document("terminus", { render: showTerminus });
document.getElementById('dv2target').appendChild(d2);
document.getElementById('table-target').appendChild(tab);
document.getElementById('chooser-target').appendChild(chooser);
});
</script>
<div id="dvtarget"><div id='dvterm'></div> <div id='dvlab'></div></div>
<div id="dv2target">=
</div>
<div id="chooser-target"></div>
<div id="table-target"></div>
<div id="property-template" style="display:none">
<div class='property-view'>
<P>Property Label: <span class='property-label'></span></P>
<P>Property Comment: <span class='property-comment'></span></P>
<P>Property Values: <span class='property-values'></span></P>
</div>
</div>
</body>
</html>