pho 0.4 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +12 -1
- data/Rakefile +2 -2
- data/doc/index.html +15 -1
- data/doc/rdoc/classes/Pho.html +14 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +12 -12
- data/doc/rdoc/classes/Pho/Etags.html +36 -36
- data/doc/rdoc/classes/Pho/Facet/Results.html +19 -19
- data/doc/rdoc/classes/Pho/Facet/Term.html +6 -6
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +90 -90
- data/doc/rdoc/classes/Pho/FieldWeighting.html +12 -12
- data/doc/rdoc/classes/Pho/Job.html +64 -64
- data/doc/rdoc/classes/Pho/Jobs.html +61 -61
- data/doc/rdoc/classes/Pho/Namespaces.html +6 -1
- data/doc/rdoc/classes/Pho/QueryProfile.html +61 -61
- data/doc/rdoc/classes/Pho/RDFCollection.html +71 -71
- data/doc/rdoc/classes/Pho/RDF_JSON.html +118 -0
- data/doc/rdoc/classes/Pho/RDF_JSON/SetAlgebra.html +240 -0
- data/doc/rdoc/classes/Pho/Snapshot.html +35 -35
- data/doc/rdoc/classes/Pho/Status.html +26 -26
- data/doc/rdoc/classes/Pho/Store.html +342 -264
- data/doc/rdoc/classes/Pho/Update.html +127 -0
- data/doc/rdoc/classes/Pho/Update/Changeset.html +520 -0
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +330 -0
- data/doc/rdoc/classes/Pho/Update/Changesets.html +204 -0
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +248 -0
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +213 -0
- data/doc/rdoc/classes/Pho/Update/Statement.html +302 -0
- data/doc/rdoc/classes/String.html +146 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +33 -2
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/changeset_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/job_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/rdf_json_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +4 -1
- data/doc/rdoc/fr_class_index.html +10 -0
- data/doc/rdoc/fr_file_index.html +3 -0
- data/doc/rdoc/fr_method_index.html +140 -110
- data/lib/pho.rb +14 -1
- data/lib/pho/changeset.rb +312 -0
- data/lib/pho/changeset_builder.rb +118 -0
- data/lib/pho/job.rb +1 -1
- data/lib/pho/query_profile.rb +1 -1
- data/lib/pho/rdf_json.rb +81 -0
- data/lib/pho/store.rb +63 -25
- data/tests/tc_changeset.rb +273 -0
- data/tests/tc_changeset_builder.rb +151 -0
- data/tests/tc_changesets.rb +96 -0
- data/tests/tc_metabox.rb +20 -2
- data/tests/tc_query_profile.rb +4 -2
- data/tests/tc_rdf_json.rb +273 -0
- data/tests/tc_search.rb +5 -5
- data/tests/tc_sparql.rb +12 -0
- data/tests/ts_pho.rb +5 -1
- metadata +25 -3
@@ -92,10 +92,10 @@ Captures status information relating to a store
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
93
93
|
|
94
94
|
<div class="name-list">
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
95
|
+
<a href="#M000049">new</a>
|
96
|
+
<a href="#M000050">read_from_store</a>
|
97
|
+
<a href="#M000051">readable?</a>
|
98
|
+
<a href="#M000052">writeable?</a>
|
99
99
|
</div>
|
100
100
|
</div>
|
101
101
|
|
@@ -153,19 +153,19 @@ Interval before status should be requested again.
|
|
153
153
|
<div id="methods">
|
154
154
|
<h3 class="section-bar">Public Class methods</h3>
|
155
155
|
|
156
|
-
<div id="method-
|
157
|
-
<a name="
|
156
|
+
<div id="method-M000049" class="method-detail">
|
157
|
+
<a name="M000049"></a>
|
158
158
|
|
159
159
|
<div class="method-heading">
|
160
|
-
<a href="#
|
160
|
+
<a href="#M000049" class="method-signature">
|
161
161
|
<span class="method-name">new</span><span class="method-args">(retry_interval, status_message, access_mode)</span>
|
162
162
|
</a>
|
163
163
|
</div>
|
164
164
|
|
165
165
|
<div class="method-description">
|
166
166
|
<p><a class="source-toggle" href="#"
|
167
|
-
onclick="toggleCode('
|
168
|
-
<div class="method-source-code" id="
|
167
|
+
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000049-source">
|
169
169
|
<pre>
|
170
170
|
<span class="ruby-comment cmt"># File lib/pho/status.rb, line 25</span>
|
171
171
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">retry_interval</span>, <span class="ruby-identifier">status_message</span>, <span class="ruby-identifier">access_mode</span>)
|
@@ -178,11 +178,11 @@ Interval before status should be requested again.
|
|
178
178
|
</div>
|
179
179
|
</div>
|
180
180
|
|
181
|
-
<div id="method-
|
182
|
-
<a name="
|
181
|
+
<div id="method-M000050" class="method-detail">
|
182
|
+
<a name="M000050"></a>
|
183
183
|
|
184
184
|
<div class="method-heading">
|
185
|
-
<a href="#
|
185
|
+
<a href="#M000050" class="method-signature">
|
186
186
|
<span class="method-name">read_from_store</span><span class="method-args">(store)</span>
|
187
187
|
</a>
|
188
188
|
</div>
|
@@ -202,8 +202,8 @@ href="Status.html">Status</a> object.
|
|
202
202
|
</td></tr>
|
203
203
|
</table>
|
204
204
|
<p><a class="source-toggle" href="#"
|
205
|
-
onclick="toggleCode('
|
206
|
-
<div class="method-source-code" id="
|
205
|
+
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
206
|
+
<div class="method-source-code" id="M000050-source">
|
207
207
|
<pre>
|
208
208
|
<span class="ruby-comment cmt"># File lib/pho/status.rb, line 36</span>
|
209
209
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Status</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
|
@@ -229,22 +229,22 @@ href="Status.html">Status</a> object.
|
|
229
229
|
|
230
230
|
<h3 class="section-bar">Public Instance methods</h3>
|
231
231
|
|
232
|
-
<div id="method-
|
233
|
-
<a name="
|
232
|
+
<div id="method-M000051" class="method-detail">
|
233
|
+
<a name="M000051"></a>
|
234
234
|
|
235
235
|
<div class="method-heading">
|
236
|
-
<a href="#
|
236
|
+
<a href="#M000051" class="method-signature">
|
237
237
|
<span class="method-name">readable?</span><span class="method-args">()</span>
|
238
238
|
</a>
|
239
239
|
</div>
|
240
240
|
|
241
241
|
<div class="method-description">
|
242
242
|
<p>
|
243
|
-
Is the store <a href="Status.html#
|
243
|
+
Is the store <a href="Status.html#M000051">readable?</a>
|
244
244
|
</p>
|
245
245
|
<p><a class="source-toggle" href="#"
|
246
|
-
onclick="toggleCode('
|
247
|
-
<div class="method-source-code" id="
|
246
|
+
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
247
|
+
<div class="method-source-code" id="M000051-source">
|
248
248
|
<pre>
|
249
249
|
<span class="ruby-comment cmt"># File lib/pho/status.rb, line 54</span>
|
250
250
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">readable?</span>
|
@@ -255,22 +255,22 @@ Is the store <a href="Status.html#M000022">readable?</a>
|
|
255
255
|
</div>
|
256
256
|
</div>
|
257
257
|
|
258
|
-
<div id="method-
|
259
|
-
<a name="
|
258
|
+
<div id="method-M000052" class="method-detail">
|
259
|
+
<a name="M000052"></a>
|
260
260
|
|
261
261
|
<div class="method-heading">
|
262
|
-
<a href="#
|
262
|
+
<a href="#M000052" class="method-signature">
|
263
263
|
<span class="method-name">writeable?</span><span class="method-args">()</span>
|
264
264
|
</a>
|
265
265
|
</div>
|
266
266
|
|
267
267
|
<div class="method-description">
|
268
268
|
<p>
|
269
|
-
Is the store <a href="Status.html#
|
269
|
+
Is the store <a href="Status.html#M000052">writeable?</a>
|
270
270
|
</p>
|
271
271
|
<p><a class="source-toggle" href="#"
|
272
|
-
onclick="toggleCode('
|
273
|
-
<div class="method-source-code" id="
|
272
|
+
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
273
|
+
<div class="method-source-code" id="M000052-source">
|
274
274
|
<pre>
|
275
275
|
<span class="ruby-comment cmt"># File lib/pho/status.rb, line 59</span>
|
276
276
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">writeable?</span>
|
@@ -109,37 +109,38 @@ See the examples directory in the distribution
|
|
109
109
|
<h3 class="section-bar">Methods</h3>
|
110
110
|
|
111
111
|
<div class="name-list">
|
112
|
-
<a href="#
|
113
|
-
<a href="#
|
114
|
-
<a href="#
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
117
|
-
<a href="#
|
118
|
-
<a href="#
|
119
|
-
<a href="#
|
120
|
-
<a href="#
|
121
|
-
<a href="#
|
122
|
-
<a href="#
|
123
|
-
<a href="#
|
124
|
-
<a href="#
|
125
|
-
<a href="#
|
126
|
-
<a href="#
|
127
|
-
<a href="#
|
128
|
-
<a href="#
|
129
|
-
<a href="#
|
130
|
-
<a href="#
|
131
|
-
<a href="#
|
132
|
-
<a href="#
|
133
|
-
<a href="#
|
134
|
-
<a href="#
|
135
|
-
<a href="#
|
136
|
-
<a href="#
|
137
|
-
<a href="#
|
138
|
-
<a href="#
|
139
|
-
<a href="#
|
140
|
-
<a href="#
|
141
|
-
<a href="#
|
142
|
-
<a href="#
|
112
|
+
<a href="#M000092">augment</a>
|
113
|
+
<a href="#M000091">augment_uri</a>
|
114
|
+
<a href="#M000077">build_uri</a>
|
115
|
+
<a href="#M000093">configure_headers_for_conditional_get</a>
|
116
|
+
<a href="#M000096">delete_item</a>
|
117
|
+
<a href="#M000081">describe</a>
|
118
|
+
<a href="#M000089">facet</a>
|
119
|
+
<a href="#M000103">get_field_predicate_map</a>
|
120
|
+
<a href="#M000097">get_item</a>
|
121
|
+
<a href="#M000098">get_job</a>
|
122
|
+
<a href="#M000099">get_jobs</a>
|
123
|
+
<a href="#M000105">get_query_profile</a>
|
124
|
+
<a href="#M000090">get_search_params</a>
|
125
|
+
<a href="#M000102">get_snapshots</a>
|
126
|
+
<a href="#M000101">get_status</a>
|
127
|
+
<a href="#M000075">new</a>
|
128
|
+
<a href="#M000104">put_field_predicate_map</a>
|
129
|
+
<a href="#M000106">put_query_profile</a>
|
130
|
+
<a href="#M000094">record_etags</a>
|
131
|
+
<a href="#M000088">search</a>
|
132
|
+
<a href="#M000076">set_credentials</a>
|
133
|
+
<a href="#M000087">sparql</a>
|
134
|
+
<a href="#M000085">sparql_ask</a>
|
135
|
+
<a href="#M000084">sparql_construct</a>
|
136
|
+
<a href="#M000083">sparql_describe</a>
|
137
|
+
<a href="#M000086">sparql_select</a>
|
138
|
+
<a href="#M000078">store_data</a>
|
139
|
+
<a href="#M000079">store_file</a>
|
140
|
+
<a href="#M000080">store_url</a>
|
141
|
+
<a href="#M000082">submit_changeset</a>
|
142
|
+
<a href="#M000100">submit_job</a>
|
143
|
+
<a href="#M000095">upload_item</a>
|
143
144
|
</div>
|
144
145
|
</div>
|
145
146
|
|
@@ -193,11 +194,11 @@ Retrieve the admin username configured in this instance
|
|
193
194
|
<div id="methods">
|
194
195
|
<h3 class="section-bar">Public Class methods</h3>
|
195
196
|
|
196
|
-
<div id="method-
|
197
|
-
<a name="
|
197
|
+
<div id="method-M000075" class="method-detail">
|
198
|
+
<a name="M000075"></a>
|
198
199
|
|
199
200
|
<div class="method-heading">
|
200
|
-
<a href="#
|
201
|
+
<a href="#M000075" class="method-signature">
|
201
202
|
<span class="method-name">new</span><span class="method-args">(storeuri, username=nil, password=nil, client = HTTPClient.new() )</span>
|
202
203
|
</a>
|
203
204
|
</div>
|
@@ -221,10 +222,10 @@ Create an instance of the store class
|
|
221
222
|
</td></tr>
|
222
223
|
</table>
|
223
224
|
<p><a class="source-toggle" href="#"
|
224
|
-
onclick="toggleCode('
|
225
|
-
<div class="method-source-code" id="
|
225
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
226
|
+
<div class="method-source-code" id="M000075-source">
|
226
227
|
<pre>
|
227
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
228
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 41</span>
|
228
229
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">storeuri</span>, <span class="ruby-identifier">username</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">password</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">client</span> = <span class="ruby-constant">HTTPClient</span>.<span class="ruby-identifier">new</span>() )
|
229
230
|
<span class="ruby-ivar">@storeuri</span> = <span class="ruby-identifier">storeuri</span>.<span class="ruby-identifier">chomp</span>(<span class="ruby-value str">"/"</span>)
|
230
231
|
<span class="ruby-ivar">@username</span> = <span class="ruby-identifier">username</span>
|
@@ -239,11 +240,11 @@ Create an instance of the store class
|
|
239
240
|
|
240
241
|
<h3 class="section-bar">Public Instance methods</h3>
|
241
242
|
|
242
|
-
<div id="method-
|
243
|
-
<a name="
|
243
|
+
<div id="method-M000092" class="method-detail">
|
244
|
+
<a name="M000092"></a>
|
244
245
|
|
245
246
|
<div class="method-heading">
|
246
|
-
<a href="#
|
247
|
+
<a href="#M000092" class="method-signature">
|
247
248
|
<span class="method-name">augment</span><span class="method-args">(data)</span>
|
248
249
|
</a>
|
249
250
|
</div>
|
@@ -254,15 +255,15 @@ Augment an RSS feed against data int this store by POSTing it to the
|
|
254
255
|
Platform
|
255
256
|
</p>
|
256
257
|
<table>
|
257
|
-
<tr><td valign="top">data:</td><td>a String containing the RSS feed
|
258
|
+
<tr><td valign="top">data:</td><td>a <a href="../String.html">String</a> containing the RSS feed
|
258
259
|
|
259
260
|
</td></tr>
|
260
261
|
</table>
|
261
262
|
<p><a class="source-toggle" href="#"
|
262
|
-
onclick="toggleCode('
|
263
|
-
<div class="method-source-code" id="
|
263
|
+
onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
|
264
|
+
<div class="method-source-code" id="M000092-source">
|
264
265
|
<pre>
|
265
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
266
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 292</span>
|
266
267
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">augment</span>(<span class="ruby-identifier">data</span>)
|
267
268
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/augment"</span>)
|
268
269
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">data</span>, <span class="ruby-keyword kw">nil</span>)
|
@@ -273,11 +274,11 @@ Platform
|
|
273
274
|
</div>
|
274
275
|
</div>
|
275
276
|
|
276
|
-
<div id="method-
|
277
|
-
<a name="
|
277
|
+
<div id="method-M000091" class="method-detail">
|
278
|
+
<a name="M000091"></a>
|
278
279
|
|
279
280
|
<div class="method-heading">
|
280
|
-
<a href="#
|
281
|
+
<a href="#M000091" class="method-signature">
|
281
282
|
<span class="method-name">augment_uri</span><span class="method-args">(uri)</span>
|
282
283
|
</a>
|
283
284
|
</div>
|
@@ -293,13 +294,13 @@ data in this store
|
|
293
294
|
</td></tr>
|
294
295
|
</table>
|
295
296
|
<p><a class="source-toggle" href="#"
|
296
|
-
onclick="toggleCode('
|
297
|
-
<div class="method-source-code" id="
|
297
|
+
onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
|
298
|
+
<div class="method-source-code" id="M000091-source">
|
298
299
|
<pre>
|
299
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
300
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 283</span>
|
300
301
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">augment_uri</span>(<span class="ruby-identifier">uri</span>)
|
301
302
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/augment"</span>)
|
302
|
-
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, {<span class="ruby-value str">"data-uri"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">uri</span>}
|
303
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, {<span class="ruby-value str">"data-uri"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">uri</span>})
|
303
304
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
304
305
|
<span class="ruby-keyword kw">end</span>
|
305
306
|
</pre>
|
@@ -307,11 +308,11 @@ data in this store
|
|
307
308
|
</div>
|
308
309
|
</div>
|
309
310
|
|
310
|
-
<div id="method-
|
311
|
-
<a name="
|
311
|
+
<div id="method-M000077" class="method-detail">
|
312
|
+
<a name="M000077"></a>
|
312
313
|
|
313
314
|
<div class="method-heading">
|
314
|
-
<a href="#
|
315
|
+
<a href="#M000077" class="method-signature">
|
315
316
|
<span class="method-name">build_uri</span><span class="method-args">(uri)</span>
|
316
317
|
</a>
|
317
318
|
</div>
|
@@ -326,10 +327,10 @@ Build a request uri, by concatenating it with the base uri of the store
|
|
326
327
|
</td></tr>
|
327
328
|
</table>
|
328
329
|
<p><a class="source-toggle" href="#"
|
329
|
-
onclick="toggleCode('
|
330
|
-
<div class="method-source-code" id="
|
330
|
+
onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
|
331
|
+
<div class="method-source-code" id="M000077-source">
|
331
332
|
<pre>
|
332
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
333
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 59</span>
|
333
334
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
334
335
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-ivar">@storeuri</span>))
|
335
336
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">uri</span>
|
@@ -345,11 +346,11 @@ Build a request uri, by concatenating it with the base uri of the store
|
|
345
346
|
</div>
|
346
347
|
</div>
|
347
348
|
|
348
|
-
<div id="method-
|
349
|
-
<a name="
|
349
|
+
<div id="method-M000093" class="method-detail">
|
350
|
+
<a name="M000093"></a>
|
350
351
|
|
351
352
|
<div class="method-heading">
|
352
|
-
<a href="#
|
353
|
+
<a href="#M000093" class="method-signature">
|
353
354
|
<span class="method-name">configure_headers_for_conditional_get</span><span class="method-args">(u, headers, etags, if_match)</span>
|
354
355
|
</a>
|
355
356
|
</div>
|
@@ -359,10 +360,10 @@ Build a request uri, by concatenating it with the base uri of the store
|
|
359
360
|
Added appropriate http header for conditional get requests
|
360
361
|
</p>
|
361
362
|
<p><a class="source-toggle" href="#"
|
362
|
-
onclick="toggleCode('
|
363
|
-
<div class="method-source-code" id="
|
363
|
+
onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
|
364
|
+
<div class="method-source-code" id="M000093-source">
|
364
365
|
<pre>
|
365
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
366
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 299</span>
|
366
367
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_headers_for_conditional_get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">etags</span>, <span class="ruby-identifier">if_match</span>)
|
367
368
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">etags</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">etags</span>.<span class="ruby-identifier">has_tag?</span>(<span class="ruby-identifier">u</span>)
|
368
369
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">if_match</span>
|
@@ -378,11 +379,11 @@ Added appropriate http header for conditional get requests
|
|
378
379
|
</div>
|
379
380
|
</div>
|
380
381
|
|
381
|
-
<div id="method-
|
382
|
-
<a name="
|
382
|
+
<div id="method-M000096" class="method-detail">
|
383
|
+
<a name="M000096"></a>
|
383
384
|
|
384
385
|
<div class="method-heading">
|
385
|
-
<a href="#
|
386
|
+
<a href="#M000096" class="method-signature">
|
386
387
|
<span class="method-name">delete_item</span><span class="method-args">(uri)</span>
|
387
388
|
</a>
|
388
389
|
</div>
|
@@ -400,10 +401,10 @@ Delete an item from the Contentbox in this <a href="Store.html">Store</a>
|
|
400
401
|
TODO: conditional deletes
|
401
402
|
</p>
|
402
403
|
<p><a class="source-toggle" href="#"
|
403
|
-
onclick="toggleCode('
|
404
|
-
<div class="method-source-code" id="
|
404
|
+
onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
|
405
|
+
<div class="method-source-code" id="M000096-source">
|
405
406
|
<pre>
|
406
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
407
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 348</span>
|
407
408
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_item</span>(<span class="ruby-identifier">uri</span>)
|
408
409
|
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">uri</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-ivar">@storeuri</span>)
|
409
410
|
<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
@@ -415,11 +416,11 @@ TODO: conditional deletes
|
|
415
416
|
</div>
|
416
417
|
</div>
|
417
418
|
|
418
|
-
<div id="method-
|
419
|
-
<a name="
|
419
|
+
<div id="method-M000081" class="method-detail">
|
420
|
+
<a name="M000081"></a>
|
420
421
|
|
421
422
|
<div class="method-heading">
|
422
|
-
<a href="#
|
423
|
+
<a href="#M000081" class="method-signature">
|
423
424
|
<span class="method-name">describe</span><span class="method-args">(uri, format="application/rdf+xml", etags=nil, if_match=false)</span>
|
424
425
|
</a>
|
425
426
|
</div>
|
@@ -431,7 +432,7 @@ be to retrieve an RDF/XML document, but other formats can be requested, as
|
|
431
432
|
supported by the Talis Platform. E.g. application/json
|
432
433
|
</p>
|
433
434
|
<table>
|
434
|
-
<tr><td valign="top">uri:</td><td>the URI of the resource to <a href="Store.html#
|
435
|
+
<tr><td valign="top">uri:</td><td>the URI of the resource to <a href="Store.html#M000081">describe</a>
|
435
436
|
|
436
437
|
</td></tr>
|
437
438
|
<tr><td valign="top">format:</td><td>the preferred response format
|
@@ -448,20 +449,20 @@ false to perform a Conditional GET
|
|
448
449
|
</table>
|
449
450
|
<p>
|
450
451
|
Note that this method is different from <a
|
451
|
-
href="Store.html#
|
452
|
+
href="Store.html#M000083">sparql_describe</a> in that it is intended to be
|
452
453
|
used to generate a description of a single URI, using an separated service
|
453
454
|
exposed by the Platform. This service is optimised for retrieval of
|
454
455
|
descriptions for single resources and supports HTTP caching and conditional
|
455
|
-
retrieval. The <a href="Store.html#
|
456
|
+
retrieval. The <a href="Store.html#M000083">sparql_describe</a> method
|
456
457
|
should be used to submit more complex DESCRIBE queries to the Platform,
|
457
458
|
e.g. to generate descriptions of resources matching a particular graph
|
458
459
|
pattern.
|
459
460
|
</p>
|
460
461
|
<p><a class="source-toggle" href="#"
|
461
|
-
onclick="toggleCode('
|
462
|
-
<div class="method-source-code" id="
|
462
|
+
onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
|
463
|
+
<div class="method-source-code" id="M000081-source">
|
463
464
|
<pre>
|
464
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
465
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 138</span>
|
465
466
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">describe</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>, <span class="ruby-identifier">etags</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">if_match</span>=<span class="ruby-keyword kw">false</span>)
|
466
467
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/meta"</span>)
|
467
468
|
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Accept"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">format</span>}
|
@@ -475,18 +476,18 @@ pattern.
|
|
475
476
|
</div>
|
476
477
|
</div>
|
477
478
|
|
478
|
-
<div id="method-
|
479
|
-
<a name="
|
479
|
+
<div id="method-M000089" class="method-detail">
|
480
|
+
<a name="M000089"></a>
|
480
481
|
|
481
482
|
<div class="method-heading">
|
482
|
-
<a href="#
|
483
|
+
<a href="#M000089" class="method-signature">
|
483
484
|
<span class="method-name">facet</span><span class="method-args">(query, facets, params=nil)</span>
|
484
485
|
</a>
|
485
486
|
</div>
|
486
487
|
|
487
488
|
<div class="method-description">
|
488
489
|
<p>
|
489
|
-
Perform a facetted <a href="Store.html#
|
490
|
+
Perform a facetted <a href="Store.html#M000088">search</a> against the
|
490
491
|
Metabox indexes.
|
491
492
|
</p>
|
492
493
|
<table>
|
@@ -505,7 +506,7 @@ The <em>params</em> hash can contain the following values:
|
|
505
506
|
</p>
|
506
507
|
<ul>
|
507
508
|
<li><b>top</b>: the maximum number of results to return for each <a
|
508
|
-
href="Store.html#
|
509
|
+
href="Store.html#M000089">facet</a>
|
509
510
|
|
510
511
|
</li>
|
511
512
|
<li><b>output</b>: the preferred response format, can be html or xml (the
|
@@ -514,10 +515,10 @@ default)
|
|
514
515
|
</li>
|
515
516
|
</ul>
|
516
517
|
<p><a class="source-toggle" href="#"
|
517
|
-
onclick="toggleCode('
|
518
|
-
<div class="method-source-code" id="
|
518
|
+
onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
|
519
|
+
<div class="method-source-code" id="M000089-source">
|
519
520
|
<pre>
|
520
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
521
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 258</span>
|
521
522
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">facet</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">facets</span>, <span class="ruby-identifier">params</span>=<span class="ruby-keyword kw">nil</span>)
|
522
523
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">facets</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">facets</span>.<span class="ruby-identifier">empty?</span>
|
523
524
|
<span class="ruby-comment cmt">#todo</span>
|
@@ -526,7 +527,7 @@ default)
|
|
526
527
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/facet"</span>)
|
527
528
|
<span class="ruby-identifier">search_params</span> = <span class="ruby-identifier">get_search_params</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>)
|
528
529
|
<span class="ruby-identifier">search_params</span>[<span class="ruby-value str">"fields"</span>] = <span class="ruby-identifier">facets</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">","</span>)
|
529
|
-
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">search_params</span
|
530
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">search_params</span>)
|
530
531
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
531
532
|
<span class="ruby-keyword kw">end</span>
|
532
533
|
</pre>
|
@@ -534,11 +535,11 @@ default)
|
|
534
535
|
</div>
|
535
536
|
</div>
|
536
537
|
|
537
|
-
<div id="method-
|
538
|
-
<a name="
|
538
|
+
<div id="method-M000103" class="method-detail">
|
539
|
+
<a name="M000103"></a>
|
539
540
|
|
540
541
|
<div class="method-heading">
|
541
|
-
<a href="#
|
542
|
+
<a href="#M000103" class="method-signature">
|
542
543
|
<span class="method-name">get_field_predicate_map</span><span class="method-args">(output=ACCEPT_JSON)</span>
|
543
544
|
</a>
|
544
545
|
</div>
|
@@ -548,7 +549,7 @@ default)
|
|
548
549
|
Read the field predicate map configuration for this store. The config can
|
549
550
|
be requested in any format supported by the platform, but the default will
|
550
551
|
return JSON. See <a
|
551
|
-
href="FieldPredicateMap.html#
|
552
|
+
href="FieldPredicateMap.html#M000034">FieldPredicateMap.read_from_store</a>
|
552
553
|
for a convenient way to quickly create a <a
|
553
554
|
href="FieldPredicateMap.html">FieldPredicateMap</a> object based on a
|
554
555
|
specific stores‘s configuration.
|
@@ -559,10 +560,10 @@ specific stores‘s configuration.
|
|
559
560
|
</td></tr>
|
560
561
|
</table>
|
561
562
|
<p><a class="source-toggle" href="#"
|
562
|
-
onclick="toggleCode('
|
563
|
-
<div class="method-source-code" id="
|
563
|
+
onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
|
564
|
+
<div class="method-source-code" id="M000103-source">
|
564
565
|
<pre>
|
565
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
566
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 430</span>
|
566
567
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_field_predicate_map</span>(<span class="ruby-identifier">output</span>=<span class="ruby-constant">ACCEPT_JSON</span>)
|
567
568
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/fpmaps/1"</span>)
|
568
569
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">output</span>)
|
@@ -573,11 +574,11 @@ specific stores‘s configuration.
|
|
573
574
|
</div>
|
574
575
|
</div>
|
575
576
|
|
576
|
-
<div id="method-
|
577
|
-
<a name="
|
577
|
+
<div id="method-M000097" class="method-detail">
|
578
|
+
<a name="M000097"></a>
|
578
579
|
|
579
580
|
<div class="method-heading">
|
580
|
-
<a href="#
|
581
|
+
<a href="#M000097" class="method-signature">
|
581
582
|
<span class="method-name">get_item</span><span class="method-args">(uri, etags=nil, if_match=false)</span>
|
582
583
|
</a>
|
583
584
|
</div>
|
@@ -600,10 +601,10 @@ the Metabox.
|
|
600
601
|
TODO: document etags, redirects
|
601
602
|
</p>
|
602
603
|
<p><a class="source-toggle" href="#"
|
603
|
-
onclick="toggleCode('
|
604
|
-
<div class="method-source-code" id="
|
604
|
+
onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
|
605
|
+
<div class="method-source-code" id="M000097-source">
|
605
606
|
<pre>
|
606
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
607
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 362</span>
|
607
608
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_item</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">etags</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">if_match</span>=<span class="ruby-keyword kw">false</span>)
|
608
609
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
609
610
|
<span class="ruby-identifier">headers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
@@ -617,11 +618,11 @@ TODO: document etags, redirects
|
|
617
618
|
</div>
|
618
619
|
</div>
|
619
620
|
|
620
|
-
<div id="method-
|
621
|
-
<a name="
|
621
|
+
<div id="method-M000098" class="method-detail">
|
622
|
+
<a name="M000098"></a>
|
622
623
|
|
623
624
|
<div class="method-heading">
|
624
|
-
<a href="#
|
625
|
+
<a href="#M000098" class="method-signature">
|
625
626
|
<span class="method-name">get_job</span><span class="method-args">(uri)</span>
|
626
627
|
</a>
|
627
628
|
</div>
|
@@ -629,7 +630,7 @@ TODO: document etags, redirects
|
|
629
630
|
<div class="method-description">
|
630
631
|
<p>
|
631
632
|
Retrieve metadata about a single job. Use <a
|
632
|
-
href="Job.html#
|
633
|
+
href="Job.html#M000113">Job.read_from_store</a> as a convenience function
|
633
634
|
which will return a fully-populated <a href="Job.html">Job</a> object
|
634
635
|
</p>
|
635
636
|
<table>
|
@@ -638,10 +639,10 @@ which will return a fully-populated <a href="Job.html">Job</a> object
|
|
638
639
|
</td></tr>
|
639
640
|
</table>
|
640
641
|
<p><a class="source-toggle" href="#"
|
641
|
-
onclick="toggleCode('
|
642
|
-
<div class="method-source-code" id="
|
642
|
+
onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
|
643
|
+
<div class="method-source-code" id="M000098-source">
|
643
644
|
<pre>
|
644
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
645
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 379</span>
|
645
646
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_job</span>(<span class="ruby-identifier">uri</span>)
|
646
647
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
647
648
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-constant">ACCEPT_RDF</span>)
|
@@ -652,11 +653,11 @@ which will return a fully-populated <a href="Job.html">Job</a> object
|
|
652
653
|
</div>
|
653
654
|
</div>
|
654
655
|
|
655
|
-
<div id="method-
|
656
|
-
<a name="
|
656
|
+
<div id="method-M000099" class="method-detail">
|
657
|
+
<a name="M000099"></a>
|
657
658
|
|
658
659
|
<div class="method-heading">
|
659
|
-
<a href="#
|
660
|
+
<a href="#M000099" class="method-signature">
|
660
661
|
<span class="method-name">get_jobs</span><span class="method-args">()</span>
|
661
662
|
</a>
|
662
663
|
</div>
|
@@ -667,10 +668,10 @@ Retrieve metadata about the Scheduled <a href="Jobs.html">Jobs</a>
|
|
667
668
|
Collection from the store
|
668
669
|
</p>
|
669
670
|
<p><a class="source-toggle" href="#"
|
670
|
-
onclick="toggleCode('
|
671
|
-
<div class="method-source-code" id="
|
671
|
+
onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
|
672
|
+
<div class="method-source-code" id="M000099-source">
|
672
673
|
<pre>
|
673
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
674
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 386</span>
|
674
675
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_jobs</span>()
|
675
676
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/jobs"</span>)
|
676
677
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-constant">ACCEPT_RDF</span>)
|
@@ -681,11 +682,11 @@ Collection from the store
|
|
681
682
|
</div>
|
682
683
|
</div>
|
683
684
|
|
684
|
-
<div id="method-
|
685
|
-
<a name="
|
685
|
+
<div id="method-M000105" class="method-detail">
|
686
|
+
<a name="M000105"></a>
|
686
687
|
|
687
688
|
<div class="method-heading">
|
688
|
-
<a href="#
|
689
|
+
<a href="#M000105" class="method-signature">
|
689
690
|
<span class="method-name">get_query_profile</span><span class="method-args">(output=ACCEPT_JSON)</span>
|
690
691
|
</a>
|
691
692
|
</div>
|
@@ -695,7 +696,7 @@ Collection from the store
|
|
695
696
|
Read the query profile configuration for this store. The config can be
|
696
697
|
requested in any format supported by the platform, but the default will
|
697
698
|
return JSON. See <a
|
698
|
-
href="QueryProfile.html#
|
699
|
+
href="QueryProfile.html#M000053">QueryProfile.read_from_store</a> for a
|
699
700
|
convenient way to quickly create a <a
|
700
701
|
href="QueryProfile.html">QueryProfile</a> object based on a specific
|
701
702
|
stores‘s configuration.
|
@@ -706,10 +707,10 @@ stores‘s configuration.
|
|
706
707
|
</td></tr>
|
707
708
|
</table>
|
708
709
|
<p><a class="source-toggle" href="#"
|
709
|
-
onclick="toggleCode('
|
710
|
-
<div class="method-source-code" id="
|
710
|
+
onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
|
711
|
+
<div class="method-source-code" id="M000105-source">
|
711
712
|
<pre>
|
712
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
713
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 451</span>
|
713
714
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_query_profile</span>(<span class="ruby-identifier">output</span>=<span class="ruby-constant">ACCEPT_JSON</span>)
|
714
715
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/queryprofiles/1"</span>)
|
715
716
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">output</span>)
|
@@ -720,21 +721,21 @@ stores‘s configuration.
|
|
720
721
|
</div>
|
721
722
|
</div>
|
722
723
|
|
723
|
-
<div id="method-
|
724
|
-
<a name="
|
724
|
+
<div id="method-M000090" class="method-detail">
|
725
|
+
<a name="M000090"></a>
|
725
726
|
|
726
727
|
<div class="method-heading">
|
727
|
-
<a href="#
|
728
|
+
<a href="#M000090" class="method-signature">
|
728
729
|
<span class="method-name">get_search_params</span><span class="method-args">(u, query, params)</span>
|
729
730
|
</a>
|
730
731
|
</div>
|
731
732
|
|
732
733
|
<div class="method-description">
|
733
734
|
<p><a class="source-toggle" href="#"
|
734
|
-
onclick="toggleCode('
|
735
|
-
<div class="method-source-code" id="
|
735
|
+
onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
|
736
|
+
<div class="method-source-code" id="M000090-source">
|
736
737
|
<pre>
|
737
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
738
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 270</span>
|
738
739
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_search_params</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>)
|
739
740
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
740
741
|
<span class="ruby-identifier">search_params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">clone</span>()
|
@@ -749,11 +750,11 @@ stores‘s configuration.
|
|
749
750
|
</div>
|
750
751
|
</div>
|
751
752
|
|
752
|
-
<div id="method-
|
753
|
-
<a name="
|
753
|
+
<div id="method-M000102" class="method-detail">
|
754
|
+
<a name="M000102"></a>
|
754
755
|
|
755
756
|
<div class="method-heading">
|
756
|
-
<a href="#
|
757
|
+
<a href="#M000102" class="method-signature">
|
757
758
|
<span class="method-name">get_snapshots</span><span class="method-args">()</span>
|
758
759
|
</a>
|
759
760
|
</div>
|
@@ -764,14 +765,14 @@ Retrieve the list of snapshots for this store
|
|
764
765
|
</p>
|
765
766
|
<p>
|
766
767
|
Currently the response will contain an HTML document. Use <a
|
767
|
-
href="Snapshot.html#
|
768
|
+
href="Snapshot.html#M000108">Snapshot.parse</a> to turn this into a <a
|
768
769
|
href="Snapshot.html">Snapshot</a> object
|
769
770
|
</p>
|
770
771
|
<p><a class="source-toggle" href="#"
|
771
|
-
onclick="toggleCode('
|
772
|
-
<div class="method-source-code" id="
|
772
|
+
onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
|
773
|
+
<div class="method-source-code" id="M000102-source">
|
773
774
|
<pre>
|
774
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
775
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 415</span>
|
775
776
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_snapshots</span>()
|
776
777
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/snapshots"</span>)
|
777
778
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-constant">ACCEPT_RDF</span>)
|
@@ -782,11 +783,11 @@ href="Snapshot.html">Snapshot</a> object
|
|
782
783
|
</div>
|
783
784
|
</div>
|
784
785
|
|
785
|
-
<div id="method-
|
786
|
-
<a name="
|
786
|
+
<div id="method-M000101" class="method-detail">
|
787
|
+
<a name="M000101"></a>
|
787
788
|
|
788
789
|
<div class="method-heading">
|
789
|
-
<a href="#
|
790
|
+
<a href="#M000101" class="method-signature">
|
790
791
|
<span class="method-name">get_status</span><span class="method-args">()</span>
|
791
792
|
</a>
|
792
793
|
</div>
|
@@ -796,10 +797,10 @@ href="Snapshot.html">Snapshot</a> object
|
|
796
797
|
ADMIN
|
797
798
|
</p>
|
798
799
|
<p><a class="source-toggle" href="#"
|
799
|
-
onclick="toggleCode('
|
800
|
-
<div class="method-source-code" id="
|
800
|
+
onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
|
801
|
+
<div class="method-source-code" id="M000101-source">
|
801
802
|
<pre>
|
802
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
803
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 405</span>
|
803
804
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_status</span>()
|
804
805
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/access-status"</span>)
|
805
806
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-constant">ACCEPT_JSON</span> )
|
@@ -810,20 +811,21 @@ ADMIN
|
|
810
811
|
</div>
|
811
812
|
</div>
|
812
813
|
|
813
|
-
<div id="method-
|
814
|
-
<a name="
|
814
|
+
<div id="method-M000104" class="method-detail">
|
815
|
+
<a name="M000104"></a>
|
815
816
|
|
816
817
|
<div class="method-heading">
|
817
|
-
<a href="#
|
818
|
+
<a href="#M000104" class="method-signature">
|
818
819
|
<span class="method-name">put_field_predicate_map</span><span class="method-args">(data)</span>
|
819
820
|
</a>
|
820
821
|
</div>
|
821
822
|
|
822
823
|
<div class="method-description">
|
823
824
|
<p>
|
824
|
-
Update
|
825
|
-
Assumes that the provided data is valid
|
826
|
-
|
825
|
+
<a href="Update.html">Update</a>/replace the current Field Predicate map
|
826
|
+
configuration in the store. Assumes that the provided data is valid
|
827
|
+
RDF/XML. Use <a
|
828
|
+
href="FieldPredicateMap.html#M000048">FieldPredicateMap.upload</a> as a
|
827
829
|
convenience function
|
828
830
|
</p>
|
829
831
|
<table>
|
@@ -832,10 +834,10 @@ convenience function
|
|
832
834
|
</td></tr>
|
833
835
|
</table>
|
834
836
|
<p><a class="source-toggle" href="#"
|
835
|
-
onclick="toggleCode('
|
836
|
-
<div class="method-source-code" id="
|
837
|
+
onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
|
838
|
+
<div class="method-source-code" id="M000104-source">
|
837
839
|
<pre>
|
838
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
840
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 440</span>
|
839
841
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_field_predicate_map</span>(<span class="ruby-identifier">data</span>)
|
840
842
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/fpmaps/1"</span>)
|
841
843
|
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"application/rdf+xml"</span>}
|
@@ -846,21 +848,21 @@ convenience function
|
|
846
848
|
</div>
|
847
849
|
</div>
|
848
850
|
|
849
|
-
<div id="method-
|
850
|
-
<a name="
|
851
|
+
<div id="method-M000106" class="method-detail">
|
852
|
+
<a name="M000106"></a>
|
851
853
|
|
852
854
|
<div class="method-heading">
|
853
|
-
<a href="#
|
855
|
+
<a href="#M000106" class="method-signature">
|
854
856
|
<span class="method-name">put_query_profile</span><span class="method-args">(data)</span>
|
855
857
|
</a>
|
856
858
|
</div>
|
857
859
|
|
858
860
|
<div class="method-description">
|
859
861
|
<p>
|
860
|
-
Update
|
861
|
-
Assumes that the provided data is valid
|
862
|
-
href="QueryProfile.html#
|
863
|
-
function
|
862
|
+
<a href="Update.html">Update</a>/replace the current Query Profile
|
863
|
+
configuration in the store. Assumes that the provided data is valid
|
864
|
+
RDF/XML. Use <a href="QueryProfile.html#M000062">QueryProfile.upload</a> as
|
865
|
+
a convenience function
|
864
866
|
</p>
|
865
867
|
<table>
|
866
868
|
<tr><td valign="top">data:</td><td>a string containing an RDF/XML document
|
@@ -868,10 +870,10 @@ function
|
|
868
870
|
</td></tr>
|
869
871
|
</table>
|
870
872
|
<p><a class="source-toggle" href="#"
|
871
|
-
onclick="toggleCode('
|
872
|
-
<div class="method-source-code" id="
|
873
|
+
onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
|
874
|
+
<div class="method-source-code" id="M000106-source">
|
873
875
|
<pre>
|
874
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
876
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 461</span>
|
875
877
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_query_profile</span>(<span class="ruby-identifier">data</span>)
|
876
878
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/queryprofiles/1"</span>)
|
877
879
|
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"application/rdf+xml"</span>}
|
@@ -882,21 +884,21 @@ function
|
|
882
884
|
</div>
|
883
885
|
</div>
|
884
886
|
|
885
|
-
<div id="method-
|
886
|
-
<a name="
|
887
|
+
<div id="method-M000094" class="method-detail">
|
888
|
+
<a name="M000094"></a>
|
887
889
|
|
888
890
|
<div class="method-heading">
|
889
|
-
<a href="#
|
891
|
+
<a href="#M000094" class="method-signature">
|
890
892
|
<span class="method-name">record_etags</span><span class="method-args">(u, etags, response)</span>
|
891
893
|
</a>
|
892
894
|
</div>
|
893
895
|
|
894
896
|
<div class="method-description">
|
895
897
|
<p><a class="source-toggle" href="#"
|
896
|
-
onclick="toggleCode('
|
897
|
-
<div class="method-source-code" id="
|
898
|
+
onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
|
899
|
+
<div class="method-source-code" id="M000094-source">
|
898
900
|
<pre>
|
899
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
901
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 310</span>
|
900
902
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record_etags</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">etags</span>, <span class="ruby-identifier">response</span>)
|
901
903
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">etags</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">status</span> = <span class="ruby-value">200</span>)
|
902
904
|
<span class="ruby-identifier">etags</span>.<span class="ruby-identifier">add_from_response</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">response</span>)
|
@@ -907,11 +909,11 @@ function
|
|
907
909
|
</div>
|
908
910
|
</div>
|
909
911
|
|
910
|
-
<div id="method-
|
911
|
-
<a name="
|
912
|
+
<div id="method-M000088" class="method-detail">
|
913
|
+
<a name="M000088"></a>
|
912
914
|
|
913
915
|
<div class="method-heading">
|
914
|
-
<a href="#
|
916
|
+
<a href="#M000088" class="method-signature">
|
915
917
|
<span class="method-name">search</span><span class="method-args">(query, params=nil)</span>
|
916
918
|
</a>
|
917
919
|
</div>
|
@@ -958,14 +960,14 @@ transformation is being applied, in which case they will be provided as
|
|
958
960
|
parameters to the stylesheet.
|
959
961
|
</p>
|
960
962
|
<p><a class="source-toggle" href="#"
|
961
|
-
onclick="toggleCode('
|
962
|
-
<div class="method-source-code" id="
|
963
|
+
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
|
964
|
+
<div class="method-source-code" id="M000088-source">
|
963
965
|
<pre>
|
964
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
966
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 241</span>
|
965
967
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">search</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>=<span class="ruby-keyword kw">nil</span>)
|
966
968
|
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/items"</span>)
|
967
969
|
<span class="ruby-identifier">search_params</span> = <span class="ruby-identifier">get_search_params</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>)
|
968
|
-
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">search_params</span
|
970
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">search_params</span>)
|
969
971
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
970
972
|
|
971
973
|
<span class="ruby-keyword kw">end</span>
|
@@ -974,11 +976,11 @@ parameters to the stylesheet.
|
|
974
976
|
</div>
|
975
977
|
</div>
|
976
978
|
|
977
|
-
<div id="method-
|
978
|
-
<a name="
|
979
|
+
<div id="method-M000076" class="method-detail">
|
980
|
+
<a name="M000076"></a>
|
979
981
|
|
980
982
|
<div class="method-heading">
|
981
|
-
<a href="#
|
983
|
+
<a href="#M000076" class="method-signature">
|
982
984
|
<span class="method-name">set_credentials</span><span class="method-args">(username, password)</span>
|
983
985
|
</a>
|
984
986
|
</div>
|
@@ -996,10 +998,10 @@ Set credentials that this store will use when carrying out authorization
|
|
996
998
|
</td></tr>
|
997
999
|
</table>
|
998
1000
|
<p><a class="source-toggle" href="#"
|
999
|
-
onclick="toggleCode('
|
1000
|
-
<div class="method-source-code" id="
|
1001
|
+
onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
|
1002
|
+
<div class="method-source-code" id="M000076-source">
|
1001
1003
|
<pre>
|
1002
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1004
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 53</span>
|
1003
1005
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_credentials</span>(<span class="ruby-identifier">username</span>, <span class="ruby-identifier">password</span>)
|
1004
1006
|
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">set_auth</span>(<span class="ruby-ivar">@storeuri</span>, <span class="ruby-identifier">username</span>, <span class="ruby-identifier">password</span>)
|
1005
1007
|
<span class="ruby-keyword kw">end</span>
|
@@ -1008,12 +1010,12 @@ Set credentials that this store will use when carrying out authorization
|
|
1008
1010
|
</div>
|
1009
1011
|
</div>
|
1010
1012
|
|
1011
|
-
<div id="method-
|
1012
|
-
<a name="
|
1013
|
+
<div id="method-M000087" class="method-detail">
|
1014
|
+
<a name="M000087"></a>
|
1013
1015
|
|
1014
1016
|
<div class="method-heading">
|
1015
|
-
<a href="#
|
1016
|
-
<span class="method-name">sparql</span><span class="method-args">(query, format=nil)</span>
|
1017
|
+
<a href="#M000087" class="method-signature">
|
1018
|
+
<span class="method-name">sparql</span><span class="method-args">(query, format=nil, multisparql=false)</span>
|
1017
1019
|
</a>
|
1018
1020
|
</div>
|
1019
1021
|
|
@@ -1024,14 +1026,20 @@ Perform a SPARQL query
|
|
1024
1026
|
<pre>
|
1025
1027
|
query:: the SPARQL query
|
1026
1028
|
format:: the preferred response format
|
1029
|
+
multisparql:: use default sparql service or multisparql service
|
1027
1030
|
</pre>
|
1028
1031
|
<p><a class="source-toggle" href="#"
|
1029
|
-
onclick="toggleCode('
|
1030
|
-
<div class="method-source-code" id="
|
1032
|
+
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
|
1033
|
+
<div class="method-source-code" id="M000087-source">
|
1031
1034
|
<pre>
|
1032
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1033
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-keyword kw">nil</span>)
|
1034
|
-
<span class="ruby-
|
1035
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 210</span>
|
1036
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">multisparql</span>=<span class="ruby-keyword kw">false</span>)
|
1037
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">multisparql</span>
|
1038
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/multisparql"</span>)
|
1039
|
+
<span class="ruby-keyword kw">else</span>
|
1040
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/sparql"</span>)
|
1041
|
+
<span class="ruby-keyword kw">end</span>
|
1042
|
+
|
1035
1043
|
<span class="ruby-identifier">params</span> = {}
|
1036
1044
|
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"query"</span>] = <span class="ruby-identifier">query</span>
|
1037
1045
|
<span class="ruby-identifier">headers</span> = {}
|
@@ -1045,12 +1053,12 @@ Perform a SPARQL query
|
|
1045
1053
|
</div>
|
1046
1054
|
</div>
|
1047
1055
|
|
1048
|
-
<div id="method-
|
1049
|
-
<a name="
|
1056
|
+
<div id="method-M000085" class="method-detail">
|
1057
|
+
<a name="M000085"></a>
|
1050
1058
|
|
1051
1059
|
<div class="method-heading">
|
1052
|
-
<a href="#
|
1053
|
-
<span class="method-name">sparql_ask</span><span class="method-args">(query, format="application/sparql-results+xml"
|
1060
|
+
<a href="#M000085" class="method-signature">
|
1061
|
+
<span class="method-name">sparql_ask</span><span class="method-args">(query, format="application/sparql-results+xml", multisparql=false)</span>
|
1054
1062
|
</a>
|
1055
1063
|
</div>
|
1056
1064
|
|
@@ -1063,24 +1071,24 @@ Perform a SPARQL ASK query.
|
|
1063
1071
|
format:: the preferred response format
|
1064
1072
|
</pre>
|
1065
1073
|
<p><a class="source-toggle" href="#"
|
1066
|
-
onclick="toggleCode('
|
1067
|
-
<div class="method-source-code" id="
|
1074
|
+
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
|
1075
|
+
<div class="method-source-code" id="M000085-source">
|
1068
1076
|
<pre>
|
1069
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1070
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_ask</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/sparql-results+xml"</span>)
|
1071
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
1077
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 193</span>
|
1078
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_ask</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/sparql-results+xml"</span>, <span class="ruby-identifier">multisparql</span>=<span class="ruby-keyword kw">false</span>)
|
1079
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>, <span class="ruby-identifier">multisparql</span>)
|
1072
1080
|
<span class="ruby-keyword kw">end</span>
|
1073
1081
|
</pre>
|
1074
1082
|
</div>
|
1075
1083
|
</div>
|
1076
1084
|
</div>
|
1077
1085
|
|
1078
|
-
<div id="method-
|
1079
|
-
<a name="
|
1086
|
+
<div id="method-M000084" class="method-detail">
|
1087
|
+
<a name="M000084"></a>
|
1080
1088
|
|
1081
1089
|
<div class="method-heading">
|
1082
|
-
<a href="#
|
1083
|
-
<span class="method-name">sparql_construct</span><span class="method-args">(query, format="application/rdf+xml"
|
1090
|
+
<a href="#M000084" class="method-signature">
|
1091
|
+
<span class="method-name">sparql_construct</span><span class="method-args">(query, format="application/rdf+xml", multisparql=false)</span>
|
1084
1092
|
</a>
|
1085
1093
|
</div>
|
1086
1094
|
|
@@ -1093,24 +1101,24 @@ Perform a SPARQL CONSTRUCT query.
|
|
1093
1101
|
format:: the preferred response format
|
1094
1102
|
</pre>
|
1095
1103
|
<p><a class="source-toggle" href="#"
|
1096
|
-
onclick="toggleCode('
|
1097
|
-
<div class="method-source-code" id="
|
1104
|
+
onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
|
1105
|
+
<div class="method-source-code" id="M000084-source">
|
1098
1106
|
<pre>
|
1099
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1100
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_construct</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>)
|
1101
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
1107
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 185</span>
|
1108
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_construct</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>, <span class="ruby-identifier">multisparql</span>=<span class="ruby-keyword kw">false</span>)
|
1109
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>, <span class="ruby-identifier">multisparql</span>)
|
1102
1110
|
<span class="ruby-keyword kw">end</span>
|
1103
1111
|
</pre>
|
1104
1112
|
</div>
|
1105
1113
|
</div>
|
1106
1114
|
</div>
|
1107
1115
|
|
1108
|
-
<div id="method-
|
1109
|
-
<a name="
|
1116
|
+
<div id="method-M000083" class="method-detail">
|
1117
|
+
<a name="M000083"></a>
|
1110
1118
|
|
1111
1119
|
<div class="method-heading">
|
1112
|
-
<a href="#
|
1113
|
-
<span class="method-name">sparql_describe</span><span class="method-args">(query, format="application/rdf+xml"
|
1120
|
+
<a href="#M000083" class="method-signature">
|
1121
|
+
<span class="method-name">sparql_describe</span><span class="method-args">(query, format="application/rdf+xml", multisparql=false)</span>
|
1114
1122
|
</a>
|
1115
1123
|
</div>
|
1116
1124
|
|
@@ -1123,24 +1131,24 @@ Perform a SPARQL DESCRIBE query.
|
|
1123
1131
|
format:: the preferred response format
|
1124
1132
|
</pre>
|
1125
1133
|
<p><a class="source-toggle" href="#"
|
1126
|
-
onclick="toggleCode('
|
1127
|
-
<div class="method-source-code" id="
|
1134
|
+
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
|
1135
|
+
<div class="method-source-code" id="M000083-source">
|
1128
1136
|
<pre>
|
1129
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1130
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_describe</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>)
|
1131
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
1137
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 177</span>
|
1138
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_describe</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>, <span class="ruby-identifier">multisparql</span>=<span class="ruby-keyword kw">false</span>)
|
1139
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>, <span class="ruby-identifier">multisparql</span>)
|
1132
1140
|
<span class="ruby-keyword kw">end</span>
|
1133
1141
|
</pre>
|
1134
1142
|
</div>
|
1135
1143
|
</div>
|
1136
1144
|
</div>
|
1137
1145
|
|
1138
|
-
<div id="method-
|
1139
|
-
<a name="
|
1146
|
+
<div id="method-M000086" class="method-detail">
|
1147
|
+
<a name="M000086"></a>
|
1140
1148
|
|
1141
1149
|
<div class="method-heading">
|
1142
|
-
<a href="#
|
1143
|
-
<span class="method-name">sparql_select</span><span class="method-args">(query, format="application/sparql-results+xml"
|
1150
|
+
<a href="#M000086" class="method-signature">
|
1151
|
+
<span class="method-name">sparql_select</span><span class="method-args">(query, format="application/sparql-results+xml", multisparql=false)</span>
|
1144
1152
|
</a>
|
1145
1153
|
</div>
|
1146
1154
|
|
@@ -1153,44 +1161,50 @@ Perform a SPARQL SELECT query.
|
|
1153
1161
|
format:: the preferred response format
|
1154
1162
|
</pre>
|
1155
1163
|
<p><a class="source-toggle" href="#"
|
1156
|
-
onclick="toggleCode('
|
1157
|
-
<div class="method-source-code" id="
|
1164
|
+
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
|
1165
|
+
<div class="method-source-code" id="M000086-source">
|
1158
1166
|
<pre>
|
1159
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1160
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_select</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/sparql-results+xml"</span>)
|
1161
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
1167
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 201</span>
|
1168
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_select</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/sparql-results+xml"</span>, <span class="ruby-identifier">multisparql</span>=<span class="ruby-keyword kw">false</span>)
|
1169
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>, <span class="ruby-identifier">multisparql</span>)
|
1162
1170
|
<span class="ruby-keyword kw">end</span>
|
1163
1171
|
</pre>
|
1164
1172
|
</div>
|
1165
1173
|
</div>
|
1166
1174
|
</div>
|
1167
1175
|
|
1168
|
-
<div id="method-
|
1169
|
-
<a name="
|
1176
|
+
<div id="method-M000078" class="method-detail">
|
1177
|
+
<a name="M000078"></a>
|
1170
1178
|
|
1171
1179
|
<div class="method-heading">
|
1172
|
-
<a href="#
|
1173
|
-
<span class="method-name">store_data</span><span class="method-args">(data)</span>
|
1180
|
+
<a href="#M000078" class="method-signature">
|
1181
|
+
<span class="method-name">store_data</span><span class="method-args">(data, graph_name=nil)</span>
|
1174
1182
|
</a>
|
1175
1183
|
</div>
|
1176
1184
|
|
1177
1185
|
<div class="method-description">
|
1178
|
-
<
|
1179
|
-
<a href="
|
1180
|
-
|
1181
|
-
</
|
1182
|
-
<
|
1183
|
-
|
1186
|
+
<table>
|
1187
|
+
<tr><td valign="top">data:</td><td>a <a href="../String.html">String</a> containing the data to store
|
1188
|
+
|
1189
|
+
</td></tr>
|
1190
|
+
<tr><td valign="top">graph_name:</td><td>name of a private graph in which to store the data. E.g. "1" or
|
1191
|
+
"private". Resolves to /meta/graphs/graph_name
|
1184
1192
|
|
1185
1193
|
</td></tr>
|
1186
1194
|
</table>
|
1187
1195
|
<p><a class="source-toggle" href="#"
|
1188
|
-
onclick="toggleCode('
|
1189
|
-
<div class="method-source-code" id="
|
1196
|
+
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
|
1197
|
+
<div class="method-source-code" id="M000078-source">
|
1190
1198
|
<pre>
|
1191
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1192
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_data</span>(<span class="ruby-identifier">data</span>)
|
1193
|
-
<span class="ruby-identifier">u</span> = <span class="ruby-
|
1199
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 79</span>
|
1200
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_data</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">graph_name</span>=<span class="ruby-keyword kw">nil</span>)
|
1201
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">nil</span>
|
1202
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">graph_name</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
1203
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/meta"</span>)
|
1204
|
+
<span class="ruby-keyword kw">else</span>
|
1205
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-node">"/meta/graphs/#{graph_name}"</span>)
|
1206
|
+
<span class="ruby-keyword kw">end</span>
|
1207
|
+
|
1194
1208
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">data</span>, <span class="ruby-constant">RDF_XML</span> )
|
1195
1209
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
1196
1210
|
<span class="ruby-keyword kw">end</span>
|
@@ -1199,11 +1213,11 @@ store
|
|
1199
1213
|
</div>
|
1200
1214
|
</div>
|
1201
1215
|
|
1202
|
-
<div id="method-
|
1203
|
-
<a name="
|
1216
|
+
<div id="method-M000079" class="method-detail">
|
1217
|
+
<a name="M000079"></a>
|
1204
1218
|
|
1205
1219
|
<div class="method-heading">
|
1206
|
-
<a href="#
|
1220
|
+
<a href="#M000079" class="method-signature">
|
1207
1221
|
<span class="method-name">store_file</span><span class="method-args">(file)</span>
|
1208
1222
|
</a>
|
1209
1223
|
</div>
|
@@ -1221,10 +1235,10 @@ is submitted to the platform
|
|
1221
1235
|
</td></tr>
|
1222
1236
|
</table>
|
1223
1237
|
<p><a class="source-toggle" href="#"
|
1224
|
-
onclick="toggleCode('
|
1225
|
-
<div class="method-source-code" id="
|
1238
|
+
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
|
1239
|
+
<div class="method-source-code" id="M000079-source">
|
1226
1240
|
<pre>
|
1227
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1241
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 94</span>
|
1228
1242
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>)
|
1229
1243
|
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">read</span>()
|
1230
1244
|
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">close</span>()
|
@@ -1235,12 +1249,12 @@ is submitted to the platform
|
|
1235
1249
|
</div>
|
1236
1250
|
</div>
|
1237
1251
|
|
1238
|
-
<div id="method-
|
1239
|
-
<a name="
|
1252
|
+
<div id="method-M000080" class="method-detail">
|
1253
|
+
<a name="M000080"></a>
|
1240
1254
|
|
1241
1255
|
<div class="method-heading">
|
1242
|
-
<a href="#
|
1243
|
-
<span class="method-name">store_url</span><span class="method-args">(u, parameters=nil)</span>
|
1256
|
+
<a href="#M000080" class="method-signature">
|
1257
|
+
<span class="method-name">store_url</span><span class="method-args">(u, parameters=nil, graph_name=nil)</span>
|
1244
1258
|
</a>
|
1245
1259
|
</div>
|
1246
1260
|
|
@@ -1254,6 +1268,15 @@ An Accept header of "application/rdf+xml" will be sent in the
|
|
1254
1268
|
request to support retrieval of RDF from URLs that support Content
|
1255
1269
|
Negotiation.
|
1256
1270
|
</p>
|
1271
|
+
<p>
|
1272
|
+
NOTE: Currently this method doesn‘t properly handle base uris of
|
1273
|
+
retrieved data. i.e. the data isn‘t parsed and there is no way to
|
1274
|
+
pass a base uri to the Platform. Be warned!
|
1275
|
+
</p>
|
1276
|
+
<p>
|
1277
|
+
The default is to store the data in the Metabox. But a private graph name
|
1278
|
+
can also be specified
|
1279
|
+
</p>
|
1257
1280
|
<table>
|
1258
1281
|
<tr><td valign="top">u:</td><td>the url of the data
|
1259
1282
|
|
@@ -1261,14 +1284,18 @@ Negotiation.
|
|
1261
1284
|
<tr><td valign="top">parameters:</td><td>a Hash of url parameters to pass when requesting data from the specified
|
1262
1285
|
URL
|
1263
1286
|
|
1287
|
+
</td></tr>
|
1288
|
+
<tr><td valign="top">graph_name:</td><td>name of a private graph in which to store the data. E.g. "1" or
|
1289
|
+
"private". Resolves to /meta/graphs/graph_name
|
1290
|
+
|
1264
1291
|
</td></tr>
|
1265
1292
|
</table>
|
1266
1293
|
<p><a class="source-toggle" href="#"
|
1267
|
-
onclick="toggleCode('
|
1268
|
-
<div class="method-source-code" id="
|
1294
|
+
onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
|
1295
|
+
<div class="method-source-code" id="M000080-source">
|
1269
1296
|
<pre>
|
1270
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1271
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_url</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">parameters</span>=<span class="ruby-keyword kw">nil</span>)
|
1297
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 112</span>
|
1298
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_url</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">parameters</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">graph_name</span>=<span class="ruby-keyword kw">nil</span>)
|
1272
1299
|
|
1273
1300
|
<span class="ruby-identifier">headers</span> = <span class="ruby-constant">ACCEPT_RDF</span>.<span class="ruby-identifier">clone</span>()
|
1274
1301
|
<span class="ruby-identifier">dataresp</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span> )
|
@@ -1278,19 +1305,70 @@ URL
|
|
1278
1305
|
<span class="ruby-identifier">throw</span>
|
1279
1306
|
<span class="ruby-keyword kw">end</span>
|
1280
1307
|
|
1281
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store_data</span>(<span class="ruby-identifier">dataresp</span>.<span class="ruby-identifier">content</span>)
|
1308
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store_data</span>(<span class="ruby-identifier">dataresp</span>.<span class="ruby-identifier">content</span>, <span class="ruby-identifier">graph_name</span>)
|
1309
|
+
|
1310
|
+
<span class="ruby-keyword kw">end</span>
|
1311
|
+
</pre>
|
1312
|
+
</div>
|
1313
|
+
</div>
|
1314
|
+
</div>
|
1315
|
+
|
1316
|
+
<div id="method-M000082" class="method-detail">
|
1317
|
+
<a name="M000082"></a>
|
1318
|
+
|
1319
|
+
<div class="method-heading">
|
1320
|
+
<a href="#M000082" class="method-signature">
|
1321
|
+
<span class="method-name">submit_changeset</span><span class="method-args">(rdf, versioned=false, graph_name=nil)</span>
|
1322
|
+
</a>
|
1323
|
+
</div>
|
1282
1324
|
|
1325
|
+
<div class="method-description">
|
1326
|
+
<p>
|
1327
|
+
Submit a Changeset to the Platform to update the metabox
|
1328
|
+
</p>
|
1329
|
+
<p>
|
1330
|
+
Default behaviour is to update the metabox with an unversioned name However
|
1331
|
+
using the optional parameters, changes can be made versioned, and can also
|
1332
|
+
be submitted to private graphs.
|
1333
|
+
</p>
|
1334
|
+
<table>
|
1335
|
+
<tr><td valign="top">rdf:</td><td>the RDF/XML describing the changes
|
1336
|
+
|
1337
|
+
</td></tr>
|
1338
|
+
<tr><td valign="top">versioned:</td><td>true or false to indicate this is a versioned change
|
1339
|
+
|
1340
|
+
</td></tr>
|
1341
|
+
<tr><td valign="top">graph_name:</td><td>name of private graph to update instead of metabox
|
1342
|
+
|
1343
|
+
</td></tr>
|
1344
|
+
</table>
|
1345
|
+
<p><a class="source-toggle" href="#"
|
1346
|
+
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
|
1347
|
+
<div class="method-source-code" id="M000082-source">
|
1348
|
+
<pre>
|
1349
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 156</span>
|
1350
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit_changeset</span>(<span class="ruby-identifier">rdf</span>, <span class="ruby-identifier">versioned</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">graph_name</span>=<span class="ruby-keyword kw">nil</span>)
|
1351
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-value str">"/meta"</span>
|
1352
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">graph_name</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
1353
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">uri</span> <span class="ruby-operator">+</span> <span class="ruby-node">"/graphs/#{graph_name}"</span>
|
1354
|
+
<span class="ruby-keyword kw">end</span>
|
1355
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">uri</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/changesets"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">versioned</span>
|
1356
|
+
|
1357
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>( <span class="ruby-identifier">uri</span> )
|
1358
|
+
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"application/vnd.talis.changeset+xml"</span>}
|
1359
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">rdf</span>, <span class="ruby-identifier">headers</span>)
|
1360
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
1283
1361
|
<span class="ruby-keyword kw">end</span>
|
1284
1362
|
</pre>
|
1285
1363
|
</div>
|
1286
1364
|
</div>
|
1287
1365
|
</div>
|
1288
1366
|
|
1289
|
-
<div id="method-
|
1290
|
-
<a name="
|
1367
|
+
<div id="method-M000100" class="method-detail">
|
1368
|
+
<a name="M000100"></a>
|
1291
1369
|
|
1292
1370
|
<div class="method-heading">
|
1293
|
-
<a href="#
|
1371
|
+
<a href="#M000100" class="method-signature">
|
1294
1372
|
<span class="method-name">submit_job</span><span class="method-args">(data)</span>
|
1295
1373
|
</a>
|
1296
1374
|
</div>
|
@@ -1306,10 +1384,10 @@ href="Jobs.html">Jobs</a> class
|
|
1306
1384
|
</td></tr>
|
1307
1385
|
</table>
|
1308
1386
|
<p><a class="source-toggle" href="#"
|
1309
|
-
onclick="toggleCode('
|
1310
|
-
<div class="method-source-code" id="
|
1387
|
+
onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
|
1388
|
+
<div class="method-source-code" id="M000100-source">
|
1311
1389
|
<pre>
|
1312
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1390
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 395</span>
|
1313
1391
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit_job</span>(<span class="ruby-identifier">data</span>)
|
1314
1392
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/jobs"</span>)
|
1315
1393
|
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">data</span>, <span class="ruby-constant">RDF_XML</span> )
|
@@ -1320,11 +1398,11 @@ href="Jobs.html">Jobs</a> class
|
|
1320
1398
|
</div>
|
1321
1399
|
</div>
|
1322
1400
|
|
1323
|
-
<div id="method-
|
1324
|
-
<a name="
|
1401
|
+
<div id="method-M000095" class="method-detail">
|
1402
|
+
<a name="M000095"></a>
|
1325
1403
|
|
1326
1404
|
<div class="method-heading">
|
1327
|
-
<a href="#
|
1405
|
+
<a href="#M000095" class="method-signature">
|
1328
1406
|
<span class="method-name">upload_item</span><span class="method-args">(f, mimetype, uri=nil)</span>
|
1329
1407
|
</a>
|
1330
1408
|
</div>
|
@@ -1352,10 +1430,10 @@ stored item. If a URI is specified then a successful request will result in
|
|
1352
1430
|
a 200 OK response.
|
1353
1431
|
</p>
|
1354
1432
|
<p><a class="source-toggle" href="#"
|
1355
|
-
onclick="toggleCode('
|
1356
|
-
<div class="method-source-code" id="
|
1433
|
+
onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
|
1434
|
+
<div class="method-source-code" id="M000095-source">
|
1357
1435
|
<pre>
|
1358
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
1436
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 329</span>
|
1359
1437
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upload_item</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">mimetype</span>, <span class="ruby-identifier">uri</span>=<span class="ruby-keyword kw">nil</span>)
|
1360
1438
|
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>()
|
1361
1439
|
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>()
|