pho 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/CHANGES +17 -0
  2. data/Rakefile +10 -2
  3. data/bin/talis_store +37 -92
  4. data/doc/rdoc/classes/Pho.html +11 -0
  5. data/doc/rdoc/classes/Pho/CommandLine.html +508 -0
  6. data/doc/rdoc/classes/Pho/DatatypeProperty.html +15 -15
  7. data/doc/rdoc/classes/Pho/Enrichment.html +1 -1
  8. data/doc/rdoc/classes/Pho/Enrichment/{ResourceEnricher.html → StoreEnricher.html} +158 -58
  9. data/doc/rdoc/classes/Pho/Etags.html +36 -36
  10. data/doc/rdoc/classes/Pho/Facet/Results.html +19 -19
  11. data/doc/rdoc/classes/Pho/Facet/Term.html +6 -6
  12. data/doc/rdoc/classes/Pho/FieldPredicateMap.html +94 -94
  13. data/doc/rdoc/classes/Pho/FieldWeighting.html +14 -14
  14. data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +126 -91
  15. data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +68 -62
  16. data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +22 -57
  17. data/doc/rdoc/classes/Pho/Job.html +68 -67
  18. data/doc/rdoc/classes/Pho/Jobs.html +62 -62
  19. data/doc/rdoc/classes/Pho/QueryProfile.html +64 -64
  20. data/doc/rdoc/classes/Pho/RDF.html +120 -0
  21. data/doc/rdoc/classes/Pho/RDF/Parser.html +277 -0
  22. data/doc/rdoc/classes/Pho/ResourceHash.html +1 -1
  23. data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +48 -46
  24. data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +15 -14
  25. data/doc/rdoc/classes/Pho/Snapshot.html +36 -36
  26. data/doc/rdoc/classes/Pho/Sparql.html +50 -0
  27. data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +147 -68
  28. data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +195 -114
  29. data/doc/rdoc/classes/Pho/Status.html +26 -26
  30. data/doc/rdoc/classes/Pho/Store.html +271 -264
  31. data/doc/rdoc/classes/Pho/StoreSparqlClient.html +183 -0
  32. data/doc/rdoc/classes/Pho/Update.html +1 -0
  33. data/doc/rdoc/classes/Pho/Update/Changeset.html +69 -68
  34. data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +24 -24
  35. data/doc/rdoc/classes/Pho/Update/Changesets.html +15 -14
  36. data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +18 -18
  37. data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +24 -24
  38. data/doc/rdoc/classes/Pho/Update/Statement.html +28 -27
  39. data/doc/rdoc/classes/String.html +1 -1
  40. data/doc/rdoc/created.rid +1 -1
  41. data/doc/rdoc/files/CHANGES.html +53 -1
  42. data/doc/rdoc/files/lib/pho/changeset_rb.html +1 -1
  43. data/doc/rdoc/files/lib/pho/command_line_rb.html +101 -0
  44. data/doc/rdoc/files/lib/pho/converter_rb.html +1 -1
  45. data/doc/rdoc/files/lib/pho/enrichment_rb.html +1 -1
  46. data/doc/rdoc/files/lib/pho/file_management_rb.html +1 -1
  47. data/doc/rdoc/files/lib/pho/file_manager_rb.html +1 -1
  48. data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +1 -1
  49. data/doc/rdoc/files/lib/pho/rdf_rb.html +108 -0
  50. data/doc/rdoc/files/lib/pho/sparql_rb.html +1 -1
  51. data/doc/rdoc/files/lib/pho/store_rb.html +8 -1
  52. data/doc/rdoc/files/lib/pho_rb.html +4 -2
  53. data/doc/rdoc/fr_class_index.html +6 -1
  54. data/doc/rdoc/fr_file_index.html +2 -0
  55. data/doc/rdoc/fr_method_index.html +192 -172
  56. data/examples/calais/bio.txt +7 -0
  57. data/examples/calais/dump.rb +17 -0
  58. data/examples/calais/enlighten.rb +23 -0
  59. data/examples/calais/output.rdf +25 -0
  60. data/examples/sinatra/viewer.rb +20 -0
  61. data/lib/pho.rb +4 -1
  62. data/lib/pho/changeset.rb +17 -1
  63. data/lib/pho/command_line.rb +166 -0
  64. data/lib/pho/converter.rb +8 -3
  65. data/lib/pho/enrichment.rb +93 -28
  66. data/lib/pho/file_management.rb +32 -19
  67. data/lib/pho/file_manager.rb +22 -26
  68. data/lib/pho/rdf.rb +74 -0
  69. data/lib/pho/rdf_collection.rb +2 -17
  70. data/lib/pho/sparql.rb +150 -38
  71. data/lib/pho/store.rb +28 -2
  72. data/tests/tc_contentbox.rb +41 -0
  73. data/tests/tc_enrichment.rb +41 -4
  74. data/tests/tc_file_manager.rb +97 -7
  75. data/tests/tc_rdf_collection.rb +25 -13
  76. data/tests/tc_rdf_parser.rb +37 -0
  77. data/tests/tc_sparql.rb +72 -2
  78. data/tests/tc_sparql_helper.rb +16 -0
  79. data/tests/ts_pho.rb +2 -1
  80. metadata +20 -3
@@ -88,10 +88,10 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000035">list</a>&nbsp;&nbsp;
92
- <a href="#M000034">new</a>&nbsp;&nbsp;
93
- <a href="#M000036">new_files</a>&nbsp;&nbsp;
94
- <a href="#M000037">store_file</a>&nbsp;&nbsp;
91
+ <a href="#M000037">list</a>&nbsp;&nbsp;
92
+ <a href="#M000038">name_for_file</a>&nbsp;&nbsp;
93
+ <a href="#M000036">new</a>&nbsp;&nbsp;
94
+ <a href="#M000039">store_file</a>&nbsp;&nbsp;
95
95
  </div>
96
96
  </div>
97
97
 
@@ -106,6 +106,19 @@
106
106
 
107
107
 
108
108
 
109
+ <div id="attribute-list">
110
+ <h3 class="section-bar">Attributes</h3>
111
+
112
+ <div class="name-list">
113
+ <table>
114
+ <tr class="top-aligned-row context-row">
115
+ <td class="context-item-name">base</td>
116
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
117
+ <td class="context-item-desc"></td>
118
+ </tr>
119
+ </table>
120
+ </div>
121
+ </div>
109
122
 
110
123
 
111
124
 
@@ -113,96 +126,88 @@
113
126
  <div id="methods">
114
127
  <h3 class="section-bar">Public Class methods</h3>
115
128
 
116
- <div id="method-M000034" class="method-detail">
117
- <a name="M000034"></a>
129
+ <div id="method-M000038" class="method-detail">
130
+ <a name="M000038"></a>
118
131
 
119
132
  <div class="method-heading">
120
- <a href="#M000034" class="method-signature">
121
- <span class="method-name">new</span><span class="method-args">(store, dir, ok_suffix=OK, fail_suffix=FAIL, sleep=1)</span>
133
+ <a href="#M000038" class="method-signature">
134
+ <span class="method-name">name_for_file</span><span class="method-args">(dir, file, base=nil)</span>
122
135
  </a>
123
136
  </div>
124
137
 
125
138
  <div class="method-description">
126
139
  <p><a class="source-toggle" href="#"
127
- onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
128
- <div class="method-source-code" id="M000034-source">
140
+ onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
141
+ <div class="method-source-code" id="M000038-source">
129
142
  <pre>
130
- <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 9</span>
131
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">ok_suffix</span>=<span class="ruby-constant">OK</span>, <span class="ruby-identifier">fail_suffix</span>=<span class="ruby-constant">FAIL</span>, <span class="ruby-identifier">sleep</span>=<span class="ruby-value">1</span>)
132
- <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">ok_suffix</span>, <span class="ruby-identifier">fail_suffix</span>, <span class="ruby-identifier">sleep</span>)
143
+ <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 32</span>
144
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">FileManager</span>.<span class="ruby-identifier">name_for_file</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">base</span>=<span class="ruby-keyword kw">nil</span>)
145
+ <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-value str">&quot;&quot;</span>)
146
+ <span class="ruby-identifier">uri</span> = <span class="ruby-node">&quot;#{base}#{uri}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
147
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">uri</span>
133
148
  <span class="ruby-keyword kw">end</span>
134
149
  </pre>
135
150
  </div>
136
151
  </div>
137
152
  </div>
138
153
 
139
- <h3 class="section-bar">Public Instance methods</h3>
140
-
141
- <div id="method-M000035" class="method-detail">
142
- <a name="M000035"></a>
154
+ <div id="method-M000036" class="method-detail">
155
+ <a name="M000036"></a>
143
156
 
144
157
  <div class="method-heading">
145
- <a href="#M000035" class="method-signature">
146
- <span class="method-name">list</span><span class="method-args">()</span>
158
+ <a href="#M000036" class="method-signature">
159
+ <span class="method-name">new</span><span class="method-args">(store, dir, base = nil, ok_suffix=OK, fail_suffix=FAIL, sleep=1)</span>
147
160
  </a>
148
161
  </div>
149
162
 
150
163
  <div class="method-description">
151
- <p>
152
- List files being managed, i.e. everything not .ok or .fail
153
- </p>
154
164
  <p><a class="source-toggle" href="#"
155
- onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
156
- <div class="method-source-code" id="M000035-source">
165
+ onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
166
+ <div class="method-source-code" id="M000036-source">
157
167
  <pre>
158
- <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 14</span>
159
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">list</span>()
160
- <span class="ruby-identifier">files</span> = []
161
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-value str">&quot;*&quot;</span>) ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
162
- <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span>
163
- <span class="ruby-identifier">files</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>
164
- <span class="ruby-keyword kw">end</span>
165
- <span class="ruby-keyword kw">end</span>
166
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">files</span>
168
+ <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 11</span>
169
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">base</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">ok_suffix</span>=<span class="ruby-constant">OK</span>, <span class="ruby-identifier">fail_suffix</span>=<span class="ruby-constant">FAIL</span>, <span class="ruby-identifier">sleep</span>=<span class="ruby-value">1</span>)
170
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">ok_suffix</span>, <span class="ruby-identifier">fail_suffix</span>, <span class="ruby-identifier">sleep</span>)
171
+ <span class="ruby-ivar">@base</span> = <span class="ruby-identifier">base</span>
167
172
  <span class="ruby-keyword kw">end</span>
168
173
  </pre>
169
174
  </div>
170
175
  </div>
171
176
  </div>
172
177
 
173
- <div id="method-M000036" class="method-detail">
174
- <a name="M000036"></a>
178
+ <h3 class="section-bar">Public Instance methods</h3>
179
+
180
+ <div id="method-M000037" class="method-detail">
181
+ <a name="M000037"></a>
175
182
 
176
183
  <div class="method-heading">
177
- <a href="#M000036" class="method-signature">
178
- <span class="method-name">new_files</span><span class="method-args">()</span>
184
+ <a href="#M000037" class="method-signature">
185
+ <span class="method-name">list</span><span class="method-args">(recursive=false)</span>
179
186
  </a>
180
187
  </div>
181
188
 
182
189
  <div class="method-description">
183
190
  <p>
184
- List any <a href="FileManager.html#M000034">new</a> files in the directory
191
+ List files being managed, i.e. everything not .ok or .fail
185
192
  </p>
186
193
  <p><a class="source-toggle" href="#"
187
- onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
188
- <div class="method-source-code" id="M000036-source">
194
+ onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
195
+ <div class="method-source-code" id="M000037-source">
189
196
  <pre>
190
- <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 25</span>
191
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_files</span>()
192
- <span class="ruby-identifier">newfiles</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
193
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-value str">&quot;*&quot;</span>) ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
194
-
195
- <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span>
196
- <span class="ruby-identifier">ok_file</span> = <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">file</span>)
197
- <span class="ruby-identifier">fail_file</span> = <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">file</span>)
198
- <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">ok_file</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">fail_file</span>) )
199
- <span class="ruby-identifier">newfiles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>
200
- <span class="ruby-keyword kw">end</span>
201
-
197
+ <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 17</span>
198
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">list</span>(<span class="ruby-identifier">recursive</span>=<span class="ruby-keyword kw">false</span>)
199
+ <span class="ruby-identifier">files</span> = []
200
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">recursive</span>
201
+ <span class="ruby-identifier">pattern</span> = <span class="ruby-value str">&quot;**/*&quot;</span>
202
+ <span class="ruby-keyword kw">else</span>
203
+ <span class="ruby-identifier">pattern</span> = <span class="ruby-value str">&quot;*&quot;</span>
202
204
  <span class="ruby-keyword kw">end</span>
203
-
204
- <span class="ruby-keyword kw">end</span>
205
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">newfiles</span>
205
+ <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-identifier">pattern</span>) ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
206
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">!=</span> <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">file</span>)
207
+ <span class="ruby-identifier">files</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>
208
+ <span class="ruby-keyword kw">end</span>
209
+ <span class="ruby-keyword kw">end</span>
210
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">files</span>
206
211
  <span class="ruby-keyword kw">end</span>
207
212
  </pre>
208
213
  </div>
@@ -211,23 +216,24 @@ List any <a href="FileManager.html#M000034">new</a> files in the directory
211
216
 
212
217
  <h3 class="section-bar">Protected Instance methods</h3>
213
218
 
214
- <div id="method-M000037" class="method-detail">
215
- <a name="M000037"></a>
219
+ <div id="method-M000039" class="method-detail">
220
+ <a name="M000039"></a>
216
221
 
217
222
  <div class="method-heading">
218
- <a href="#M000037" class="method-signature">
223
+ <a href="#M000039" class="method-signature">
219
224
  <span class="method-name">store_file</span><span class="method-args">(file, filename)</span>
220
225
  </a>
221
226
  </div>
222
227
 
223
228
  <div class="method-description">
224
229
  <p><a class="source-toggle" href="#"
225
- onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
226
- <div class="method-source-code" id="M000037-source">
230
+ onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
231
+ <div class="method-source-code" id="M000039-source">
227
232
  <pre>
228
- <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 45</span>
233
+ <span class="ruby-comment cmt"># File lib/pho/file_manager.rb, line 40</span>
229
234
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
230
- <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@store</span>.<span class="ruby-identifier">upload_item</span>(<span class="ruby-identifier">file</span>, <span class="ruby-constant">MIME</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span>.<span class="ruby-identifier">type_for</span>(<span class="ruby-identifier">filename</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_s</span> )
235
+ <span class="ruby-identifier">uri</span> = <span class="ruby-constant">FileManager</span>.<span class="ruby-identifier">name_for_file</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-identifier">file</span>, <span class="ruby-ivar">@base</span>)
236
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@store</span>.<span class="ruby-identifier">upload_item</span>(<span class="ruby-identifier">file</span>, <span class="ruby-constant">MIME</span><span class="ruby-operator">::</span><span class="ruby-constant">Types</span>.<span class="ruby-identifier">type_for</span>(<span class="ruby-identifier">filename</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">uri</span> )
231
237
  <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">response</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">300</span> )
232
238
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">filename</span>), <span class="ruby-value str">&quot;w&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
233
239
  <span class="ruby-identifier">file</span>.<span class="ruby-identifier">print</span>( <span class="ruby-value str">&quot;OK&quot;</span> )
@@ -98,10 +98,9 @@ Allows a collection to be mirrored into the platform
98
98
  <h3 class="section-bar">Methods</h3>
99
99
 
100
100
  <div class="name-list">
101
- <a href="#M000022">list</a>&nbsp;&nbsp;
102
- <a href="#M000021">new</a>&nbsp;&nbsp;
103
- <a href="#M000023">new_files</a>&nbsp;&nbsp;
104
- <a href="#M000024">store_file</a>&nbsp;&nbsp;
101
+ <a href="#M000024">list</a>&nbsp;&nbsp;
102
+ <a href="#M000023">new</a>&nbsp;&nbsp;
103
+ <a href="#M000025">store_file</a>&nbsp;&nbsp;
105
104
  </div>
106
105
  </div>
107
106
 
@@ -136,19 +135,19 @@ Allows a collection to be mirrored into the platform
136
135
  <div id="methods">
137
136
  <h3 class="section-bar">Public Class methods</h3>
138
137
 
139
- <div id="method-M000021" class="method-detail">
140
- <a name="M000021"></a>
138
+ <div id="method-M000023" class="method-detail">
139
+ <a name="M000023"></a>
141
140
 
142
141
  <div class="method-heading">
143
- <a href="#M000021" class="method-signature">
142
+ <a href="#M000023" class="method-signature">
144
143
  <span class="method-name">new</span><span class="method-args">(store, dir, rdf_suffix=RDF, ok_suffix=OK, fail_suffix=FAIL, sleep=1)</span>
145
144
  </a>
146
145
  </div>
147
146
 
148
147
  <div class="method-description">
149
148
  <p><a class="source-toggle" href="#"
150
- onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
151
- <div class="method-source-code" id="M000021-source">
149
+ onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
150
+ <div class="method-source-code" id="M000023-source">
152
151
  <pre>
153
152
  <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 13</span>
154
153
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">rdf_suffix</span>=<span class="ruby-constant">RDF</span>, <span class="ruby-identifier">ok_suffix</span>=<span class="ruby-constant">OK</span>, <span class="ruby-identifier">fail_suffix</span>=<span class="ruby-constant">FAIL</span>, <span class="ruby-identifier">sleep</span>=<span class="ruby-value">1</span>)
@@ -162,12 +161,12 @@ Allows a collection to be mirrored into the platform
162
161
 
163
162
  <h3 class="section-bar">Public Instance methods</h3>
164
163
 
165
- <div id="method-M000022" class="method-detail">
166
- <a name="M000022"></a>
164
+ <div id="method-M000024" class="method-detail">
165
+ <a name="M000024"></a>
167
166
 
168
167
  <div class="method-heading">
169
- <a href="#M000022" class="method-signature">
170
- <span class="method-name">list</span><span class="method-args">()</span>
168
+ <a href="#M000024" class="method-signature">
169
+ <span class="method-name">list</span><span class="method-args">(recursive=false)</span>
171
170
  </a>
172
171
  </div>
173
172
 
@@ -176,11 +175,11 @@ Allows a collection to be mirrored into the platform
176
175
  List files being managed
177
176
  </p>
178
177
  <p><a class="source-toggle" href="#"
179
- onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
180
- <div class="method-source-code" id="M000022-source">
178
+ onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
179
+ <div class="method-source-code" id="M000024-source">
181
180
  <pre>
182
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 20</span>
183
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">list</span>()
181
+ <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 19</span>
182
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">list</span>(<span class="ruby-identifier">recursive</span>=<span class="ruby-keyword kw">false</span>)
184
183
  <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">&quot;*.#{@rdf_suffix}&quot;</span>) )
185
184
  <span class="ruby-keyword kw">end</span>
186
185
  </pre>
@@ -188,57 +187,23 @@ List files being managed
188
187
  </div>
189
188
  </div>
190
189
 
191
- <div id="method-M000023" class="method-detail">
192
- <a name="M000023"></a>
193
-
194
- <div class="method-heading">
195
- <a href="#M000023" class="method-signature">
196
- <span class="method-name">new_files</span><span class="method-args">()</span>
197
- </a>
198
- </div>
199
-
200
- <div class="method-description">
201
- <p>
202
- List any <a href="RDFManager.html#M000021">new</a> files in the directory
203
- </p>
204
- <p><a class="source-toggle" href="#"
205
- onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
206
- <div class="method-source-code" id="M000023-source">
207
- <pre>
208
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 25</span>
209
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_files</span>()
210
- <span class="ruby-identifier">newfiles</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
211
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">&quot;*.#{@rdf_suffix}&quot;</span>) ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
212
- <span class="ruby-identifier">ok_file</span> = <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">file</span>)
213
- <span class="ruby-identifier">fail_file</span> = <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">file</span>)
214
- <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">ok_file</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">fail_file</span>) )
215
- <span class="ruby-identifier">newfiles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>
216
- <span class="ruby-keyword kw">end</span>
217
- <span class="ruby-keyword kw">end</span>
218
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">newfiles</span>
219
- <span class="ruby-keyword kw">end</span>
220
- </pre>
221
- </div>
222
- </div>
223
- </div>
224
-
225
190
  <h3 class="section-bar">Protected Instance methods</h3>
226
191
 
227
- <div id="method-M000024" class="method-detail">
228
- <a name="M000024"></a>
192
+ <div id="method-M000025" class="method-detail">
193
+ <a name="M000025"></a>
229
194
 
230
195
  <div class="method-heading">
231
- <a href="#M000024" class="method-signature">
196
+ <a href="#M000025" class="method-signature">
232
197
  <span class="method-name">store_file</span><span class="method-args">(file, filename)</span>
233
198
  </a>
234
199
  </div>
235
200
 
236
201
  <div class="method-description">
237
202
  <p><a class="source-toggle" href="#"
238
- onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
239
- <div class="method-source-code" id="M000024-source">
203
+ onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
204
+ <div class="method-source-code" id="M000025-source">
240
205
  <pre>
241
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 40</span>
206
+ <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 25</span>
242
207
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
243
208
  <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@store</span>.<span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>)
244
209
  <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">response</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">300</span> )
@@ -101,16 +101,16 @@ about a specific <a href="Job.html">Job</a> from a platform store
101
101
  <h3 class="section-bar">Methods</h3>
102
102
 
103
103
  <div class="name-list">
104
- <a href="#M000165">completed?</a>&nbsp;&nbsp;
105
- <a href="#M000160">new</a>&nbsp;&nbsp;
106
- <a href="#M000162">parse</a>&nbsp;&nbsp;
107
- <a href="#M000163">progress_updates</a>&nbsp;&nbsp;
108
- <a href="#M000161">read_from_store</a>&nbsp;&nbsp;
109
- <a href="#M000167">running?</a>&nbsp;&nbsp;
110
- <a href="#M000164">started?</a>&nbsp;&nbsp;
111
- <a href="#M000166">successful?</a>&nbsp;&nbsp;
112
- <a href="#M000169">with_each</a>&nbsp;&nbsp;
113
- <a href="#M000168">with_first</a>&nbsp;&nbsp;
104
+ <a href="#M000185">completed?</a>&nbsp;&nbsp;
105
+ <a href="#M000180">new</a>&nbsp;&nbsp;
106
+ <a href="#M000182">parse</a>&nbsp;&nbsp;
107
+ <a href="#M000183">progress_updates</a>&nbsp;&nbsp;
108
+ <a href="#M000181">read_from_store</a>&nbsp;&nbsp;
109
+ <a href="#M000187">running?</a>&nbsp;&nbsp;
110
+ <a href="#M000184">started?</a>&nbsp;&nbsp;
111
+ <a href="#M000186">successful?</a>&nbsp;&nbsp;
112
+ <a href="#M000189">with_each</a>&nbsp;&nbsp;
113
+ <a href="#M000188">with_first</a>&nbsp;&nbsp;
114
114
  </div>
115
115
  </div>
116
116
 
@@ -255,11 +255,11 @@ URI of the job
255
255
  <div id="methods">
256
256
  <h3 class="section-bar">Public Class methods</h3>
257
257
 
258
- <div id="method-M000160" class="method-detail">
259
- <a name="M000160"></a>
258
+ <div id="method-M000180" class="method-detail">
259
+ <a name="M000180"></a>
260
260
 
261
261
  <div class="method-heading">
262
- <a href="#M000160" class="method-signature">
262
+ <a href="#M000180" class="method-signature">
263
263
  <span class="method-name">new</span><span class="method-args">(uri, label, type, start_time, created=nil)</span>
264
264
  </a>
265
265
  </div>
@@ -286,8 +286,8 @@ Constructor. Used in the reading/parsing code
286
286
  </td></tr>
287
287
  </table>
288
288
  <p><a class="source-toggle" href="#"
289
- onclick="toggleCode('M000160-source');return false;">[Source]</a></p>
290
- <div class="method-source-code" id="M000160-source">
289
+ onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
290
+ <div class="method-source-code" id="M000180-source">
291
291
  <pre>
292
292
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 214</span>
293
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>)
@@ -303,31 +303,32 @@ Constructor. Used in the reading/parsing code
303
303
  </div>
304
304
  </div>
305
305
 
306
- <div id="method-M000162" class="method-detail">
307
- <a name="M000162"></a>
306
+ <div id="method-M000182" class="method-detail">
307
+ <a name="M000182"></a>
308
308
 
309
309
  <div class="method-heading">
310
- <a href="#M000162" class="method-signature">
310
+ <a href="#M000182" class="method-signature">
311
311
  <span class="method-name">parse</span><span class="method-args">(uri, xml)</span>
312
312
  </a>
313
313
  </div>
314
314
 
315
315
  <div class="method-description">
316
316
  <p>
317
- Parses job metadata returned from the platform as RDF/XML, creating a fully
318
- populated <a href="Job.html">Job</a> instance
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
319
320
  </p>
320
321
  <table>
321
322
  <tr><td valign="top">uri:</td><td>uri of the job to be parsed
322
323
 
323
324
  </td></tr>
324
- <tr><td valign="top">xml:</td><td>the RDF/XML text to be parsed
325
+ <tr><td valign="top">xml:</td><td>the <a href="RDF.html">RDF</a>/XML text to be parsed
325
326
 
326
327
  </td></tr>
327
328
  </table>
328
329
  <p><a class="source-toggle" href="#"
329
- onclick="toggleCode('M000162-source');return false;">[Source]</a></p>
330
- <div class="method-source-code" id="M000162-source">
330
+ onclick="toggleCode('M000182-source');return false;">[Source]</a></p>
331
+ <div class="method-source-code" id="M000182-source">
331
332
  <pre>
332
333
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 241</span>
333
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>)
@@ -384,11 +385,11 @@ populated <a href="Job.html">Job</a> instance
384
385
  </div>
385
386
  </div>
386
387
 
387
- <div id="method-M000161" class="method-detail">
388
- <a name="M000161"></a>
388
+ <div id="method-M000181" class="method-detail">
389
+ <a name="M000181"></a>
389
390
 
390
391
  <div class="method-heading">
391
- <a href="#M000161" class="method-signature">
392
+ <a href="#M000181" class="method-signature">
392
393
  <span class="method-name">read_from_store</span><span class="method-args">(uri, store)</span>
393
394
  </a>
394
395
  </div>
@@ -406,8 +407,8 @@ Read a job from a store
406
407
  </td></tr>
407
408
  </table>
408
409
  <p><a class="source-toggle" href="#"
409
- onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
410
- <div class="method-source-code" id="M000161-source">
410
+ onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
411
+ <div class="method-source-code" id="M000181-source">
411
412
  <pre>
412
413
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 227</span>
413
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>)
@@ -425,19 +426,19 @@ Read a job from a store
425
426
 
426
427
  <h3 class="section-bar">Protected Class methods</h3>
427
428
 
428
- <div id="method-M000169" class="method-detail">
429
- <a name="M000169"></a>
429
+ <div id="method-M000189" class="method-detail">
430
+ <a name="M000189"></a>
430
431
 
431
432
  <div class="method-heading">
432
- <a href="#M000169" class="method-signature">
433
+ <a href="#M000189" class="method-signature">
433
434
  <span class="method-name">with_each</span><span class="method-args">(el, xpath) {|ref_el| ...}</span>
434
435
  </a>
435
436
  </div>
436
437
 
437
438
  <div class="method-description">
438
439
  <p><a class="source-toggle" href="#"
439
- onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
440
- <div class="method-source-code" id="M000169-source">
440
+ onclick="toggleCode('M000189-source');return false;">[Source]</a></p>
441
+ <div class="method-source-code" id="M000189-source">
441
442
  <pre>
442
443
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 327</span>
443
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>)
@@ -453,19 +454,19 @@ Read a job from a store
453
454
  </div>
454
455
  </div>
455
456
 
456
- <div id="method-M000168" class="method-detail">
457
- <a name="M000168"></a>
457
+ <div id="method-M000188" class="method-detail">
458
+ <a name="M000188"></a>
458
459
 
459
460
  <div class="method-heading">
460
- <a href="#M000168" class="method-signature">
461
+ <a href="#M000188" class="method-signature">
461
462
  <span class="method-name">with_first</span><span class="method-args">(el, xpath) {|found_el| ...}</span>
462
463
  </a>
463
464
  </div>
464
465
 
465
466
  <div class="method-description">
466
467
  <p><a class="source-toggle" href="#"
467
- onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
468
- <div class="method-source-code" id="M000168-source">
468
+ onclick="toggleCode('M000188-source');return false;">[Source]</a></p>
469
+ <div class="method-source-code" id="M000188-source">
469
470
  <pre>
470
471
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 320</span>
471
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>)
@@ -481,22 +482,22 @@ Read a job from a store
481
482
 
482
483
  <h3 class="section-bar">Public Instance methods</h3>
483
484
 
484
- <div id="method-M000165" class="method-detail">
485
- <a name="M000165"></a>
485
+ <div id="method-M000185" class="method-detail">
486
+ <a name="M000185"></a>
486
487
 
487
488
  <div class="method-heading">
488
- <a href="#M000165" class="method-signature">
489
+ <a href="#M000185" class="method-signature">
489
490
  <span class="method-name">completed?</span><span class="method-args">()</span>
490
491
  </a>
491
492
  </div>
492
493
 
493
494
  <div class="method-description">
494
495
  <p>
495
- Has the job <a href="Job.html#M000165">completed?</a>
496
+ Has the job <a href="Job.html#M000185">completed?</a>
496
497
  </p>
497
498
  <p><a class="source-toggle" href="#"
498
- onclick="toggleCode('M000165-source');return false;">[Source]</a></p>
499
- <div class="method-source-code" id="M000165-source">
499
+ onclick="toggleCode('M000185-source');return false;">[Source]</a></p>
500
+ <div class="method-source-code" id="M000185-source">
500
501
  <pre>
501
502
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 304</span>
502
503
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">completed?</span>
@@ -507,19 +508,19 @@ Has the job <a href="Job.html#M000165">completed?</a>
507
508
  </div>
508
509
  </div>
509
510
 
510
- <div id="method-M000163" class="method-detail">
511
- <a name="M000163"></a>
511
+ <div id="method-M000183" class="method-detail">
512
+ <a name="M000183"></a>
512
513
 
513
514
  <div class="method-heading">
514
- <a href="#M000163" class="method-signature">
515
+ <a href="#M000183" class="method-signature">
515
516
  <span class="method-name">progress_updates</span><span class="method-args">()</span>
516
517
  </a>
517
518
  </div>
518
519
 
519
520
  <div class="method-description">
520
521
  <p><a class="source-toggle" href="#"
521
- onclick="toggleCode('M000163-source');return false;">[Source]</a></p>
522
- <div class="method-source-code" id="M000163-source">
522
+ onclick="toggleCode('M000183-source');return false;">[Source]</a></p>
523
+ <div class="method-source-code" id="M000183-source">
523
524
  <pre>
524
525
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 291</span>
525
526
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">progress_updates</span>()
@@ -533,22 +534,22 @@ Has the job <a href="Job.html#M000165">completed?</a>
533
534
  </div>
534
535
  </div>
535
536
 
536
- <div id="method-M000167" class="method-detail">
537
- <a name="M000167"></a>
537
+ <div id="method-M000187" class="method-detail">
538
+ <a name="M000187"></a>
538
539
 
539
540
  <div class="method-heading">
540
- <a href="#M000167" class="method-signature">
541
+ <a href="#M000187" class="method-signature">
541
542
  <span class="method-name">running?</span><span class="method-args">()</span>
542
543
  </a>
543
544
  </div>
544
545
 
545
546
  <div class="method-description">
546
547
  <p>
547
- Is the job still <a href="Job.html#M000167">running?</a>
548
+ Is the job still <a href="Job.html#M000187">running?</a>
548
549
  </p>
549
550
  <p><a class="source-toggle" href="#"
550
- onclick="toggleCode('M000167-source');return false;">[Source]</a></p>
551
- <div class="method-source-code" id="M000167-source">
551
+ onclick="toggleCode('M000187-source');return false;">[Source]</a></p>
552
+ <div class="method-source-code" id="M000187-source">
552
553
  <pre>
553
554
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 314</span>
554
555
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">running?</span>
@@ -559,22 +560,22 @@ Is the job still <a href="Job.html#M000167">running?</a>
559
560
  </div>
560
561
  </div>
561
562
 
562
- <div id="method-M000164" class="method-detail">
563
- <a name="M000164"></a>
563
+ <div id="method-M000184" class="method-detail">
564
+ <a name="M000184"></a>
564
565
 
565
566
  <div class="method-heading">
566
- <a href="#M000164" class="method-signature">
567
+ <a href="#M000184" class="method-signature">
567
568
  <span class="method-name">started?</span><span class="method-args">()</span>
568
569
  </a>
569
570
  </div>
570
571
 
571
572
  <div class="method-description">
572
573
  <p>
573
- Has the job <a href="Job.html#M000164">started?</a>
574
+ Has the job <a href="Job.html#M000184">started?</a>
574
575
  </p>
575
576
  <p><a class="source-toggle" href="#"
576
- onclick="toggleCode('M000164-source');return false;">[Source]</a></p>
577
- <div class="method-source-code" id="M000164-source">
577
+ onclick="toggleCode('M000184-source');return false;">[Source]</a></p>
578
+ <div class="method-source-code" id="M000184-source">
578
579
  <pre>
579
580
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 299</span>
580
581
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">started?</span>
@@ -585,22 +586,22 @@ Has the job <a href="Job.html#M000164">started?</a>
585
586
  </div>
586
587
  </div>
587
588
 
588
- <div id="method-M000166" class="method-detail">
589
- <a name="M000166"></a>
589
+ <div id="method-M000186" class="method-detail">
590
+ <a name="M000186"></a>
590
591
 
591
592
  <div class="method-heading">
592
- <a href="#M000166" class="method-signature">
593
+ <a href="#M000186" class="method-signature">
593
594
  <span class="method-name">successful?</span><span class="method-args">()</span>
594
595
  </a>
595
596
  </div>
596
597
 
597
598
  <div class="method-description">
598
599
  <p>
599
- Was the job <a href="Job.html#M000166">successful?</a>
600
+ Was the job <a href="Job.html#M000186">successful?</a>
600
601
  </p>
601
602
  <p><a class="source-toggle" href="#"
602
- onclick="toggleCode('M000166-source');return false;">[Source]</a></p>
603
- <div class="method-source-code" id="M000166-source">
603
+ onclick="toggleCode('M000186-source');return false;">[Source]</a></p>
604
+ <div class="method-source-code" id="M000186-source">
604
605
  <pre>
605
606
  <span class="ruby-comment cmt"># File lib/pho/job.rb, line 309</span>
606
607
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successful?</span>