-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
188 lines (160 loc) · 9.28 KB
/
index.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>SPARQL Editor</title>
<link href="libs/yasqe.min.css" rel="stylesheet">
<script src="libs/yasqe.bundled.min.js"></script>
<link href="style.css" rel="stylesheet">
</head>
<body>
<nav class="thor-nav">
<h1 id="title">Editor</h1>
<ul>
<li><a href="#query-library-modal">Query Library</a></li>
<li><a href="#documentation-modal">Documentation</a></li>
</ul>
</nav>
<a href="#share-modal" class="share-btn" title="Share query" onclick="populateShareModal()"><svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" aria-hidden="true"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92c0-1.61-1.31-2.92-2.92-2.92zM18 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 13c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm12 7.02c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/></svg></a>
<div id="queryEditor" class="m-lr-small"></div>
<div style="position: relative;" aria-hidden="true">
<div class="handle">≡</div>
</div>
<div class="flex space-between">
<div class="flex">
<select id="renderModeSelector" class="thor-input thor-select m-tb-small m-lr-small" onchange="setRenderMode(this)">
<option value="table">Table</option>
<option value="piechart">Pie Chart</option>
<option value="imagegrid">Image Grid</option>
<option value="map">Map</option>
</select>
<select class="thor-input thor-select m-tb-small m-lr-small" onchange="download(this)">
<option>Download as</option>
<option value="json">JSON</option>
<option value="csv">CSV</option>
<option value="rq">SPARQL</option>
</select>
</div>
<div class="flex center-items">
<span style="display: none;" id="result-label" class="thor-label"></span>
<button class="thor-button thor-button-confirm m-tb-small m-lr-small" onclick="yasqe.query()">Execute</button>
</div>
</div>
<div class="results float-left m-lr-small" id="resultContainer" style="width: calc(100% - 1rem)"></div>
<div class="thor-loading" id="queryLoadingIndicator" style="display: none;">
<img src="assets/loading.svg" />
</div>
<a id="download" download style="display:none"></a>
<p class="thor-alert" id="messageContainer" style="display: none;"></p>
<div class="thor-modal-overlay" id="share-modal">
<div class="thor-modal" style="max-width: 500px;">
<h3 style="margin: 1.5rem .5rem;">Shareable URL</h3>
<a href="#" class="close"title="Close modal">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" aria-hidden="true"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</a>
<input type="url" readonly id="shareURLInput" class="m-tb-small m-lr-small thor-input" style="width:483px" onfocus="this.select();">
<button class="m-tb-small m-lr-small thor-button thor-button-confirm" style="width:483px" onclick="copyAndCloseShareModal()">Copy and close</button>
</div>
</div>
<div class="thor-modal-overlay" id="endpoint-modal">
<div class="thor-modal" style="max-width: 500px;">
<h3 style="margin: 1.5rem .5rem;">Enter Endpoint</h3>
<a href="#" class="close"title="Close modal">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" aria-hidden="true"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</a>
<input type="url" id="endpointInput" class="m-tb-small m-lr-small thor-input" style="width:483px" placeholder="http://example.com/sparql-endpoint">
<button class="m-tb-small m-lr-small thor-button thor-button-confirm" style="width:483px" onclick="closeAndSetEndpointModal()">Save</button>
</div>
</div>
<div class="thor-modal-overlay" id="documentation-modal">
<div class="thor-modal">
<h2>Documentation</h2>
<a href="#" class="close"title="Close modal">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" aria-hidden="true"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</a>
<div>
<h3>Tips & Tricks</h3>
<ul>
<li>You can drag and drop SPARQL files into the editor.</li>
<li>You can set the browser tab title by adding a line to your query prefixed by "<code>#title:</code>".</li>
</ul>
<h3>Using Visualizations</h3>
<p>This SPARQL has several built in visualizations in addition to the default table view. They can all be used by specifying specific variables described below.</p>
<h4>Image Grid</h4>
<p>The image grid requires only one variable. <var>?thumbnail</var> should be an image URL invalid image URLs within this variable will be ignored. Note that if you are running Thor over HTTPS images will need to be served over HTTPS as well. The image grid will only render the first 100 images.</p>
<h4>Pie Chart</h4>
<p>The pie chart requires two variables. <var>?count</var> should be a numeric value. <var>?label</var> should be a literal.</p>
<h4>Map</h4>
<p>The map requires either the two variables <var>?lat</var> and <var>?lon</var> (both numeric) or `?geometry` (points should space-seperated). Four optional variables are also avaible: <ul>
<li><var>?geometryColor</var>: Literal with a valid CSS color.</li>
<li><var>?markerRadius</var>: Numeric value defining the maker size in pixels.</li>
<li><var>?geometryOpacity</var>: Numeric 0-1 defining the opacity of the geometry.</li>
<li><var>?geometryTitle</var>: Literal which renders in a popup when a geometry is clicked.</li>
</ul></p>
<h3>Keyboard Shortcuts</h3>
<table class="thor-table">
<thead>
<tr>
<th>Shortcut</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><kbd>Ctrl</kbd> or <kbd>Cmd</kbd> + <kbd>Enter</kbd></td>
<td>Execute query</td>
</tr>
<tr>
<td><kbd>Ctrl</kbd> or <kbd>Cmd</kbd> + <kbd>[</kbd></td>
<td>Indent current/selected line(s) less</td>
</tr>
<tr>
<td><kbd>Ctrl</kbd> or <kbd>Cmd</kbd> + <kbd>]</kbd></td>
<td>Indent current/selected line(s) more</td>
</tr>
<tr>
<td><kbd>Ctrl</kbd> or <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>F</kbd></td>
<td>Auto-format/indent selected lines</td>
</tr>
<tr>
<td><kbd>Ctrl</kbd> or <kbd>Cmd</kbd> + <kbd>/</kbd></td>
<td>Comment or uncomment current/selected line(s)</td>
</tr>
<tr>
<td><kbd>Ctrl</kbd> or <kbd>Cmd</kbd> + <kbd>D</kbd></td>
<td>Delete current/selected line(s)</td>
</tr>
</tbody>
</table>
<h3>Contribute</h3>
<p>This SPARQL Editor is built upon Thor which is open source and you can report issues through <a href="https://github.com/Abbe98/thor">Github</a>.</p>
</div>
</div>
</div>
<div class="thor-modal-overlay" id="query-library-modal">
<div class="thor-modal">
<h2>Query Library</h2>
<a href="#" class="close"title="Close modal">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" aria-hidden="true"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</a>
<div>
<ul id="query-library-container" class="thor-large-list"></ul>
</div>
</div>
</div>
<script src="libs/d3.v5.min.js"></script>
<script src="libs/shepherd.min.js"></script>
<script src="libs/leaflet/leaflet.js"></script>
<script src="autocompleters/prefixes.js"></script>
<script src="autocompleters/properties.js"></script>
<script src="autocompleters/classes.js"></script>
<script src="autocompleters/uris.js"></script>
<script src="autocompleters/services.js"></script>
<script src="app.js"></script>
<script src="tour.js"></script>
<script src="config-loader.js"></script>
<link rel="stylesheet" href="libs/shepherd-theme-default.css"/>
<link rel="stylesheet" href="libs/leaflet/leaflet.css"/>
</body>
</html>