pho 0.4.1 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -81,7 +81,7 @@
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
83
|
In the Talis Platform a "snapshot" is an <a
|
84
|
-
href="Snapshot.html#
|
84
|
+
href="Snapshot.html#M000159">backup</a> of the contents of a <a
|
85
85
|
href="Store.html">Store</a>
|
86
86
|
</p>
|
87
87
|
<p>
|
@@ -102,11 +102,11 @@ A snapshot can be generated (or scheduled) using the Store.snapshot method.
|
|
102
102
|
<h3 class="section-bar">Methods</h3>
|
103
103
|
|
104
104
|
<div class="name-list">
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
105
|
+
<a href="#M000159">backup</a>
|
106
|
+
<a href="#M000157">new</a>
|
107
|
+
<a href="#M000156">parse</a>
|
108
|
+
<a href="#M000155">read_from_store</a>
|
109
|
+
<a href="#M000158">read_md5</a>
|
110
110
|
</div>
|
111
111
|
</div>
|
112
112
|
|
@@ -176,19 +176,19 @@ The URL from which the snapshot can be retrieved
|
|
176
176
|
<div id="methods">
|
177
177
|
<h3 class="section-bar">Public Class methods</h3>
|
178
178
|
|
179
|
-
<div id="method-
|
180
|
-
<a name="
|
179
|
+
<div id="method-M000157" class="method-detail">
|
180
|
+
<a name="M000157"></a>
|
181
181
|
|
182
182
|
<div class="method-heading">
|
183
|
-
<a href="#
|
183
|
+
<a href="#M000157" class="method-signature">
|
184
184
|
<span class="method-name">new</span><span class="method-args">(url, md5_url, size, units, date)</span>
|
185
185
|
</a>
|
186
186
|
</div>
|
187
187
|
|
188
188
|
<div class="method-description">
|
189
189
|
<p><a class="source-toggle" href="#"
|
190
|
-
onclick="toggleCode('
|
191
|
-
<div class="method-source-code" id="
|
190
|
+
onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
|
191
|
+
<div class="method-source-code" id="M000157-source">
|
192
192
|
<pre>
|
193
193
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 76</span>
|
194
194
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">md5_url</span>, <span class="ruby-identifier">size</span>, <span class="ruby-identifier">units</span>, <span class="ruby-identifier">date</span>)
|
@@ -203,21 +203,21 @@ The URL from which the snapshot can be retrieved
|
|
203
203
|
</div>
|
204
204
|
</div>
|
205
205
|
|
206
|
-
<div id="method-
|
207
|
-
<a name="
|
206
|
+
<div id="method-M000156" class="method-detail">
|
207
|
+
<a name="M000156"></a>
|
208
208
|
|
209
209
|
<div class="method-heading">
|
210
|
-
<a href="#
|
210
|
+
<a href="#M000156" class="method-signature">
|
211
211
|
<span class="method-name">parse</span><span class="method-args">(storeuri, content)</span>
|
212
212
|
</a>
|
213
213
|
</div>
|
214
214
|
|
215
215
|
<div class="method-description">
|
216
216
|
<p>
|
217
|
-
Class method to <a href="Snapshot.html#
|
217
|
+
Class method to <a href="Snapshot.html#M000156">parse</a> the RDF response
|
218
218
|
from the API, e.g. as produced by the <a
|
219
|
-
href="Store.html#
|
220
|
-
href="Snapshot.html#
|
219
|
+
href="Store.html#M000150">Store.get_snapshots</a> method and create a <a
|
220
|
+
href="Snapshot.html#M000157">new</a> <a href="Snapshot.html">Snapshot</a>
|
221
221
|
object. At the moment the Platform only supports single snapshot.
|
222
222
|
</p>
|
223
223
|
<p>
|
@@ -228,8 +228,8 @@ If the response was an error, then an exception will be thrown
|
|
228
228
|
content:: response from the API
|
229
229
|
</pre>
|
230
230
|
<p><a class="source-toggle" href="#"
|
231
|
-
onclick="toggleCode('
|
232
|
-
<div class="method-source-code" id="
|
231
|
+
onclick="toggleCode('M000156-source');return false;">[Source]</a></p>
|
232
|
+
<div class="method-source-code" id="M000156-source">
|
233
233
|
<pre>
|
234
234
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 52</span>
|
235
235
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Snapshot</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">storeuri</span>, <span class="ruby-identifier">content</span>)
|
@@ -260,11 +260,11 @@ If the response was an error, then an exception will be thrown
|
|
260
260
|
</div>
|
261
261
|
</div>
|
262
262
|
|
263
|
-
<div id="method-
|
264
|
-
<a name="
|
263
|
+
<div id="method-M000155" class="method-detail">
|
264
|
+
<a name="M000155"></a>
|
265
265
|
|
266
266
|
<div class="method-heading">
|
267
|
-
<a href="#
|
267
|
+
<a href="#M000155" class="method-signature">
|
268
268
|
<span class="method-name">read_from_store</span><span class="method-args">(store)</span>
|
269
269
|
</a>
|
270
270
|
</div>
|
@@ -279,8 +279,8 @@ Read snapshot data from the given store
|
|
279
279
|
</td></tr>
|
280
280
|
</table>
|
281
281
|
<p><a class="source-toggle" href="#"
|
282
|
-
onclick="toggleCode('
|
283
|
-
<div class="method-source-code" id="
|
282
|
+
onclick="toggleCode('M000155-source');return false;">[Source]</a></p>
|
283
|
+
<div class="method-source-code" id="M000155-source">
|
284
284
|
<pre>
|
285
285
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 34</span>
|
286
286
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Snapshot</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
|
@@ -300,11 +300,11 @@ Read snapshot data from the given store
|
|
300
300
|
|
301
301
|
<h3 class="section-bar">Public Instance methods</h3>
|
302
302
|
|
303
|
-
<div id="method-
|
304
|
-
<a name="
|
303
|
+
<div id="method-M000159" class="method-detail">
|
304
|
+
<a name="M000159"></a>
|
305
305
|
|
306
306
|
<div class="method-heading">
|
307
|
-
<a href="#
|
307
|
+
<a href="#M000159" class="method-signature">
|
308
308
|
<span class="method-name">backup</span><span class="method-args">(store, dir=Dir.tmpdir)</span>
|
309
309
|
</a>
|
310
310
|
</div>
|
@@ -317,7 +317,7 @@ published value. If they don‘t match then a RuntimeError will be
|
|
317
317
|
raised
|
318
318
|
</p>
|
319
319
|
<table>
|
320
|
-
<tr><td valign="top">store:</td><td>the store to <a href="Snapshot.html#
|
320
|
+
<tr><td valign="top">store:</td><td>the store to <a href="Snapshot.html#M000159">backup</a>
|
321
321
|
|
322
322
|
</td></tr>
|
323
323
|
<tr><td valign="top">dir:</td><td>directory in which snapshot will be stored
|
@@ -325,8 +325,8 @@ raised
|
|
325
325
|
</td></tr>
|
326
326
|
</table>
|
327
327
|
<p><a class="source-toggle" href="#"
|
328
|
-
onclick="toggleCode('
|
329
|
-
<div class="method-source-code" id="
|
328
|
+
onclick="toggleCode('M000159-source');return false;">[Source]</a></p>
|
329
|
+
<div class="method-source-code" id="M000159-source">
|
330
330
|
<pre>
|
331
331
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 96</span>
|
332
332
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backup</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>=<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>)
|
@@ -356,11 +356,11 @@ raised
|
|
356
356
|
</div>
|
357
357
|
</div>
|
358
358
|
|
359
|
-
<div id="method-
|
360
|
-
<a name="
|
359
|
+
<div id="method-M000158" class="method-detail">
|
360
|
+
<a name="M000158"></a>
|
361
361
|
|
362
362
|
<div class="method-heading">
|
363
|
-
<a href="#
|
363
|
+
<a href="#M000158" class="method-signature">
|
364
364
|
<span class="method-name">read_md5</span><span class="method-args">(client=HttpClient.new())</span>
|
365
365
|
</a>
|
366
366
|
</div>
|
@@ -370,8 +370,8 @@ raised
|
|
370
370
|
Read the published MD5 value
|
371
371
|
</p>
|
372
372
|
<p><a class="source-toggle" href="#"
|
373
|
-
onclick="toggleCode('
|
374
|
-
<div class="method-source-code" id="
|
373
|
+
onclick="toggleCode('M000158-source');return false;">[Source]</a></p>
|
374
|
+
<div class="method-source-code" id="M000158-source">
|
375
375
|
<pre>
|
376
376
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 86</span>
|
377
377
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_md5</span>(<span class="ruby-identifier">client</span>=<span class="ruby-constant">HttpClient</span>.<span class="ruby-identifier">new</span>())
|
@@ -0,0 +1,137 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Pho::Sparql</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::Sparql</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/pho/sparql_rb.html">
|
59
|
+
lib/pho/sparql.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
Module providing a SPARQL client library, support for parsing SPARQL query
|
78
|
+
responses into Ruby objects and other useful behaviour
|
79
|
+
</p>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if includes -->
|
91
|
+
|
92
|
+
<div id="section">
|
93
|
+
|
94
|
+
<div id="class-list">
|
95
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
96
|
+
|
97
|
+
Class <a href="Sparql/SparqlClient.html" class="link">Pho::Sparql::SparqlClient</a><br />
|
98
|
+
Class <a href="Sparql/SparqlHelper.html" class="link">Pho::Sparql::SparqlHelper</a><br />
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<div id="constants-list">
|
103
|
+
<h3 class="section-bar">Constants</h3>
|
104
|
+
|
105
|
+
<div class="name-list">
|
106
|
+
<table summary="Constants">
|
107
|
+
<tr class="top-aligned-row context-row">
|
108
|
+
<td class="context-item-name">SPARQL_RESULTS_XML</td>
|
109
|
+
<td>=</td>
|
110
|
+
<td class="context-item-value">"application/sparql-results+xml"</td>
|
111
|
+
</tr>
|
112
|
+
<tr class="top-aligned-row context-row">
|
113
|
+
<td class="context-item-name">SPARQL_RESULTS_JSON</td>
|
114
|
+
<td>=</td>
|
115
|
+
<td class="context-item-value">"application/sparql-results+json"</td>
|
116
|
+
</tr>
|
117
|
+
</table>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<!-- if method_list -->
|
127
|
+
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
|
132
|
+
<div id="validator-badges">
|
133
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</body>
|
137
|
+
</html>
|
@@ -0,0 +1,515 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Pho::Sparql::SparqlClient</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::Sparql::SparqlClient</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/pho/sparql_rb.html">
|
59
|
+
lib/pho/sparql.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
A simple SPARQL client that handles the basic HTTP traffic
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div id="method-list">
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
93
|
+
|
94
|
+
<div class="name-list">
|
95
|
+
<a href="#M000003">add_default_graph</a>
|
96
|
+
<a href="#M000004">add_named_graph</a>
|
97
|
+
<a href="#M000009">ask</a>
|
98
|
+
<a href="#M000008">construct</a>
|
99
|
+
<a href="#M000006">describe</a>
|
100
|
+
<a href="#M000007">multi_describe</a>
|
101
|
+
<a href="#M000002">new</a>
|
102
|
+
<a href="#M000005">query</a>
|
103
|
+
<a href="#M000010">select</a>
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
|
110
|
+
<!-- if includes -->
|
111
|
+
|
112
|
+
<div id="section">
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<div id="attribute-list">
|
119
|
+
<h3 class="section-bar">Attributes</h3>
|
120
|
+
|
121
|
+
<div class="name-list">
|
122
|
+
<table>
|
123
|
+
<tr class="top-aligned-row context-row">
|
124
|
+
<td class="context-item-name">client</td>
|
125
|
+
<td class="context-item-value"> [R] </td>
|
126
|
+
<td class="context-item-desc">
|
127
|
+
HTTPClient object
|
128
|
+
|
129
|
+
</td>
|
130
|
+
</tr>
|
131
|
+
<tr class="top-aligned-row context-row">
|
132
|
+
<td class="context-item-name">endpoint</td>
|
133
|
+
<td class="context-item-value"> [R] </td>
|
134
|
+
<td class="context-item-desc">
|
135
|
+
URI of the endpoint
|
136
|
+
|
137
|
+
</td>
|
138
|
+
</tr>
|
139
|
+
<tr class="top-aligned-row context-row">
|
140
|
+
<td class="context-item-name">graphs</td>
|
141
|
+
<td class="context-item-value"> [R] </td>
|
142
|
+
<td class="context-item-desc"></td>
|
143
|
+
</tr>
|
144
|
+
<tr class="top-aligned-row context-row">
|
145
|
+
<td class="context-item-name">named_graphs</td>
|
146
|
+
<td class="context-item-value"> [R] </td>
|
147
|
+
<td class="context-item-desc"></td>
|
148
|
+
</tr>
|
149
|
+
<tr class="top-aligned-row context-row">
|
150
|
+
<td class="context-item-name">output_parameter_name</td>
|
151
|
+
<td class="context-item-value"> [RW] </td>
|
152
|
+
<td class="context-item-desc">
|
153
|
+
Name of output parameter to use to control response format. If set then
|
154
|
+
this parameter is added to the <a
|
155
|
+
href="SparqlClient.html#M000005">query</a> string, rather than using
|
156
|
+
Content Negotiation
|
157
|
+
|
158
|
+
</td>
|
159
|
+
</tr>
|
160
|
+
<tr class="top-aligned-row context-row">
|
161
|
+
<td class="context-item-name">supports_rdf_json</td>
|
162
|
+
<td class="context-item-value"> [RW] </td>
|
163
|
+
<td class="context-item-desc">
|
164
|
+
Configures whether the remote endpoint supports the RDF-in-JSON
|
165
|
+
specification for serializing RDF graphs as JSON. Will default to false.
|
166
|
+
|
167
|
+
</td>
|
168
|
+
</tr>
|
169
|
+
<tr class="top-aligned-row context-row">
|
170
|
+
<td class="context-item-name">supports_sparql_json</td>
|
171
|
+
<td class="context-item-value"> [RW] </td>
|
172
|
+
<td class="context-item-desc">
|
173
|
+
Configures whether the remote endpoint supports SPARQL JSON Results format
|
174
|
+
Will default to true.
|
175
|
+
|
176
|
+
</td>
|
177
|
+
</tr>
|
178
|
+
</table>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
<!-- if method_list -->
|
185
|
+
<div id="methods">
|
186
|
+
<h3 class="section-bar">Public Class methods</h3>
|
187
|
+
|
188
|
+
<div id="method-M000002" class="method-detail">
|
189
|
+
<a name="M000002"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="#M000002" class="method-signature">
|
193
|
+
<span class="method-name">new</span><span class="method-args">(endpoint, client=HTTPClient.new() )</span>
|
194
|
+
</a>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
<p>
|
199
|
+
Initialize a client for a specific endpoint
|
200
|
+
</p>
|
201
|
+
<pre>
|
202
|
+
endpoint:: uri of the SPARQL endpoint
|
203
|
+
client:: optionally, a reference to an existing HTTPClient object instance
|
204
|
+
</pre>
|
205
|
+
<p><a class="source-toggle" href="#"
|
206
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
207
|
+
<div class="method-source-code" id="M000002-source">
|
208
|
+
<pre>
|
209
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 34</span>
|
210
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">endpoint</span>, <span class="ruby-identifier">client</span>=<span class="ruby-constant">HTTPClient</span>.<span class="ruby-identifier">new</span>() )
|
211
|
+
<span class="ruby-ivar">@endpoint</span> = <span class="ruby-identifier">endpoint</span>
|
212
|
+
<span class="ruby-ivar">@graphs</span> = <span class="ruby-keyword kw">nil</span>
|
213
|
+
<span class="ruby-ivar">@named_graphs</span> = <span class="ruby-keyword kw">nil</span>
|
214
|
+
<span class="ruby-ivar">@client</span> = <span class="ruby-identifier">client</span>
|
215
|
+
<span class="ruby-ivar">@output_parameter_name</span> = <span class="ruby-keyword kw">nil</span>
|
216
|
+
<span class="ruby-ivar">@supports_rdf_json</span> = <span class="ruby-keyword kw">false</span>
|
217
|
+
<span class="ruby-ivar">@supports_sparql_json</span> = <span class="ruby-keyword kw">true</span>
|
218
|
+
<span class="ruby-keyword kw">end</span>
|
219
|
+
</pre>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
225
|
+
|
226
|
+
<div id="method-M000003" class="method-detail">
|
227
|
+
<a name="M000003"></a>
|
228
|
+
|
229
|
+
<div class="method-heading">
|
230
|
+
<a href="#M000003" class="method-signature">
|
231
|
+
<span class="method-name">add_default_graph</span><span class="method-args">(graph_uri)</span>
|
232
|
+
</a>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div class="method-description">
|
236
|
+
<p>
|
237
|
+
Add a default graph. This will be added as a default graph in the request
|
238
|
+
protocol
|
239
|
+
</p>
|
240
|
+
<p><a class="source-toggle" href="#"
|
241
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
242
|
+
<div class="method-source-code" id="M000003-source">
|
243
|
+
<pre>
|
244
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 45</span>
|
245
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_default_graph</span>(<span class="ruby-identifier">graph_uri</span>)
|
246
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@graphs</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
247
|
+
<span class="ruby-ivar">@graphs</span> = []
|
248
|
+
<span class="ruby-keyword kw">end</span>
|
249
|
+
<span class="ruby-ivar">@graphs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">graph_uri</span>
|
250
|
+
<span class="ruby-keyword kw">end</span>
|
251
|
+
</pre>
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
<div id="method-M000004" class="method-detail">
|
257
|
+
<a name="M000004"></a>
|
258
|
+
|
259
|
+
<div class="method-heading">
|
260
|
+
<a href="#M000004" class="method-signature">
|
261
|
+
<span class="method-name">add_named_graph</span><span class="method-args">(graph_uri)</span>
|
262
|
+
</a>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<div class="method-description">
|
266
|
+
<p>
|
267
|
+
Add a named graph. This will be added as a named graph in the request
|
268
|
+
protocol
|
269
|
+
</p>
|
270
|
+
<p><a class="source-toggle" href="#"
|
271
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
272
|
+
<div class="method-source-code" id="M000004-source">
|
273
|
+
<pre>
|
274
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 53</span>
|
275
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_named_graph</span>(<span class="ruby-identifier">graph_uri</span>)
|
276
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@named_graphs</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
277
|
+
<span class="ruby-ivar">@named_graphs</span> = []
|
278
|
+
<span class="ruby-keyword kw">end</span>
|
279
|
+
<span class="ruby-ivar">@named_graphs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">graph_uri</span>
|
280
|
+
<span class="ruby-keyword kw">end</span>
|
281
|
+
</pre>
|
282
|
+
</div>
|
283
|
+
</div>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
<div id="method-M000009" class="method-detail">
|
287
|
+
<a name="M000009"></a>
|
288
|
+
|
289
|
+
<div class="method-heading">
|
290
|
+
<a href="#M000009" class="method-signature">
|
291
|
+
<span class="method-name">ask</span><span class="method-args">(query, format=Pho::Sparql::SPARQL_RESULTS_XML)</span>
|
292
|
+
</a>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
<div class="method-description">
|
296
|
+
<p>
|
297
|
+
Perform a SPARQL ASK <a href="SparqlClient.html#M000005">query</a>.
|
298
|
+
</p>
|
299
|
+
<pre>
|
300
|
+
query:: the SPARQL query
|
301
|
+
format:: the preferred response format
|
302
|
+
</pre>
|
303
|
+
<p><a class="source-toggle" href="#"
|
304
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
305
|
+
<div class="method-source-code" id="M000009-source">
|
306
|
+
<pre>
|
307
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 130</span>
|
308
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ask</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</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">SPARQL_RESULTS_XML</span>)
|
309
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
310
|
+
<span class="ruby-keyword kw">end</span>
|
311
|
+
</pre>
|
312
|
+
</div>
|
313
|
+
</div>
|
314
|
+
</div>
|
315
|
+
|
316
|
+
<div id="method-M000008" class="method-detail">
|
317
|
+
<a name="M000008"></a>
|
318
|
+
|
319
|
+
<div class="method-heading">
|
320
|
+
<a href="#M000008" class="method-signature">
|
321
|
+
<span class="method-name">construct</span><span class="method-args">(query, format="application/rdf+xml")</span>
|
322
|
+
</a>
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div class="method-description">
|
326
|
+
<p>
|
327
|
+
Perform a SPARQL CONSTRUCT <a href="SparqlClient.html#M000005">query</a>.
|
328
|
+
</p>
|
329
|
+
<pre>
|
330
|
+
query:: the SPARQL query
|
331
|
+
format:: the preferred response format
|
332
|
+
</pre>
|
333
|
+
<p><a class="source-toggle" href="#"
|
334
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
335
|
+
<div class="method-source-code" id="M000008-source">
|
336
|
+
<pre>
|
337
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 122</span>
|
338
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">construct</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>)
|
339
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
340
|
+
<span class="ruby-keyword kw">end</span>
|
341
|
+
</pre>
|
342
|
+
</div>
|
343
|
+
</div>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
<div id="method-M000006" class="method-detail">
|
347
|
+
<a name="M000006"></a>
|
348
|
+
|
349
|
+
<div class="method-heading">
|
350
|
+
<a href="#M000006" class="method-signature">
|
351
|
+
<span class="method-name">describe</span><span class="method-args">(query, format="application/rdf+xml")</span>
|
352
|
+
</a>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
<div class="method-description">
|
356
|
+
<p>
|
357
|
+
Perform a SPARQL DESCRIBE <a href="SparqlClient.html#M000005">query</a>.
|
358
|
+
</p>
|
359
|
+
<pre>
|
360
|
+
query:: the SPARQL query
|
361
|
+
format:: the preferred response format
|
362
|
+
</pre>
|
363
|
+
<p><a class="source-toggle" href="#"
|
364
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
365
|
+
<div class="method-source-code" id="M000006-source">
|
366
|
+
<pre>
|
367
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 101</span>
|
368
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">describe</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>)
|
369
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
370
|
+
<span class="ruby-keyword kw">end</span>
|
371
|
+
</pre>
|
372
|
+
</div>
|
373
|
+
</div>
|
374
|
+
</div>
|
375
|
+
|
376
|
+
<div id="method-M000007" class="method-detail">
|
377
|
+
<a name="M000007"></a>
|
378
|
+
|
379
|
+
<div class="method-heading">
|
380
|
+
<a href="#M000007" class="method-signature">
|
381
|
+
<span class="method-name">multi_describe</span><span class="method-args">(uris, format="application/rdf+xml")</span>
|
382
|
+
</a>
|
383
|
+
</div>
|
384
|
+
|
385
|
+
<div class="method-description">
|
386
|
+
<p>
|
387
|
+
DESCRIBE multiple resources in a single <a
|
388
|
+
href="SparqlClient.html#M000005">query</a>. The provided array should
|
389
|
+
contain the uris that are to be described
|
390
|
+
</p>
|
391
|
+
<p>
|
392
|
+
This will generate a <a href="SparqlClient.html#M000005">query</a> like:
|
393
|
+
</p>
|
394
|
+
<pre>
|
395
|
+
DESCRIBE <http://www.example.org> <http://www.example.com> ...
|
396
|
+
|
397
|
+
uris:: list of the uris to be described
|
398
|
+
format:: the preferred response format. Default is RDF/XML
|
399
|
+
</pre>
|
400
|
+
<p><a class="source-toggle" href="#"
|
401
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
402
|
+
<div class="method-source-code" id="M000007-source">
|
403
|
+
<pre>
|
404
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 113</span>
|
405
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">multi_describe</span>(<span class="ruby-identifier">uris</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>)
|
406
|
+
<span class="ruby-identifier">query</span> = <span class="ruby-value str">"DESCRIBE "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uris</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">u</span><span class="ruby-operator">|</span> <span class="ruby-node">"<#{u}>"</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">" "</span>)
|
407
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
408
|
+
<span class="ruby-keyword kw">end</span>
|
409
|
+
</pre>
|
410
|
+
</div>
|
411
|
+
</div>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
<div id="method-M000005" class="method-detail">
|
415
|
+
<a name="M000005"></a>
|
416
|
+
|
417
|
+
<div class="method-heading">
|
418
|
+
<a href="#M000005" class="method-signature">
|
419
|
+
<span class="method-name">query</span><span class="method-args">(sparql, format=nil, graphs=nil, named_graphs=nil)</span>
|
420
|
+
</a>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
<div class="method-description">
|
424
|
+
<p>
|
425
|
+
Perform a sparql <a href="SparqlClient.html#M000005">query</a>
|
426
|
+
</p>
|
427
|
+
<pre>
|
428
|
+
sparql:: a valid SPARQL query
|
429
|
+
format:: specific a request format. Usually a media-type, but may be a name for a type, if not using Conneg
|
430
|
+
graphs:: an array of default graphs
|
431
|
+
named_graphs:: an array of named graphs
|
432
|
+
</pre>
|
433
|
+
<p><a class="source-toggle" href="#"
|
434
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
435
|
+
<div class="method-source-code" id="M000005-source">
|
436
|
+
<pre>
|
437
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 66</span>
|
438
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">sparql</span>, <span class="ruby-identifier">format</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">graphs</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">named_graphs</span>=<span class="ruby-keyword kw">nil</span>)
|
439
|
+
|
440
|
+
<span class="ruby-identifier">params</span> = {}
|
441
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"query"</span>] = <span class="ruby-identifier">sparql</span>
|
442
|
+
|
443
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">graphs</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
444
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"default-graph-uri"</span>] = <span class="ruby-identifier">graphs</span>
|
445
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@graphs</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
446
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"default-graph-uri"</span>] = <span class="ruby-ivar">@graphs</span>
|
447
|
+
<span class="ruby-keyword kw">end</span>
|
448
|
+
|
449
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">named_graphs</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
450
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"named-graph-uri"</span>] = <span class="ruby-identifier">named_graphs</span>
|
451
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@named_graphs</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
452
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"named-graph-uri"</span>] = <span class="ruby-ivar">@named_graphs</span>
|
453
|
+
<span class="ruby-keyword kw">end</span>
|
454
|
+
|
455
|
+
<span class="ruby-identifier">headers</span> = {}
|
456
|
+
<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>
|
457
|
+
|
458
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@output_parameter_name</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
459
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-ivar">@output_parameter_name</span>] = <span class="ruby-identifier">format</span>
|
460
|
+
<span class="ruby-keyword kw">else</span>
|
461
|
+
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"Accept"</span>] = <span class="ruby-identifier">format</span>
|
462
|
+
<span class="ruby-keyword kw">end</span>
|
463
|
+
|
464
|
+
<span class="ruby-keyword kw">end</span>
|
465
|
+
|
466
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>( <span class="ruby-ivar">@endpoint</span>, <span class="ruby-identifier">params</span>, <span class="ruby-identifier">headers</span> )
|
467
|
+
<span class="ruby-keyword kw">end</span>
|
468
|
+
</pre>
|
469
|
+
</div>
|
470
|
+
</div>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
<div id="method-M000010" class="method-detail">
|
474
|
+
<a name="M000010"></a>
|
475
|
+
|
476
|
+
<div class="method-heading">
|
477
|
+
<a href="#M000010" class="method-signature">
|
478
|
+
<span class="method-name">select</span><span class="method-args">(query, format=Pho::Sparql::SPARQL_RESULTS_XML)</span>
|
479
|
+
</a>
|
480
|
+
</div>
|
481
|
+
|
482
|
+
<div class="method-description">
|
483
|
+
<p>
|
484
|
+
Perform a SPARQL SELECT <a href="SparqlClient.html#M000005">query</a>.
|
485
|
+
</p>
|
486
|
+
<pre>
|
487
|
+
query:: the SPARQL query
|
488
|
+
format:: the preferred response format
|
489
|
+
</pre>
|
490
|
+
<p><a class="source-toggle" href="#"
|
491
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
492
|
+
<div class="method-source-code" id="M000010-source">
|
493
|
+
<pre>
|
494
|
+
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 138</span>
|
495
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</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">SPARQL_RESULTS_XML</span>)
|
496
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
497
|
+
<span class="ruby-keyword kw">end</span>
|
498
|
+
</pre>
|
499
|
+
</div>
|
500
|
+
</div>
|
501
|
+
</div>
|
502
|
+
|
503
|
+
|
504
|
+
</div>
|
505
|
+
|
506
|
+
|
507
|
+
</div>
|
508
|
+
|
509
|
+
|
510
|
+
<div id="validator-badges">
|
511
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
512
|
+
</div>
|
513
|
+
|
514
|
+
</body>
|
515
|
+
</html>
|