pho 0.7.5 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +21 -0
- data/Rakefile +1 -1
- data/doc/rdoc/classes/Pho.html +0 -5
- data/doc/rdoc/classes/Pho/CommandLine.html +108 -108
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +15 -15
- data/doc/rdoc/classes/Pho/Enrichment/StoreEnricher.html +3 -3
- data/doc/rdoc/classes/Pho/Etags.html +36 -36
- data/doc/rdoc/classes/Pho/Facet/Results.html +1 -1
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +106 -106
- data/doc/rdoc/classes/Pho/FieldWeighting.html +14 -14
- data/doc/rdoc/classes/Pho/Job.html +67 -68
- data/doc/rdoc/classes/Pho/Jobs.html +62 -62
- data/doc/rdoc/classes/Pho/OAI/Records.html +7 -6
- data/doc/rdoc/classes/Pho/OAI/Statistics.html +194 -0
- data/doc/rdoc/classes/Pho/QueryProfile.html +86 -81
- data/doc/rdoc/classes/Pho/ResourceHash.html +1 -1
- data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +36 -35
- data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +2 -3
- data/doc/rdoc/classes/Pho/Snapshot.html +36 -36
- data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +3 -4
- data/doc/rdoc/classes/Pho/Status.html +26 -26
- data/doc/rdoc/classes/Pho/Store.html +257 -254
- data/doc/rdoc/classes/Pho/StoreSparqlClient.html +14 -14
- data/doc/rdoc/classes/Pho/Update/Changeset.html +5 -6
- data/doc/rdoc/classes/Pho/Update/Changesets.html +2 -3
- data/doc/rdoc/classes/Pho/Update/Statement.html +3 -4
- data/doc/rdoc/classes/String.html +1 -1
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +33 -4
- data/doc/rdoc/files/lib/pho/converter_rb.html +1 -8
- data/doc/rdoc/files/lib/pho/oai_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +5 -3
- data/doc/rdoc/fr_class_index.html +0 -2
- data/doc/rdoc/fr_file_index.html +0 -1
- data/doc/rdoc/fr_method_index.html +132 -136
- data/lib/pho.rb +7 -3
- data/lib/pho/converter.rb +23 -30
- data/lib/pho/oai.rb +5 -4
- data/lib/pho/query_profile.rb +6 -1
- data/lib/pho/store.rb +17 -12
- data/tests/tc_changeset_builder.rb +2 -2
- data/tests/tc_converter.rb +3 -3
- data/tests/tc_oai.rb +1 -1
- data/tests/tc_query_profile.rb +37 -1
- data/tests/ts_pho.rb +0 -1
- metadata +5 -9
- data/doc/rdoc/classes/Pho/RDF.html +0 -120
- data/doc/rdoc/classes/Pho/RDF/Parser.html +0 -279
- data/doc/rdoc/files/lib/pho/rdf_rb.html +0 -108
- data/lib/pho/rdf.rb +0 -76
- data/tests/tc_rdf_parser.rb +0 -37
@@ -216,7 +216,8 @@ Collection of records
|
|
216
216
|
<span class="ruby-keyword kw">end</span>
|
217
217
|
<span class="ruby-identifier">records</span> = []
|
218
218
|
<span class="ruby-identifier">responseDate</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"responseDate"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">text</span>
|
219
|
-
<span class="ruby-identifier">from</span> = <span class="ruby-
|
219
|
+
<span class="ruby-identifier">from</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"request"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"from"</span>]
|
220
|
+
<span class="ruby-identifier">from</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">from</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">from</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
220
221
|
<span class="ruby-identifier">to</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"request"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"until"</span>]
|
221
222
|
<span class="ruby-identifier">to</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">to</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">to</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
222
223
|
<span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">each</span>( <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">"//oai:header"</span>, {<span class="ruby-value str">"oai"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"http://www.openarchives.org/OAI/2.0/"</span>} ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">header</span><span class="ruby-operator">|</span>
|
@@ -254,7 +255,7 @@ List records from a store
|
|
254
255
|
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
255
256
|
<div class="method-source-code" id="M000071-source">
|
256
257
|
<pre>
|
257
|
-
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line
|
258
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 89</span>
|
258
259
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">from</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">to</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">resumption_token</span>=<span class="ruby-keyword kw">nil</span>)
|
259
260
|
<span class="ruby-identifier">resp</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">list_records</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">resumption_token</span>)
|
260
261
|
<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>
|
@@ -288,14 +289,14 @@ iterator, e.g:
|
|
288
289
|
records = store.list_records
|
289
290
|
while records != nil
|
290
291
|
#do something with retrieved records
|
291
|
-
records = Records.read_next_records(store, records.resumption_token
|
292
|
+
records = Records.read_next_records(store, records.resumption_token)
|
292
293
|
end
|
293
294
|
</pre>
|
294
295
|
<table>
|
295
296
|
<tr><td valign="top">store:</td><td>the store
|
296
297
|
|
297
298
|
</td></tr>
|
298
|
-
<tr><td valign="top">
|
299
|
+
<tr><td valign="top">resumption_token:</td><td>previously retrieved resumption_token
|
299
300
|
|
300
301
|
</td></tr>
|
301
302
|
</table>
|
@@ -303,10 +304,10 @@ iterator, e.g:
|
|
303
304
|
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
304
305
|
<div class="method-source-code" id="M000072-source">
|
305
306
|
<pre>
|
306
|
-
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line
|
307
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 109</span>
|
307
308
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_next_records</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">resumption_token</span>)
|
308
309
|
<span class="ruby-comment cmt">#list is already complete</span>
|
309
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">
|
310
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resumption_token</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
310
311
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
311
312
|
<span class="ruby-keyword kw">end</span>
|
312
313
|
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">token</span>)
|
@@ -0,0 +1,194 @@
|
|
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::OAI::Statistics</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::OAI::Statistics</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/pho/oai_rb.html">
|
59
|
+
lib/pho/oai.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
|
+
Access basic store statistics via the <a href="../OAI.html">OAI</a>
|
84
|
+
interface
|
85
|
+
</p>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<div id="method-list">
|
93
|
+
<h3 class="section-bar">Methods</h3>
|
94
|
+
|
95
|
+
<div class="name-list">
|
96
|
+
<a href="#M000074">last_updated</a>
|
97
|
+
<a href="#M000075">num_of_entities</a>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if includes -->
|
105
|
+
|
106
|
+
<div id="section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<!-- if method_list -->
|
116
|
+
<div id="methods">
|
117
|
+
<h3 class="section-bar">Public Class methods</h3>
|
118
|
+
|
119
|
+
<div id="method-M000074" class="method-detail">
|
120
|
+
<a name="M000074"></a>
|
121
|
+
|
122
|
+
<div class="method-heading">
|
123
|
+
<a href="#M000074" class="method-signature">
|
124
|
+
<span class="method-name">last_updated</span><span class="method-args">(store)</span>
|
125
|
+
</a>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div class="method-description">
|
129
|
+
<p>
|
130
|
+
Datestamp of last updated record in the store
|
131
|
+
</p>
|
132
|
+
<p>
|
133
|
+
This reads the <a href="../OAI.html">OAI</a>-PMH interface and retrieves
|
134
|
+
the datestamp of the most recently updated item
|
135
|
+
</p>
|
136
|
+
<p><a class="source-toggle" href="#"
|
137
|
+
onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
|
138
|
+
<div class="method-source-code" id="M000074-source">
|
139
|
+
<pre>
|
140
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 13</span>
|
141
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Statistics</span>.<span class="ruby-identifier">last_updated</span>(<span class="ruby-identifier">store</span>)
|
142
|
+
<span class="ruby-identifier">records</span> = <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
|
143
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">records</span>.<span class="ruby-identifier">records</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">datestamp</span>
|
144
|
+
<span class="ruby-keyword kw">end</span>
|
145
|
+
</pre>
|
146
|
+
</div>
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
<div id="method-M000075" class="method-detail">
|
151
|
+
<a name="M000075"></a>
|
152
|
+
|
153
|
+
<div class="method-heading">
|
154
|
+
<a href="#M000075" class="method-signature">
|
155
|
+
<span class="method-name">num_of_entities</span><span class="method-args">(store)</span>
|
156
|
+
</a>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<div class="method-description">
|
160
|
+
<p>
|
161
|
+
Number of entities in the store. This includes all resources in both the
|
162
|
+
metabox AND the contentbox
|
163
|
+
</p>
|
164
|
+
<p><a class="source-toggle" href="#"
|
165
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
166
|
+
<div class="method-source-code" id="M000075-source">
|
167
|
+
<pre>
|
168
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 20</span>
|
169
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Statistics</span>.<span class="ruby-identifier">num_of_entities</span>(<span class="ruby-identifier">store</span>)
|
170
|
+
<span class="ruby-identifier">records</span> = <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
|
171
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">records</span>.<span class="ruby-identifier">resumption_token</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
172
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">records</span>.<span class="ruby-identifier">list_size</span>
|
173
|
+
<span class="ruby-keyword kw">else</span>
|
174
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">records</span>.<span class="ruby-identifier">records</span>.<span class="ruby-identifier">length</span>
|
175
|
+
<span class="ruby-keyword kw">end</span>
|
176
|
+
<span class="ruby-keyword kw">end</span>
|
177
|
+
</pre>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
</div>
|
187
|
+
|
188
|
+
|
189
|
+
<div id="validator-badges">
|
190
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
</body>
|
194
|
+
</html>
|
@@ -98,17 +98,17 @@ href="Store.html">Store</a> methods.
|
|
98
98
|
<h3 class="section-bar">Methods</h3>
|
99
99
|
|
100
100
|
<div class="name-list">
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
101
|
+
<a href="#M000134"><<</a>
|
102
|
+
<a href="#M000132">create_weighting</a>
|
103
|
+
<a href="#M000135">get_by_name</a>
|
104
|
+
<a href="#M000139">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="#M000138">remove_all</a>
|
109
|
+
<a href="#M000136">remove_by_name</a>
|
110
|
+
<a href="#M000140">to_rdf</a>
|
111
|
+
<a href="#M000141">upload</a>
|
112
112
|
</div>
|
113
113
|
</div>
|
114
114
|
|
@@ -162,11 +162,11 @@ URI for this resource
|
|
162
162
|
<div id="methods">
|
163
163
|
<h3 class="section-bar">Public Class methods</h3>
|
164
164
|
|
165
|
-
<div id="method-
|
166
|
-
<a name="
|
165
|
+
<div id="method-M000132" class="method-detail">
|
166
|
+
<a name="M000132"></a>
|
167
167
|
|
168
168
|
<div class="method-heading">
|
169
|
-
<a href="#
|
169
|
+
<a href="#M000132" class="method-signature">
|
170
170
|
<span class="method-name">create_weighting</span><span class="method-args">(store, name, weight)</span>
|
171
171
|
</a>
|
172
172
|
</div>
|
@@ -189,10 +189,10 @@ according to the Platform naming rules
|
|
189
189
|
</td></tr>
|
190
190
|
</table>
|
191
191
|
<p><a class="source-toggle" href="#"
|
192
|
-
onclick="toggleCode('
|
193
|
-
<div class="method-source-code" id="
|
192
|
+
onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
|
193
|
+
<div class="method-source-code" id="M000132-source">
|
194
194
|
<pre>
|
195
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
195
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 89</span>
|
196
196
|
<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>)
|
197
197
|
<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>)
|
198
198
|
<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>
|
@@ -207,21 +207,21 @@ according to the Platform naming rules
|
|
207
207
|
</div>
|
208
208
|
</div>
|
209
209
|
|
210
|
-
<div id="method-
|
211
|
-
<a name="
|
210
|
+
<div id="method-M000133" class="method-detail">
|
211
|
+
<a name="M000133"></a>
|
212
212
|
|
213
213
|
<div class="method-heading">
|
214
|
-
<a href="#
|
214
|
+
<a href="#M000133" class="method-signature">
|
215
215
|
<span class="method-name">new</span><span class="method-args">(uri, label, field_weights=Array.new)</span>
|
216
216
|
</a>
|
217
217
|
</div>
|
218
218
|
|
219
219
|
<div class="method-description">
|
220
220
|
<p><a class="source-toggle" href="#"
|
221
|
-
onclick="toggleCode('
|
222
|
-
<div class="method-source-code" id="
|
221
|
+
onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
|
222
|
+
<div class="method-source-code" id="M000133-source">
|
223
223
|
<pre>
|
224
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
224
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 99</span>
|
225
225
|
<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>)
|
226
226
|
<span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">uri</span>
|
227
227
|
<span class="ruby-ivar">@label</span> = <span class="ruby-identifier">label</span>
|
@@ -232,19 +232,19 @@ according to the Platform naming rules
|
|
232
232
|
</div>
|
233
233
|
</div>
|
234
234
|
|
235
|
-
<div id="method-
|
236
|
-
<a name="
|
235
|
+
<div id="method-M000131" class="method-detail">
|
236
|
+
<a name="M000131"></a>
|
237
237
|
|
238
238
|
<div class="method-heading">
|
239
|
-
<a href="#
|
239
|
+
<a href="#M000131" class="method-signature">
|
240
240
|
<span class="method-name">read_from_store</span><span class="method-args">(store)</span>
|
241
241
|
</a>
|
242
242
|
</div>
|
243
243
|
|
244
244
|
<div class="method-description">
|
245
245
|
<p><a class="source-toggle" href="#"
|
246
|
-
onclick="toggleCode('
|
247
|
-
<div class="method-source-code" id="
|
246
|
+
onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
|
247
|
+
<div class="method-source-code" id="M000131-source">
|
248
248
|
<pre>
|
249
249
|
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 53</span>
|
250
250
|
<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>)
|
@@ -257,7 +257,12 @@ according to the Platform naming rules
|
|
257
257
|
|
258
258
|
<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> )
|
259
259
|
|
260
|
-
<span class="ruby-identifier">
|
260
|
+
<span class="ruby-identifier">labels</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>]
|
261
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">labels</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">labels</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
262
|
+
<span class="ruby-identifier">label</span> = <span class="ruby-identifier">labels</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">"value"</span>]
|
263
|
+
<span class="ruby-keyword kw">else</span>
|
264
|
+
<span class="ruby-identifier">label</span> = <span class="ruby-value str">"query profile"</span>
|
265
|
+
<span class="ruby-keyword kw">end</span>
|
261
266
|
<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>)
|
262
267
|
|
263
268
|
<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>]
|
@@ -278,21 +283,21 @@ according to the Platform naming rules
|
|
278
283
|
|
279
284
|
<h3 class="section-bar">Public Instance methods</h3>
|
280
285
|
|
281
|
-
<div id="method-
|
282
|
-
<a name="
|
286
|
+
<div id="method-M000134" class="method-detail">
|
287
|
+
<a name="M000134"></a>
|
283
288
|
|
284
289
|
<div class="method-heading">
|
285
|
-
<a href="#
|
290
|
+
<a href="#M000134" class="method-signature">
|
286
291
|
<span class="method-name"><<</span><span class="method-args">(weight)</span>
|
287
292
|
</a>
|
288
293
|
</div>
|
289
294
|
|
290
295
|
<div class="method-description">
|
291
296
|
<p><a class="source-toggle" href="#"
|
292
|
-
onclick="toggleCode('
|
293
|
-
<div class="method-source-code" id="
|
297
|
+
onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
|
298
|
+
<div class="method-source-code" id="M000134-source">
|
294
299
|
<pre>
|
295
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
300
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 105</span>
|
296
301
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator"><<</span>(<span class="ruby-identifier">weight</span>)
|
297
302
|
<span class="ruby-ivar">@field_weights</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">weight</span>
|
298
303
|
<span class="ruby-keyword kw">end</span>
|
@@ -301,11 +306,11 @@ according to the Platform naming rules
|
|
301
306
|
</div>
|
302
307
|
</div>
|
303
308
|
|
304
|
-
<div id="method-
|
305
|
-
<a name="
|
309
|
+
<div id="method-M000135" class="method-detail">
|
310
|
+
<a name="M000135"></a>
|
306
311
|
|
307
312
|
<div class="method-heading">
|
308
|
-
<a href="#
|
313
|
+
<a href="#M000135" class="method-signature">
|
309
314
|
<span class="method-name">get_by_name</span><span class="method-args">(name)</span>
|
310
315
|
</a>
|
311
316
|
</div>
|
@@ -315,10 +320,10 @@ according to the Platform naming rules
|
|
315
320
|
Retrieve a FieldWeighing by name
|
316
321
|
</p>
|
317
322
|
<p><a class="source-toggle" href="#"
|
318
|
-
onclick="toggleCode('
|
319
|
-
<div class="method-source-code" id="
|
323
|
+
onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
|
324
|
+
<div class="method-source-code" id="M000135-source">
|
320
325
|
<pre>
|
321
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
326
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 110</span>
|
322
327
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>)
|
323
328
|
<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> }
|
324
329
|
<span class="ruby-keyword kw">end</span>
|
@@ -327,11 +332,11 @@ Retrieve a FieldWeighing by name
|
|
327
332
|
</div>
|
328
333
|
</div>
|
329
334
|
|
330
|
-
<div id="method-
|
331
|
-
<a name="
|
335
|
+
<div id="method-M000139" class="method-detail">
|
336
|
+
<a name="M000139"></a>
|
332
337
|
|
333
338
|
<div class="method-heading">
|
334
|
-
<a href="#
|
339
|
+
<a href="#M000139" class="method-signature">
|
335
340
|
<span class="method-name">mapped_name?</span><span class="method-args">(name)</span>
|
336
341
|
</a>
|
337
342
|
</div>
|
@@ -341,10 +346,10 @@ Retrieve a FieldWeighing by name
|
|
341
346
|
Is there a field weighting for a property with this name?
|
342
347
|
</p>
|
343
348
|
<p><a class="source-toggle" href="#"
|
344
|
-
onclick="toggleCode('
|
345
|
-
<div class="method-source-code" id="
|
349
|
+
onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
|
350
|
+
<div class="method-source-code" id="M000139-source">
|
346
351
|
<pre>
|
347
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
352
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 133</span>
|
348
353
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapped_name?</span>(<span class="ruby-identifier">name</span>)
|
349
354
|
<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>
|
350
355
|
<span class="ruby-keyword kw">end</span>
|
@@ -353,11 +358,11 @@ Is there a field weighting for a property with this name?
|
|
353
358
|
</div>
|
354
359
|
</div>
|
355
360
|
|
356
|
-
<div id="method-
|
357
|
-
<a name="
|
361
|
+
<div id="method-M000137" class="method-detail">
|
362
|
+
<a name="M000137"></a>
|
358
363
|
|
359
364
|
<div class="method-heading">
|
360
|
-
<a href="#
|
365
|
+
<a href="#M000137" class="method-signature">
|
361
366
|
<span class="method-name">remove</span><span class="method-args">(fw)</span>
|
362
367
|
</a>
|
363
368
|
</div>
|
@@ -368,10 +373,10 @@ Remove a <a href="FieldWeighting.html">FieldWeighting</a> from the
|
|
368
373
|
collection
|
369
374
|
</p>
|
370
375
|
<p><a class="source-toggle" href="#"
|
371
|
-
onclick="toggleCode('
|
372
|
-
<div class="method-source-code" id="
|
376
|
+
onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
|
377
|
+
<div class="method-source-code" id="M000137-source">
|
373
378
|
<pre>
|
374
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
379
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 123</span>
|
375
380
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">fw</span>)
|
376
381
|
<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>)
|
377
382
|
<span class="ruby-keyword kw">end</span>
|
@@ -380,11 +385,11 @@ collection
|
|
380
385
|
</div>
|
381
386
|
</div>
|
382
387
|
|
383
|
-
<div id="method-
|
384
|
-
<a name="
|
388
|
+
<div id="method-M000138" class="method-detail">
|
389
|
+
<a name="M000138"></a>
|
385
390
|
|
386
391
|
<div class="method-heading">
|
387
|
-
<a href="#
|
392
|
+
<a href="#M000138" class="method-signature">
|
388
393
|
<span class="method-name">remove_all</span><span class="method-args">()</span>
|
389
394
|
</a>
|
390
395
|
</div>
|
@@ -394,10 +399,10 @@ collection
|
|
394
399
|
Remove all field weights
|
395
400
|
</p>
|
396
401
|
<p><a class="source-toggle" href="#"
|
397
|
-
onclick="toggleCode('
|
398
|
-
<div class="method-source-code" id="
|
402
|
+
onclick="toggleCode('M000138-source');return false;">[Source]</a></p>
|
403
|
+
<div class="method-source-code" id="M000138-source">
|
399
404
|
<pre>
|
400
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
405
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 128</span>
|
401
406
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_all</span>()
|
402
407
|
<span class="ruby-ivar">@field_weights</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
403
408
|
<span class="ruby-keyword kw">end</span>
|
@@ -406,11 +411,11 @@ Remove all field weights
|
|
406
411
|
</div>
|
407
412
|
</div>
|
408
413
|
|
409
|
-
<div id="method-
|
410
|
-
<a name="
|
414
|
+
<div id="method-M000136" class="method-detail">
|
415
|
+
<a name="M000136"></a>
|
411
416
|
|
412
417
|
<div class="method-heading">
|
413
|
-
<a href="#
|
418
|
+
<a href="#M000136" class="method-signature">
|
414
419
|
<span class="method-name">remove_by_name</span><span class="method-args">(name)</span>
|
415
420
|
</a>
|
416
421
|
</div>
|
@@ -420,10 +425,10 @@ Remove all field weights
|
|
420
425
|
Remove a <a href="FieldWeighting.html">FieldWeighting</a> by name
|
421
426
|
</p>
|
422
427
|
<p><a class="source-toggle" href="#"
|
423
|
-
onclick="toggleCode('
|
424
|
-
<div class="method-source-code" id="
|
428
|
+
onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
|
429
|
+
<div class="method-source-code" id="M000136-source">
|
425
430
|
<pre>
|
426
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
431
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 115</span>
|
427
432
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_by_name</span>(<span class="ruby-identifier">name</span>)
|
428
433
|
<span class="ruby-identifier">fw</span> = <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>)
|
429
434
|
<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>)
|
@@ -435,25 +440,25 @@ Remove a <a href="FieldWeighting.html">FieldWeighting</a> by name
|
|
435
440
|
</div>
|
436
441
|
</div>
|
437
442
|
|
438
|
-
<div id="method-
|
439
|
-
<a name="
|
443
|
+
<div id="method-M000140" class="method-detail">
|
444
|
+
<a name="M000140"></a>
|
440
445
|
|
441
446
|
<div class="method-heading">
|
442
|
-
<a href="#
|
447
|
+
<a href="#M000140" class="method-signature">
|
443
448
|
<span class="method-name">to_rdf</span><span class="method-args">()</span>
|
444
449
|
</a>
|
445
450
|
</div>
|
446
451
|
|
447
452
|
<div class="method-description">
|
448
453
|
<p>
|
449
|
-
Dump this object to an
|
450
|
-
|
454
|
+
Dump this object to an RDF/XML representation suitable for submitting to
|
455
|
+
the Platform
|
451
456
|
</p>
|
452
457
|
<p><a class="source-toggle" href="#"
|
453
|
-
onclick="toggleCode('
|
454
|
-
<div class="method-source-code" id="
|
458
|
+
onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
|
459
|
+
<div class="method-source-code" id="M000140-source">
|
455
460
|
<pre>
|
456
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
461
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 138</span>
|
457
462
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rdf</span>
|
458
463
|
<span class="ruby-identifier">rdf</span> = <span class="ruby-node">"<rdf:RDF xmlns:frm=\"#{Pho::Namespaces::FRAME}\" "</span>
|
459
464
|
<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>
|
@@ -482,25 +487,25 @@ suitable for submitting to the Platform
|
|
482
487
|
</div>
|
483
488
|
</div>
|
484
489
|
|
485
|
-
<div id="method-
|
486
|
-
<a name="
|
490
|
+
<div id="method-M000141" class="method-detail">
|
491
|
+
<a name="M000141"></a>
|
487
492
|
|
488
493
|
<div class="method-heading">
|
489
|
-
<a href="#
|
494
|
+
<a href="#M000141" class="method-signature">
|
490
495
|
<span class="method-name">upload</span><span class="method-args">(store)</span>
|
491
496
|
</a>
|
492
497
|
</div>
|
493
498
|
|
494
499
|
<div class="method-description">
|
495
500
|
<p>
|
496
|
-
Upload an
|
497
|
-
|
501
|
+
Upload an RDF/XML presentation of this object to the provided Platform <a
|
502
|
+
href="Store.html">Store</a>
|
498
503
|
</p>
|
499
504
|
<p><a class="source-toggle" href="#"
|
500
|
-
onclick="toggleCode('
|
501
|
-
<div class="method-source-code" id="
|
505
|
+
onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
|
506
|
+
<div class="method-source-code" id="M000141-source">
|
502
507
|
<pre>
|
503
|
-
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line
|
508
|
+
<span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 163</span>
|
504
509
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upload</span>(<span class="ruby-identifier">store</span>)
|
505
510
|
<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>)
|
506
511
|
<span class="ruby-keyword kw">end</span>
|