pho 0.7.2 → 0.7.3
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 +5 -0
- data/Rakefile +1 -1
- data/lib/pho/snapshot.rb +6 -1
- data/lib/pho/sparql.rb +4 -1
- data/tests/tc_snapshots.rb +14 -1
- data/tests/tc_sparql_helper.rb +23 -0
- metadata +60 -160
- data/doc/rdoc/classes/Pho/Analyzers.html +0 -310
- data/doc/rdoc/classes/Pho/CommandLine.html +0 -770
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +0 -241
- data/doc/rdoc/classes/Pho/Enrichment/StoreEnricher.html +0 -410
- data/doc/rdoc/classes/Pho/Enrichment.html +0 -119
- data/doc/rdoc/classes/Pho/Etags.html +0 -310
- data/doc/rdoc/classes/Pho/Facet/Results.html +0 -299
- data/doc/rdoc/classes/Pho/Facet/Term.html +0 -177
- data/doc/rdoc/classes/Pho/Facet.html +0 -119
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +0 -668
- data/doc/rdoc/classes/Pho/FieldWeighting.html +0 -230
- data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +0 -478
- data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +0 -264
- data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +0 -259
- data/doc/rdoc/classes/Pho/FileManagement.html +0 -121
- data/doc/rdoc/classes/Pho/Job.html +0 -627
- data/doc/rdoc/classes/Pho/JobUpdate.html +0 -141
- data/doc/rdoc/classes/Pho/Jobs.html +0 -538
- data/doc/rdoc/classes/Pho/Namespaces.html +0 -164
- data/doc/rdoc/classes/Pho/OAI/Record.html +0 -165
- data/doc/rdoc/classes/Pho/OAI/Records.html +0 -331
- data/doc/rdoc/classes/Pho/OAI.html +0 -118
- data/doc/rdoc/classes/Pho/QueryProfile.html +0 -497
- data/doc/rdoc/classes/Pho/RDF/Parser.html +0 -279
- data/doc/rdoc/classes/Pho/RDF.html +0 -120
- data/doc/rdoc/classes/Pho/RDFCollection.html +0 -119
- data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +0 -325
- data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +0 -241
- data/doc/rdoc/classes/Pho/ResourceHash.html +0 -123
- data/doc/rdoc/classes/Pho/Snapshot.html +0 -397
- data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +0 -594
- data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +0 -692
- data/doc/rdoc/classes/Pho/Sparql.html +0 -187
- data/doc/rdoc/classes/Pho/Status.html +0 -296
- data/doc/rdoc/classes/Pho/Store.html +0 -1560
- data/doc/rdoc/classes/Pho/StoreSparqlClient.html +0 -183
- data/doc/rdoc/classes/Pho/Update/Changeset.html +0 -521
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +0 -330
- data/doc/rdoc/classes/Pho/Update/ChangesetHelper.html +0 -159
- data/doc/rdoc/classes/Pho/Update/Changesets.html +0 -205
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +0 -257
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +0 -237
- data/doc/rdoc/classes/Pho/Update/Statement.html +0 -303
- data/doc/rdoc/classes/Pho/Update.html +0 -128
- data/doc/rdoc/classes/Pho.html +0 -283
- data/doc/rdoc/classes/String.html +0 -146
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/CHANGES.html +0 -351
- data/doc/rdoc/files/README.html +0 -191
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/changeset_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/command_line_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/converter_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/enrichment_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/etags_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/facet_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/file_management_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/file_manager_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/job_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/oai_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/rdf_rb.html +0 -108
- data/doc/rdoc/files/lib/pho/resource_hash_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/snapshot_rb.html +0 -109
- data/doc/rdoc/files/lib/pho/sparql_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/status_rb.html +0 -101
- data/doc/rdoc/files/lib/pho/store_rb.html +0 -108
- data/doc/rdoc/files/lib/pho_rb.html +0 -133
- data/doc/rdoc/fr_class_index.html +0 -72
- data/doc/rdoc/fr_file_index.html +0 -49
- data/doc/rdoc/fr_method_index.html +0 -237
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
|
@@ -1,594 +0,0 @@
|
|
|
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="#M000010">ask</a>
|
|
98
|
-
<a href="#M000009">construct</a>
|
|
99
|
-
<a href="#M000007">describe</a>
|
|
100
|
-
<a href="#M000006">describe_uri</a>
|
|
101
|
-
<a href="#M000008">multi_describe</a>
|
|
102
|
-
<a href="#M000002">new</a>
|
|
103
|
-
<a href="#M000005">query</a>
|
|
104
|
-
<a href="#M000011">select</a>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<!-- if includes -->
|
|
112
|
-
|
|
113
|
-
<div id="section">
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<div id="attribute-list">
|
|
120
|
-
<h3 class="section-bar">Attributes</h3>
|
|
121
|
-
|
|
122
|
-
<div class="name-list">
|
|
123
|
-
<table>
|
|
124
|
-
<tr class="top-aligned-row context-row">
|
|
125
|
-
<td class="context-item-name">client</td>
|
|
126
|
-
<td class="context-item-value"> [R] </td>
|
|
127
|
-
<td class="context-item-desc">
|
|
128
|
-
HTTPClient object
|
|
129
|
-
|
|
130
|
-
</td>
|
|
131
|
-
</tr>
|
|
132
|
-
<tr class="top-aligned-row context-row">
|
|
133
|
-
<td class="context-item-name">endpoint</td>
|
|
134
|
-
<td class="context-item-value"> [R] </td>
|
|
135
|
-
<td class="context-item-desc">
|
|
136
|
-
URI of the endpoint
|
|
137
|
-
|
|
138
|
-
</td>
|
|
139
|
-
</tr>
|
|
140
|
-
<tr class="top-aligned-row context-row">
|
|
141
|
-
<td class="context-item-name">graphs</td>
|
|
142
|
-
<td class="context-item-value"> [R] </td>
|
|
143
|
-
<td class="context-item-desc"></td>
|
|
144
|
-
</tr>
|
|
145
|
-
<tr class="top-aligned-row context-row">
|
|
146
|
-
<td class="context-item-name">named_graphs</td>
|
|
147
|
-
<td class="context-item-value"> [R] </td>
|
|
148
|
-
<td class="context-item-desc"></td>
|
|
149
|
-
</tr>
|
|
150
|
-
<tr class="top-aligned-row context-row">
|
|
151
|
-
<td class="context-item-name">output_parameter_name</td>
|
|
152
|
-
<td class="context-item-value"> [RW] </td>
|
|
153
|
-
<td class="context-item-desc">
|
|
154
|
-
Name of output parameter to use to control response format. If set then
|
|
155
|
-
this parameter is added to the <a
|
|
156
|
-
href="SparqlClient.html#M000005">query</a> string, rather than using
|
|
157
|
-
Content Negotiation
|
|
158
|
-
|
|
159
|
-
</td>
|
|
160
|
-
</tr>
|
|
161
|
-
<tr class="top-aligned-row context-row">
|
|
162
|
-
<td class="context-item-name">supports_rdf_json</td>
|
|
163
|
-
<td class="context-item-value"> [RW] </td>
|
|
164
|
-
<td class="context-item-desc">
|
|
165
|
-
Configures whether the remote endpoint supports the <a
|
|
166
|
-
href="../RDF.html">RDF</a>-in-JSON specification for serializing <a
|
|
167
|
-
href="../RDF.html">RDF</a> graphs as JSON. Will default to false.
|
|
168
|
-
|
|
169
|
-
</td>
|
|
170
|
-
</tr>
|
|
171
|
-
<tr class="top-aligned-row context-row">
|
|
172
|
-
<td class="context-item-name">supports_sparql_json</td>
|
|
173
|
-
<td class="context-item-value"> [RW] </td>
|
|
174
|
-
<td class="context-item-desc">
|
|
175
|
-
Configures whether the remote endpoint supports SPARQL JSON Results format
|
|
176
|
-
Will default to true.
|
|
177
|
-
|
|
178
|
-
</td>
|
|
179
|
-
</tr>
|
|
180
|
-
</table>
|
|
181
|
-
</div>
|
|
182
|
-
</div>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<!-- if method_list -->
|
|
187
|
-
<div id="methods">
|
|
188
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
189
|
-
|
|
190
|
-
<div id="method-M000002" class="method-detail">
|
|
191
|
-
<a name="M000002"></a>
|
|
192
|
-
|
|
193
|
-
<div class="method-heading">
|
|
194
|
-
<a href="#M000002" class="method-signature">
|
|
195
|
-
<span class="method-name">new</span><span class="method-args">(endpoint, client=HTTPClient.new() )</span>
|
|
196
|
-
</a>
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
<div class="method-description">
|
|
200
|
-
<p>
|
|
201
|
-
Initialize a client for a specific endpoint
|
|
202
|
-
</p>
|
|
203
|
-
<table>
|
|
204
|
-
<tr><td valign="top">endpoint:</td><td>uri of the SPARQL endpoint
|
|
205
|
-
|
|
206
|
-
</td></tr>
|
|
207
|
-
<tr><td valign="top">client:</td><td>optionally, a reference to an existing HTTPClient object instance
|
|
208
|
-
|
|
209
|
-
</td></tr>
|
|
210
|
-
</table>
|
|
211
|
-
<p><a class="source-toggle" href="#"
|
|
212
|
-
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
213
|
-
<div class="method-source-code" id="M000002-source">
|
|
214
|
-
<pre>
|
|
215
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 121</span>
|
|
216
|
-
<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>() )
|
|
217
|
-
<span class="ruby-ivar">@endpoint</span> = <span class="ruby-identifier">endpoint</span>
|
|
218
|
-
<span class="ruby-ivar">@graphs</span> = <span class="ruby-keyword kw">nil</span>
|
|
219
|
-
<span class="ruby-ivar">@named_graphs</span> = <span class="ruby-keyword kw">nil</span>
|
|
220
|
-
<span class="ruby-ivar">@client</span> = <span class="ruby-identifier">client</span>
|
|
221
|
-
<span class="ruby-ivar">@output_parameter_name</span> = <span class="ruby-keyword kw">nil</span>
|
|
222
|
-
<span class="ruby-ivar">@supports_rdf_json</span> = <span class="ruby-keyword kw">false</span>
|
|
223
|
-
<span class="ruby-ivar">@supports_sparql_json</span> = <span class="ruby-keyword kw">true</span>
|
|
224
|
-
<span class="ruby-keyword kw">end</span>
|
|
225
|
-
</pre>
|
|
226
|
-
</div>
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
229
|
-
|
|
230
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
231
|
-
|
|
232
|
-
<div id="method-M000003" class="method-detail">
|
|
233
|
-
<a name="M000003"></a>
|
|
234
|
-
|
|
235
|
-
<div class="method-heading">
|
|
236
|
-
<a href="#M000003" class="method-signature">
|
|
237
|
-
<span class="method-name">add_default_graph</span><span class="method-args">(graph_uri)</span>
|
|
238
|
-
</a>
|
|
239
|
-
</div>
|
|
240
|
-
|
|
241
|
-
<div class="method-description">
|
|
242
|
-
<p>
|
|
243
|
-
Add a default graph. This will be added as a default graph in the request
|
|
244
|
-
protocol
|
|
245
|
-
</p>
|
|
246
|
-
<p><a class="source-toggle" href="#"
|
|
247
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
248
|
-
<div class="method-source-code" id="M000003-source">
|
|
249
|
-
<pre>
|
|
250
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 132</span>
|
|
251
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_default_graph</span>(<span class="ruby-identifier">graph_uri</span>)
|
|
252
|
-
<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>
|
|
253
|
-
<span class="ruby-ivar">@graphs</span> = []
|
|
254
|
-
<span class="ruby-keyword kw">end</span>
|
|
255
|
-
<span class="ruby-ivar">@graphs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">graph_uri</span>
|
|
256
|
-
<span class="ruby-keyword kw">end</span>
|
|
257
|
-
</pre>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
</div>
|
|
261
|
-
|
|
262
|
-
<div id="method-M000004" class="method-detail">
|
|
263
|
-
<a name="M000004"></a>
|
|
264
|
-
|
|
265
|
-
<div class="method-heading">
|
|
266
|
-
<a href="#M000004" class="method-signature">
|
|
267
|
-
<span class="method-name">add_named_graph</span><span class="method-args">(graph_uri)</span>
|
|
268
|
-
</a>
|
|
269
|
-
</div>
|
|
270
|
-
|
|
271
|
-
<div class="method-description">
|
|
272
|
-
<p>
|
|
273
|
-
Add a named graph. This will be added as a named graph in the request
|
|
274
|
-
protocol
|
|
275
|
-
</p>
|
|
276
|
-
<p><a class="source-toggle" href="#"
|
|
277
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
278
|
-
<div class="method-source-code" id="M000004-source">
|
|
279
|
-
<pre>
|
|
280
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 140</span>
|
|
281
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_named_graph</span>(<span class="ruby-identifier">graph_uri</span>)
|
|
282
|
-
<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>
|
|
283
|
-
<span class="ruby-ivar">@named_graphs</span> = []
|
|
284
|
-
<span class="ruby-keyword kw">end</span>
|
|
285
|
-
<span class="ruby-ivar">@named_graphs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">graph_uri</span>
|
|
286
|
-
<span class="ruby-keyword kw">end</span>
|
|
287
|
-
</pre>
|
|
288
|
-
</div>
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
|
|
292
|
-
<div id="method-M000010" class="method-detail">
|
|
293
|
-
<a name="M000010"></a>
|
|
294
|
-
|
|
295
|
-
<div class="method-heading">
|
|
296
|
-
<a href="#M000010" class="method-signature">
|
|
297
|
-
<span class="method-name">ask</span><span class="method-args">(query, format=Pho::Sparql::SPARQL_RESULTS_XML)</span>
|
|
298
|
-
</a>
|
|
299
|
-
</div>
|
|
300
|
-
|
|
301
|
-
<div class="method-description">
|
|
302
|
-
<p>
|
|
303
|
-
Perform a SPARQL ASK <a href="SparqlClient.html#M000005">query</a>.
|
|
304
|
-
</p>
|
|
305
|
-
<table>
|
|
306
|
-
<tr><td valign="top"><a href="SparqlClient.html#M000005">query</a>:</td><td>the SPARQL <a href="SparqlClient.html#M000005">query</a>
|
|
307
|
-
|
|
308
|
-
</td></tr>
|
|
309
|
-
<tr><td valign="top">format:</td><td>the preferred response format
|
|
310
|
-
|
|
311
|
-
</td></tr>
|
|
312
|
-
</table>
|
|
313
|
-
<p><a class="source-toggle" href="#"
|
|
314
|
-
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
|
315
|
-
<div class="method-source-code" id="M000010-source">
|
|
316
|
-
<pre>
|
|
317
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 231</span>
|
|
318
|
-
<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>)
|
|
319
|
-
<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>)
|
|
320
|
-
<span class="ruby-keyword kw">end</span>
|
|
321
|
-
</pre>
|
|
322
|
-
</div>
|
|
323
|
-
</div>
|
|
324
|
-
</div>
|
|
325
|
-
|
|
326
|
-
<div id="method-M000009" class="method-detail">
|
|
327
|
-
<a name="M000009"></a>
|
|
328
|
-
|
|
329
|
-
<div class="method-heading">
|
|
330
|
-
<a href="#M000009" class="method-signature">
|
|
331
|
-
<span class="method-name">construct</span><span class="method-args">(query, format="application/rdf+xml")</span>
|
|
332
|
-
</a>
|
|
333
|
-
</div>
|
|
334
|
-
|
|
335
|
-
<div class="method-description">
|
|
336
|
-
<p>
|
|
337
|
-
Perform a SPARQL CONSTRUCT <a href="SparqlClient.html#M000005">query</a>.
|
|
338
|
-
</p>
|
|
339
|
-
<table>
|
|
340
|
-
<tr><td valign="top"><a href="SparqlClient.html#M000005">query</a>:</td><td>the SPARQL <a href="SparqlClient.html#M000005">query</a>
|
|
341
|
-
|
|
342
|
-
</td></tr>
|
|
343
|
-
<tr><td valign="top">format:</td><td>the preferred response format
|
|
344
|
-
|
|
345
|
-
</td></tr>
|
|
346
|
-
</table>
|
|
347
|
-
<p><a class="source-toggle" href="#"
|
|
348
|
-
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
|
349
|
-
<div class="method-source-code" id="M000009-source">
|
|
350
|
-
<pre>
|
|
351
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 223</span>
|
|
352
|
-
<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>)
|
|
353
|
-
<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>)
|
|
354
|
-
<span class="ruby-keyword kw">end</span>
|
|
355
|
-
</pre>
|
|
356
|
-
</div>
|
|
357
|
-
</div>
|
|
358
|
-
</div>
|
|
359
|
-
|
|
360
|
-
<div id="method-M000007" class="method-detail">
|
|
361
|
-
<a name="M000007"></a>
|
|
362
|
-
|
|
363
|
-
<div class="method-heading">
|
|
364
|
-
<a href="#M000007" class="method-signature">
|
|
365
|
-
<span class="method-name">describe</span><span class="method-args">(query, format="application/rdf+xml")</span>
|
|
366
|
-
</a>
|
|
367
|
-
</div>
|
|
368
|
-
|
|
369
|
-
<div class="method-description">
|
|
370
|
-
<p>
|
|
371
|
-
Perform a SPARQL DESCRIBE <a href="SparqlClient.html#M000005">query</a>.
|
|
372
|
-
</p>
|
|
373
|
-
<table>
|
|
374
|
-
<tr><td valign="top"><a href="SparqlClient.html#M000005">query</a>:</td><td>the SPARQL <a href="SparqlClient.html#M000005">query</a>
|
|
375
|
-
|
|
376
|
-
</td></tr>
|
|
377
|
-
<tr><td valign="top">format:</td><td>the preferred response format
|
|
378
|
-
|
|
379
|
-
</td></tr>
|
|
380
|
-
</table>
|
|
381
|
-
<p><a class="source-toggle" href="#"
|
|
382
|
-
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
|
383
|
-
<div class="method-source-code" id="M000007-source">
|
|
384
|
-
<pre>
|
|
385
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 202</span>
|
|
386
|
-
<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>)
|
|
387
|
-
<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>)
|
|
388
|
-
<span class="ruby-keyword kw">end</span>
|
|
389
|
-
</pre>
|
|
390
|
-
</div>
|
|
391
|
-
</div>
|
|
392
|
-
</div>
|
|
393
|
-
|
|
394
|
-
<div id="method-M000006" class="method-detail">
|
|
395
|
-
<a name="M000006"></a>
|
|
396
|
-
|
|
397
|
-
<div class="method-heading">
|
|
398
|
-
<a href="#M000006" class="method-signature">
|
|
399
|
-
<span class="method-name">describe_uri</span><span class="method-args">(uri, format="application/rdf+xml", type=:cbd)</span>
|
|
400
|
-
</a>
|
|
401
|
-
</div>
|
|
402
|
-
|
|
403
|
-
<div class="method-description">
|
|
404
|
-
<p>
|
|
405
|
-
Describe a uri, optionally specifying a form of bounded description
|
|
406
|
-
</p>
|
|
407
|
-
<table>
|
|
408
|
-
<tr><td valign="top">uri:</td><td>the uri to <a href="SparqlClient.html#M000007">describe</a>
|
|
409
|
-
|
|
410
|
-
</td></tr>
|
|
411
|
-
<tr><td valign="top">format:</td><td>mimetype for results
|
|
412
|
-
|
|
413
|
-
</td></tr>
|
|
414
|
-
<tr><td valign="top">type:</td><td>symbol indicating type of description, i.e. +:cbd+, +:scbd+, +:lcbd+, or
|
|
415
|
-
+:slcbd+
|
|
416
|
-
|
|
417
|
-
</td></tr>
|
|
418
|
-
</table>
|
|
419
|
-
<p><a class="source-toggle" href="#"
|
|
420
|
-
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
|
421
|
-
<div class="method-source-code" id="M000006-source">
|
|
422
|
-
<pre>
|
|
423
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 189</span>
|
|
424
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">describe_uri</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">type</span>=<span class="ruby-identifier">:cbd</span>)
|
|
425
|
-
<span class="ruby-identifier">template</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">DESCRIPTIONS</span>[<span class="ruby-identifier">type</span>]
|
|
426
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">template</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
|
427
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unknown description type"</span>
|
|
428
|
-
<span class="ruby-keyword kw">end</span>
|
|
429
|
-
<span class="ruby-identifier">query</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">SparqlHelper</span>.<span class="ruby-identifier">apply_initial_bindings</span>(<span class="ruby-identifier">template</span>, {<span class="ruby-value str">"uri"</span> =<span class="ruby-operator">></span> <span class="ruby-node">"<#{uri}>"</span>} )
|
|
430
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">describe</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
|
431
|
-
<span class="ruby-keyword kw">end</span>
|
|
432
|
-
</pre>
|
|
433
|
-
</div>
|
|
434
|
-
</div>
|
|
435
|
-
</div>
|
|
436
|
-
|
|
437
|
-
<div id="method-M000008" class="method-detail">
|
|
438
|
-
<a name="M000008"></a>
|
|
439
|
-
|
|
440
|
-
<div class="method-heading">
|
|
441
|
-
<a href="#M000008" class="method-signature">
|
|
442
|
-
<span class="method-name">multi_describe</span><span class="method-args">(uris, format="application/rdf+xml")</span>
|
|
443
|
-
</a>
|
|
444
|
-
</div>
|
|
445
|
-
|
|
446
|
-
<div class="method-description">
|
|
447
|
-
<p>
|
|
448
|
-
DESCRIBE multiple resources in a single <a
|
|
449
|
-
href="SparqlClient.html#M000005">query</a>. The provided array should
|
|
450
|
-
contain the uris that are to be described
|
|
451
|
-
</p>
|
|
452
|
-
<p>
|
|
453
|
-
This will generate a <a href="SparqlClient.html#M000005">query</a> like:
|
|
454
|
-
</p>
|
|
455
|
-
<pre>
|
|
456
|
-
DESCRIBE <http://www.example.org> <http://www.example.com> ...
|
|
457
|
-
</pre>
|
|
458
|
-
<table>
|
|
459
|
-
<tr><td valign="top">uris:</td><td>list of the uris to be described
|
|
460
|
-
|
|
461
|
-
</td></tr>
|
|
462
|
-
<tr><td valign="top">format:</td><td>the preferred response format. Default is <a href="../RDF.html">RDF</a>/XML
|
|
463
|
-
|
|
464
|
-
</td></tr>
|
|
465
|
-
</table>
|
|
466
|
-
<p><a class="source-toggle" href="#"
|
|
467
|
-
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
|
468
|
-
<div class="method-source-code" id="M000008-source">
|
|
469
|
-
<pre>
|
|
470
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 214</span>
|
|
471
|
-
<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>)
|
|
472
|
-
<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>)
|
|
473
|
-
<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>)
|
|
474
|
-
<span class="ruby-keyword kw">end</span>
|
|
475
|
-
</pre>
|
|
476
|
-
</div>
|
|
477
|
-
</div>
|
|
478
|
-
</div>
|
|
479
|
-
|
|
480
|
-
<div id="method-M000005" class="method-detail">
|
|
481
|
-
<a name="M000005"></a>
|
|
482
|
-
|
|
483
|
-
<div class="method-heading">
|
|
484
|
-
<a href="#M000005" class="method-signature">
|
|
485
|
-
<span class="method-name">query</span><span class="method-args">(sparql, format=nil, graphs=nil, named_graphs=nil)</span>
|
|
486
|
-
</a>
|
|
487
|
-
</div>
|
|
488
|
-
|
|
489
|
-
<div class="method-description">
|
|
490
|
-
<p>
|
|
491
|
-
Perform a sparql <a href="SparqlClient.html#M000005">query</a>
|
|
492
|
-
</p>
|
|
493
|
-
<table>
|
|
494
|
-
<tr><td valign="top">sparql:</td><td>a valid SPARQL <a href="SparqlClient.html#M000005">query</a>
|
|
495
|
-
|
|
496
|
-
</td></tr>
|
|
497
|
-
<tr><td valign="top">format:</td><td>specific a request format. Usually a media-type, but may be a name for a
|
|
498
|
-
type, if not using Conneg
|
|
499
|
-
|
|
500
|
-
</td></tr>
|
|
501
|
-
<tr><td valign="top">graphs:</td><td>an array of default graphs
|
|
502
|
-
|
|
503
|
-
</td></tr>
|
|
504
|
-
<tr><td valign="top">named_graphs:</td><td>an array of named graphs
|
|
505
|
-
|
|
506
|
-
</td></tr>
|
|
507
|
-
</table>
|
|
508
|
-
<p><a class="source-toggle" href="#"
|
|
509
|
-
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
|
510
|
-
<div class="method-source-code" id="M000005-source">
|
|
511
|
-
<pre>
|
|
512
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 153</span>
|
|
513
|
-
<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>)
|
|
514
|
-
|
|
515
|
-
<span class="ruby-identifier">params</span> = {}
|
|
516
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"query"</span>] = <span class="ruby-identifier">sparql</span>
|
|
517
|
-
|
|
518
|
-
<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>
|
|
519
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"default-graph-uri"</span>] = <span class="ruby-identifier">graphs</span>
|
|
520
|
-
<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>
|
|
521
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"default-graph-uri"</span>] = <span class="ruby-ivar">@graphs</span>
|
|
522
|
-
<span class="ruby-keyword kw">end</span>
|
|
523
|
-
|
|
524
|
-
<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>
|
|
525
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"named-graph-uri"</span>] = <span class="ruby-identifier">named_graphs</span>
|
|
526
|
-
<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>
|
|
527
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"named-graph-uri"</span>] = <span class="ruby-ivar">@named_graphs</span>
|
|
528
|
-
<span class="ruby-keyword kw">end</span>
|
|
529
|
-
|
|
530
|
-
<span class="ruby-identifier">headers</span> = {}
|
|
531
|
-
<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>
|
|
532
|
-
|
|
533
|
-
<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>
|
|
534
|
-
<span class="ruby-identifier">params</span>[<span class="ruby-ivar">@output_parameter_name</span>] = <span class="ruby-identifier">format</span>
|
|
535
|
-
<span class="ruby-keyword kw">else</span>
|
|
536
|
-
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"Accept"</span>] = <span class="ruby-identifier">format</span>
|
|
537
|
-
<span class="ruby-keyword kw">end</span>
|
|
538
|
-
|
|
539
|
-
<span class="ruby-keyword kw">end</span>
|
|
540
|
-
|
|
541
|
-
<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> )
|
|
542
|
-
<span class="ruby-keyword kw">end</span>
|
|
543
|
-
</pre>
|
|
544
|
-
</div>
|
|
545
|
-
</div>
|
|
546
|
-
</div>
|
|
547
|
-
|
|
548
|
-
<div id="method-M000011" class="method-detail">
|
|
549
|
-
<a name="M000011"></a>
|
|
550
|
-
|
|
551
|
-
<div class="method-heading">
|
|
552
|
-
<a href="#M000011" class="method-signature">
|
|
553
|
-
<span class="method-name">select</span><span class="method-args">(query, format=Pho::Sparql::SPARQL_RESULTS_XML)</span>
|
|
554
|
-
</a>
|
|
555
|
-
</div>
|
|
556
|
-
|
|
557
|
-
<div class="method-description">
|
|
558
|
-
<p>
|
|
559
|
-
Perform a SPARQL SELECT <a href="SparqlClient.html#M000005">query</a>.
|
|
560
|
-
</p>
|
|
561
|
-
<table>
|
|
562
|
-
<tr><td valign="top"><a href="SparqlClient.html#M000005">query</a>:</td><td>the SPARQL <a href="SparqlClient.html#M000005">query</a>
|
|
563
|
-
|
|
564
|
-
</td></tr>
|
|
565
|
-
<tr><td valign="top">format:</td><td>the preferred response format
|
|
566
|
-
|
|
567
|
-
</td></tr>
|
|
568
|
-
</table>
|
|
569
|
-
<p><a class="source-toggle" href="#"
|
|
570
|
-
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
|
571
|
-
<div class="method-source-code" id="M000011-source">
|
|
572
|
-
<pre>
|
|
573
|
-
<span class="ruby-comment cmt"># File lib/pho/sparql.rb, line 239</span>
|
|
574
|
-
<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>)
|
|
575
|
-
<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>)
|
|
576
|
-
<span class="ruby-keyword kw">end</span>
|
|
577
|
-
</pre>
|
|
578
|
-
</div>
|
|
579
|
-
</div>
|
|
580
|
-
</div>
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
</div>
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
</div>
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
<div id="validator-badges">
|
|
590
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
591
|
-
</div>
|
|
592
|
-
|
|
593
|
-
</body>
|
|
594
|
-
</html>
|