pho 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/CHANGES +5 -0
  2. data/Rakefile +1 -1
  3. data/lib/pho/snapshot.rb +6 -1
  4. data/lib/pho/sparql.rb +4 -1
  5. data/tests/tc_snapshots.rb +14 -1
  6. data/tests/tc_sparql_helper.rb +23 -0
  7. metadata +60 -160
  8. data/doc/rdoc/classes/Pho/Analyzers.html +0 -310
  9. data/doc/rdoc/classes/Pho/CommandLine.html +0 -770
  10. data/doc/rdoc/classes/Pho/DatatypeProperty.html +0 -241
  11. data/doc/rdoc/classes/Pho/Enrichment/StoreEnricher.html +0 -410
  12. data/doc/rdoc/classes/Pho/Enrichment.html +0 -119
  13. data/doc/rdoc/classes/Pho/Etags.html +0 -310
  14. data/doc/rdoc/classes/Pho/Facet/Results.html +0 -299
  15. data/doc/rdoc/classes/Pho/Facet/Term.html +0 -177
  16. data/doc/rdoc/classes/Pho/Facet.html +0 -119
  17. data/doc/rdoc/classes/Pho/FieldPredicateMap.html +0 -668
  18. data/doc/rdoc/classes/Pho/FieldWeighting.html +0 -230
  19. data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +0 -478
  20. data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +0 -264
  21. data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +0 -259
  22. data/doc/rdoc/classes/Pho/FileManagement.html +0 -121
  23. data/doc/rdoc/classes/Pho/Job.html +0 -627
  24. data/doc/rdoc/classes/Pho/JobUpdate.html +0 -141
  25. data/doc/rdoc/classes/Pho/Jobs.html +0 -538
  26. data/doc/rdoc/classes/Pho/Namespaces.html +0 -164
  27. data/doc/rdoc/classes/Pho/OAI/Record.html +0 -165
  28. data/doc/rdoc/classes/Pho/OAI/Records.html +0 -331
  29. data/doc/rdoc/classes/Pho/OAI.html +0 -118
  30. data/doc/rdoc/classes/Pho/QueryProfile.html +0 -497
  31. data/doc/rdoc/classes/Pho/RDF/Parser.html +0 -279
  32. data/doc/rdoc/classes/Pho/RDF.html +0 -120
  33. data/doc/rdoc/classes/Pho/RDFCollection.html +0 -119
  34. data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +0 -325
  35. data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +0 -241
  36. data/doc/rdoc/classes/Pho/ResourceHash.html +0 -123
  37. data/doc/rdoc/classes/Pho/Snapshot.html +0 -397
  38. data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +0 -594
  39. data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +0 -692
  40. data/doc/rdoc/classes/Pho/Sparql.html +0 -187
  41. data/doc/rdoc/classes/Pho/Status.html +0 -296
  42. data/doc/rdoc/classes/Pho/Store.html +0 -1560
  43. data/doc/rdoc/classes/Pho/StoreSparqlClient.html +0 -183
  44. data/doc/rdoc/classes/Pho/Update/Changeset.html +0 -521
  45. data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +0 -330
  46. data/doc/rdoc/classes/Pho/Update/ChangesetHelper.html +0 -159
  47. data/doc/rdoc/classes/Pho/Update/Changesets.html +0 -205
  48. data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +0 -257
  49. data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +0 -237
  50. data/doc/rdoc/classes/Pho/Update/Statement.html +0 -303
  51. data/doc/rdoc/classes/Pho/Update.html +0 -128
  52. data/doc/rdoc/classes/Pho.html +0 -283
  53. data/doc/rdoc/classes/String.html +0 -146
  54. data/doc/rdoc/created.rid +0 -1
  55. data/doc/rdoc/files/CHANGES.html +0 -351
  56. data/doc/rdoc/files/README.html +0 -191
  57. data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +0 -108
  58. data/doc/rdoc/files/lib/pho/changeset_rb.html +0 -108
  59. data/doc/rdoc/files/lib/pho/command_line_rb.html +0 -101
  60. data/doc/rdoc/files/lib/pho/converter_rb.html +0 -108
  61. data/doc/rdoc/files/lib/pho/enrichment_rb.html +0 -101
  62. data/doc/rdoc/files/lib/pho/etags_rb.html +0 -108
  63. data/doc/rdoc/files/lib/pho/facet_rb.html +0 -101
  64. data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +0 -101
  65. data/doc/rdoc/files/lib/pho/file_management_rb.html +0 -101
  66. data/doc/rdoc/files/lib/pho/file_manager_rb.html +0 -108
  67. data/doc/rdoc/files/lib/pho/job_rb.html +0 -101
  68. data/doc/rdoc/files/lib/pho/oai_rb.html +0 -101
  69. data/doc/rdoc/files/lib/pho/query_profile_rb.html +0 -101
  70. data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +0 -101
  71. data/doc/rdoc/files/lib/pho/rdf_rb.html +0 -108
  72. data/doc/rdoc/files/lib/pho/resource_hash_rb.html +0 -101
  73. data/doc/rdoc/files/lib/pho/snapshot_rb.html +0 -109
  74. data/doc/rdoc/files/lib/pho/sparql_rb.html +0 -101
  75. data/doc/rdoc/files/lib/pho/status_rb.html +0 -101
  76. data/doc/rdoc/files/lib/pho/store_rb.html +0 -108
  77. data/doc/rdoc/files/lib/pho_rb.html +0 -133
  78. data/doc/rdoc/fr_class_index.html +0 -72
  79. data/doc/rdoc/fr_file_index.html +0 -49
  80. data/doc/rdoc/fr_method_index.html +0 -237
  81. data/doc/rdoc/index.html +0 -24
  82. data/doc/rdoc/rdoc-style.css +0 -208
@@ -1,627 +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::Job</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::Job</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/pho/job_rb.html">
59
- lib/pho/job.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 Platform <a href="Job.html">Job</a>
84
- </p>
85
- <p>
86
- Instances of this class encapsulate all of the core metadata relating to a
87
- Platform <a href="Job.html">Job</a>. This includes not only the timing
88
- information but also the completion status, etc.
89
- </p>
90
- <p>
91
- The class provides convenience methods for retrieving and parsing data
92
- about a specific <a href="Job.html">Job</a> from a platform store
93
- </p>
94
-
95
- </div>
96
-
97
-
98
- </div>
99
-
100
- <div id="method-list">
101
- <h3 class="section-bar">Methods</h3>
102
-
103
- <div class="name-list">
104
- <a href="#M000199">completed?</a>&nbsp;&nbsp;
105
- <a href="#M000194">new</a>&nbsp;&nbsp;
106
- <a href="#M000196">parse</a>&nbsp;&nbsp;
107
- <a href="#M000197">progress_updates</a>&nbsp;&nbsp;
108
- <a href="#M000195">read_from_store</a>&nbsp;&nbsp;
109
- <a href="#M000201">running?</a>&nbsp;&nbsp;
110
- <a href="#M000198">started?</a>&nbsp;&nbsp;
111
- <a href="#M000200">successful?</a>&nbsp;&nbsp;
112
- <a href="#M000203">with_each</a>&nbsp;&nbsp;
113
- <a href="#M000202">with_first</a>&nbsp;&nbsp;
114
- </div>
115
- </div>
116
-
117
- </div>
118
-
119
-
120
- <!-- if includes -->
121
-
122
- <div id="section">
123
-
124
-
125
- <div id="constants-list">
126
- <h3 class="section-bar">Constants</h3>
127
-
128
- <div class="name-list">
129
- <table summary="Constants">
130
- <tr class="top-aligned-row context-row">
131
- <td class="context-item-name">SUCCESS</td>
132
- <td>=</td>
133
- <td class="context-item-value">&quot;http://schemas.talis.com/2006/bigfoot/configuration#success&quot;</td>
134
- </tr>
135
- <tr class="top-aligned-row context-row">
136
- <td class="context-item-name">ABORTED</td>
137
- <td>=</td>
138
- <td class="context-item-value">&quot;http://schemas.talis.com/2006/bigfoot/configuration#aborted&quot;</td>
139
- </tr>
140
- </table>
141
- </div>
142
- </div>
143
-
144
-
145
-
146
- <div id="attribute-list">
147
- <h3 class="section-bar">Attributes</h3>
148
-
149
- <div class="name-list">
150
- <table>
151
- <tr class="top-aligned-row context-row">
152
- <td class="context-item-name">actual_start_time</td>
153
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
154
- <td class="context-item-desc">
155
- Date-time that the job actually started
156
-
157
- </td>
158
- </tr>
159
- <tr class="top-aligned-row context-row">
160
- <td class="context-item-name">completion_message</td>
161
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
162
- <td class="context-item-desc">
163
- Completion message
164
-
165
- </td>
166
- </tr>
167
- <tr class="top-aligned-row context-row">
168
- <td class="context-item-name">completion_status</td>
169
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
170
- <td class="context-item-desc">
171
- URI indicating completion status of the job
172
-
173
- </td>
174
- </tr>
175
- <tr class="top-aligned-row context-row">
176
- <td class="context-item-name">created</td>
177
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
178
- <td class="context-item-desc">
179
- Date-time that the job was created
180
-
181
- </td>
182
- </tr>
183
- <tr class="top-aligned-row context-row">
184
- <td class="context-item-name">end_time</td>
185
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
186
- <td class="context-item-desc">
187
- Date time that the job actually completed
188
-
189
- </td>
190
- </tr>
191
- <tr class="top-aligned-row context-row">
192
- <td class="context-item-name">label</td>
193
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
194
- <td class="context-item-desc">
195
- Label associated with job
196
-
197
- </td>
198
- </tr>
199
- <tr class="top-aligned-row context-row">
200
- <td class="context-item-name">progress_updates</td>
201
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
202
- <td class="context-item-desc">
203
- An array of <a href="JobUpdate.html">JobUpdate</a> instances. May be empty
204
- if no updates have been logged
205
-
206
- </td>
207
- </tr>
208
- <tr class="top-aligned-row context-row">
209
- <td class="context-item-name">snapshot_uri</td>
210
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
211
- <td class="context-item-desc">
212
- URI of snapshot to load. (For RestoreJob only)
213
-
214
- </td>
215
- </tr>
216
- <tr class="top-aligned-row context-row">
217
- <td class="context-item-name">start_message</td>
218
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
219
- <td class="context-item-desc">
220
- Message recorded at the time the job started
221
-
222
- </td>
223
- </tr>
224
- <tr class="top-aligned-row context-row">
225
- <td class="context-item-name">start_time</td>
226
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
227
- <td class="context-item-desc">
228
- Date-time that the job will start
229
-
230
- </td>
231
- </tr>
232
- <tr class="top-aligned-row context-row">
233
- <td class="context-item-name">type</td>
234
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
235
- <td class="context-item-desc">
236
- Type of job
237
-
238
- </td>
239
- </tr>
240
- <tr class="top-aligned-row context-row">
241
- <td class="context-item-name">uri</td>
242
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
243
- <td class="context-item-desc">
244
- URI of the job
245
-
246
- </td>
247
- </tr>
248
- </table>
249
- </div>
250
- </div>
251
-
252
-
253
-
254
- <!-- if method_list -->
255
- <div id="methods">
256
- <h3 class="section-bar">Public Class methods</h3>
257
-
258
- <div id="method-M000194" class="method-detail">
259
- <a name="M000194"></a>
260
-
261
- <div class="method-heading">
262
- <a href="#M000194" class="method-signature">
263
- <span class="method-name">new</span><span class="method-args">(uri, label, type, start_time, created=nil)</span>
264
- </a>
265
- </div>
266
-
267
- <div class="method-description">
268
- <p>
269
- Constructor. Used in the reading/parsing code
270
- </p>
271
- <table>
272
- <tr><td valign="top">uri:</td><td>a unique identifier for the job
273
-
274
- </td></tr>
275
- <tr><td valign="top">label:</td><td>a description of the job
276
-
277
- </td></tr>
278
- <tr><td valign="top">type:</td><td>the type of the job, e.g. Pho::Jobs::RESTORE
279
-
280
- </td></tr>
281
- <tr><td valign="top">created:</td><td>date-time the job was created in the system
282
-
283
- </td></tr>
284
- <tr><td valign="top">start_time:</td><td>scheduled start time for the job
285
-
286
- </td></tr>
287
- </table>
288
- <p><a class="source-toggle" href="#"
289
- onclick="toggleCode('M000194-source');return false;">[Source]</a></p>
290
- <div class="method-source-code" id="M000194-source">
291
- <pre>
292
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 214</span>
293
- <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">type</span>, <span class="ruby-identifier">start_time</span>, <span class="ruby-identifier">created</span>=<span class="ruby-keyword kw">nil</span>)
294
- <span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">uri</span>
295
- <span class="ruby-ivar">@label</span> = <span class="ruby-identifier">label</span>
296
- <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">type</span>
297
- <span class="ruby-ivar">@created</span> = <span class="ruby-identifier">created</span>
298
- <span class="ruby-ivar">@start_time</span> = <span class="ruby-identifier">start_time</span>
299
- <span class="ruby-ivar">@progress_updates</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
300
- <span class="ruby-keyword kw">end</span>
301
- </pre>
302
- </div>
303
- </div>
304
- </div>
305
-
306
- <div id="method-M000196" class="method-detail">
307
- <a name="M000196"></a>
308
-
309
- <div class="method-heading">
310
- <a href="#M000196" class="method-signature">
311
- <span class="method-name">parse</span><span class="method-args">(uri, xml)</span>
312
- </a>
313
- </div>
314
-
315
- <div class="method-description">
316
- <p>
317
- Parses job metadata returned from the platform as <a
318
- href="RDF.html">RDF</a>/XML, creating a fully populated <a
319
- href="Job.html">Job</a> instance
320
- </p>
321
- <table>
322
- <tr><td valign="top">uri:</td><td>uri of the job to be parsed
323
-
324
- </td></tr>
325
- <tr><td valign="top">xml:</td><td>the <a href="RDF.html">RDF</a>/XML text to be parsed
326
-
327
- </td></tr>
328
- </table>
329
- <p><a class="source-toggle" href="#"
330
- onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
331
- <div class="method-source-code" id="M000196-source">
332
- <pre>
333
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 241</span>
334
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Job</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">xml</span>)
335
- <span class="ruby-identifier">doc</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">xml</span>)
336
- <span class="ruby-identifier">root</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>
337
-
338
- <span class="ruby-comment cmt">#job_el = REXML::XPath.first(root, &quot;rdf:Description[rdf:type]&quot;, Pho::Namespaces::MAPPING ) </span>
339
- <span class="ruby-identifier">job_el</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">root</span>, <span class="ruby-node">&quot;//*[@rdf:about='#{uri}']&quot;</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span> )
340
- <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">job_el</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;rdf:about&quot;</span>]
341
- <span class="ruby-identifier">label</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;rdfs:label&quot;</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span> ).<span class="ruby-identifier">text</span>
342
- <span class="ruby-identifier">type_el</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;rdf:type&quot;</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span> )
343
- <span class="ruby-identifier">type</span> = <span class="ruby-identifier">type_el</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;rdf:resource&quot;</span>]
344
- <span class="ruby-identifier">created</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;dcterms:created&quot;</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span> ).<span class="ruby-identifier">text</span>
345
- <span class="ruby-identifier">start_time</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:startTime&quot;</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span> ).<span class="ruby-identifier">text</span>
346
-
347
- <span class="ruby-identifier">job</span> = <span class="ruby-constant">Job</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">start_time</span>, <span class="ruby-identifier">created</span>)
348
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Jobs</span><span class="ruby-operator">::</span><span class="ruby-constant">RESTORE</span>
349
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:snapshotUri&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span>
350
- <span class="ruby-identifier">job</span>.<span class="ruby-identifier">snapshot_uri</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;rdf:resource&quot;</span>]
351
- <span class="ruby-keyword kw">end</span>
352
- <span class="ruby-keyword kw">end</span>
353
-
354
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:actualStartTime&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span>
355
- <span class="ruby-identifier">job</span>.<span class="ruby-identifier">actual_start_time</span> = <span class="ruby-identifier">el</span>.<span class="ruby-identifier">text</span>
356
- <span class="ruby-keyword kw">end</span>
357
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:startMessage&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span>
358
- <span class="ruby-identifier">job</span>.<span class="ruby-identifier">start_message</span> = <span class="ruby-identifier">el</span>.<span class="ruby-identifier">text</span>
359
- <span class="ruby-keyword kw">end</span>
360
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:completionMessage&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span>
361
- <span class="ruby-identifier">job</span>.<span class="ruby-identifier">completion_message</span> = <span class="ruby-identifier">el</span>.<span class="ruby-identifier">text</span>
362
- <span class="ruby-keyword kw">end</span>
363
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:endTime&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span>
364
- <span class="ruby-identifier">job</span>.<span class="ruby-identifier">end_time</span> = <span class="ruby-identifier">el</span>.<span class="ruby-identifier">text</span>
365
- <span class="ruby-keyword kw">end</span>
366
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:completionStatus&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span>
367
- <span class="ruby-identifier">job</span>.<span class="ruby-identifier">completion_status</span> = <span class="ruby-identifier">el</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;rdf:resource&quot;</span>]
368
- <span class="ruby-keyword kw">end</span>
369
- <span class="ruby-identifier">with_each</span>(<span class="ruby-identifier">job_el</span>, <span class="ruby-value str">&quot;bf:progressUpdate&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">el</span><span class="ruby-operator">|</span>
370
- <span class="ruby-identifier">update</span> = <span class="ruby-constant">JobUpdate</span>.<span class="ruby-identifier">new</span>
371
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">el</span>, <span class="ruby-value str">&quot;bf:progressUpdateMessage&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">msg</span><span class="ruby-operator">|</span>
372
- <span class="ruby-identifier">update</span>.<span class="ruby-identifier">message</span> = <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">text</span>
373
- <span class="ruby-keyword kw">end</span>
374
- <span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">el</span>, <span class="ruby-value str">&quot;bf:progressUpdateTime&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">time</span><span class="ruby-operator">|</span>
375
- <span class="ruby-identifier">update</span>.<span class="ruby-identifier">time</span> = <span class="ruby-identifier">time</span>.<span class="ruby-identifier">text</span>
376
- <span class="ruby-keyword kw">end</span>
377
- <span class="ruby-identifier">job</span>.<span class="ruby-identifier">progress_updates</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">update</span>
378
- <span class="ruby-keyword kw">end</span>
379
-
380
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">job</span>
381
-
382
- <span class="ruby-keyword kw">end</span>
383
- </pre>
384
- </div>
385
- </div>
386
- </div>
387
-
388
- <div id="method-M000195" class="method-detail">
389
- <a name="M000195"></a>
390
-
391
- <div class="method-heading">
392
- <a href="#M000195" class="method-signature">
393
- <span class="method-name">read_from_store</span><span class="method-args">(uri, store)</span>
394
- </a>
395
- </div>
396
-
397
- <div class="method-description">
398
- <p>
399
- Read a job from a store
400
- </p>
401
- <table>
402
- <tr><td valign="top">uri:</td><td>uri of the job to read
403
-
404
- </td></tr>
405
- <tr><td valign="top">store:</td><td>store from which the job will be read
406
-
407
- </td></tr>
408
- </table>
409
- <p><a class="source-toggle" href="#"
410
- onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
411
- <div class="method-source-code" id="M000195-source">
412
- <pre>
413
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 227</span>
414
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Job</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">store</span>)
415
- <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">get_job</span>(<span class="ruby-identifier">uri</span>)
416
- <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>
417
- <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unable to read job from store. Response code was #{resp.status}&quot;</span>
418
- <span class="ruby-keyword kw">end</span>
419
-
420
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">content</span>)
421
- <span class="ruby-keyword kw">end</span>
422
- </pre>
423
- </div>
424
- </div>
425
- </div>
426
-
427
- <h3 class="section-bar">Protected Class methods</h3>
428
-
429
- <div id="method-M000203" class="method-detail">
430
- <a name="M000203"></a>
431
-
432
- <div class="method-heading">
433
- <a href="#M000203" class="method-signature">
434
- <span class="method-name">with_each</span><span class="method-args">(el, xpath) {|ref_el| ...}</span>
435
- </a>
436
- </div>
437
-
438
- <div class="method-description">
439
- <p><a class="source-toggle" href="#"
440
- onclick="toggleCode('M000203-source');return false;">[Source]</a></p>
441
- <div class="method-source-code" id="M000203-source">
442
- <pre>
443
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 327</span>
444
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Job</span>.<span class="ruby-identifier">with_each</span>(<span class="ruby-identifier">el</span>, <span class="ruby-identifier">xpath</span>)
445
- <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">el</span>, <span class="ruby-identifier">xpath</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
446
- <span class="ruby-identifier">root</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">document</span>.<span class="ruby-identifier">root</span>
447
- <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">&quot;rdf:resource&quot;</span>]
448
- <span class="ruby-identifier">ref_el</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">root</span>, <span class="ruby-node">&quot;//*[@rdf:about='#{uri}']&quot;</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span>)
449
- <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">ref_el</span>
450
- <span class="ruby-keyword kw">end</span>
451
- <span class="ruby-keyword kw">end</span>
452
- </pre>
453
- </div>
454
- </div>
455
- </div>
456
-
457
- <div id="method-M000202" class="method-detail">
458
- <a name="M000202"></a>
459
-
460
- <div class="method-heading">
461
- <a href="#M000202" class="method-signature">
462
- <span class="method-name">with_first</span><span class="method-args">(el, xpath) {|found_el| ...}</span>
463
- </a>
464
- </div>
465
-
466
- <div class="method-description">
467
- <p><a class="source-toggle" href="#"
468
- onclick="toggleCode('M000202-source');return false;">[Source]</a></p>
469
- <div class="method-source-code" id="M000202-source">
470
- <pre>
471
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 320</span>
472
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Job</span>.<span class="ruby-identifier">with_first</span>(<span class="ruby-identifier">el</span>, <span class="ruby-identifier">xpath</span>)
473
- <span class="ruby-identifier">found_el</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">el</span>, <span class="ruby-identifier">xpath</span>, <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespaces</span><span class="ruby-operator">::</span><span class="ruby-constant">MAPPING</span>)
474
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">found_el</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
475
- <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">found_el</span>
476
- <span class="ruby-keyword kw">end</span>
477
- <span class="ruby-keyword kw">end</span>
478
- </pre>
479
- </div>
480
- </div>
481
- </div>
482
-
483
- <h3 class="section-bar">Public Instance methods</h3>
484
-
485
- <div id="method-M000199" class="method-detail">
486
- <a name="M000199"></a>
487
-
488
- <div class="method-heading">
489
- <a href="#M000199" class="method-signature">
490
- <span class="method-name">completed?</span><span class="method-args">()</span>
491
- </a>
492
- </div>
493
-
494
- <div class="method-description">
495
- <p>
496
- Has the job <a href="Job.html#M000199">completed?</a>
497
- </p>
498
- <p><a class="source-toggle" href="#"
499
- onclick="toggleCode('M000199-source');return false;">[Source]</a></p>
500
- <div class="method-source-code" id="M000199-source">
501
- <pre>
502
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 304</span>
503
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">completed?</span>
504
- <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@completion_status</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
505
- <span class="ruby-keyword kw">end</span>
506
- </pre>
507
- </div>
508
- </div>
509
- </div>
510
-
511
- <div id="method-M000197" class="method-detail">
512
- <a name="M000197"></a>
513
-
514
- <div class="method-heading">
515
- <a href="#M000197" class="method-signature">
516
- <span class="method-name">progress_updates</span><span class="method-args">()</span>
517
- </a>
518
- </div>
519
-
520
- <div class="method-description">
521
- <p><a class="source-toggle" href="#"
522
- onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
523
- <div class="method-source-code" id="M000197-source">
524
- <pre>
525
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 291</span>
526
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">progress_updates</span>()
527
- <span class="ruby-ivar">@progress_updates</span>.<span class="ruby-identifier">sort!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span>
528
- <span class="ruby-identifier">x</span>.<span class="ruby-identifier">time</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">y</span>.<span class="ruby-identifier">time</span>
529
- }
530
- <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@progress_updates</span>
531
- <span class="ruby-keyword kw">end</span>
532
- </pre>
533
- </div>
534
- </div>
535
- </div>
536
-
537
- <div id="method-M000201" class="method-detail">
538
- <a name="M000201"></a>
539
-
540
- <div class="method-heading">
541
- <a href="#M000201" class="method-signature">
542
- <span class="method-name">running?</span><span class="method-args">()</span>
543
- </a>
544
- </div>
545
-
546
- <div class="method-description">
547
- <p>
548
- Is the job still <a href="Job.html#M000201">running?</a>
549
- </p>
550
- <p><a class="source-toggle" href="#"
551
- onclick="toggleCode('M000201-source');return false;">[Source]</a></p>
552
- <div class="method-source-code" id="M000201-source">
553
- <pre>
554
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 314</span>
555
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">running?</span>
556
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">started?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">completed?</span>
557
- <span class="ruby-keyword kw">end</span>
558
- </pre>
559
- </div>
560
- </div>
561
- </div>
562
-
563
- <div id="method-M000198" class="method-detail">
564
- <a name="M000198"></a>
565
-
566
- <div class="method-heading">
567
- <a href="#M000198" class="method-signature">
568
- <span class="method-name">started?</span><span class="method-args">()</span>
569
- </a>
570
- </div>
571
-
572
- <div class="method-description">
573
- <p>
574
- Has the job <a href="Job.html#M000198">started?</a>
575
- </p>
576
- <p><a class="source-toggle" href="#"
577
- onclick="toggleCode('M000198-source');return false;">[Source]</a></p>
578
- <div class="method-source-code" id="M000198-source">
579
- <pre>
580
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 299</span>
581
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">started?</span>
582
- <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@actual_start_time</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
583
- <span class="ruby-keyword kw">end</span>
584
- </pre>
585
- </div>
586
- </div>
587
- </div>
588
-
589
- <div id="method-M000200" class="method-detail">
590
- <a name="M000200"></a>
591
-
592
- <div class="method-heading">
593
- <a href="#M000200" class="method-signature">
594
- <span class="method-name">successful?</span><span class="method-args">()</span>
595
- </a>
596
- </div>
597
-
598
- <div class="method-description">
599
- <p>
600
- Was the job <a href="Job.html#M000200">successful?</a>
601
- </p>
602
- <p><a class="source-toggle" href="#"
603
- onclick="toggleCode('M000200-source');return false;">[Source]</a></p>
604
- <div class="method-source-code" id="M000200-source">
605
- <pre>
606
- <span class="ruby-comment cmt"># File lib/pho/job.rb, line 309</span>
607
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successful?</span>
608
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">completed?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@completion_status</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">Job</span><span class="ruby-operator">::</span><span class="ruby-constant">SUCCESS</span>
609
- <span class="ruby-keyword kw">end</span>
610
- </pre>
611
- </div>
612
- </div>
613
- </div>
614
-
615
-
616
- </div>
617
-
618
-
619
- </div>
620
-
621
-
622
- <div id="validator-badges">
623
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
624
- </div>
625
-
626
- </body>
627
- </html>