pho 0.4.1 → 0.5

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 +18 -1
  2. data/README +10 -0
  3. data/Rakefile +2 -1
  4. data/doc/rdoc/classes/Pho.html +33 -22
  5. data/doc/rdoc/classes/Pho/DatatypeProperty.html +12 -12
  6. data/doc/rdoc/classes/Pho/{RDF_JSON.html → Enrichment.html} +8 -7
  7. data/doc/rdoc/classes/Pho/Enrichment/ResourceEnricher.html +310 -0
  8. data/doc/rdoc/classes/Pho/Etags.html +42 -42
  9. data/doc/rdoc/classes/Pho/Facet/Results.html +19 -19
  10. data/doc/rdoc/classes/Pho/Facet/Term.html +6 -6
  11. data/doc/rdoc/classes/Pho/FieldPredicateMap.html +110 -105
  12. data/doc/rdoc/classes/Pho/FieldWeighting.html +12 -12
  13. data/doc/rdoc/classes/Pho/FileManagement.html +121 -0
  14. data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +443 -0
  15. data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +258 -0
  16. data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +271 -0
  17. data/doc/rdoc/classes/Pho/Job.html +64 -64
  18. data/doc/rdoc/classes/Pho/Jobs.html +60 -60
  19. data/doc/rdoc/classes/Pho/QueryProfile.html +60 -60
  20. data/doc/rdoc/classes/Pho/RDFCollection.html +4 -378
  21. data/doc/rdoc/classes/Pho/ResourceHash.html +123 -0
  22. data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +323 -0
  23. data/doc/rdoc/classes/Pho/{RDF_JSON → ResourceHash}/SetAlgebra.html +18 -18
  24. data/doc/rdoc/classes/Pho/Snapshot.html +35 -35
  25. data/doc/rdoc/classes/Pho/Sparql.html +137 -0
  26. data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +515 -0
  27. data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +575 -0
  28. data/doc/rdoc/classes/Pho/Status.html +26 -26
  29. data/doc/rdoc/classes/Pho/Store.html +271 -241
  30. data/doc/rdoc/classes/Pho/Update/Changeset.html +73 -73
  31. data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +34 -34
  32. data/doc/rdoc/classes/Pho/Update/Changesets.html +14 -14
  33. data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +31 -23
  34. data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +45 -21
  35. data/doc/rdoc/classes/Pho/Update/Statement.html +29 -29
  36. data/doc/rdoc/classes/String.html +1 -1
  37. data/doc/rdoc/created.rid +1 -1
  38. data/doc/rdoc/files/CHANGES.html +49 -3
  39. data/doc/rdoc/files/README.html +15 -1
  40. data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +1 -1
  41. data/doc/rdoc/files/lib/pho/changeset_rb.html +1 -1
  42. data/doc/rdoc/files/lib/pho/converter_rb.html +108 -0
  43. data/doc/rdoc/files/lib/pho/enrichment_rb.html +101 -0
  44. data/doc/rdoc/files/lib/pho/etags_rb.html +1 -1
  45. data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +1 -1
  46. data/doc/rdoc/files/lib/pho/file_management_rb.html +101 -0
  47. data/doc/rdoc/files/lib/pho/file_manager_rb.html +108 -0
  48. data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +1 -1
  49. data/doc/rdoc/files/lib/pho/resource_hash_rb.html +101 -0
  50. data/doc/rdoc/files/lib/pho/{rdf_json_rb.html → sparql_rb.html} +4 -4
  51. data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
  52. data/doc/rdoc/files/lib/pho_rb.html +7 -2
  53. data/doc/rdoc/fr_class_index.html +12 -2
  54. data/doc/rdoc/fr_file_index.html +6 -1
  55. data/doc/rdoc/fr_method_index.html +176 -139
  56. data/examples/sparql_construct_hash.rb +26 -0
  57. data/examples/sparql_select.rb +18 -0
  58. data/lib/pho.rb +6 -1
  59. data/lib/pho/changeset.rb +24 -9
  60. data/lib/pho/changeset_builder.rb +10 -10
  61. data/lib/pho/converter.rb +74 -0
  62. data/lib/pho/enrichment.rb +81 -0
  63. data/lib/pho/etags.rb +1 -0
  64. data/lib/pho/field_predicate_map.rb +6 -1
  65. data/lib/pho/file_management.rb +102 -0
  66. data/lib/pho/file_manager.rb +61 -0
  67. data/lib/pho/rdf_collection.rb +54 -120
  68. data/lib/pho/{rdf_json.rb → resource_hash.rb} +3 -4
  69. data/lib/pho/sparql.rb +332 -0
  70. data/lib/pho/store.rb +20 -14
  71. data/tests/tc_changeset.rb +46 -0
  72. data/tests/tc_changeset_builder.rb +122 -1
  73. data/tests/tc_converter.rb +95 -0
  74. data/tests/tc_enrichment.rb +83 -0
  75. data/tests/tc_file_manager.rb +88 -0
  76. data/tests/tc_rdf_collection.rb +3 -0
  77. data/tests/{tc_rdf_json.rb → tc_resource_hash.rb} +23 -23
  78. data/tests/tc_search.rb +1 -1
  79. data/tests/tc_sparql.rb +131 -6
  80. data/tests/tc_sparql_helper.rb +214 -0
  81. data/tests/ts_pho.rb +6 -2
  82. metadata +47 -8
@@ -98,16 +98,16 @@ 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="#M000056">&lt;&lt;</a>&nbsp;&nbsp;
102
- <a href="#M000054">create_weighting</a>&nbsp;&nbsp;
103
- <a href="#M000057">get_by_name</a>&nbsp;&nbsp;
104
- <a href="#M000060">mapped_name?</a>&nbsp;&nbsp;
105
- <a href="#M000055">new</a>&nbsp;&nbsp;
106
- <a href="#M000053">read_from_store</a>&nbsp;&nbsp;
107
- <a href="#M000059">remove</a>&nbsp;&nbsp;
108
- <a href="#M000058">remove_by_name</a>&nbsp;&nbsp;
109
- <a href="#M000061">to_rdf</a>&nbsp;&nbsp;
110
- <a href="#M000062">upload</a>&nbsp;&nbsp;
101
+ <a href="#M000103">&lt;&lt;</a>&nbsp;&nbsp;
102
+ <a href="#M000101">create_weighting</a>&nbsp;&nbsp;
103
+ <a href="#M000104">get_by_name</a>&nbsp;&nbsp;
104
+ <a href="#M000107">mapped_name?</a>&nbsp;&nbsp;
105
+ <a href="#M000102">new</a>&nbsp;&nbsp;
106
+ <a href="#M000100">read_from_store</a>&nbsp;&nbsp;
107
+ <a href="#M000106">remove</a>&nbsp;&nbsp;
108
+ <a href="#M000105">remove_by_name</a>&nbsp;&nbsp;
109
+ <a href="#M000108">to_rdf</a>&nbsp;&nbsp;
110
+ <a href="#M000109">upload</a>&nbsp;&nbsp;
111
111
  </div>
112
112
  </div>
113
113
 
@@ -161,11 +161,11 @@ URI for this resource
161
161
  <div id="methods">
162
162
  <h3 class="section-bar">Public Class methods</h3>
163
163
 
164
- <div id="method-M000054" class="method-detail">
165
- <a name="M000054"></a>
164
+ <div id="method-M000101" class="method-detail">
165
+ <a name="M000101"></a>
166
166
 
167
167
  <div class="method-heading">
168
- <a href="#M000054" class="method-signature">
168
+ <a href="#M000101" class="method-signature">
169
169
  <span class="method-name">create_weighting</span><span class="method-args">(store, name, weight)</span>
170
170
  </a>
171
171
  </div>
@@ -188,8 +188,8 @@ according to the Platform naming rules
188
188
  </td></tr>
189
189
  </table>
190
190
  <p><a class="source-toggle" href="#"
191
- onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
192
- <div class="method-source-code" id="M000054-source">
191
+ onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
192
+ <div class="method-source-code" id="M000101-source">
193
193
  <pre>
194
194
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 84</span>
195
195
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">QueryProfile</span>.<span class="ruby-identifier">create_weighting</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">weight</span>)
@@ -206,19 +206,19 @@ according to the Platform naming rules
206
206
  </div>
207
207
  </div>
208
208
 
209
- <div id="method-M000055" class="method-detail">
210
- <a name="M000055"></a>
209
+ <div id="method-M000102" class="method-detail">
210
+ <a name="M000102"></a>
211
211
 
212
212
  <div class="method-heading">
213
- <a href="#M000055" class="method-signature">
213
+ <a href="#M000102" class="method-signature">
214
214
  <span class="method-name">new</span><span class="method-args">(uri, label, field_weights=Array.new)</span>
215
215
  </a>
216
216
  </div>
217
217
 
218
218
  <div class="method-description">
219
219
  <p><a class="source-toggle" href="#"
220
- onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
221
- <div class="method-source-code" id="M000055-source">
220
+ onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
221
+ <div class="method-source-code" id="M000102-source">
222
222
  <pre>
223
223
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 94</span>
224
224
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">field_weights</span>=<span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>)
@@ -231,19 +231,19 @@ according to the Platform naming rules
231
231
  </div>
232
232
  </div>
233
233
 
234
- <div id="method-M000053" class="method-detail">
235
- <a name="M000053"></a>
234
+ <div id="method-M000100" class="method-detail">
235
+ <a name="M000100"></a>
236
236
 
237
237
  <div class="method-heading">
238
- <a href="#M000053" class="method-signature">
238
+ <a href="#M000100" class="method-signature">
239
239
  <span class="method-name">read_from_store</span><span class="method-args">(store)</span>
240
240
  </a>
241
241
  </div>
242
242
 
243
243
  <div class="method-description">
244
244
  <p><a class="source-toggle" href="#"
245
- onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
246
- <div class="method-source-code" id="M000053-source">
245
+ onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
246
+ <div class="method-source-code" id="M000100-source">
247
247
  <pre>
248
248
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 53</span>
249
249
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">QueryProfile</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
@@ -277,19 +277,19 @@ according to the Platform naming rules
277
277
 
278
278
  <h3 class="section-bar">Public Instance methods</h3>
279
279
 
280
- <div id="method-M000056" class="method-detail">
281
- <a name="M000056"></a>
280
+ <div id="method-M000103" class="method-detail">
281
+ <a name="M000103"></a>
282
282
 
283
283
  <div class="method-heading">
284
- <a href="#M000056" class="method-signature">
284
+ <a href="#M000103" class="method-signature">
285
285
  <span class="method-name">&lt;&lt;</span><span class="method-args">(weight)</span>
286
286
  </a>
287
287
  </div>
288
288
 
289
289
  <div class="method-description">
290
290
  <p><a class="source-toggle" href="#"
291
- onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
292
- <div class="method-source-code" id="M000056-source">
291
+ onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
292
+ <div class="method-source-code" id="M000103-source">
293
293
  <pre>
294
294
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 100</span>
295
295
  <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;&lt;</span>(<span class="ruby-identifier">weight</span>)
@@ -300,11 +300,11 @@ according to the Platform naming rules
300
300
  </div>
301
301
  </div>
302
302
 
303
- <div id="method-M000057" class="method-detail">
304
- <a name="M000057"></a>
303
+ <div id="method-M000104" class="method-detail">
304
+ <a name="M000104"></a>
305
305
 
306
306
  <div class="method-heading">
307
- <a href="#M000057" class="method-signature">
307
+ <a href="#M000104" class="method-signature">
308
308
  <span class="method-name">get_by_name</span><span class="method-args">(name)</span>
309
309
  </a>
310
310
  </div>
@@ -314,8 +314,8 @@ according to the Platform naming rules
314
314
  Retrieve a FieldWeighing by name
315
315
  </p>
316
316
  <p><a class="source-toggle" href="#"
317
- onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
318
- <div class="method-source-code" id="M000057-source">
317
+ onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
318
+ <div class="method-source-code" id="M000104-source">
319
319
  <pre>
320
320
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 105</span>
321
321
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>)
@@ -326,11 +326,11 @@ Retrieve a FieldWeighing by name
326
326
  </div>
327
327
  </div>
328
328
 
329
- <div id="method-M000060" class="method-detail">
330
- <a name="M000060"></a>
329
+ <div id="method-M000107" class="method-detail">
330
+ <a name="M000107"></a>
331
331
 
332
332
  <div class="method-heading">
333
- <a href="#M000060" class="method-signature">
333
+ <a href="#M000107" class="method-signature">
334
334
  <span class="method-name">mapped_name?</span><span class="method-args">(name)</span>
335
335
  </a>
336
336
  </div>
@@ -340,8 +340,8 @@ Retrieve a FieldWeighing by name
340
340
  Is there a field weighting for a property with this name?
341
341
  </p>
342
342
  <p><a class="source-toggle" href="#"
343
- onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
344
- <div class="method-source-code" id="M000060-source">
343
+ onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
344
+ <div class="method-source-code" id="M000107-source">
345
345
  <pre>
346
346
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 123</span>
347
347
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapped_name?</span>(<span class="ruby-identifier">name</span>)
@@ -352,11 +352,11 @@ Is there a field weighting for a property with this name?
352
352
  </div>
353
353
  </div>
354
354
 
355
- <div id="method-M000059" class="method-detail">
356
- <a name="M000059"></a>
355
+ <div id="method-M000106" class="method-detail">
356
+ <a name="M000106"></a>
357
357
 
358
358
  <div class="method-heading">
359
- <a href="#M000059" class="method-signature">
359
+ <a href="#M000106" class="method-signature">
360
360
  <span class="method-name">remove</span><span class="method-args">(fw)</span>
361
361
  </a>
362
362
  </div>
@@ -367,8 +367,8 @@ Remove a <a href="FieldWeighting.html">FieldWeighting</a> from the
367
367
  collection
368
368
  </p>
369
369
  <p><a class="source-toggle" href="#"
370
- onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
371
- <div class="method-source-code" id="M000059-source">
370
+ onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
371
+ <div class="method-source-code" id="M000106-source">
372
372
  <pre>
373
373
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 118</span>
374
374
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">fw</span>)
@@ -379,11 +379,11 @@ collection
379
379
  </div>
380
380
  </div>
381
381
 
382
- <div id="method-M000058" class="method-detail">
383
- <a name="M000058"></a>
382
+ <div id="method-M000105" class="method-detail">
383
+ <a name="M000105"></a>
384
384
 
385
385
  <div class="method-heading">
386
- <a href="#M000058" class="method-signature">
386
+ <a href="#M000105" class="method-signature">
387
387
  <span class="method-name">remove_by_name</span><span class="method-args">(name)</span>
388
388
  </a>
389
389
  </div>
@@ -393,8 +393,8 @@ collection
393
393
  Remove a <a href="FieldWeighting.html">FieldWeighting</a> by name
394
394
  </p>
395
395
  <p><a class="source-toggle" href="#"
396
- onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
397
- <div class="method-source-code" id="M000058-source">
396
+ onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
397
+ <div class="method-source-code" id="M000105-source">
398
398
  <pre>
399
399
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 110</span>
400
400
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_by_name</span>(<span class="ruby-identifier">name</span>)
@@ -408,11 +408,11 @@ Remove a <a href="FieldWeighting.html">FieldWeighting</a> by name
408
408
  </div>
409
409
  </div>
410
410
 
411
- <div id="method-M000061" class="method-detail">
412
- <a name="M000061"></a>
411
+ <div id="method-M000108" class="method-detail">
412
+ <a name="M000108"></a>
413
413
 
414
414
  <div class="method-heading">
415
- <a href="#M000061" class="method-signature">
415
+ <a href="#M000108" class="method-signature">
416
416
  <span class="method-name">to_rdf</span><span class="method-args">()</span>
417
417
  </a>
418
418
  </div>
@@ -423,8 +423,8 @@ Dump this object to an RDF/XML representation suitable for submitting to
423
423
  the Platform
424
424
  </p>
425
425
  <p><a class="source-toggle" href="#"
426
- onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
427
- <div class="method-source-code" id="M000061-source">
426
+ onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
427
+ <div class="method-source-code" id="M000108-source">
428
428
  <pre>
429
429
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 128</span>
430
430
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rdf</span>
@@ -455,11 +455,11 @@ the Platform
455
455
  </div>
456
456
  </div>
457
457
 
458
- <div id="method-M000062" class="method-detail">
459
- <a name="M000062"></a>
458
+ <div id="method-M000109" class="method-detail">
459
+ <a name="M000109"></a>
460
460
 
461
461
  <div class="method-heading">
462
- <a href="#M000062" class="method-signature">
462
+ <a href="#M000109" class="method-signature">
463
463
  <span class="method-name">upload</span><span class="method-args">(store)</span>
464
464
  </a>
465
465
  </div>
@@ -470,8 +470,8 @@ Upload an RDF/XML presentation of this object to the provided Platform <a
470
470
  href="Store.html">Store</a>
471
471
  </p>
472
472
  <p><a class="source-toggle" href="#"
473
- onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
474
- <div class="method-source-code" id="M000062-source">
473
+ onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
474
+ <div class="method-source-code" id="M000109-source">
475
475
  <pre>
476
476
  <span class="ruby-comment cmt"># File lib/pho/query_profile.rb, line 153</span>
477
477
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upload</span>(<span class="ruby-identifier">store</span>)
@@ -65,7 +65,9 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- Object
68
+ <a href="FileManagement/RDFManager.html">
69
+ Pho::FileManagement::RDFManager
70
+ </a>
69
71
  </td>
70
72
  </tr>
71
73
  </table>
@@ -80,12 +82,7 @@
80
82
 
81
83
  <div id="description">
82
84
  <p>
83
- Provides a simple mechanism for managing a directory of RDF/XML documents
84
- and uploading them to platform <a
85
- href="RDFCollection.html#M000125">store</a>.
86
- </p>
87
- <p>
88
- Allows a collection to be mirrored into the platform
85
+ Deprecated. Use Pho::FileManangement::RDFManager instead
89
86
  </p>
90
87
 
91
88
  </div>
@@ -93,23 +90,6 @@ Allows a collection to be mirrored into the platform
93
90
 
94
91
  </div>
95
92
 
96
- <div id="method-list">
97
- <h3 class="section-bar">Methods</h3>
98
-
99
- <div class="name-list">
100
- <a href="#M000129">failures</a>&nbsp;&nbsp;
101
- <a href="#M000133">get_fail_file_for</a>&nbsp;&nbsp;
102
- <a href="#M000134">get_ok_file_for</a>&nbsp;&nbsp;
103
- <a href="#M000128">list</a>&nbsp;&nbsp;
104
- <a href="#M000124">new</a>&nbsp;&nbsp;
105
- <a href="#M000131">new_files</a>&nbsp;&nbsp;
106
- <a href="#M000127">reset</a>&nbsp;&nbsp;
107
- <a href="#M000126">retry_failures</a>&nbsp;&nbsp;
108
- <a href="#M000125">store</a>&nbsp;&nbsp;
109
- <a href="#M000130">successes</a>&nbsp;&nbsp;
110
- <a href="#M000132">summary</a>&nbsp;&nbsp;
111
- </div>
112
- </div>
113
93
 
114
94
  </div>
115
95
 
@@ -119,29 +99,6 @@ Allows a collection to be mirrored into the platform
119
99
  <div id="section">
120
100
 
121
101
 
122
- <div id="constants-list">
123
- <h3 class="section-bar">Constants</h3>
124
-
125
- <div class="name-list">
126
- <table summary="Constants">
127
- <tr class="top-aligned-row context-row">
128
- <td class="context-item-name">RDF</td>
129
- <td>=</td>
130
- <td class="context-item-value">&quot;rdf&quot;.freeze</td>
131
- </tr>
132
- <tr class="top-aligned-row context-row">
133
- <td class="context-item-name">OK</td>
134
- <td>=</td>
135
- <td class="context-item-value">&quot;ok&quot;.freeze</td>
136
- </tr>
137
- <tr class="top-aligned-row context-row">
138
- <td class="context-item-name">FAIL</td>
139
- <td>=</td>
140
- <td class="context-item-value">&quot;fail&quot;.freeze</td>
141
- </tr>
142
- </table>
143
- </div>
144
- </div>
145
102
 
146
103
 
147
104
 
@@ -149,337 +106,6 @@ Allows a collection to be mirrored into the platform
149
106
 
150
107
 
151
108
  <!-- if method_list -->
152
- <div id="methods">
153
- <h3 class="section-bar">Public Class methods</h3>
154
-
155
- <div id="method-M000124" class="method-detail">
156
- <a name="M000124"></a>
157
-
158
- <div class="method-heading">
159
- <a href="#M000124" class="method-signature">
160
- <span class="method-name">new</span><span class="method-args">(store, dir, rdf_suffix=RDF, ok_suffix=OK, fail_suffix=FAIL, sleep=1)</span>
161
- </a>
162
- </div>
163
-
164
- <div class="method-description">
165
- <p><a class="source-toggle" href="#"
166
- onclick="toggleCode('M000124-source');return false;">[Source]</a></p>
167
- <div class="method-source-code" id="M000124-source">
168
- <pre>
169
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 16</span>
170
- <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>)
171
- <span class="ruby-ivar">@store</span> = <span class="ruby-identifier">store</span>
172
- <span class="ruby-ivar">@dir</span> = <span class="ruby-identifier">dir</span>
173
- <span class="ruby-ivar">@sleep</span> = <span class="ruby-identifier">sleep</span>
174
- <span class="ruby-ivar">@rdf_suffix</span> = <span class="ruby-identifier">rdf_suffix</span>
175
- <span class="ruby-ivar">@ok_suffix</span> = <span class="ruby-identifier">ok_suffix</span>
176
- <span class="ruby-ivar">@fail_suffix</span> = <span class="ruby-identifier">fail_suffix</span>
177
- <span class="ruby-keyword kw">end</span>
178
- </pre>
179
- </div>
180
- </div>
181
- </div>
182
-
183
- <h3 class="section-bar">Public Instance methods</h3>
184
-
185
- <div id="method-M000129" class="method-detail">
186
- <a name="M000129"></a>
187
-
188
- <div class="method-heading">
189
- <a href="#M000129" class="method-signature">
190
- <span class="method-name">failures</span><span class="method-args">()</span>
191
- </a>
192
- </div>
193
-
194
- <div class="method-description">
195
- <p>
196
- List <a href="RDFCollection.html#M000129">failures</a>
197
- </p>
198
- <p><a class="source-toggle" href="#"
199
- onclick="toggleCode('M000129-source');return false;">[Source]</a></p>
200
- <div class="method-source-code" id="M000129-source">
201
- <pre>
202
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 62</span>
203
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failures</span>()
204
- <span class="ruby-identifier">fails</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</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-node">&quot;*.#{@fail_suffix}&quot;</span>) ).<span class="ruby-identifier">each</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-identifier">fails</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@fail_suffix}/</span>, <span class="ruby-node">&quot;.#{@rdf_suffix}&quot;</span>)
207
- <span class="ruby-keyword kw">end</span>
208
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fails</span>
209
- <span class="ruby-keyword kw">end</span>
210
- </pre>
211
- </div>
212
- </div>
213
- </div>
214
-
215
- <div id="method-M000133" class="method-detail">
216
- <a name="M000133"></a>
217
-
218
- <div class="method-heading">
219
- <a href="#M000133" class="method-signature">
220
- <span class="method-name">get_fail_file_for</span><span class="method-args">(filename)</span>
221
- </a>
222
- </div>
223
-
224
- <div class="method-description">
225
- <p><a class="source-toggle" href="#"
226
- onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
227
- <div class="method-source-code" id="M000133-source">
228
- <pre>
229
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 103</span>
230
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">filename</span>)
231
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@rdf_suffix}/</span>, <span class="ruby-node">&quot;.#{@fail_suffix}&quot;</span>)
232
- <span class="ruby-keyword kw">end</span>
233
- </pre>
234
- </div>
235
- </div>
236
- </div>
237
-
238
- <div id="method-M000134" class="method-detail">
239
- <a name="M000134"></a>
240
-
241
- <div class="method-heading">
242
- <a href="#M000134" class="method-signature">
243
- <span class="method-name">get_ok_file_for</span><span class="method-args">(filename)</span>
244
- </a>
245
- </div>
246
-
247
- <div class="method-description">
248
- <p><a class="source-toggle" href="#"
249
- onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
250
- <div class="method-source-code" id="M000134-source">
251
- <pre>
252
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 107</span>
253
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">filename</span>)
254
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@rdf_suffix}/</span>, <span class="ruby-node">&quot;.#{@ok_suffix}&quot;</span>)
255
- <span class="ruby-keyword kw">end</span>
256
- </pre>
257
- </div>
258
- </div>
259
- </div>
260
-
261
- <div id="method-M000128" class="method-detail">
262
- <a name="M000128"></a>
263
-
264
- <div class="method-heading">
265
- <a href="#M000128" class="method-signature">
266
- <span class="method-name">list</span><span class="method-args">()</span>
267
- </a>
268
- </div>
269
-
270
- <div class="method-description">
271
- <p>
272
- List files being managed
273
- </p>
274
- <p><a class="source-toggle" href="#"
275
- onclick="toggleCode('M000128-source');return false;">[Source]</a></p>
276
- <div class="method-source-code" id="M000128-source">
277
- <pre>
278
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 57</span>
279
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">list</span>()
280
- <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>) )
281
- <span class="ruby-keyword kw">end</span>
282
- </pre>
283
- </div>
284
- </div>
285
- </div>
286
-
287
- <div id="method-M000131" class="method-detail">
288
- <a name="M000131"></a>
289
-
290
- <div class="method-heading">
291
- <a href="#M000131" class="method-signature">
292
- <span class="method-name">new_files</span><span class="method-args">()</span>
293
- </a>
294
- </div>
295
-
296
- <div class="method-description">
297
- <p>
298
- List any <a href="RDFCollection.html#M000124">new</a> files in the
299
- directory
300
- </p>
301
- <p><a class="source-toggle" href="#"
302
- onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
303
- <div class="method-source-code" id="M000131-source">
304
- <pre>
305
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 80</span>
306
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_files</span>()
307
- <span class="ruby-identifier">newfiles</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
308
- <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>
309
- <span class="ruby-identifier">ok_file</span> = <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">file</span>)
310
- <span class="ruby-identifier">fail_file</span> = <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">file</span>)
311
- <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>) )
312
- <span class="ruby-identifier">newfiles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>
313
- <span class="ruby-keyword kw">end</span>
314
- <span class="ruby-keyword kw">end</span>
315
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">newfiles</span>
316
- <span class="ruby-keyword kw">end</span>
317
- </pre>
318
- </div>
319
- </div>
320
- </div>
321
-
322
- <div id="method-M000127" class="method-detail">
323
- <a name="M000127"></a>
324
-
325
- <div class="method-heading">
326
- <a href="#M000127" class="method-signature">
327
- <span class="method-name">reset</span><span class="method-args">(reset_store=false)</span>
328
- </a>
329
- </div>
330
-
331
- <div class="method-description">
332
- <p>
333
- Reset the directory to clear out any previous statuses <a
334
- href="Store.html">Store</a> can also be <a
335
- href="RDFCollection.html#M000127">reset</a> at the same time: use with
336
- care!
337
- </p>
338
- <p><a class="source-toggle" href="#"
339
- onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
340
- <div class="method-source-code" id="M000127-source">
341
- <pre>
342
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 47</span>
343
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>(<span class="ruby-identifier">reset_store</span>=<span class="ruby-keyword kw">false</span>)
344
- <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;*.#{@fail_suffix}&quot;</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
345
- <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file</span>)
346
- <span class="ruby-keyword kw">end</span>
347
- <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;*.#{@ok_suffix}&quot;</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
348
- <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file</span>)
349
- <span class="ruby-keyword kw">end</span>
350
- <span class="ruby-keyword kw">end</span>
351
- </pre>
352
- </div>
353
- </div>
354
- </div>
355
-
356
- <div id="method-M000126" class="method-detail">
357
- <a name="M000126"></a>
358
-
359
- <div class="method-heading">
360
- <a href="#M000126" class="method-signature">
361
- <span class="method-name">retry_failures</span><span class="method-args">()</span>
362
- </a>
363
- </div>
364
-
365
- <div class="method-description">
366
- <p>
367
- Retry anything known to have failed
368
- </p>
369
- <p><a class="source-toggle" href="#"
370
- onclick="toggleCode('M000126-source');return false;">[Source]</a></p>
371
- <div class="method-source-code" id="M000126-source">
372
- <pre>
373
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 35</span>
374
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retry_failures</span>()
375
- <span class="ruby-identifier">retries</span> = <span class="ruby-identifier">failures</span>()
376
- <span class="ruby-identifier">retries</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
377
- <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">filename</span>) )
378
- <span class="ruby-comment cmt">#store it</span>
379
- <span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>)
380
- <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
381
- <span class="ruby-keyword kw">end</span>
382
- <span class="ruby-keyword kw">end</span>
383
- </pre>
384
- </div>
385
- </div>
386
- </div>
387
-
388
- <div id="method-M000125" class="method-detail">
389
- <a name="M000125"></a>
390
-
391
- <div class="method-heading">
392
- <a href="#M000125" class="method-signature">
393
- <span class="method-name">store</span><span class="method-args">()</span>
394
- </a>
395
- </div>
396
-
397
- <div class="method-description">
398
- <p>
399
- <a href="Store.html">Store</a> all files that match the file name in
400
- directory
401
- </p>
402
- <p><a class="source-toggle" href="#"
403
- onclick="toggleCode('M000125-source');return false;">[Source]</a></p>
404
- <div class="method-source-code" id="M000125-source">
405
- <pre>
406
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 26</span>
407
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store</span>()
408
- <span class="ruby-identifier">files_to_store</span> = <span class="ruby-identifier">new_files</span>()
409
- <span class="ruby-identifier">files_to_store</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
410
- <span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>)
411
- <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
412
- <span class="ruby-keyword kw">end</span>
413
- <span class="ruby-keyword kw">end</span>
414
- </pre>
415
- </div>
416
- </div>
417
- </div>
418
-
419
- <div id="method-M000130" class="method-detail">
420
- <a name="M000130"></a>
421
-
422
- <div class="method-heading">
423
- <a href="#M000130" class="method-signature">
424
- <span class="method-name">successes</span><span class="method-args">()</span>
425
- </a>
426
- </div>
427
-
428
- <div class="method-description">
429
- <p>
430
- List <a href="RDFCollection.html#M000130">successes</a>
431
- </p>
432
- <p><a class="source-toggle" href="#"
433
- onclick="toggleCode('M000130-source');return false;">[Source]</a></p>
434
- <div class="method-source-code" id="M000130-source">
435
- <pre>
436
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 71</span>
437
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successes</span>()
438
- <span class="ruby-identifier">successes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
439
- <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;*.#{@ok_suffix}&quot;</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
440
- <span class="ruby-identifier">successes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@ok_suffix}/</span>, <span class="ruby-node">&quot;.#{@rdf_suffix}&quot;</span>)
441
- <span class="ruby-keyword kw">end</span>
442
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">successes</span>
443
- <span class="ruby-keyword kw">end</span>
444
- </pre>
445
- </div>
446
- </div>
447
- </div>
448
-
449
- <div id="method-M000132" class="method-detail">
450
- <a name="M000132"></a>
451
-
452
- <div class="method-heading">
453
- <a href="#M000132" class="method-signature">
454
- <span class="method-name">summary</span><span class="method-args">()</span>
455
- </a>
456
- </div>
457
-
458
- <div class="method-description">
459
- <p>
460
- Summarize the state of the collection to the provied IO object Creates a
461
- simple report
462
- </p>
463
- <p><a class="source-toggle" href="#"
464
- onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
465
- <div class="method-source-code" id="M000132-source">
466
- <pre>
467
- <span class="ruby-comment cmt"># File lib/pho/rdf_collection.rb, line 94</span>
468
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summary</span>()
469
- <span class="ruby-identifier">failures</span> = <span class="ruby-identifier">failures</span>()
470
- <span class="ruby-identifier">successes</span> = <span class="ruby-identifier">successes</span>()
471
- <span class="ruby-identifier">newfiles</span> = <span class="ruby-identifier">new_files</span>()
472
- <span class="ruby-identifier">total</span> = <span class="ruby-identifier">failures</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">successes</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">newfiles</span>.<span class="ruby-identifier">size</span>
473
- <span class="ruby-identifier">summary</span> = <span class="ruby-node">&quot;#{@dir} contains #{total} files: #{successes.size} stored, #{failures.size} failed, #{newfiles.size} new&quot;</span>
474
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">summary</span>
475
- <span class="ruby-keyword kw">end</span>
476
- </pre>
477
- </div>
478
- </div>
479
- </div>
480
-
481
-
482
- </div>
483
109
 
484
110
 
485
111
  </div>