pho 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- 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,497 +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::QueryProfile</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::QueryProfile</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/pho/query_profile_rb.html">
|
59
|
-
lib/pho/query_profile.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
|
-
Models the <a href="QueryProfile.html">QueryProfile</a> configuration
|
84
|
-
associated with a Platform store
|
85
|
-
</p>
|
86
|
-
<p>
|
87
|
-
Class methods exist to read a <a href="QueryProfile.html">QueryProfile</a>
|
88
|
-
from a store, providing some convenience over the basic <a
|
89
|
-
href="Store.html">Store</a> methods.
|
90
|
-
</p>
|
91
|
-
|
92
|
-
</div>
|
93
|
-
|
94
|
-
|
95
|
-
</div>
|
96
|
-
|
97
|
-
<div id="method-list">
|
98
|
-
<h3 class="section-bar">Methods</h3>
|
99
|
-
|
100
|
-
<div class="name-list">
|
101
|
-
<a href="#M000134"><<</a>
|
102
|
-
<a href="#M000132">create_weighting</a>
|
103
|
-
<a href="#M000135">get_by_name</a>
|
104
|
-
<a href="#M000138">mapped_name?</a>
|
105
|
-
<a href="#M000133">new</a>
|
106
|
-
<a href="#M000131">read_from_store</a>
|
107
|
-
<a href="#M000137">remove</a>
|
108
|
-
<a href="#M000136">remove_by_name</a>
|
109
|
-
<a href="#M000139">to_rdf</a>
|
110
|
-
<a href="#M000140">upload</a>
|
111
|
-
</div>
|
112
|
-
</div>
|
113
|
-
|
114
|
-
</div>
|
115
|
-
|
116
|
-
|
117
|
-
<!-- if includes -->
|
118
|
-
|
119
|
-
<div id="section">
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
<div id="attribute-list">
|
126
|
-
<h3 class="section-bar">Attributes</h3>
|
127
|
-
|
128
|
-
<div class="name-list">
|
129
|
-
<table>
|
130
|
-
<tr class="top-aligned-row context-row">
|
131
|
-
<td class="context-item-name">field_weights</td>
|
132
|
-
<td class="context-item-value"> [R] </td>
|
133
|
-
<td class="context-item-desc">
|
134
|
-
The list of field weightings
|
135
|
-
|
136
|
-
</td>
|
137
|
-
</tr>
|
138
|
-
<tr class="top-aligned-row context-row">
|
139
|
-
<td class="context-item-name">label</td>
|
140
|
-
<td class="context-item-value"> [R] </td>
|
141
|
-
<td class="context-item-desc">
|
142
|
-
Label associated with the resource in the Platform config
|
143
|
-
|
144
|
-
</td>
|
145
|
-
</tr>
|
146
|
-
<tr class="top-aligned-row context-row">
|
147
|
-
<td class="context-item-name">uri</td>
|
148
|
-
<td class="context-item-value"> [R] </td>
|
149
|
-
<td class="context-item-desc">
|
150
|
-
URI for this resource
|
151
|
-
|
152
|
-
</td>
|
153
|
-
</tr>
|
154
|
-
</table>
|
155
|
-
</div>
|
156
|
-
</div>
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
<!-- if method_list -->
|
161
|
-
<div id="methods">
|
162
|
-
<h3 class="section-bar">Public Class methods</h3>
|
163
|
-
|
164
|
-
<div id="method-M000132" class="method-detail">
|
165
|
-
<a name="M000132"></a>
|
166
|
-
|
167
|
-
<div class="method-heading">
|
168
|
-
<a href="#M000132" class="method-signature">
|
169
|
-
<span class="method-name">create_weighting</span><span class="method-args">(store, name, weight)</span>
|
170
|
-
</a>
|
171
|
-
</div>
|
172
|
-
|
173
|
-
<div class="method-description">
|
174
|
-
<p>
|
175
|
-
Create a <a href="FieldWeighting.html">FieldWeighting</a> object suitable
|
176
|
-
for adding to this store. Will ensure that the name of the propery is valid
|
177
|
-
according to the Platform naming rules
|
178
|
-
</p>
|
179
|
-
<table>
|
180
|
-
<tr><td valign="top">store:</td><td>the store that the weighting is to be created for
|
181
|
-
|
182
|
-
</td></tr>
|
183
|
-
<tr><td valign="top">name:</td><td>name of the field to be weighted
|
184
|
-
|
185
|
-
</td></tr>
|
186
|
-
<tr><td valign="top">weight:</td><td>the weighting of the field
|
187
|
-
|
188
|
-
</td></tr>
|
189
|
-
</table>
|
190
|
-
<p><a class="source-toggle" href="#"
|
191
|
-
onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
|
192
|
-
<div class="method-source-code" id="M000132-source">
|
193
|
-
<pre>
|
194
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 84</span>
|
195
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">QueryProfile</span>.<span class="ruby-identifier">create_weighting</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">weight</span>)
|
196
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">name</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^[a-zA-Z][a-zA-Z0-9]*$/</span>)
|
197
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Name does not conform to regular expression: ^[a-zA-Z][a-zA-Z0-9]*$"</span>
|
198
|
-
<span class="ruby-keyword kw">end</span>
|
199
|
-
|
200
|
-
<span class="ruby-identifier">weight_uri</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-node">"/config/queryprofiles/1##{name}"</span>)
|
201
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">FieldWeighting</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">weight_uri</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">weight</span>)
|
202
|
-
|
203
|
-
<span class="ruby-keyword kw">end</span>
|
204
|
-
</pre>
|
205
|
-
</div>
|
206
|
-
</div>
|
207
|
-
</div>
|
208
|
-
|
209
|
-
<div id="method-M000133" class="method-detail">
|
210
|
-
<a name="M000133"></a>
|
211
|
-
|
212
|
-
<div class="method-heading">
|
213
|
-
<a href="#M000133" class="method-signature">
|
214
|
-
<span class="method-name">new</span><span class="method-args">(uri, label, field_weights=Array.new)</span>
|
215
|
-
</a>
|
216
|
-
</div>
|
217
|
-
|
218
|
-
<div class="method-description">
|
219
|
-
<p><a class="source-toggle" href="#"
|
220
|
-
onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
|
221
|
-
<div class="method-source-code" id="M000133-source">
|
222
|
-
<pre>
|
223
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 94</span>
|
224
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">field_weights</span>=<span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>)
|
225
|
-
<span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">uri</span>
|
226
|
-
<span class="ruby-ivar">@label</span> = <span class="ruby-identifier">label</span>
|
227
|
-
<span class="ruby-ivar">@field_weights</span> = <span class="ruby-identifier">field_weights</span>
|
228
|
-
<span class="ruby-keyword kw">end</span>
|
229
|
-
</pre>
|
230
|
-
</div>
|
231
|
-
</div>
|
232
|
-
</div>
|
233
|
-
|
234
|
-
<div id="method-M000131" class="method-detail">
|
235
|
-
<a name="M000131"></a>
|
236
|
-
|
237
|
-
<div class="method-heading">
|
238
|
-
<a href="#M000131" class="method-signature">
|
239
|
-
<span class="method-name">read_from_store</span><span class="method-args">(store)</span>
|
240
|
-
</a>
|
241
|
-
</div>
|
242
|
-
|
243
|
-
<div class="method-description">
|
244
|
-
<p><a class="source-toggle" href="#"
|
245
|
-
onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
|
246
|
-
<div class="method-source-code" id="M000131-source">
|
247
|
-
<pre>
|
248
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 53</span>
|
249
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">QueryProfile</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
|
250
|
-
<span class="ruby-identifier">resp</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">get_query_profile</span>(<span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">ACCEPT_JSON</span>)
|
251
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">200</span>
|
252
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Unable to read Query Profile from store. Response code was #{resp.status}"</span>
|
253
|
-
<span class="ruby-keyword kw">end</span>
|
254
|
-
|
255
|
-
<span class="ruby-identifier">qp_uri</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/config/queryprofiles/1"</span>)
|
256
|
-
|
257
|
-
<span class="ruby-identifier">json</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">content</span> )
|
258
|
-
|
259
|
-
<span class="ruby-identifier">label</span> = <span class="ruby-identifier">json</span>[<span class="ruby-identifier">qp_uri</span>][<span class="ruby-value str">"http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">"value"</span>]
|
260
|
-
<span class="ruby-identifier">qp</span> = <span class="ruby-constant">QueryProfile</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">qp_uri</span>, <span class="ruby-identifier">label</span>)
|
261
|
-
|
262
|
-
<span class="ruby-identifier">field_weights</span> = <span class="ruby-identifier">json</span>[<span class="ruby-identifier">qp_uri</span>][<span class="ruby-value str">"http:\/\/schemas.talis.com\/2006\/bigfoot\/configuration#fieldWeight"</span>]
|
263
|
-
<span class="ruby-identifier">field_weights</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span>
|
264
|
-
<span class="ruby-identifier">property</span> = <span class="ruby-identifier">json</span>[<span class="ruby-identifier">uri</span>[<span class="ruby-value str">"value"</span>]]
|
265
|
-
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">property</span>[<span class="ruby-value str">"http:\/\/schemas.talis.com\/2006\/frame\/schema#name"</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">"value"</span>]
|
266
|
-
<span class="ruby-identifier">weight</span> = <span class="ruby-identifier">property</span>[<span class="ruby-value str">"http:\/\/schemas.talis.com\/2006\/bigfoot\/configuration#weight"</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">"value"</span>]
|
267
|
-
<span class="ruby-identifier">qp</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">FieldWeighting</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>[<span class="ruby-value str">"value"</span>], <span class="ruby-identifier">name</span>, <span class="ruby-identifier">weight</span>)
|
268
|
-
}
|
269
|
-
|
270
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">qp</span>
|
271
|
-
|
272
|
-
<span class="ruby-keyword kw">end</span>
|
273
|
-
</pre>
|
274
|
-
</div>
|
275
|
-
</div>
|
276
|
-
</div>
|
277
|
-
|
278
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
279
|
-
|
280
|
-
<div id="method-M000134" class="method-detail">
|
281
|
-
<a name="M000134"></a>
|
282
|
-
|
283
|
-
<div class="method-heading">
|
284
|
-
<a href="#M000134" class="method-signature">
|
285
|
-
<span class="method-name"><<</span><span class="method-args">(weight)</span>
|
286
|
-
</a>
|
287
|
-
</div>
|
288
|
-
|
289
|
-
<div class="method-description">
|
290
|
-
<p><a class="source-toggle" href="#"
|
291
|
-
onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
|
292
|
-
<div class="method-source-code" id="M000134-source">
|
293
|
-
<pre>
|
294
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 100</span>
|
295
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-operator"><<</span>(<span class="ruby-identifier">weight</span>)
|
296
|
-
<span class="ruby-ivar">@field_weights</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">weight</span>
|
297
|
-
<span class="ruby-keyword kw">end</span>
|
298
|
-
</pre>
|
299
|
-
</div>
|
300
|
-
</div>
|
301
|
-
</div>
|
302
|
-
|
303
|
-
<div id="method-M000135" class="method-detail">
|
304
|
-
<a name="M000135"></a>
|
305
|
-
|
306
|
-
<div class="method-heading">
|
307
|
-
<a href="#M000135" class="method-signature">
|
308
|
-
<span class="method-name">get_by_name</span><span class="method-args">(name)</span>
|
309
|
-
</a>
|
310
|
-
</div>
|
311
|
-
|
312
|
-
<div class="method-description">
|
313
|
-
<p>
|
314
|
-
Retrieve a FieldWeighing by name
|
315
|
-
</p>
|
316
|
-
<p><a class="source-toggle" href="#"
|
317
|
-
onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
|
318
|
-
<div class="method-source-code" id="M000135-source">
|
319
|
-
<pre>
|
320
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 105</span>
|
321
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>)
|
322
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@field_weights</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">field</span><span class="ruby-operator">|</span> <span class="ruby-identifier">field</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> }
|
323
|
-
<span class="ruby-keyword kw">end</span>
|
324
|
-
</pre>
|
325
|
-
</div>
|
326
|
-
</div>
|
327
|
-
</div>
|
328
|
-
|
329
|
-
<div id="method-M000138" class="method-detail">
|
330
|
-
<a name="M000138"></a>
|
331
|
-
|
332
|
-
<div class="method-heading">
|
333
|
-
<a href="#M000138" class="method-signature">
|
334
|
-
<span class="method-name">mapped_name?</span><span class="method-args">(name)</span>
|
335
|
-
</a>
|
336
|
-
</div>
|
337
|
-
|
338
|
-
<div class="method-description">
|
339
|
-
<p>
|
340
|
-
Is there a field weighting for a property with this name?
|
341
|
-
</p>
|
342
|
-
<p><a class="source-toggle" href="#"
|
343
|
-
onclick="toggleCode('M000138-source');return false;">[Source]</a></p>
|
344
|
-
<div class="method-source-code" id="M000138-source">
|
345
|
-
<pre>
|
346
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 123</span>
|
347
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapped_name?</span>(<span class="ruby-identifier">name</span>)
|
348
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
349
|
-
<span class="ruby-keyword kw">end</span>
|
350
|
-
</pre>
|
351
|
-
</div>
|
352
|
-
</div>
|
353
|
-
</div>
|
354
|
-
|
355
|
-
<div id="method-M000137" class="method-detail">
|
356
|
-
<a name="M000137"></a>
|
357
|
-
|
358
|
-
<div class="method-heading">
|
359
|
-
<a href="#M000137" class="method-signature">
|
360
|
-
<span class="method-name">remove</span><span class="method-args">(fw)</span>
|
361
|
-
</a>
|
362
|
-
</div>
|
363
|
-
|
364
|
-
<div class="method-description">
|
365
|
-
<p>
|
366
|
-
Remove a <a href="FieldWeighting.html">FieldWeighting</a> from the
|
367
|
-
collection
|
368
|
-
</p>
|
369
|
-
<p><a class="source-toggle" href="#"
|
370
|
-
onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
|
371
|
-
<div class="method-source-code" id="M000137-source">
|
372
|
-
<pre>
|
373
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 118</span>
|
374
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">fw</span>)
|
375
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@field_weights</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">fw</span>)
|
376
|
-
<span class="ruby-keyword kw">end</span>
|
377
|
-
</pre>
|
378
|
-
</div>
|
379
|
-
</div>
|
380
|
-
</div>
|
381
|
-
|
382
|
-
<div id="method-M000136" class="method-detail">
|
383
|
-
<a name="M000136"></a>
|
384
|
-
|
385
|
-
<div class="method-heading">
|
386
|
-
<a href="#M000136" class="method-signature">
|
387
|
-
<span class="method-name">remove_by_name</span><span class="method-args">(name)</span>
|
388
|
-
</a>
|
389
|
-
</div>
|
390
|
-
|
391
|
-
<div class="method-description">
|
392
|
-
<p>
|
393
|
-
Remove a <a href="FieldWeighting.html">FieldWeighting</a> by name
|
394
|
-
</p>
|
395
|
-
<p><a class="source-toggle" href="#"
|
396
|
-
onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
|
397
|
-
<div class="method-source-code" id="M000136-source">
|
398
|
-
<pre>
|
399
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 110</span>
|
400
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_by_name</span>(<span class="ruby-identifier">name</span>)
|
401
|
-
<span class="ruby-identifier">fw</span> = <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>)
|
402
|
-
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">fw</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>)
|
403
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">fw</span>)
|
404
|
-
<span class="ruby-keyword kw">end</span>
|
405
|
-
<span class="ruby-keyword kw">end</span>
|
406
|
-
</pre>
|
407
|
-
</div>
|
408
|
-
</div>
|
409
|
-
</div>
|
410
|
-
|
411
|
-
<div id="method-M000139" class="method-detail">
|
412
|
-
<a name="M000139"></a>
|
413
|
-
|
414
|
-
<div class="method-heading">
|
415
|
-
<a href="#M000139" class="method-signature">
|
416
|
-
<span class="method-name">to_rdf</span><span class="method-args">()</span>
|
417
|
-
</a>
|
418
|
-
</div>
|
419
|
-
|
420
|
-
<div class="method-description">
|
421
|
-
<p>
|
422
|
-
Dump this object to an <a href="RDF.html">RDF</a>/XML representation
|
423
|
-
suitable for submitting to the Platform
|
424
|
-
</p>
|
425
|
-
<p><a class="source-toggle" href="#"
|
426
|
-
onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
|
427
|
-
<div class="method-source-code" id="M000139-source">
|
428
|
-
<pre>
|
429
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 128</span>
|
430
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rdf</span>
|
431
|
-
<span class="ruby-identifier">rdf</span> = <span class="ruby-node">"<rdf:RDF xmlns:frm=\"#{Pho::Namespaces::FRAME}\" "</span>
|
432
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" "</span>
|
433
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" "</span>
|
434
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" xmlns:bf=\"#{Pho::Namespaces::CONFIG}\" > "</span>
|
435
|
-
|
436
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <rdf:Description rdf:about=\"#{@uri}\"> "</span>
|
437
|
-
|
438
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <rdf:type rdf:resource=\"#{Pho::Namespaces::CONFIG}QueryProfile\"/> "</span>
|
439
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <rdfs:label>#{@label}</rdfs:label> "</span>
|
440
|
-
|
441
|
-
<span class="ruby-ivar">@field_weights</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span>
|
442
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <bf:fieldWeight rdf:resource=\"#{property.uri}\"/> "</span>
|
443
|
-
<span class="ruby-keyword kw">end</span>
|
444
|
-
|
445
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" </rdf:Description>"</span>
|
446
|
-
|
447
|
-
<span class="ruby-ivar">@field_weights</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span>
|
448
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">property</span>.<span class="ruby-identifier">to_rdf</span>(<span class="ruby-keyword kw">false</span>)
|
449
|
-
<span class="ruby-keyword kw">end</span>
|
450
|
-
|
451
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</rdf:RDF>"</span>
|
452
|
-
<span class="ruby-keyword kw">end</span>
|
453
|
-
</pre>
|
454
|
-
</div>
|
455
|
-
</div>
|
456
|
-
</div>
|
457
|
-
|
458
|
-
<div id="method-M000140" class="method-detail">
|
459
|
-
<a name="M000140"></a>
|
460
|
-
|
461
|
-
<div class="method-heading">
|
462
|
-
<a href="#M000140" class="method-signature">
|
463
|
-
<span class="method-name">upload</span><span class="method-args">(store)</span>
|
464
|
-
</a>
|
465
|
-
</div>
|
466
|
-
|
467
|
-
<div class="method-description">
|
468
|
-
<p>
|
469
|
-
Upload an <a href="RDF.html">RDF</a>/XML presentation of this object to the
|
470
|
-
provided Platform <a href="Store.html">Store</a>
|
471
|
-
</p>
|
472
|
-
<p><a class="source-toggle" href="#"
|
473
|
-
onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
|
474
|
-
<div class="method-source-code" id="M000140-source">
|
475
|
-
<pre>
|
476
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 153</span>
|
477
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upload</span>(<span class="ruby-identifier">store</span>)
|
478
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store</span>.<span class="ruby-identifier">put_query_profile</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_rdf</span>)
|
479
|
-
<span class="ruby-keyword kw">end</span>
|
480
|
-
</pre>
|
481
|
-
</div>
|
482
|
-
</div>
|
483
|
-
</div>
|
484
|
-
|
485
|
-
|
486
|
-
</div>
|
487
|
-
|
488
|
-
|
489
|
-
</div>
|
490
|
-
|
491
|
-
|
492
|
-
<div id="validator-badges">
|
493
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
494
|
-
</div>
|
495
|
-
|
496
|
-
</body>
|
497
|
-
</html>
|