-
Notifications
You must be signed in to change notification settings - Fork 21
/
flint_manual_1_0.html
executable file
·214 lines (194 loc) · 9.54 KB
/
flint_manual_1_0.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title></head>
<body>
<h1>Flint <span class="caps">SPARQL</span> Editor v1.0</h1>
<p>Released 19 September 2012</p>
<p><a href="http://openuplabs.tso.co.uk/demos/sparqleditor" target="_blank">http://openuplabs.tso.co.uk/demos/sparqleditor</a></p>
<p>Bug reports/discussion at</p>
<p><a href="https://groups.google.com/group/flint-sparql-editor" target="_blank">https://groups.google.com/group/flint-sparql-editor</a></p>
<p>Created by <span class="caps">TSO</span> – <a href="http://www.tso.co.uk" target="_blank">www.tso.co.uk</a></p>
<p>You can contact the developers on the Flint Google Group or at <a href="mailto:flintsparqleditor@tso.co.uk">flintsparqleditor@tso.co.uk</a>. If you are deploying Flint on your site, please let us know and we’ll keep you informed of new releases.</p>
<h2>Installation instructions</h2>
<p>Flint can be used locally or on a website.</p>
<p>To install Flint simply unzip all of the files in the download file into a folder, maintaining the structure of the download <span class="caps">ZIP</span>.</p>
<p>If the installation is local you can ‘run’ Flint by opening sparqleditor.html in your browser.</p>
<p>To use within a web page you need to reference the necessary files. This can be done by including the following lines in your web page:</p>
<pre><script type="text/javascript" src="sparql/jquery-1.5.2.min.js">//</script>
<script type="text/javascript" src="sparql/lib/codemirror.js">//</script>
<script type="text/javascript" src="sparql/sparql10querymode_ll1.js">//</script>
<script type="text/javascript" src="sparql/sparql11querymode_ll1.js">//</script>
<script type="text/javascript" src="sparql/sparql11updatemode_ll1.js">//</script>
<script type="text/javascript" src="sparql/flint-editor.js">//</script>
<link rel="stylesheet" href="sparql/lib/codemirror.css"/>
<link rel="stylesheet" href="sparql/css/sparqlcolors.css"/>
<link rel="stylesheet" href="sparql/css/docs.css"/></pre>
To create an instance of Flint in a web page you will need to use Javascript to create a FlintEditor object, passing in the relevant parameters. An example if given below:
<pre>
var flintEd = new FlintEditor("flint-test", "sparql/images", flintConfig);
</pre>
<p>The parameters are:</p>
<p>The id of a container element (e.g. a <div> element) in which Flint will be created
The relative path of the images for Flint. By default this will use the supplied images
A Flint configuration object. You can simply look at init-local.js as an example of how to do it or follow the instructions below.</p>
<h2>Flint Configuration</h2>
<p>Flint is configured using a <span class="caps">JSON</span> array. An example file is given below:</p>
<pre>
var flintConfig = {
"interface": {
"toolbar": true,
"menu": true
},
"namespaces": [
{"name": "Friend of a friend", "prefix": "foaf", "uri": "http://xmlns.com/foaf/0.1/"},
],
"defaultEndpointParameters": {
"queryParameters": {
"format": "output",
"query": "query",
"update" : "update"
},
"selectFormats": [
{"name": "Plain text", "format": "text", "type": "text/plain"},
{"name": "SPARQL-XML", "format": "sparql", "type": "application/sparql-results+xml"},
{"name": "JSON", "format": "json", "type": "application/sparql-results+json"}
],
"constructFormats": [
{"name": "Plain text", "format": "text", "type": "text/plain"},
{"name": "RDF/XML", "format": "rdfxml", "type": "application/rdf+xml"},
{"name": "Turtle", "format": "turtle", "type": "application/turtle"}
]
},
"endpoints": [
{"name": "Legislation",
"uri": "http://gov.tso.co.uk/legislation/sparql",
queries: [
{"name": "Sample Legislation Query 1", "description": "Select up to 100 pieces of legislation after a given date, with most recent first.", "query": sampleQuery1},
{"name": "Sample Legislation Query 2", "description": "The RDF description of each piece of legislation is stored in a separate named graph, so all of the RDF for the item can be retrieved with the following query.", "query": sampleQuery2}
]
}
}
</pre>
<h3>interface:</h3>
<p>This defines whether certain aspects of the UI should be visible or not. The options are:</p>
<table border="1">
<tr>
<td>toolbar</td>
<td><code>true</code> or <code>false</code></td>
</tr>
<tr>
<td>menu</td>
<td><code>true</code> or <code>false</code></td>
</tr>
</table>
<h3>namespaces:</h3>
<p>This defines the namespaces that the application ‘knows’ about. This should be an array of namespaces. Each namespace should define the following:</p>
<table border="1">
<tr>
<td>name</td>
<td>UI name</td>
</tr>
<tr>
<td>prefix</td>
<td>A prefix for the application to use for the namespace</td>
</tr>
<tr>
<td>uri</td>
<td>The <span class="caps">URI</span> of the namespace</td>
</tr>
</table>
<h3>defaultEndpointParameters:</h3>
<p>These are default values to use for endpoints. In future versions these will be customisable at the endpoint level</p>
<h3>queryParameters:</h3>
<p>Details about the query parameter settings. This should define:</p>
<table border="1">
<tr>
<td>format</td>
<td>The request parameter name for the format to return. Note this is not currently used</td>
</tr>
<tr>
<td>query</td>
<td>The request parameter that will carry the <span class="caps">SPARQL</span></td>
</tr>
<tr>
<td>update</td>
<td>The request parameter that will carry the <span class="caps">SPARQL</span></td>
</tr>
</table>
<h3>selectFormats:</h3>
<p>This should be an array of possible formats that can be returned for <span class="caps">SELECT</span> queries. Each format should define:</p>
<table border="1">
<tr>
<td>name</td>
<td>UI name</td>
</tr>
<tr>
<td>format</td>
<td>query parameter value. Note this is not currently used</td>
</tr>
<tr>
<td>type</td>
<td>The <span class="caps">MIME</span> type of the format. This is used in the request and assumes that an endpoint correctly performs content negotiation</td>
</tr>
</table>
<h3>constructFormats:</h3>
<p>This should be an array of possible formats that can be returned for <span class="caps">CONSTRUCT</span> queries. Each format should define:</p>
<table border="1">
<tr>
<td>name</td>
<td>UI name</td>
</tr>
<tr>
<td>format</td>
<td>query parameter value. Note this is not currently used</td>
</tr>
<tr>
<td>type</td>
<td>The <span class="caps">MIME</span> type of the format. This is used in the request and assumes that an endpoint correctly performs content negotiation</td>
</tr>
</table>
<h3>endpoints:</h3>
<p>This defines a list of pre-defined endpoints that will appear in the UI. Each endpoint should define:</p>
<table border="1">
<tr>
<td>name</td>
<td colspan="2">UI name</td>
</tr>
<tr>
<td>uri</td>
<td colspan="2">The <span class="caps">URI</span> of the endpoint</td>
</tr>
<tr>
<td>queries</td>
<td colspan="2">An array of sample queries for this endpoint (optional). Each of these queries should define:</td>
</tr>
<tr>
<td></td>
<td>name</td>
<td>UI name of query</td>
</tr>
<tr>
<td></td>
<td>description</td>
<td>A description of the what the query does</td>
</tr>
<tr>
<td></td>
<td>query</td>
<td>The actual query. (Note you will need to do some tricky escaping, which is why in init-local.js they are defined using variables)</td>
</tr>
</table>
<h3>defaultFormats:</h3>
<p>Defines which SPARQL modes should be made available within the editor</h3>
<table border="1">
<tr>
<td>name</td>
<td colspan="2">UI name</td>
</tr>
<tr>
<td>mode</td>
<td colspan="2">The internal mode identifier. This should be one of: sparql10, sparql11query, sparql11update</td>
</tr>
</table>
</body>
</html>