pho 0.4.1 → 0.5
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 +18 -1
- data/README +10 -0
- data/Rakefile +2 -1
- data/doc/rdoc/classes/Pho.html +33 -22
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +12 -12
- data/doc/rdoc/classes/Pho/{RDF_JSON.html → Enrichment.html} +8 -7
- data/doc/rdoc/classes/Pho/Enrichment/ResourceEnricher.html +310 -0
- data/doc/rdoc/classes/Pho/Etags.html +42 -42
- 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 +110 -105
- data/doc/rdoc/classes/Pho/FieldWeighting.html +12 -12
- data/doc/rdoc/classes/Pho/FileManagement.html +121 -0
- data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +443 -0
- data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +258 -0
- data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +271 -0
- data/doc/rdoc/classes/Pho/Job.html +64 -64
- data/doc/rdoc/classes/Pho/Jobs.html +60 -60
- data/doc/rdoc/classes/Pho/QueryProfile.html +60 -60
- data/doc/rdoc/classes/Pho/RDFCollection.html +4 -378
- data/doc/rdoc/classes/Pho/ResourceHash.html +123 -0
- data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +323 -0
- data/doc/rdoc/classes/Pho/{RDF_JSON → ResourceHash}/SetAlgebra.html +18 -18
- data/doc/rdoc/classes/Pho/Snapshot.html +35 -35
- data/doc/rdoc/classes/Pho/Sparql.html +137 -0
- data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +515 -0
- data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +575 -0
- data/doc/rdoc/classes/Pho/Status.html +26 -26
- data/doc/rdoc/classes/Pho/Store.html +271 -241
- data/doc/rdoc/classes/Pho/Update/Changeset.html +73 -73
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +34 -34
- data/doc/rdoc/classes/Pho/Update/Changesets.html +14 -14
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +31 -23
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +45 -21
- data/doc/rdoc/classes/Pho/Update/Statement.html +29 -29
- data/doc/rdoc/classes/String.html +1 -1
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +49 -3
- data/doc/rdoc/files/README.html +15 -1
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/changeset_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/converter_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/enrichment_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/etags_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/file_management_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/file_manager_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/resource_hash_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/{rdf_json_rb.html → sparql_rb.html} +4 -4
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +7 -2
- data/doc/rdoc/fr_class_index.html +12 -2
- data/doc/rdoc/fr_file_index.html +6 -1
- data/doc/rdoc/fr_method_index.html +176 -139
- data/examples/sparql_construct_hash.rb +26 -0
- data/examples/sparql_select.rb +18 -0
- data/lib/pho.rb +6 -1
- data/lib/pho/changeset.rb +24 -9
- data/lib/pho/changeset_builder.rb +10 -10
- data/lib/pho/converter.rb +74 -0
- data/lib/pho/enrichment.rb +81 -0
- data/lib/pho/etags.rb +1 -0
- data/lib/pho/field_predicate_map.rb +6 -1
- data/lib/pho/file_management.rb +102 -0
- data/lib/pho/file_manager.rb +61 -0
- data/lib/pho/rdf_collection.rb +54 -120
- data/lib/pho/{rdf_json.rb → resource_hash.rb} +3 -4
- data/lib/pho/sparql.rb +332 -0
- data/lib/pho/store.rb +20 -14
- data/tests/tc_changeset.rb +46 -0
- data/tests/tc_changeset_builder.rb +122 -1
- data/tests/tc_converter.rb +95 -0
- data/tests/tc_enrichment.rb +83 -0
- data/tests/tc_file_manager.rb +88 -0
- data/tests/tc_rdf_collection.rb +3 -0
- data/tests/{tc_rdf_json.rb → tc_resource_hash.rb} +23 -23
- data/tests/tc_search.rb +1 -1
- data/tests/tc_sparql.rb +131 -6
- data/tests/tc_sparql_helper.rb +214 -0
- data/tests/ts_pho.rb +6 -2
- metadata +47 -8
|
@@ -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="#M000096">new</a>
|
|
96
|
+
<a href="#M000097">read_from_store</a>
|
|
97
|
+
<a href="#M000098">readable?</a>
|
|
98
|
+
<a href="#M000099">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-M000096" class="method-detail">
|
|
157
|
+
<a name="M000096"></a>
|
|
158
158
|
|
|
159
159
|
<div class="method-heading">
|
|
160
|
-
<a href="#
|
|
160
|
+
<a href="#M000096" 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('M000096-source');return false;">[Source]</a></p>
|
|
168
|
+
<div class="method-source-code" id="M000096-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-M000097" class="method-detail">
|
|
182
|
+
<a name="M000097"></a>
|
|
183
183
|
|
|
184
184
|
<div class="method-heading">
|
|
185
|
-
<a href="#
|
|
185
|
+
<a href="#M000097" 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('M000097-source');return false;">[Source]</a></p>
|
|
206
|
+
<div class="method-source-code" id="M000097-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-M000098" class="method-detail">
|
|
233
|
+
<a name="M000098"></a>
|
|
234
234
|
|
|
235
235
|
<div class="method-heading">
|
|
236
|
-
<a href="#
|
|
236
|
+
<a href="#M000098" 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#M000098">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('M000098-source');return false;">[Source]</a></p>
|
|
247
|
+
<div class="method-source-code" id="M000098-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#M000051">readable?</a>
|
|
|
255
255
|
</div>
|
|
256
256
|
</div>
|
|
257
257
|
|
|
258
|
-
<div id="method-
|
|
259
|
-
<a name="
|
|
258
|
+
<div id="method-M000099" class="method-detail">
|
|
259
|
+
<a name="M000099"></a>
|
|
260
260
|
|
|
261
261
|
<div class="method-heading">
|
|
262
|
-
<a href="#
|
|
262
|
+
<a href="#M000099" 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#M000099">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('M000099-source');return false;">[Source]</a></p>
|
|
273
|
+
<div class="method-source-code" id="M000099-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,38 +109,39 @@ 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="#
|
|
143
|
-
<a href="#
|
|
112
|
+
<a href="#M000140">augment</a>
|
|
113
|
+
<a href="#M000139">augment_uri</a>
|
|
114
|
+
<a href="#M000124">build_uri</a>
|
|
115
|
+
<a href="#M000141">configure_headers_for_conditional_get</a>
|
|
116
|
+
<a href="#M000144">delete_item</a>
|
|
117
|
+
<a href="#M000128">describe</a>
|
|
118
|
+
<a href="#M000137">facet</a>
|
|
119
|
+
<a href="#M000151">get_field_predicate_map</a>
|
|
120
|
+
<a href="#M000145">get_item</a>
|
|
121
|
+
<a href="#M000146">get_job</a>
|
|
122
|
+
<a href="#M000147">get_jobs</a>
|
|
123
|
+
<a href="#M000153">get_query_profile</a>
|
|
124
|
+
<a href="#M000138">get_search_params</a>
|
|
125
|
+
<a href="#M000150">get_snapshots</a>
|
|
126
|
+
<a href="#M000149">get_status</a>
|
|
127
|
+
<a href="#M000122">new</a>
|
|
128
|
+
<a href="#M000152">put_field_predicate_map</a>
|
|
129
|
+
<a href="#M000154">put_query_profile</a>
|
|
130
|
+
<a href="#M000142">record_etags</a>
|
|
131
|
+
<a href="#M000136">search</a>
|
|
132
|
+
<a href="#M000123">set_credentials</a>
|
|
133
|
+
<a href="#M000135">sparql</a>
|
|
134
|
+
<a href="#M000133">sparql_ask</a>
|
|
135
|
+
<a href="#M000130">sparql_client</a>
|
|
136
|
+
<a href="#M000132">sparql_construct</a>
|
|
137
|
+
<a href="#M000131">sparql_describe</a>
|
|
138
|
+
<a href="#M000134">sparql_select</a>
|
|
139
|
+
<a href="#M000125">store_data</a>
|
|
140
|
+
<a href="#M000126">store_file</a>
|
|
141
|
+
<a href="#M000127">store_url</a>
|
|
142
|
+
<a href="#M000129">submit_changeset</a>
|
|
143
|
+
<a href="#M000148">submit_job</a>
|
|
144
|
+
<a href="#M000143">upload_item</a>
|
|
144
145
|
</div>
|
|
145
146
|
</div>
|
|
146
147
|
|
|
@@ -194,11 +195,11 @@ Retrieve the admin username configured in this instance
|
|
|
194
195
|
<div id="methods">
|
|
195
196
|
<h3 class="section-bar">Public Class methods</h3>
|
|
196
197
|
|
|
197
|
-
<div id="method-
|
|
198
|
-
<a name="
|
|
198
|
+
<div id="method-M000122" class="method-detail">
|
|
199
|
+
<a name="M000122"></a>
|
|
199
200
|
|
|
200
201
|
<div class="method-heading">
|
|
201
|
-
<a href="#
|
|
202
|
+
<a href="#M000122" class="method-signature">
|
|
202
203
|
<span class="method-name">new</span><span class="method-args">(storeuri, username=nil, password=nil, client = HTTPClient.new() )</span>
|
|
203
204
|
</a>
|
|
204
205
|
</div>
|
|
@@ -222,8 +223,8 @@ Create an instance of the store class
|
|
|
222
223
|
</td></tr>
|
|
223
224
|
</table>
|
|
224
225
|
<p><a class="source-toggle" href="#"
|
|
225
|
-
onclick="toggleCode('
|
|
226
|
-
<div class="method-source-code" id="
|
|
226
|
+
onclick="toggleCode('M000122-source');return false;">[Source]</a></p>
|
|
227
|
+
<div class="method-source-code" id="M000122-source">
|
|
227
228
|
<pre>
|
|
228
229
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 41</span>
|
|
229
230
|
<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>() )
|
|
@@ -240,11 +241,11 @@ Create an instance of the store class
|
|
|
240
241
|
|
|
241
242
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
242
243
|
|
|
243
|
-
<div id="method-
|
|
244
|
-
<a name="
|
|
244
|
+
<div id="method-M000140" class="method-detail">
|
|
245
|
+
<a name="M000140"></a>
|
|
245
246
|
|
|
246
247
|
<div class="method-heading">
|
|
247
|
-
<a href="#
|
|
248
|
+
<a href="#M000140" class="method-signature">
|
|
248
249
|
<span class="method-name">augment</span><span class="method-args">(data)</span>
|
|
249
250
|
</a>
|
|
250
251
|
</div>
|
|
@@ -260,13 +261,13 @@ Platform
|
|
|
260
261
|
</td></tr>
|
|
261
262
|
</table>
|
|
262
263
|
<p><a class="source-toggle" href="#"
|
|
263
|
-
onclick="toggleCode('
|
|
264
|
-
<div class="method-source-code" id="
|
|
264
|
+
onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
|
|
265
|
+
<div class="method-source-code" id="M000140-source">
|
|
265
266
|
<pre>
|
|
266
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
267
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 297</span>
|
|
267
268
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">augment</span>(<span class="ruby-identifier">data</span>)
|
|
268
269
|
<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>)
|
|
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-
|
|
270
|
+
<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-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"application/rss+xml"</span>})
|
|
270
271
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
|
271
272
|
<span class="ruby-keyword kw">end</span>
|
|
272
273
|
</pre>
|
|
@@ -274,11 +275,11 @@ Platform
|
|
|
274
275
|
</div>
|
|
275
276
|
</div>
|
|
276
277
|
|
|
277
|
-
<div id="method-
|
|
278
|
-
<a name="
|
|
278
|
+
<div id="method-M000139" class="method-detail">
|
|
279
|
+
<a name="M000139"></a>
|
|
279
280
|
|
|
280
281
|
<div class="method-heading">
|
|
281
|
-
<a href="#
|
|
282
|
+
<a href="#M000139" class="method-signature">
|
|
282
283
|
<span class="method-name">augment_uri</span><span class="method-args">(uri)</span>
|
|
283
284
|
</a>
|
|
284
285
|
</div>
|
|
@@ -294,10 +295,10 @@ data in this store
|
|
|
294
295
|
</td></tr>
|
|
295
296
|
</table>
|
|
296
297
|
<p><a class="source-toggle" href="#"
|
|
297
|
-
onclick="toggleCode('
|
|
298
|
-
<div class="method-source-code" id="
|
|
298
|
+
onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
|
|
299
|
+
<div class="method-source-code" id="M000139-source">
|
|
299
300
|
<pre>
|
|
300
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
301
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 288</span>
|
|
301
302
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">augment_uri</span>(<span class="ruby-identifier">uri</span>)
|
|
302
303
|
<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>)
|
|
303
304
|
<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>})
|
|
@@ -308,11 +309,11 @@ data in this store
|
|
|
308
309
|
</div>
|
|
309
310
|
</div>
|
|
310
311
|
|
|
311
|
-
<div id="method-
|
|
312
|
-
<a name="
|
|
312
|
+
<div id="method-M000124" class="method-detail">
|
|
313
|
+
<a name="M000124"></a>
|
|
313
314
|
|
|
314
315
|
<div class="method-heading">
|
|
315
|
-
<a href="#
|
|
316
|
+
<a href="#M000124" class="method-signature">
|
|
316
317
|
<span class="method-name">build_uri</span><span class="method-args">(uri)</span>
|
|
317
318
|
</a>
|
|
318
319
|
</div>
|
|
@@ -327,8 +328,8 @@ Build a request uri, by concatenating it with the base uri of the store
|
|
|
327
328
|
</td></tr>
|
|
328
329
|
</table>
|
|
329
330
|
<p><a class="source-toggle" href="#"
|
|
330
|
-
onclick="toggleCode('
|
|
331
|
-
<div class="method-source-code" id="
|
|
331
|
+
onclick="toggleCode('M000124-source');return false;">[Source]</a></p>
|
|
332
|
+
<div class="method-source-code" id="M000124-source">
|
|
332
333
|
<pre>
|
|
333
334
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 59</span>
|
|
334
335
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
|
@@ -346,11 +347,11 @@ Build a request uri, by concatenating it with the base uri of the store
|
|
|
346
347
|
</div>
|
|
347
348
|
</div>
|
|
348
349
|
|
|
349
|
-
<div id="method-
|
|
350
|
-
<a name="
|
|
350
|
+
<div id="method-M000141" class="method-detail">
|
|
351
|
+
<a name="M000141"></a>
|
|
351
352
|
|
|
352
353
|
<div class="method-heading">
|
|
353
|
-
<a href="#
|
|
354
|
+
<a href="#M000141" class="method-signature">
|
|
354
355
|
<span class="method-name">configure_headers_for_conditional_get</span><span class="method-args">(u, headers, etags, if_match)</span>
|
|
355
356
|
</a>
|
|
356
357
|
</div>
|
|
@@ -360,10 +361,10 @@ Build a request uri, by concatenating it with the base uri of the store
|
|
|
360
361
|
Added appropriate http header for conditional get requests
|
|
361
362
|
</p>
|
|
362
363
|
<p><a class="source-toggle" href="#"
|
|
363
|
-
onclick="toggleCode('
|
|
364
|
-
<div class="method-source-code" id="
|
|
364
|
+
onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
|
|
365
|
+
<div class="method-source-code" id="M000141-source">
|
|
365
366
|
<pre>
|
|
366
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
367
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 304</span>
|
|
367
368
|
<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>)
|
|
368
369
|
<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>)
|
|
369
370
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">if_match</span>
|
|
@@ -379,11 +380,11 @@ Added appropriate http header for conditional get requests
|
|
|
379
380
|
</div>
|
|
380
381
|
</div>
|
|
381
382
|
|
|
382
|
-
<div id="method-
|
|
383
|
-
<a name="
|
|
383
|
+
<div id="method-M000144" class="method-detail">
|
|
384
|
+
<a name="M000144"></a>
|
|
384
385
|
|
|
385
386
|
<div class="method-heading">
|
|
386
|
-
<a href="#
|
|
387
|
+
<a href="#M000144" class="method-signature">
|
|
387
388
|
<span class="method-name">delete_item</span><span class="method-args">(uri)</span>
|
|
388
389
|
</a>
|
|
389
390
|
</div>
|
|
@@ -401,10 +402,10 @@ Delete an item from the Contentbox in this <a href="Store.html">Store</a>
|
|
|
401
402
|
TODO: conditional deletes
|
|
402
403
|
</p>
|
|
403
404
|
<p><a class="source-toggle" href="#"
|
|
404
|
-
onclick="toggleCode('
|
|
405
|
-
<div class="method-source-code" id="
|
|
405
|
+
onclick="toggleCode('M000144-source');return false;">[Source]</a></p>
|
|
406
|
+
<div class="method-source-code" id="M000144-source">
|
|
406
407
|
<pre>
|
|
407
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
408
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 354</span>
|
|
408
409
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_item</span>(<span class="ruby-identifier">uri</span>)
|
|
409
410
|
<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>)
|
|
410
411
|
<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
|
@@ -416,11 +417,11 @@ TODO: conditional deletes
|
|
|
416
417
|
</div>
|
|
417
418
|
</div>
|
|
418
419
|
|
|
419
|
-
<div id="method-
|
|
420
|
-
<a name="
|
|
420
|
+
<div id="method-M000128" class="method-detail">
|
|
421
|
+
<a name="M000128"></a>
|
|
421
422
|
|
|
422
423
|
<div class="method-heading">
|
|
423
|
-
<a href="#
|
|
424
|
+
<a href="#M000128" class="method-signature">
|
|
424
425
|
<span class="method-name">describe</span><span class="method-args">(uri, format="application/rdf+xml", etags=nil, if_match=false)</span>
|
|
425
426
|
</a>
|
|
426
427
|
</div>
|
|
@@ -432,7 +433,7 @@ be to retrieve an RDF/XML document, but other formats can be requested, as
|
|
|
432
433
|
supported by the Talis Platform. E.g. application/json
|
|
433
434
|
</p>
|
|
434
435
|
<table>
|
|
435
|
-
<tr><td valign="top">uri:</td><td>the URI of the resource to <a href="Store.html#
|
|
436
|
+
<tr><td valign="top">uri:</td><td>the URI of the resource to <a href="Store.html#M000128">describe</a>
|
|
436
437
|
|
|
437
438
|
</td></tr>
|
|
438
439
|
<tr><td valign="top">format:</td><td>the preferred response format
|
|
@@ -449,18 +450,18 @@ false to perform a Conditional GET
|
|
|
449
450
|
</table>
|
|
450
451
|
<p>
|
|
451
452
|
Note that this method is different from <a
|
|
452
|
-
href="Store.html#
|
|
453
|
+
href="Store.html#M000131">sparql_describe</a> in that it is intended to be
|
|
453
454
|
used to generate a description of a single URI, using an separated service
|
|
454
455
|
exposed by the Platform. This service is optimised for retrieval of
|
|
455
456
|
descriptions for single resources and supports HTTP caching and conditional
|
|
456
|
-
retrieval. The <a href="Store.html#
|
|
457
|
+
retrieval. The <a href="Store.html#M000131">sparql_describe</a> method
|
|
457
458
|
should be used to submit more complex DESCRIBE queries to the Platform,
|
|
458
459
|
e.g. to generate descriptions of resources matching a particular graph
|
|
459
460
|
pattern.
|
|
460
461
|
</p>
|
|
461
462
|
<p><a class="source-toggle" href="#"
|
|
462
|
-
onclick="toggleCode('
|
|
463
|
-
<div class="method-source-code" id="
|
|
463
|
+
onclick="toggleCode('M000128-source');return false;">[Source]</a></p>
|
|
464
|
+
<div class="method-source-code" id="M000128-source">
|
|
464
465
|
<pre>
|
|
465
466
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 138</span>
|
|
466
467
|
<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>)
|
|
@@ -476,18 +477,18 @@ pattern.
|
|
|
476
477
|
</div>
|
|
477
478
|
</div>
|
|
478
479
|
|
|
479
|
-
<div id="method-
|
|
480
|
-
<a name="
|
|
480
|
+
<div id="method-M000137" class="method-detail">
|
|
481
|
+
<a name="M000137"></a>
|
|
481
482
|
|
|
482
483
|
<div class="method-heading">
|
|
483
|
-
<a href="#
|
|
484
|
+
<a href="#M000137" class="method-signature">
|
|
484
485
|
<span class="method-name">facet</span><span class="method-args">(query, facets, params=nil)</span>
|
|
485
486
|
</a>
|
|
486
487
|
</div>
|
|
487
488
|
|
|
488
489
|
<div class="method-description">
|
|
489
490
|
<p>
|
|
490
|
-
Perform a facetted <a href="Store.html#
|
|
491
|
+
Perform a facetted <a href="Store.html#M000136">search</a> against the
|
|
491
492
|
Metabox indexes.
|
|
492
493
|
</p>
|
|
493
494
|
<table>
|
|
@@ -506,7 +507,7 @@ The <em>params</em> hash can contain the following values:
|
|
|
506
507
|
</p>
|
|
507
508
|
<ul>
|
|
508
509
|
<li><b>top</b>: the maximum number of results to return for each <a
|
|
509
|
-
href="Store.html#
|
|
510
|
+
href="Store.html#M000137">facet</a>
|
|
510
511
|
|
|
511
512
|
</li>
|
|
512
513
|
<li><b>output</b>: the preferred response format, can be html or xml (the
|
|
@@ -515,10 +516,10 @@ default)
|
|
|
515
516
|
</li>
|
|
516
517
|
</ul>
|
|
517
518
|
<p><a class="source-toggle" href="#"
|
|
518
|
-
onclick="toggleCode('
|
|
519
|
-
<div class="method-source-code" id="
|
|
519
|
+
onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
|
|
520
|
+
<div class="method-source-code" id="M000137-source">
|
|
520
521
|
<pre>
|
|
521
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
522
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 263</span>
|
|
522
523
|
<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>)
|
|
523
524
|
<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>
|
|
524
525
|
<span class="ruby-comment cmt">#todo</span>
|
|
@@ -535,11 +536,11 @@ default)
|
|
|
535
536
|
</div>
|
|
536
537
|
</div>
|
|
537
538
|
|
|
538
|
-
<div id="method-
|
|
539
|
-
<a name="
|
|
539
|
+
<div id="method-M000151" class="method-detail">
|
|
540
|
+
<a name="M000151"></a>
|
|
540
541
|
|
|
541
542
|
<div class="method-heading">
|
|
542
|
-
<a href="#
|
|
543
|
+
<a href="#M000151" class="method-signature">
|
|
543
544
|
<span class="method-name">get_field_predicate_map</span><span class="method-args">(output=ACCEPT_JSON)</span>
|
|
544
545
|
</a>
|
|
545
546
|
</div>
|
|
@@ -549,7 +550,7 @@ default)
|
|
|
549
550
|
Read the field predicate map configuration for this store. The config can
|
|
550
551
|
be requested in any format supported by the platform, but the default will
|
|
551
552
|
return JSON. See <a
|
|
552
|
-
href="FieldPredicateMap.html#
|
|
553
|
+
href="FieldPredicateMap.html#M000081">FieldPredicateMap.read_from_store</a>
|
|
553
554
|
for a convenient way to quickly create a <a
|
|
554
555
|
href="FieldPredicateMap.html">FieldPredicateMap</a> object based on a
|
|
555
556
|
specific stores‘s configuration.
|
|
@@ -560,10 +561,10 @@ specific stores‘s configuration.
|
|
|
560
561
|
</td></tr>
|
|
561
562
|
</table>
|
|
562
563
|
<p><a class="source-toggle" href="#"
|
|
563
|
-
onclick="toggleCode('
|
|
564
|
-
<div class="method-source-code" id="
|
|
564
|
+
onclick="toggleCode('M000151-source');return false;">[Source]</a></p>
|
|
565
|
+
<div class="method-source-code" id="M000151-source">
|
|
565
566
|
<pre>
|
|
566
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
567
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 436</span>
|
|
567
568
|
<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>)
|
|
568
569
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/fpmaps/1"</span>)
|
|
569
570
|
<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>)
|
|
@@ -574,11 +575,11 @@ specific stores‘s configuration.
|
|
|
574
575
|
</div>
|
|
575
576
|
</div>
|
|
576
577
|
|
|
577
|
-
<div id="method-
|
|
578
|
-
<a name="
|
|
578
|
+
<div id="method-M000145" class="method-detail">
|
|
579
|
+
<a name="M000145"></a>
|
|
579
580
|
|
|
580
581
|
<div class="method-heading">
|
|
581
|
-
<a href="#
|
|
582
|
+
<a href="#M000145" class="method-signature">
|
|
582
583
|
<span class="method-name">get_item</span><span class="method-args">(uri, etags=nil, if_match=false)</span>
|
|
583
584
|
</a>
|
|
584
585
|
</div>
|
|
@@ -601,10 +602,10 @@ the Metabox.
|
|
|
601
602
|
TODO: document etags, redirects
|
|
602
603
|
</p>
|
|
603
604
|
<p><a class="source-toggle" href="#"
|
|
604
|
-
onclick="toggleCode('
|
|
605
|
-
<div class="method-source-code" id="
|
|
605
|
+
onclick="toggleCode('M000145-source');return false;">[Source]</a></p>
|
|
606
|
+
<div class="method-source-code" id="M000145-source">
|
|
606
607
|
<pre>
|
|
607
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
608
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 368</span>
|
|
608
609
|
<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>)
|
|
609
610
|
<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>)
|
|
610
611
|
<span class="ruby-identifier">headers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
|
@@ -618,11 +619,11 @@ TODO: document etags, redirects
|
|
|
618
619
|
</div>
|
|
619
620
|
</div>
|
|
620
621
|
|
|
621
|
-
<div id="method-
|
|
622
|
-
<a name="
|
|
622
|
+
<div id="method-M000146" class="method-detail">
|
|
623
|
+
<a name="M000146"></a>
|
|
623
624
|
|
|
624
625
|
<div class="method-heading">
|
|
625
|
-
<a href="#
|
|
626
|
+
<a href="#M000146" class="method-signature">
|
|
626
627
|
<span class="method-name">get_job</span><span class="method-args">(uri)</span>
|
|
627
628
|
</a>
|
|
628
629
|
</div>
|
|
@@ -630,7 +631,7 @@ TODO: document etags, redirects
|
|
|
630
631
|
<div class="method-description">
|
|
631
632
|
<p>
|
|
632
633
|
Retrieve metadata about a single job. Use <a
|
|
633
|
-
href="Job.html#
|
|
634
|
+
href="Job.html#M000161">Job.read_from_store</a> as a convenience function
|
|
634
635
|
which will return a fully-populated <a href="Job.html">Job</a> object
|
|
635
636
|
</p>
|
|
636
637
|
<table>
|
|
@@ -639,10 +640,10 @@ which will return a fully-populated <a href="Job.html">Job</a> object
|
|
|
639
640
|
</td></tr>
|
|
640
641
|
</table>
|
|
641
642
|
<p><a class="source-toggle" href="#"
|
|
642
|
-
onclick="toggleCode('
|
|
643
|
-
<div class="method-source-code" id="
|
|
643
|
+
onclick="toggleCode('M000146-source');return false;">[Source]</a></p>
|
|
644
|
+
<div class="method-source-code" id="M000146-source">
|
|
644
645
|
<pre>
|
|
645
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
646
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 385</span>
|
|
646
647
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_job</span>(<span class="ruby-identifier">uri</span>)
|
|
647
648
|
<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>)
|
|
648
649
|
<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>)
|
|
@@ -653,11 +654,11 @@ which will return a fully-populated <a href="Job.html">Job</a> object
|
|
|
653
654
|
</div>
|
|
654
655
|
</div>
|
|
655
656
|
|
|
656
|
-
<div id="method-
|
|
657
|
-
<a name="
|
|
657
|
+
<div id="method-M000147" class="method-detail">
|
|
658
|
+
<a name="M000147"></a>
|
|
658
659
|
|
|
659
660
|
<div class="method-heading">
|
|
660
|
-
<a href="#
|
|
661
|
+
<a href="#M000147" class="method-signature">
|
|
661
662
|
<span class="method-name">get_jobs</span><span class="method-args">()</span>
|
|
662
663
|
</a>
|
|
663
664
|
</div>
|
|
@@ -668,10 +669,10 @@ Retrieve metadata about the Scheduled <a href="Jobs.html">Jobs</a>
|
|
|
668
669
|
Collection from the store
|
|
669
670
|
</p>
|
|
670
671
|
<p><a class="source-toggle" href="#"
|
|
671
|
-
onclick="toggleCode('
|
|
672
|
-
<div class="method-source-code" id="
|
|
672
|
+
onclick="toggleCode('M000147-source');return false;">[Source]</a></p>
|
|
673
|
+
<div class="method-source-code" id="M000147-source">
|
|
673
674
|
<pre>
|
|
674
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
675
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 392</span>
|
|
675
676
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_jobs</span>()
|
|
676
677
|
<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>)
|
|
677
678
|
<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>)
|
|
@@ -682,11 +683,11 @@ Collection from the store
|
|
|
682
683
|
</div>
|
|
683
684
|
</div>
|
|
684
685
|
|
|
685
|
-
<div id="method-
|
|
686
|
-
<a name="
|
|
686
|
+
<div id="method-M000153" class="method-detail">
|
|
687
|
+
<a name="M000153"></a>
|
|
687
688
|
|
|
688
689
|
<div class="method-heading">
|
|
689
|
-
<a href="#
|
|
690
|
+
<a href="#M000153" class="method-signature">
|
|
690
691
|
<span class="method-name">get_query_profile</span><span class="method-args">(output=ACCEPT_JSON)</span>
|
|
691
692
|
</a>
|
|
692
693
|
</div>
|
|
@@ -696,7 +697,7 @@ Collection from the store
|
|
|
696
697
|
Read the query profile configuration for this store. The config can be
|
|
697
698
|
requested in any format supported by the platform, but the default will
|
|
698
699
|
return JSON. See <a
|
|
699
|
-
href="QueryProfile.html#
|
|
700
|
+
href="QueryProfile.html#M000100">QueryProfile.read_from_store</a> for a
|
|
700
701
|
convenient way to quickly create a <a
|
|
701
702
|
href="QueryProfile.html">QueryProfile</a> object based on a specific
|
|
702
703
|
stores‘s configuration.
|
|
@@ -707,10 +708,10 @@ stores‘s configuration.
|
|
|
707
708
|
</td></tr>
|
|
708
709
|
</table>
|
|
709
710
|
<p><a class="source-toggle" href="#"
|
|
710
|
-
onclick="toggleCode('
|
|
711
|
-
<div class="method-source-code" id="
|
|
711
|
+
onclick="toggleCode('M000153-source');return false;">[Source]</a></p>
|
|
712
|
+
<div class="method-source-code" id="M000153-source">
|
|
712
713
|
<pre>
|
|
713
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
714
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 457</span>
|
|
714
715
|
<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>)
|
|
715
716
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/queryprofiles/1"</span>)
|
|
716
717
|
<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>)
|
|
@@ -721,21 +722,21 @@ stores‘s configuration.
|
|
|
721
722
|
</div>
|
|
722
723
|
</div>
|
|
723
724
|
|
|
724
|
-
<div id="method-
|
|
725
|
-
<a name="
|
|
725
|
+
<div id="method-M000138" class="method-detail">
|
|
726
|
+
<a name="M000138"></a>
|
|
726
727
|
|
|
727
728
|
<div class="method-heading">
|
|
728
|
-
<a href="#
|
|
729
|
+
<a href="#M000138" class="method-signature">
|
|
729
730
|
<span class="method-name">get_search_params</span><span class="method-args">(u, query, params)</span>
|
|
730
731
|
</a>
|
|
731
732
|
</div>
|
|
732
733
|
|
|
733
734
|
<div class="method-description">
|
|
734
735
|
<p><a class="source-toggle" href="#"
|
|
735
|
-
onclick="toggleCode('
|
|
736
|
-
<div class="method-source-code" id="
|
|
736
|
+
onclick="toggleCode('M000138-source');return false;">[Source]</a></p>
|
|
737
|
+
<div class="method-source-code" id="M000138-source">
|
|
737
738
|
<pre>
|
|
738
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
739
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 275</span>
|
|
739
740
|
<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>)
|
|
740
741
|
<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>
|
|
741
742
|
<span class="ruby-identifier">search_params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">clone</span>()
|
|
@@ -750,11 +751,11 @@ stores‘s configuration.
|
|
|
750
751
|
</div>
|
|
751
752
|
</div>
|
|
752
753
|
|
|
753
|
-
<div id="method-
|
|
754
|
-
<a name="
|
|
754
|
+
<div id="method-M000150" class="method-detail">
|
|
755
|
+
<a name="M000150"></a>
|
|
755
756
|
|
|
756
757
|
<div class="method-heading">
|
|
757
|
-
<a href="#
|
|
758
|
+
<a href="#M000150" class="method-signature">
|
|
758
759
|
<span class="method-name">get_snapshots</span><span class="method-args">()</span>
|
|
759
760
|
</a>
|
|
760
761
|
</div>
|
|
@@ -765,14 +766,14 @@ Retrieve the list of snapshots for this store
|
|
|
765
766
|
</p>
|
|
766
767
|
<p>
|
|
767
768
|
Currently the response will contain an HTML document. Use <a
|
|
768
|
-
href="Snapshot.html#
|
|
769
|
+
href="Snapshot.html#M000156">Snapshot.parse</a> to turn this into a <a
|
|
769
770
|
href="Snapshot.html">Snapshot</a> object
|
|
770
771
|
</p>
|
|
771
772
|
<p><a class="source-toggle" href="#"
|
|
772
|
-
onclick="toggleCode('
|
|
773
|
-
<div class="method-source-code" id="
|
|
773
|
+
onclick="toggleCode('M000150-source');return false;">[Source]</a></p>
|
|
774
|
+
<div class="method-source-code" id="M000150-source">
|
|
774
775
|
<pre>
|
|
775
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
776
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 421</span>
|
|
776
777
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_snapshots</span>()
|
|
777
778
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/snapshots"</span>)
|
|
778
779
|
<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>)
|
|
@@ -783,11 +784,11 @@ href="Snapshot.html">Snapshot</a> object
|
|
|
783
784
|
</div>
|
|
784
785
|
</div>
|
|
785
786
|
|
|
786
|
-
<div id="method-
|
|
787
|
-
<a name="
|
|
787
|
+
<div id="method-M000149" class="method-detail">
|
|
788
|
+
<a name="M000149"></a>
|
|
788
789
|
|
|
789
790
|
<div class="method-heading">
|
|
790
|
-
<a href="#
|
|
791
|
+
<a href="#M000149" class="method-signature">
|
|
791
792
|
<span class="method-name">get_status</span><span class="method-args">()</span>
|
|
792
793
|
</a>
|
|
793
794
|
</div>
|
|
@@ -797,10 +798,10 @@ href="Snapshot.html">Snapshot</a> object
|
|
|
797
798
|
ADMIN
|
|
798
799
|
</p>
|
|
799
800
|
<p><a class="source-toggle" href="#"
|
|
800
|
-
onclick="toggleCode('
|
|
801
|
-
<div class="method-source-code" id="
|
|
801
|
+
onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
|
|
802
|
+
<div class="method-source-code" id="M000149-source">
|
|
802
803
|
<pre>
|
|
803
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
804
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 411</span>
|
|
804
805
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_status</span>()
|
|
805
806
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/access-status"</span>)
|
|
806
807
|
<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> )
|
|
@@ -811,11 +812,11 @@ ADMIN
|
|
|
811
812
|
</div>
|
|
812
813
|
</div>
|
|
813
814
|
|
|
814
|
-
<div id="method-
|
|
815
|
-
<a name="
|
|
815
|
+
<div id="method-M000152" class="method-detail">
|
|
816
|
+
<a name="M000152"></a>
|
|
816
817
|
|
|
817
818
|
<div class="method-heading">
|
|
818
|
-
<a href="#
|
|
819
|
+
<a href="#M000152" class="method-signature">
|
|
819
820
|
<span class="method-name">put_field_predicate_map</span><span class="method-args">(data)</span>
|
|
820
821
|
</a>
|
|
821
822
|
</div>
|
|
@@ -825,7 +826,7 @@ ADMIN
|
|
|
825
826
|
<a href="Update.html">Update</a>/replace the current Field Predicate map
|
|
826
827
|
configuration in the store. Assumes that the provided data is valid
|
|
827
828
|
RDF/XML. Use <a
|
|
828
|
-
href="FieldPredicateMap.html#
|
|
829
|
+
href="FieldPredicateMap.html#M000095">FieldPredicateMap.upload</a> as a
|
|
829
830
|
convenience function
|
|
830
831
|
</p>
|
|
831
832
|
<table>
|
|
@@ -834,10 +835,10 @@ convenience function
|
|
|
834
835
|
</td></tr>
|
|
835
836
|
</table>
|
|
836
837
|
<p><a class="source-toggle" href="#"
|
|
837
|
-
onclick="toggleCode('
|
|
838
|
-
<div class="method-source-code" id="
|
|
838
|
+
onclick="toggleCode('M000152-source');return false;">[Source]</a></p>
|
|
839
|
+
<div class="method-source-code" id="M000152-source">
|
|
839
840
|
<pre>
|
|
840
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
841
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 446</span>
|
|
841
842
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_field_predicate_map</span>(<span class="ruby-identifier">data</span>)
|
|
842
843
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/fpmaps/1"</span>)
|
|
843
844
|
<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>}
|
|
@@ -848,11 +849,11 @@ convenience function
|
|
|
848
849
|
</div>
|
|
849
850
|
</div>
|
|
850
851
|
|
|
851
|
-
<div id="method-
|
|
852
|
-
<a name="
|
|
852
|
+
<div id="method-M000154" class="method-detail">
|
|
853
|
+
<a name="M000154"></a>
|
|
853
854
|
|
|
854
855
|
<div class="method-heading">
|
|
855
|
-
<a href="#
|
|
856
|
+
<a href="#M000154" class="method-signature">
|
|
856
857
|
<span class="method-name">put_query_profile</span><span class="method-args">(data)</span>
|
|
857
858
|
</a>
|
|
858
859
|
</div>
|
|
@@ -861,7 +862,7 @@ convenience function
|
|
|
861
862
|
<p>
|
|
862
863
|
<a href="Update.html">Update</a>/replace the current Query Profile
|
|
863
864
|
configuration in the store. Assumes that the provided data is valid
|
|
864
|
-
RDF/XML. Use <a href="QueryProfile.html#
|
|
865
|
+
RDF/XML. Use <a href="QueryProfile.html#M000109">QueryProfile.upload</a> as
|
|
865
866
|
a convenience function
|
|
866
867
|
</p>
|
|
867
868
|
<table>
|
|
@@ -870,10 +871,10 @@ a convenience function
|
|
|
870
871
|
</td></tr>
|
|
871
872
|
</table>
|
|
872
873
|
<p><a class="source-toggle" href="#"
|
|
873
|
-
onclick="toggleCode('
|
|
874
|
-
<div class="method-source-code" id="
|
|
874
|
+
onclick="toggleCode('M000154-source');return false;">[Source]</a></p>
|
|
875
|
+
<div class="method-source-code" id="M000154-source">
|
|
875
876
|
<pre>
|
|
876
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
877
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 467</span>
|
|
877
878
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_query_profile</span>(<span class="ruby-identifier">data</span>)
|
|
878
879
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/queryprofiles/1"</span>)
|
|
879
880
|
<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>}
|
|
@@ -884,21 +885,21 @@ a convenience function
|
|
|
884
885
|
</div>
|
|
885
886
|
</div>
|
|
886
887
|
|
|
887
|
-
<div id="method-
|
|
888
|
-
<a name="
|
|
888
|
+
<div id="method-M000142" class="method-detail">
|
|
889
|
+
<a name="M000142"></a>
|
|
889
890
|
|
|
890
891
|
<div class="method-heading">
|
|
891
|
-
<a href="#
|
|
892
|
+
<a href="#M000142" class="method-signature">
|
|
892
893
|
<span class="method-name">record_etags</span><span class="method-args">(u, etags, response)</span>
|
|
893
894
|
</a>
|
|
894
895
|
</div>
|
|
895
896
|
|
|
896
897
|
<div class="method-description">
|
|
897
898
|
<p><a class="source-toggle" href="#"
|
|
898
|
-
onclick="toggleCode('
|
|
899
|
-
<div class="method-source-code" id="
|
|
899
|
+
onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
|
|
900
|
+
<div class="method-source-code" id="M000142-source">
|
|
900
901
|
<pre>
|
|
901
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
902
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 315</span>
|
|
902
903
|
<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>)
|
|
903
904
|
<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>)
|
|
904
905
|
<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>)
|
|
@@ -909,11 +910,11 @@ a convenience function
|
|
|
909
910
|
</div>
|
|
910
911
|
</div>
|
|
911
912
|
|
|
912
|
-
<div id="method-
|
|
913
|
-
<a name="
|
|
913
|
+
<div id="method-M000136" class="method-detail">
|
|
914
|
+
<a name="M000136"></a>
|
|
914
915
|
|
|
915
916
|
<div class="method-heading">
|
|
916
|
-
<a href="#
|
|
917
|
+
<a href="#M000136" class="method-signature">
|
|
917
918
|
<span class="method-name">search</span><span class="method-args">(query, params=nil)</span>
|
|
918
919
|
</a>
|
|
919
920
|
</div>
|
|
@@ -960,10 +961,10 @@ transformation is being applied, in which case they will be provided as
|
|
|
960
961
|
parameters to the stylesheet.
|
|
961
962
|
</p>
|
|
962
963
|
<p><a class="source-toggle" href="#"
|
|
963
|
-
onclick="toggleCode('
|
|
964
|
-
<div class="method-source-code" id="
|
|
964
|
+
onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
|
|
965
|
+
<div class="method-source-code" id="M000136-source">
|
|
965
966
|
<pre>
|
|
966
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
967
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 246</span>
|
|
967
968
|
<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>)
|
|
968
969
|
<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>)
|
|
969
970
|
<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>)
|
|
@@ -976,11 +977,11 @@ parameters to the stylesheet.
|
|
|
976
977
|
</div>
|
|
977
978
|
</div>
|
|
978
979
|
|
|
979
|
-
<div id="method-
|
|
980
|
-
<a name="
|
|
980
|
+
<div id="method-M000123" class="method-detail">
|
|
981
|
+
<a name="M000123"></a>
|
|
981
982
|
|
|
982
983
|
<div class="method-heading">
|
|
983
|
-
<a href="#
|
|
984
|
+
<a href="#M000123" class="method-signature">
|
|
984
985
|
<span class="method-name">set_credentials</span><span class="method-args">(username, password)</span>
|
|
985
986
|
</a>
|
|
986
987
|
</div>
|
|
@@ -998,8 +999,8 @@ Set credentials that this store will use when carrying out authorization
|
|
|
998
999
|
</td></tr>
|
|
999
1000
|
</table>
|
|
1000
1001
|
<p><a class="source-toggle" href="#"
|
|
1001
|
-
onclick="toggleCode('
|
|
1002
|
-
<div class="method-source-code" id="
|
|
1002
|
+
onclick="toggleCode('M000123-source');return false;">[Source]</a></p>
|
|
1003
|
+
<div class="method-source-code" id="M000123-source">
|
|
1003
1004
|
<pre>
|
|
1004
1005
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 53</span>
|
|
1005
1006
|
<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>)
|
|
@@ -1010,11 +1011,11 @@ Set credentials that this store will use when carrying out authorization
|
|
|
1010
1011
|
</div>
|
|
1011
1012
|
</div>
|
|
1012
1013
|
|
|
1013
|
-
<div id="method-
|
|
1014
|
-
<a name="
|
|
1014
|
+
<div id="method-M000135" class="method-detail">
|
|
1015
|
+
<a name="M000135"></a>
|
|
1015
1016
|
|
|
1016
1017
|
<div class="method-heading">
|
|
1017
|
-
<a href="#
|
|
1018
|
+
<a href="#M000135" class="method-signature">
|
|
1018
1019
|
<span class="method-name">sparql</span><span class="method-args">(query, format=nil, multisparql=false)</span>
|
|
1019
1020
|
</a>
|
|
1020
1021
|
</div>
|
|
@@ -1029,35 +1030,23 @@ Perform a SPARQL query
|
|
|
1029
1030
|
multisparql:: use default sparql service or multisparql service
|
|
1030
1031
|
</pre>
|
|
1031
1032
|
<p><a class="source-toggle" href="#"
|
|
1032
|
-
onclick="toggleCode('
|
|
1033
|
-
<div class="method-source-code" id="
|
|
1033
|
+
onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
|
|
1034
|
+
<div class="method-source-code" id="M000135-source">
|
|
1034
1035
|
<pre>
|
|
1035
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
1036
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 227</span>
|
|
1036
1037
|
<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">
|
|
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
|
-
|
|
1043
|
-
<span class="ruby-identifier">params</span> = {}
|
|
1044
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"query"</span>] = <span class="ruby-identifier">query</span>
|
|
1045
|
-
<span class="ruby-identifier">headers</span> = {}
|
|
1046
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">format</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
|
1047
|
-
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"Accept"</span>] = <span class="ruby-identifier">format</span>
|
|
1048
|
-
<span class="ruby-keyword kw">end</span>
|
|
1049
|
-
<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">params</span>, <span class="ruby-identifier">headers</span>)
|
|
1038
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql_client</span>(<span class="ruby-identifier">multisparql</span>).<span class="ruby-identifier">query</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
|
1050
1039
|
<span class="ruby-keyword kw">end</span>
|
|
1051
1040
|
</pre>
|
|
1052
1041
|
</div>
|
|
1053
1042
|
</div>
|
|
1054
1043
|
</div>
|
|
1055
1044
|
|
|
1056
|
-
<div id="method-
|
|
1057
|
-
<a name="
|
|
1045
|
+
<div id="method-M000133" class="method-detail">
|
|
1046
|
+
<a name="M000133"></a>
|
|
1058
1047
|
|
|
1059
1048
|
<div class="method-heading">
|
|
1060
|
-
<a href="#
|
|
1049
|
+
<a href="#M000133" class="method-signature">
|
|
1061
1050
|
<span class="method-name">sparql_ask</span><span class="method-args">(query, format="application/sparql-results+xml", multisparql=false)</span>
|
|
1062
1051
|
</a>
|
|
1063
1052
|
</div>
|
|
@@ -1071,10 +1060,10 @@ Perform a SPARQL ASK query.
|
|
|
1071
1060
|
format:: the preferred response format
|
|
1072
1061
|
</pre>
|
|
1073
1062
|
<p><a class="source-toggle" href="#"
|
|
1074
|
-
onclick="toggleCode('
|
|
1075
|
-
<div class="method-source-code" id="
|
|
1063
|
+
onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
|
|
1064
|
+
<div class="method-source-code" id="M000133-source">
|
|
1076
1065
|
<pre>
|
|
1077
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
1066
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 210</span>
|
|
1078
1067
|
<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
1068
|
<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>)
|
|
1080
1069
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -1083,11 +1072,51 @@ Perform a SPARQL ASK query.
|
|
|
1083
1072
|
</div>
|
|
1084
1073
|
</div>
|
|
1085
1074
|
|
|
1086
|
-
<div id="method-
|
|
1087
|
-
<a name="
|
|
1075
|
+
<div id="method-M000130" class="method-detail">
|
|
1076
|
+
<a name="M000130"></a>
|
|
1088
1077
|
|
|
1089
1078
|
<div class="method-heading">
|
|
1090
|
-
<a href="#
|
|
1079
|
+
<a href="#M000130" class="method-signature">
|
|
1080
|
+
<span class="method-name">sparql_client</span><span class="method-args">(multisparql=false)</span>
|
|
1081
|
+
</a>
|
|
1082
|
+
</div>
|
|
1083
|
+
|
|
1084
|
+
<div class="method-description">
|
|
1085
|
+
<p>
|
|
1086
|
+
Retrieve a SparqlClient object for interacting with the endpoint for this
|
|
1087
|
+
store
|
|
1088
|
+
</p>
|
|
1089
|
+
<pre>
|
|
1090
|
+
multisparql:: optional, set to true to retrieve client for multisparql endpoint
|
|
1091
|
+
</pre>
|
|
1092
|
+
<p><a class="source-toggle" href="#"
|
|
1093
|
+
onclick="toggleCode('M000130-source');return false;">[Source]</a></p>
|
|
1094
|
+
<div class="method-source-code" id="M000130-source">
|
|
1095
|
+
<pre>
|
|
1096
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 176</span>
|
|
1097
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_client</span>(<span class="ruby-identifier">multisparql</span>=<span class="ruby-keyword kw">false</span>)
|
|
1098
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">multisparql</span>
|
|
1099
|
+
<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>)
|
|
1100
|
+
<span class="ruby-keyword kw">else</span>
|
|
1101
|
+
<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>)
|
|
1102
|
+
<span class="ruby-keyword kw">end</span>
|
|
1103
|
+
|
|
1104
|
+
<span class="ruby-identifier">sparql_client</span> = <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Sparql</span><span class="ruby-operator">::</span><span class="ruby-constant">SparqlClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">u</span>, <span class="ruby-ivar">@client</span>)
|
|
1105
|
+
<span class="ruby-identifier">sparql_client</span>.<span class="ruby-identifier">supports_rdf_json</span> = <span class="ruby-keyword kw">true</span>
|
|
1106
|
+
<span class="ruby-identifier">sparql_client</span>.<span class="ruby-identifier">supports_sparql_json</span> = <span class="ruby-keyword kw">true</span>
|
|
1107
|
+
|
|
1108
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql_client</span>
|
|
1109
|
+
<span class="ruby-keyword kw">end</span>
|
|
1110
|
+
</pre>
|
|
1111
|
+
</div>
|
|
1112
|
+
</div>
|
|
1113
|
+
</div>
|
|
1114
|
+
|
|
1115
|
+
<div id="method-M000132" class="method-detail">
|
|
1116
|
+
<a name="M000132"></a>
|
|
1117
|
+
|
|
1118
|
+
<div class="method-heading">
|
|
1119
|
+
<a href="#M000132" class="method-signature">
|
|
1091
1120
|
<span class="method-name">sparql_construct</span><span class="method-args">(query, format="application/rdf+xml", multisparql=false)</span>
|
|
1092
1121
|
</a>
|
|
1093
1122
|
</div>
|
|
@@ -1101,10 +1130,10 @@ Perform a SPARQL CONSTRUCT query.
|
|
|
1101
1130
|
format:: the preferred response format
|
|
1102
1131
|
</pre>
|
|
1103
1132
|
<p><a class="source-toggle" href="#"
|
|
1104
|
-
onclick="toggleCode('
|
|
1105
|
-
<div class="method-source-code" id="
|
|
1133
|
+
onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
|
|
1134
|
+
<div class="method-source-code" id="M000132-source">
|
|
1106
1135
|
<pre>
|
|
1107
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
1136
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 202</span>
|
|
1108
1137
|
<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
1138
|
<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>)
|
|
1110
1139
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -1113,11 +1142,11 @@ Perform a SPARQL CONSTRUCT query.
|
|
|
1113
1142
|
</div>
|
|
1114
1143
|
</div>
|
|
1115
1144
|
|
|
1116
|
-
<div id="method-
|
|
1117
|
-
<a name="
|
|
1145
|
+
<div id="method-M000131" class="method-detail">
|
|
1146
|
+
<a name="M000131"></a>
|
|
1118
1147
|
|
|
1119
1148
|
<div class="method-heading">
|
|
1120
|
-
<a href="#
|
|
1149
|
+
<a href="#M000131" class="method-signature">
|
|
1121
1150
|
<span class="method-name">sparql_describe</span><span class="method-args">(query, format="application/rdf+xml", multisparql=false)</span>
|
|
1122
1151
|
</a>
|
|
1123
1152
|
</div>
|
|
@@ -1131,10 +1160,10 @@ Perform a SPARQL DESCRIBE query.
|
|
|
1131
1160
|
format:: the preferred response format
|
|
1132
1161
|
</pre>
|
|
1133
1162
|
<p><a class="source-toggle" href="#"
|
|
1134
|
-
onclick="toggleCode('
|
|
1135
|
-
<div class="method-source-code" id="
|
|
1163
|
+
onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
|
|
1164
|
+
<div class="method-source-code" id="M000131-source">
|
|
1136
1165
|
<pre>
|
|
1137
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
1166
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 194</span>
|
|
1138
1167
|
<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
1168
|
<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>)
|
|
1140
1169
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -1143,11 +1172,11 @@ Perform a SPARQL DESCRIBE query.
|
|
|
1143
1172
|
</div>
|
|
1144
1173
|
</div>
|
|
1145
1174
|
|
|
1146
|
-
<div id="method-
|
|
1147
|
-
<a name="
|
|
1175
|
+
<div id="method-M000134" class="method-detail">
|
|
1176
|
+
<a name="M000134"></a>
|
|
1148
1177
|
|
|
1149
1178
|
<div class="method-heading">
|
|
1150
|
-
<a href="#
|
|
1179
|
+
<a href="#M000134" class="method-signature">
|
|
1151
1180
|
<span class="method-name">sparql_select</span><span class="method-args">(query, format="application/sparql-results+xml", multisparql=false)</span>
|
|
1152
1181
|
</a>
|
|
1153
1182
|
</div>
|
|
@@ -1161,10 +1190,10 @@ Perform a SPARQL SELECT query.
|
|
|
1161
1190
|
format:: the preferred response format
|
|
1162
1191
|
</pre>
|
|
1163
1192
|
<p><a class="source-toggle" href="#"
|
|
1164
|
-
onclick="toggleCode('
|
|
1165
|
-
<div class="method-source-code" id="
|
|
1193
|
+
onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
|
|
1194
|
+
<div class="method-source-code" id="M000134-source">
|
|
1166
1195
|
<pre>
|
|
1167
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
1196
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 218</span>
|
|
1168
1197
|
<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
1198
|
<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>)
|
|
1170
1199
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -1173,11 +1202,11 @@ Perform a SPARQL SELECT query.
|
|
|
1173
1202
|
</div>
|
|
1174
1203
|
</div>
|
|
1175
1204
|
|
|
1176
|
-
<div id="method-
|
|
1177
|
-
<a name="
|
|
1205
|
+
<div id="method-M000125" class="method-detail">
|
|
1206
|
+
<a name="M000125"></a>
|
|
1178
1207
|
|
|
1179
1208
|
<div class="method-heading">
|
|
1180
|
-
<a href="#
|
|
1209
|
+
<a href="#M000125" class="method-signature">
|
|
1181
1210
|
<span class="method-name">store_data</span><span class="method-args">(data, graph_name=nil)</span>
|
|
1182
1211
|
</a>
|
|
1183
1212
|
</div>
|
|
@@ -1193,8 +1222,8 @@ Perform a SPARQL SELECT query.
|
|
|
1193
1222
|
</td></tr>
|
|
1194
1223
|
</table>
|
|
1195
1224
|
<p><a class="source-toggle" href="#"
|
|
1196
|
-
onclick="toggleCode('
|
|
1197
|
-
<div class="method-source-code" id="
|
|
1225
|
+
onclick="toggleCode('M000125-source');return false;">[Source]</a></p>
|
|
1226
|
+
<div class="method-source-code" id="M000125-source">
|
|
1198
1227
|
<pre>
|
|
1199
1228
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 79</span>
|
|
1200
1229
|
<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>)
|
|
@@ -1213,11 +1242,11 @@ Perform a SPARQL SELECT query.
|
|
|
1213
1242
|
</div>
|
|
1214
1243
|
</div>
|
|
1215
1244
|
|
|
1216
|
-
<div id="method-
|
|
1217
|
-
<a name="
|
|
1245
|
+
<div id="method-M000126" class="method-detail">
|
|
1246
|
+
<a name="M000126"></a>
|
|
1218
1247
|
|
|
1219
1248
|
<div class="method-heading">
|
|
1220
|
-
<a href="#
|
|
1249
|
+
<a href="#M000126" class="method-signature">
|
|
1221
1250
|
<span class="method-name">store_file</span><span class="method-args">(file)</span>
|
|
1222
1251
|
</a>
|
|
1223
1252
|
</div>
|
|
@@ -1235,8 +1264,8 @@ is submitted to the platform
|
|
|
1235
1264
|
</td></tr>
|
|
1236
1265
|
</table>
|
|
1237
1266
|
<p><a class="source-toggle" href="#"
|
|
1238
|
-
onclick="toggleCode('
|
|
1239
|
-
<div class="method-source-code" id="
|
|
1267
|
+
onclick="toggleCode('M000126-source');return false;">[Source]</a></p>
|
|
1268
|
+
<div class="method-source-code" id="M000126-source">
|
|
1240
1269
|
<pre>
|
|
1241
1270
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 94</span>
|
|
1242
1271
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>)
|
|
@@ -1249,11 +1278,11 @@ is submitted to the platform
|
|
|
1249
1278
|
</div>
|
|
1250
1279
|
</div>
|
|
1251
1280
|
|
|
1252
|
-
<div id="method-
|
|
1253
|
-
<a name="
|
|
1281
|
+
<div id="method-M000127" class="method-detail">
|
|
1282
|
+
<a name="M000127"></a>
|
|
1254
1283
|
|
|
1255
1284
|
<div class="method-heading">
|
|
1256
|
-
<a href="#
|
|
1285
|
+
<a href="#M000127" class="method-signature">
|
|
1257
1286
|
<span class="method-name">store_url</span><span class="method-args">(u, parameters=nil, graph_name=nil)</span>
|
|
1258
1287
|
</a>
|
|
1259
1288
|
</div>
|
|
@@ -1291,8 +1320,8 @@ URL
|
|
|
1291
1320
|
</td></tr>
|
|
1292
1321
|
</table>
|
|
1293
1322
|
<p><a class="source-toggle" href="#"
|
|
1294
|
-
onclick="toggleCode('
|
|
1295
|
-
<div class="method-source-code" id="
|
|
1323
|
+
onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
|
|
1324
|
+
<div class="method-source-code" id="M000127-source">
|
|
1296
1325
|
<pre>
|
|
1297
1326
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 112</span>
|
|
1298
1327
|
<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>)
|
|
@@ -1313,11 +1342,11 @@ URL
|
|
|
1313
1342
|
</div>
|
|
1314
1343
|
</div>
|
|
1315
1344
|
|
|
1316
|
-
<div id="method-
|
|
1317
|
-
<a name="
|
|
1345
|
+
<div id="method-M000129" class="method-detail">
|
|
1346
|
+
<a name="M000129"></a>
|
|
1318
1347
|
|
|
1319
1348
|
<div class="method-heading">
|
|
1320
|
-
<a href="#
|
|
1349
|
+
<a href="#M000129" class="method-signature">
|
|
1321
1350
|
<span class="method-name">submit_changeset</span><span class="method-args">(rdf, versioned=false, graph_name=nil)</span>
|
|
1322
1351
|
</a>
|
|
1323
1352
|
</div>
|
|
@@ -1343,8 +1372,8 @@ be submitted to private graphs.
|
|
|
1343
1372
|
</td></tr>
|
|
1344
1373
|
</table>
|
|
1345
1374
|
<p><a class="source-toggle" href="#"
|
|
1346
|
-
onclick="toggleCode('
|
|
1347
|
-
<div class="method-source-code" id="
|
|
1375
|
+
onclick="toggleCode('M000129-source');return false;">[Source]</a></p>
|
|
1376
|
+
<div class="method-source-code" id="M000129-source">
|
|
1348
1377
|
<pre>
|
|
1349
1378
|
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 156</span>
|
|
1350
1379
|
<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>)
|
|
@@ -1364,11 +1393,11 @@ be submitted to private graphs.
|
|
|
1364
1393
|
</div>
|
|
1365
1394
|
</div>
|
|
1366
1395
|
|
|
1367
|
-
<div id="method-
|
|
1368
|
-
<a name="
|
|
1396
|
+
<div id="method-M000148" class="method-detail">
|
|
1397
|
+
<a name="M000148"></a>
|
|
1369
1398
|
|
|
1370
1399
|
<div class="method-heading">
|
|
1371
|
-
<a href="#
|
|
1400
|
+
<a href="#M000148" class="method-signature">
|
|
1372
1401
|
<span class="method-name">submit_job</span><span class="method-args">(data)</span>
|
|
1373
1402
|
</a>
|
|
1374
1403
|
</div>
|
|
@@ -1384,10 +1413,10 @@ href="Jobs.html">Jobs</a> class
|
|
|
1384
1413
|
</td></tr>
|
|
1385
1414
|
</table>
|
|
1386
1415
|
<p><a class="source-toggle" href="#"
|
|
1387
|
-
onclick="toggleCode('
|
|
1388
|
-
<div class="method-source-code" id="
|
|
1416
|
+
onclick="toggleCode('M000148-source');return false;">[Source]</a></p>
|
|
1417
|
+
<div class="method-source-code" id="M000148-source">
|
|
1389
1418
|
<pre>
|
|
1390
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
1419
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 401</span>
|
|
1391
1420
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit_job</span>(<span class="ruby-identifier">data</span>)
|
|
1392
1421
|
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/jobs"</span>)
|
|
1393
1422
|
<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> )
|
|
@@ -1398,11 +1427,11 @@ href="Jobs.html">Jobs</a> class
|
|
|
1398
1427
|
</div>
|
|
1399
1428
|
</div>
|
|
1400
1429
|
|
|
1401
|
-
<div id="method-
|
|
1402
|
-
<a name="
|
|
1430
|
+
<div id="method-M000143" class="method-detail">
|
|
1431
|
+
<a name="M000143"></a>
|
|
1403
1432
|
|
|
1404
1433
|
<div class="method-heading">
|
|
1405
|
-
<a href="#
|
|
1434
|
+
<a href="#M000143" class="method-signature">
|
|
1406
1435
|
<span class="method-name">upload_item</span><span class="method-args">(f, mimetype, uri=nil)</span>
|
|
1407
1436
|
</a>
|
|
1408
1437
|
</div>
|
|
@@ -1430,14 +1459,15 @@ stored item. If a URI is specified then a successful request will result in
|
|
|
1430
1459
|
a 200 OK response.
|
|
1431
1460
|
</p>
|
|
1432
1461
|
<p><a class="source-toggle" href="#"
|
|
1433
|
-
onclick="toggleCode('
|
|
1434
|
-
<div class="method-source-code" id="
|
|
1462
|
+
onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
|
|
1463
|
+
<div class="method-source-code" id="M000143-source">
|
|
1435
1464
|
<pre>
|
|
1436
|
-
<span class="ruby-comment cmt"># File lib/pho/store.rb, line
|
|
1465
|
+
<span class="ruby-comment cmt"># File lib/pho/store.rb, line 334</span>
|
|
1437
1466
|
<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>)
|
|
1438
1467
|
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>()
|
|
1439
1468
|
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>()
|
|
1440
1469
|
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">mimetype</span>}
|
|
1470
|
+
|
|
1441
1471
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
|
1442
1472
|
<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>)
|
|
1443
1473
|
<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-identifier">headers</span>)
|