pho 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/CHANGES +9 -0
  2. data/Rakefile +2 -1
  3. data/bin/talis_store +263 -0
  4. data/doc/rdoc/classes/Pho.html +3 -21
  5. data/doc/rdoc/classes/Pho/Analyzers.html +22 -0
  6. data/doc/rdoc/classes/Pho/DatatypeProperty.html +42 -10
  7. data/doc/rdoc/classes/Pho/Etags.html +102 -30
  8. data/doc/rdoc/classes/Pho/Facet/Results.html +81 -7
  9. data/doc/rdoc/classes/Pho/Facet/Term.html +13 -2
  10. data/doc/rdoc/classes/Pho/FieldPredicateMap.html +233 -30
  11. data/doc/rdoc/classes/Pho/FieldWeighting.html +38 -10
  12. data/doc/rdoc/classes/Pho/Job.html +488 -9
  13. data/doc/rdoc/classes/Pho/JobUpdate.html +141 -0
  14. data/doc/rdoc/classes/Pho/Jobs.html +538 -0
  15. data/doc/rdoc/classes/Pho/Namespaces.html +33 -2
  16. data/doc/rdoc/classes/Pho/QueryProfile.html +162 -20
  17. data/doc/rdoc/classes/Pho/RDFCollection.html +200 -60
  18. data/doc/rdoc/classes/Pho/Snapshot.html +162 -36
  19. data/doc/rdoc/classes/Pho/Status.html +59 -8
  20. data/doc/rdoc/classes/Pho/Store.html +589 -253
  21. data/doc/rdoc/created.rid +1 -1
  22. data/doc/rdoc/files/CHANGES.html +24 -1
  23. data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +1 -1
  24. data/doc/rdoc/files/lib/pho/job_rb.html +1 -1
  25. data/doc/rdoc/files/lib/pho/snapshot_rb.html +2 -1
  26. data/doc/rdoc/files/lib/pho/status_rb.html +1 -1
  27. data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
  28. data/doc/rdoc/files/lib/pho_rb.html +2 -1
  29. data/doc/rdoc/fr_class_index.html +2 -0
  30. data/doc/rdoc/fr_method_index.html +85 -68
  31. data/lib/pho.rb +18 -10
  32. data/lib/pho/field_predicate_map.rb +6 -1
  33. data/lib/pho/job.rb +326 -6
  34. data/lib/pho/snapshot.rb +46 -19
  35. data/lib/pho/store.rb +22 -56
  36. data/tests/tc_job.rb +262 -0
  37. data/tests/tc_jobcontrol.rb +159 -12
  38. data/tests/tc_snapshots.rb +57 -28
  39. data/tests/ts_pho.rb +1 -0
  40. metadata +9 -110
  41. data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000034.html +0 -21
  42. data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000035.html +0 -29
  43. data/doc/rdoc/classes/Pho/Etags.src/M000088.html +0 -23
  44. data/doc/rdoc/classes/Pho/Etags.src/M000089.html +0 -28
  45. data/doc/rdoc/classes/Pho/Etags.src/M000090.html +0 -21
  46. data/doc/rdoc/classes/Pho/Etags.src/M000091.html +0 -18
  47. data/doc/rdoc/classes/Pho/Etags.src/M000092.html +0 -18
  48. data/doc/rdoc/classes/Pho/Etags.src/M000093.html +0 -18
  49. data/doc/rdoc/classes/Pho/Facet/Results.src/M000001.html +0 -20
  50. data/doc/rdoc/classes/Pho/Facet/Results.src/M000002.html +0 -27
  51. data/doc/rdoc/classes/Pho/Facet/Results.src/M000003.html +0 -54
  52. data/doc/rdoc/classes/Pho/Facet/Term.src/M000004.html +0 -20
  53. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000005.html +0 -38
  54. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000006.html +0 -28
  55. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000007.html +0 -20
  56. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000008.html +0 -18
  57. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000009.html +0 -23
  58. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000010.html +0 -23
  59. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000011.html +0 -18
  60. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000012.html +0 -18
  61. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000013.html +0 -18
  62. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000014.html +0 -18
  63. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000015.html +0 -18
  64. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000016.html +0 -21
  65. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000017.html +0 -21
  66. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000018.html +0 -38
  67. data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000019.html +0 -18
  68. data/doc/rdoc/classes/Pho/FieldWeighting.src/M000075.html +0 -20
  69. data/doc/rdoc/classes/Pho/FieldWeighting.src/M000076.html +0 -26
  70. data/doc/rdoc/classes/Pho/Job.src/M000074.html +0 -21
  71. data/doc/rdoc/classes/Pho/QueryProfile.src/M000024.html +0 -39
  72. data/doc/rdoc/classes/Pho/QueryProfile.src/M000025.html +0 -24
  73. data/doc/rdoc/classes/Pho/QueryProfile.src/M000026.html +0 -20
  74. data/doc/rdoc/classes/Pho/QueryProfile.src/M000027.html +0 -18
  75. data/doc/rdoc/classes/Pho/QueryProfile.src/M000028.html +0 -18
  76. data/doc/rdoc/classes/Pho/QueryProfile.src/M000029.html +0 -21
  77. data/doc/rdoc/classes/Pho/QueryProfile.src/M000030.html +0 -18
  78. data/doc/rdoc/classes/Pho/QueryProfile.src/M000031.html +0 -18
  79. data/doc/rdoc/classes/Pho/QueryProfile.src/M000032.html +0 -38
  80. data/doc/rdoc/classes/Pho/QueryProfile.src/M000033.html +0 -18
  81. data/doc/rdoc/classes/Pho/RDFCollection.src/M000077.html +0 -23
  82. data/doc/rdoc/classes/Pho/RDFCollection.src/M000078.html +0 -22
  83. data/doc/rdoc/classes/Pho/RDFCollection.src/M000079.html +0 -24
  84. data/doc/rdoc/classes/Pho/RDFCollection.src/M000080.html +0 -23
  85. data/doc/rdoc/classes/Pho/RDFCollection.src/M000081.html +0 -18
  86. data/doc/rdoc/classes/Pho/RDFCollection.src/M000082.html +0 -22
  87. data/doc/rdoc/classes/Pho/RDFCollection.src/M000083.html +0 -22
  88. data/doc/rdoc/classes/Pho/RDFCollection.src/M000084.html +0 -26
  89. data/doc/rdoc/classes/Pho/RDFCollection.src/M000085.html +0 -23
  90. data/doc/rdoc/classes/Pho/RDFCollection.src/M000086.html +0 -18
  91. data/doc/rdoc/classes/Pho/RDFCollection.src/M000087.html +0 -18
  92. data/doc/rdoc/classes/Pho/Snapshot.src/M000070.html +0 -31
  93. data/doc/rdoc/classes/Pho/Snapshot.src/M000071.html +0 -21
  94. data/doc/rdoc/classes/Pho/Snapshot.src/M000072.html +0 -18
  95. data/doc/rdoc/classes/Pho/Snapshot.src/M000073.html +0 -37
  96. data/doc/rdoc/classes/Pho/Status.src/M000020.html +0 -20
  97. data/doc/rdoc/classes/Pho/Status.src/M000021.html +0 -31
  98. data/doc/rdoc/classes/Pho/Status.src/M000022.html +0 -18
  99. data/doc/rdoc/classes/Pho/Status.src/M000023.html +0 -18
  100. data/doc/rdoc/classes/Pho/Store.src/M000036.html +0 -22
  101. data/doc/rdoc/classes/Pho/Store.src/M000037.html +0 -18
  102. data/doc/rdoc/classes/Pho/Store.src/M000038.html +0 -25
  103. data/doc/rdoc/classes/Pho/Store.src/M000039.html +0 -20
  104. data/doc/rdoc/classes/Pho/Store.src/M000040.html +0 -20
  105. data/doc/rdoc/classes/Pho/Store.src/M000041.html +0 -28
  106. data/doc/rdoc/classes/Pho/Store.src/M000042.html +0 -23
  107. data/doc/rdoc/classes/Pho/Store.src/M000043.html +0 -18
  108. data/doc/rdoc/classes/Pho/Store.src/M000044.html +0 -18
  109. data/doc/rdoc/classes/Pho/Store.src/M000045.html +0 -18
  110. data/doc/rdoc/classes/Pho/Store.src/M000046.html +0 -18
  111. data/doc/rdoc/classes/Pho/Store.src/M000047.html +0 -23
  112. data/doc/rdoc/classes/Pho/Store.src/M000048.html +0 -22
  113. data/doc/rdoc/classes/Pho/Store.src/M000049.html +0 -26
  114. data/doc/rdoc/classes/Pho/Store.src/M000050.html +0 -24
  115. data/doc/rdoc/classes/Pho/Store.src/M000051.html +0 -20
  116. data/doc/rdoc/classes/Pho/Store.src/M000052.html +0 -20
  117. data/doc/rdoc/classes/Pho/Store.src/M000053.html +0 -25
  118. data/doc/rdoc/classes/Pho/Store.src/M000054.html +0 -20
  119. data/doc/rdoc/classes/Pho/Store.src/M000055.html +0 -30
  120. data/doc/rdoc/classes/Pho/Store.src/M000056.html +0 -21
  121. data/doc/rdoc/classes/Pho/Store.src/M000057.html +0 -23
  122. data/doc/rdoc/classes/Pho/Store.src/M000058.html +0 -28
  123. data/doc/rdoc/classes/Pho/Store.src/M000059.html +0 -18
  124. data/doc/rdoc/classes/Pho/Store.src/M000060.html +0 -18
  125. data/doc/rdoc/classes/Pho/Store.src/M000061.html +0 -18
  126. data/doc/rdoc/classes/Pho/Store.src/M000062.html +0 -31
  127. data/doc/rdoc/classes/Pho/Store.src/M000063.html +0 -21
  128. data/doc/rdoc/classes/Pho/Store.src/M000064.html +0 -20
  129. data/doc/rdoc/classes/Pho/Store.src/M000065.html +0 -20
  130. data/doc/rdoc/classes/Pho/Store.src/M000066.html +0 -20
  131. data/doc/rdoc/classes/Pho/Store.src/M000067.html +0 -20
  132. data/doc/rdoc/classes/Pho/Store.src/M000068.html +0 -20
  133. data/doc/rdoc/classes/Pho/Store.src/M000069.html +0 -20
@@ -92,12 +92,12 @@ Simple mechanism for managing etags
92
92
  <h3 class="section-bar">Methods</h3>
93
93
 
94
94
  <div class="name-list">
95
- <a href="#M000090">add</a>&nbsp;&nbsp;
96
- <a href="#M000091">add_from_response</a>&nbsp;&nbsp;
97
- <a href="#M000092">get</a>&nbsp;&nbsp;
98
- <a href="#M000093">has_tag?</a>&nbsp;&nbsp;
99
- <a href="#M000088">new</a>&nbsp;&nbsp;
100
- <a href="#M000089">save</a>&nbsp;&nbsp;
95
+ <a href="#M000107">add</a>&nbsp;&nbsp;
96
+ <a href="#M000108">add_from_response</a>&nbsp;&nbsp;
97
+ <a href="#M000109">get</a>&nbsp;&nbsp;
98
+ <a href="#M000110">has_tag?</a>&nbsp;&nbsp;
99
+ <a href="#M000105">new</a>&nbsp;&nbsp;
100
+ <a href="#M000106">save</a>&nbsp;&nbsp;
101
101
  </div>
102
102
  </div>
103
103
 
@@ -137,89 +137,161 @@ Simple mechanism for managing etags
137
137
  <div id="methods">
138
138
  <h3 class="section-bar">Public Class methods</h3>
139
139
 
140
- <div id="method-M000088" class="method-detail">
141
- <a name="M000088"></a>
140
+ <div id="method-M000105" class="method-detail">
141
+ <a name="M000105"></a>
142
142
 
143
143
  <div class="method-heading">
144
- <a href="Etags.src/M000088.html" target="Code" class="method-signature"
145
- onclick="popupCode('Etags.src/M000088.html');return false;">
144
+ <a href="#M000105" class="method-signature">
146
145
  <span class="method-name">new</span><span class="method-args">(file = nil)</span>
147
146
  </a>
148
147
  </div>
149
148
 
150
149
  <div class="method-description">
150
+ <p><a class="source-toggle" href="#"
151
+ onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
152
+ <div class="method-source-code" id="M000105-source">
153
+ <pre>
154
+ <span class="ruby-comment cmt"># File lib/pho/etags.rb, line 10</span>
155
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">file</span> = <span class="ruby-keyword kw">nil</span>)
156
+ <span class="ruby-ivar">@file</span> = <span class="ruby-identifier">file</span>
157
+ <span class="ruby-ivar">@saved</span> = <span class="ruby-keyword kw">true</span>
158
+ <span class="ruby-ivar">@tags</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
159
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@file</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
160
+ <span class="ruby-ivar">@tags</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-ivar">@file</span>)[<span class="ruby-value">0</span>]
161
+ <span class="ruby-keyword kw">end</span>
162
+ <span class="ruby-keyword kw">end</span>
163
+ </pre>
164
+ </div>
151
165
  </div>
152
166
  </div>
153
167
 
154
168
  <h3 class="section-bar">Public Instance methods</h3>
155
169
 
156
- <div id="method-M000090" class="method-detail">
157
- <a name="M000090"></a>
170
+ <div id="method-M000107" class="method-detail">
171
+ <a name="M000107"></a>
158
172
 
159
173
  <div class="method-heading">
160
- <a href="Etags.src/M000090.html" target="Code" class="method-signature"
161
- onclick="popupCode('Etags.src/M000090.html');return false;">
174
+ <a href="#M000107" class="method-signature">
162
175
  <span class="method-name">add</span><span class="method-args">(uri, tag)</span>
163
176
  </a>
164
177
  </div>
165
178
 
166
179
  <div class="method-description">
180
+ <p><a class="source-toggle" href="#"
181
+ onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
182
+ <div class="method-source-code" id="M000107-source">
183
+ <pre>
184
+ <span class="ruby-comment cmt"># File lib/pho/etags.rb, line 33</span>
185
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">tag</span>)
186
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">uri</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">tag</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>)
187
+ <span class="ruby-ivar">@tags</span>[<span class="ruby-identifier">uri</span>] = <span class="ruby-identifier">tag</span>
188
+ <span class="ruby-ivar">@saved</span> = <span class="ruby-keyword kw">false</span>
189
+ <span class="ruby-keyword kw">end</span>
190
+ <span class="ruby-keyword kw">end</span>
191
+ </pre>
192
+ </div>
167
193
  </div>
168
194
  </div>
169
195
 
170
- <div id="method-M000091" class="method-detail">
171
- <a name="M000091"></a>
196
+ <div id="method-M000108" class="method-detail">
197
+ <a name="M000108"></a>
172
198
 
173
199
  <div class="method-heading">
174
- <a href="Etags.src/M000091.html" target="Code" class="method-signature"
175
- onclick="popupCode('Etags.src/M000091.html');return false;">
200
+ <a href="#M000108" class="method-signature">
176
201
  <span class="method-name">add_from_response</span><span class="method-args">(uri, response)</span>
177
202
  </a>
178
203
  </div>
179
204
 
180
205
  <div class="method-description">
206
+ <p><a class="source-toggle" href="#"
207
+ onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
208
+ <div class="method-source-code" id="M000108-source">
209
+ <pre>
210
+ <span class="ruby-comment cmt"># File lib/pho/etags.rb, line 40</span>
211
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_from_response</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">response</span>)
212
+ <span class="ruby-identifier">add</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>[<span class="ruby-value str">&quot;ETag&quot;</span>][<span class="ruby-value">0</span>])
213
+ <span class="ruby-keyword kw">end</span>
214
+ </pre>
215
+ </div>
181
216
  </div>
182
217
  </div>
183
218
 
184
- <div id="method-M000092" class="method-detail">
185
- <a name="M000092"></a>
219
+ <div id="method-M000109" class="method-detail">
220
+ <a name="M000109"></a>
186
221
 
187
222
  <div class="method-heading">
188
- <a href="Etags.src/M000092.html" target="Code" class="method-signature"
189
- onclick="popupCode('Etags.src/M000092.html');return false;">
223
+ <a href="#M000109" class="method-signature">
190
224
  <span class="method-name">get</span><span class="method-args">(uri)</span>
191
225
  </a>
192
226
  </div>
193
227
 
194
228
  <div class="method-description">
229
+ <p><a class="source-toggle" href="#"
230
+ onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
231
+ <div class="method-source-code" id="M000109-source">
232
+ <pre>
233
+ <span class="ruby-comment cmt"># File lib/pho/etags.rb, line 44</span>
234
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">uri</span>)
235
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@tags</span>[<span class="ruby-identifier">uri</span>]
236
+ <span class="ruby-keyword kw">end</span>
237
+ </pre>
238
+ </div>
195
239
  </div>
196
240
  </div>
197
241
 
198
- <div id="method-M000093" class="method-detail">
199
- <a name="M000093"></a>
242
+ <div id="method-M000110" class="method-detail">
243
+ <a name="M000110"></a>
200
244
 
201
245
  <div class="method-heading">
202
- <a href="Etags.src/M000093.html" target="Code" class="method-signature"
203
- onclick="popupCode('Etags.src/M000093.html');return false;">
246
+ <a href="#M000110" class="method-signature">
204
247
  <span class="method-name">has_tag?</span><span class="method-args">(uri)</span>
205
248
  </a>
206
249
  </div>
207
250
 
208
251
  <div class="method-description">
252
+ <p><a class="source-toggle" href="#"
253
+ onclick="toggleCode('M000110-source');return false;">[Source]</a></p>
254
+ <div class="method-source-code" id="M000110-source">
255
+ <pre>
256
+ <span class="ruby-comment cmt"># File lib/pho/etags.rb, line 48</span>
257
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_tag?</span>(<span class="ruby-identifier">uri</span>)
258
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@tags</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">uri</span>)
259
+ <span class="ruby-keyword kw">end</span>
260
+ </pre>
261
+ </div>
209
262
  </div>
210
263
  </div>
211
264
 
212
- <div id="method-M000089" class="method-detail">
213
- <a name="M000089"></a>
265
+ <div id="method-M000106" class="method-detail">
266
+ <a name="M000106"></a>
214
267
 
215
268
  <div class="method-heading">
216
- <a href="Etags.src/M000089.html" target="Code" class="method-signature"
217
- onclick="popupCode('Etags.src/M000089.html');return false;">
269
+ <a href="#M000106" class="method-signature">
218
270
  <span class="method-name">save</span><span class="method-args">(other=nil)</span>
219
271
  </a>
220
272
  </div>
221
273
 
222
274
  <div class="method-description">
275
+ <p><a class="source-toggle" href="#"
276
+ onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
277
+ <div class="method-source-code" id="M000106-source">
278
+ <pre>
279
+ <span class="ruby-comment cmt"># File lib/pho/etags.rb, line 19</span>
280
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>(<span class="ruby-identifier">other</span>=<span class="ruby-keyword kw">nil</span>)
281
+
282
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">other</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>)
283
+ <span class="ruby-identifier">other</span>.<span class="ruby-identifier">write</span>( <span class="ruby-ivar">@tags</span>.<span class="ruby-identifier">to_yaml</span>() )
284
+ <span class="ruby-keyword kw">return</span>
285
+ <span class="ruby-keyword kw">else</span>
286
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">saved</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@file</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> )
287
+ <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">write</span>( <span class="ruby-ivar">@tags</span>.<span class="ruby-identifier">to_yaml</span>() )
288
+ <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">close</span>
289
+ <span class="ruby-keyword kw">end</span>
290
+ <span class="ruby-keyword kw">end</span>
291
+
292
+ <span class="ruby-keyword kw">end</span>
293
+ </pre>
294
+ </div>
223
295
  </div>
224
296
  </div>
225
297
 
@@ -152,13 +152,24 @@ The query used to generate the facet results, as echoed in the response
152
152
  <a name="M000001"></a>
153
153
 
154
154
  <div class="method-heading">
155
- <a href="Results.src/M000001.html" target="Code" class="method-signature"
156
- onclick="popupCode('Results.src/M000001.html');return false;">
155
+ <a href="#M000001" class="method-signature">
157
156
  <span class="method-name">new</span><span class="method-args">(query, fields, facets=Hash.new)</span>
158
157
  </a>
159
158
  </div>
160
159
 
161
160
  <div class="method-description">
161
+ <p><a class="source-toggle" href="#"
162
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
163
+ <div class="method-source-code" id="M000001-source">
164
+ <pre>
165
+ <span class="ruby-comment cmt"># File lib/pho/facet.rb, line 32</span>
166
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">fields</span>, <span class="ruby-identifier">facets</span>=<span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>)
167
+ <span class="ruby-ivar">@query</span> = <span class="ruby-identifier">query</span>
168
+ <span class="ruby-ivar">@fields</span> = <span class="ruby-identifier">fields</span>
169
+ <span class="ruby-ivar">@facets</span> = <span class="ruby-identifier">facets</span>
170
+ <span class="ruby-keyword kw">end</span>
171
+ </pre>
172
+ </div>
162
173
  </div>
163
174
  </div>
164
175
 
@@ -166,13 +177,58 @@ The query used to generate the facet results, as echoed in the response
166
177
  <a name="M000003"></a>
167
178
 
168
179
  <div class="method-heading">
169
- <a href="Results.src/M000003.html" target="Code" class="method-signature"
170
- onclick="popupCode('Results.src/M000003.html');return false;">
180
+ <a href="#M000003" class="method-signature">
171
181
  <span class="method-name">parse</span><span class="method-args">(data)</span>
172
182
  </a>
173
183
  </div>
174
184
 
175
185
  <div class="method-description">
186
+ <p><a class="source-toggle" href="#"
187
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
188
+ <div class="method-source-code" id="M000003-source">
189
+ <pre>
190
+ <span class="ruby-comment cmt"># File lib/pho/facet.rb, line 58</span>
191
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Results</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">data</span>)
192
+ <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">data</span>)
193
+ <span class="ruby-identifier">root</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>
194
+ <span class="ruby-identifier">head</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value">1</span>]
195
+
196
+ <span class="ruby-identifier">query</span> = <span class="ruby-value str">&quot;&quot;</span>
197
+ <span class="ruby-identifier">fields</span> = <span class="ruby-value str">&quot;&quot;</span>
198
+ <span class="ruby-identifier">queryEl</span> = <span class="ruby-identifier">head</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">&quot;query&quot;</span>)[<span class="ruby-value">0</span>]
199
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">queryEl</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
200
+ <span class="ruby-identifier">query</span> = <span class="ruby-identifier">queryEl</span>.<span class="ruby-identifier">text</span>
201
+ <span class="ruby-keyword kw">end</span>
202
+ <span class="ruby-identifier">fieldsEl</span> = <span class="ruby-identifier">head</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">&quot;fields&quot;</span>)[<span class="ruby-value">0</span>]
203
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fieldsEl</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
204
+ <span class="ruby-identifier">fields</span> = <span class="ruby-identifier">fieldsEl</span>.<span class="ruby-identifier">text</span>
205
+ <span class="ruby-keyword kw">end</span>
206
+
207
+ <span class="ruby-identifier">results</span> = <span class="ruby-constant">Results</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">fields</span>)
208
+
209
+ <span class="ruby-identifier">fields</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">&quot;fields&quot;</span>)[<span class="ruby-value">0</span>]
210
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fields</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
211
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No fields in document!&quot;</span>
212
+ <span class="ruby-keyword kw">end</span>
213
+
214
+ <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">&quot;field&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">field</span><span class="ruby-operator">|</span>
215
+ <span class="ruby-identifier">field_name</span> = <span class="ruby-identifier">field</span>.<span class="ruby-identifier">attribute</span>(<span class="ruby-value str">&quot;name&quot;</span>).<span class="ruby-identifier">value</span>
216
+ <span class="ruby-identifier">results</span>.<span class="ruby-identifier">facets</span>[<span class="ruby-identifier">field_name</span>] = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
217
+
218
+ <span class="ruby-identifier">field</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">&quot;term&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">term</span><span class="ruby-operator">|</span>
219
+ <span class="ruby-identifier">term</span> = <span class="ruby-constant">Term</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">term</span>.<span class="ruby-identifier">attribute</span>(<span class="ruby-value str">&quot;number&quot;</span>).<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_i</span>,
220
+ <span class="ruby-identifier">term</span>.<span class="ruby-identifier">attribute</span>(<span class="ruby-value str">&quot;search-uri&quot;</span>).<span class="ruby-identifier">value</span>,
221
+ <span class="ruby-identifier">term</span>.<span class="ruby-identifier">text</span>() )
222
+
223
+ <span class="ruby-identifier">results</span>.<span class="ruby-identifier">facets</span>[<span class="ruby-identifier">field_name</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">term</span>
224
+ <span class="ruby-keyword kw">end</span>
225
+
226
+ <span class="ruby-keyword kw">end</span>
227
+
228
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">results</span>
229
+ <span class="ruby-keyword kw">end</span>
230
+ </pre>
231
+ </div>
176
232
  </div>
177
233
  </div>
178
234
 
@@ -180,8 +236,7 @@ The query used to generate the facet results, as echoed in the response
180
236
  <a name="M000002"></a>
181
237
 
182
238
  <div class="method-heading">
183
- <a href="Results.src/M000002.html" target="Code" class="method-signature"
184
- onclick="popupCode('Results.src/M000002.html');return false;">
239
+ <a href="#M000002" class="method-signature">
185
240
  <span class="method-name">read_from_store</span><span class="method-args">(store, query, facets, params=Hash.new)</span>
186
241
  </a>
187
242
  </div>
@@ -202,11 +257,30 @@ response
202
257
  <tr><td valign="top">facets:</td><td>an ordered list of facets to be used
203
258
 
204
259
  </td></tr>
205
- <tr><td valign="top">params:</td><td>additional params. See <a href="../Store.html#M000049">Store.facet</a> for
260
+ <tr><td valign="top">params:</td><td>additional params. See <a href="../Store.html#M000059">Store.facet</a> for
206
261
  details. XML output is requested automatically
207
262
 
208
263
  </td></tr>
209
264
  </table>
265
+ <p><a class="source-toggle" href="#"
266
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
267
+ <div class="method-source-code" id="M000002-source">
268
+ <pre>
269
+ <span class="ruby-comment cmt"># File lib/pho/facet.rb, line 45</span>
270
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Results</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">facets</span>, <span class="ruby-identifier">params</span>=<span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>)
271
+
272
+ <span class="ruby-identifier">params</span>[<span class="ruby-value str">&quot;output&quot;</span>] = <span class="ruby-value str">&quot;xml&quot;</span>
273
+ <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">facet</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">facets</span>, <span class="ruby-identifier">params</span>)
274
+
275
+ <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>
276
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unable to do facetted search. Response code was #{resp.status}&quot;</span>
277
+ <span class="ruby-keyword kw">end</span>
278
+
279
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">resp</span>.<span class="ruby-identifier">content</span>)
280
+
281
+ <span class="ruby-keyword kw">end</span>
282
+ </pre>
283
+ </div>
210
284
  </div>
211
285
  </div>
212
286
 
@@ -141,13 +141,24 @@ Captures the information about a specific term
141
141
  <a name="M000004"></a>
142
142
 
143
143
  <div class="method-heading">
144
- <a href="Term.src/M000004.html" target="Code" class="method-signature"
145
- onclick="popupCode('Term.src/M000004.html');return false;">
144
+ <a href="#M000004" class="method-signature">
146
145
  <span class="method-name">new</span><span class="method-args">(hits, search_uri, value)</span>
147
146
  </a>
148
147
  </div>
149
148
 
150
149
  <div class="method-description">
150
+ <p><a class="source-toggle" href="#"
151
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
152
+ <div class="method-source-code" id="M000004-source">
153
+ <pre>
154
+ <span class="ruby-comment cmt"># File lib/pho/facet.rb, line 12</span>
155
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hits</span>, <span class="ruby-identifier">search_uri</span>, <span class="ruby-identifier">value</span>)
156
+ <span class="ruby-ivar">@hits</span> = <span class="ruby-identifier">hits</span>
157
+ <span class="ruby-ivar">@search_uri</span> = <span class="ruby-identifier">search_uri</span>
158
+ <span class="ruby-ivar">@value</span> = <span class="ruby-identifier">value</span>
159
+ <span class="ruby-keyword kw">end</span>
160
+ </pre>
161
+ </div>
151
162
  </div>
152
163
  </div>
153
164
 
@@ -173,8 +173,7 @@ URI for this resource
173
173
  <a name="M000006"></a>
174
174
 
175
175
  <div class="method-heading">
176
- <a href="FieldPredicateMap.src/M000006.html" target="Code" class="method-signature"
177
- onclick="popupCode('FieldPredicateMap.src/M000006.html');return false;">
176
+ <a href="#M000006" class="method-signature">
178
177
  <span class="method-name">create_mapping</span><span class="method-args">(store, property_uri, name, analyzer=nil)</span>
179
178
  </a>
180
179
  </div>
@@ -185,6 +184,26 @@ Create a <a href="DatatypeProperty.html">DatatypeProperty</a> instance,
185
184
  automatically assigning a unique identifier to it, and adding validating
186
185
  the supplied data to ensure it matches the platform rules
187
186
  </p>
187
+ <p><a class="source-toggle" href="#"
188
+ onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
189
+ <div class="method-source-code" id="M000006-source">
190
+ <pre>
191
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 135</span>
192
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">FieldPredicateMap</span>.<span class="ruby-identifier">create_mapping</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">property_uri</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">analyzer</span>=<span class="ruby-keyword kw">nil</span>)
193
+ <span class="ruby-identifier">check_value</span>(<span class="ruby-value str">&quot;property_uri&quot;</span>, <span class="ruby-identifier">property_uri</span>)
194
+ <span class="ruby-identifier">check_value</span>(<span class="ruby-value str">&quot;name&quot;</span>, <span class="ruby-identifier">name</span>)
195
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">name</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^[a-zA-Z][a-zA-Z0-9]*$/</span>)
196
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Name does not conform to regular expression: ^[a-zA-Z][a-zA-Z0-9]*$&quot;</span>
197
+ <span class="ruby-keyword kw">end</span>
198
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">analyzer</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">analyzer</span>.<span class="ruby-identifier">empty?</span>
199
+ <span class="ruby-identifier">analyzer</span> = <span class="ruby-keyword kw">nil</span>
200
+ <span class="ruby-keyword kw">end</span>
201
+ <span class="ruby-identifier">suffix</span> = <span class="ruby-identifier">get_suffix</span>(<span class="ruby-identifier">property_uri</span>)
202
+ <span class="ruby-identifier">mapping_uri</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-node">&quot;/config/fpmaps/1##{suffix}&quot;</span>)
203
+ <span class="ruby-keyword kw">return</span> <span class="ruby-constant">DatatypeProperty</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">mapping_uri</span>, <span class="ruby-identifier">property_uri</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">analyzer</span>)
204
+ <span class="ruby-keyword kw">end</span>
205
+ </pre>
206
+ </div>
188
207
  </div>
189
208
  </div>
190
209
 
@@ -192,13 +211,24 @@ the supplied data to ensure it matches the platform rules
192
211
  <a name="M000007"></a>
193
212
 
194
213
  <div class="method-heading">
195
- <a href="FieldPredicateMap.src/M000007.html" target="Code" class="method-signature"
196
- onclick="popupCode('FieldPredicateMap.src/M000007.html');return false;">
214
+ <a href="#M000007" class="method-signature">
197
215
  <span class="method-name">new</span><span class="method-args">(uri, label, datatype_properties = [])</span>
198
216
  </a>
199
217
  </div>
200
218
 
201
219
  <div class="method-description">
220
+ <p><a class="source-toggle" href="#"
221
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
222
+ <div class="method-source-code" id="M000007-source">
223
+ <pre>
224
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 149</span>
225
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">datatype_properties</span> = [])
226
+ <span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">uri</span>
227
+ <span class="ruby-ivar">@label</span> = <span class="ruby-identifier">label</span>
228
+ <span class="ruby-ivar">@datatype_properties</span> = <span class="ruby-identifier">datatype_properties</span>
229
+ <span class="ruby-keyword kw">end</span>
230
+ </pre>
231
+ </div>
202
232
  </div>
203
233
  </div>
204
234
 
@@ -206,8 +236,7 @@ the supplied data to ensure it matches the platform rules
206
236
  <a name="M000005"></a>
207
237
 
208
238
  <div class="method-heading">
209
- <a href="FieldPredicateMap.src/M000005.html" target="Code" class="method-signature"
210
- onclick="popupCode('FieldPredicateMap.src/M000005.html');return false;">
239
+ <a href="#M000005" class="method-signature">
211
240
  <span class="method-name">read_from_store</span><span class="method-args">(store)</span>
212
241
  </a>
213
242
  </div>
@@ -218,6 +247,36 @@ Read a <a href="FieldPredicateMap.html">FieldPredicateMap</a> instance from
218
247
  the provided store. The method will retrieve the config as JSON, and parse
219
248
  it to create an object instance.
220
249
  </p>
250
+ <p><a class="source-toggle" href="#"
251
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
252
+ <div class="method-source-code" id="M000005-source">
253
+ <pre>
254
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 109</span>
255
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">FieldPredicateMap</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
256
+ <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">get_field_predicate_map</span>(<span class="ruby-constant">Pho</span><span class="ruby-operator">::</span><span class="ruby-constant">ACCEPT_JSON</span>)
257
+ <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>
258
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unable to read Field Predicate Map from store. Response code was #{resp.status}&quot;</span>
259
+ <span class="ruby-keyword kw">end</span>
260
+
261
+ <span class="ruby-identifier">fpmap_uri</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">&quot;/config/fpmaps/1&quot;</span>)
262
+
263
+ <span class="ruby-identifier">json</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">content</span> )
264
+
265
+ <span class="ruby-identifier">label</span> = <span class="ruby-identifier">json</span>[<span class="ruby-identifier">fpmap_uri</span>][<span class="ruby-value str">&quot;http:\/\/www.w3.org\/2000\/01\/rdf-schema#label&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;value&quot;</span>]
266
+ <span class="ruby-identifier">fpmap</span> = <span class="ruby-constant">FieldPredicateMap</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">fpmap_uri</span>, <span class="ruby-identifier">label</span>)
267
+
268
+ <span class="ruby-identifier">mapped_properties</span> = <span class="ruby-identifier">json</span>[<span class="ruby-identifier">fpmap_uri</span>][<span class="ruby-value str">&quot;http:\/\/schemas.talis.com\/2006\/frame\/schema#mappedDatatypeProperty&quot;</span>]
269
+ <span class="ruby-identifier">mapped_properties</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span>
270
+ <span class="ruby-identifier">property</span> = <span class="ruby-identifier">json</span>[<span class="ruby-identifier">uri</span>[<span class="ruby-value str">&quot;value&quot;</span>]]
271
+ <span class="ruby-identifier">property_uri</span> = <span class="ruby-identifier">property</span>[<span class="ruby-value str">&quot;http:\/\/schemas.talis.com\/2006\/frame\/schema#property&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;value&quot;</span>]
272
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">property</span>[<span class="ruby-value str">&quot;http:\/\/schemas.talis.com\/2006\/frame\/schema#name&quot;</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;value&quot;</span>]
273
+ <span class="ruby-identifier">fpmap</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">DatatypeProperty</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>[<span class="ruby-value str">&quot;value&quot;</span>], <span class="ruby-identifier">property_uri</span>, <span class="ruby-identifier">name</span>)
274
+ }
275
+
276
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fpmap</span>
277
+ <span class="ruby-keyword kw">end</span>
278
+ </pre>
279
+ </div>
221
280
  </div>
222
281
  </div>
223
282
 
@@ -227,8 +286,7 @@ it to create an object instance.
227
286
  <a name="M000008"></a>
228
287
 
229
288
  <div class="method-heading">
230
- <a href="FieldPredicateMap.src/M000008.html" target="Code" class="method-signature"
231
- onclick="popupCode('FieldPredicateMap.src/M000008.html');return false;">
289
+ <a href="#M000008" class="method-signature">
232
290
  <span class="method-name">&lt;&lt;</span><span class="method-args">(obj)</span>
233
291
  </a>
234
292
  </div>
@@ -239,6 +297,16 @@ Append a <a href="DatatypeProperty.html">DatatypeProperty</a> object to
239
297
  this map. Note that the method does not validate the object, and neither
240
298
  does it check for duplicate mappings.
241
299
  </p>
300
+ <p><a class="source-toggle" href="#"
301
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
302
+ <div class="method-source-code" id="M000008-source">
303
+ <pre>
304
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 158</span>
305
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;&lt;</span>(<span class="ruby-identifier">obj</span>)
306
+ <span class="ruby-ivar">@datatype_properties</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">obj</span>
307
+ <span class="ruby-keyword kw">end</span>
308
+ </pre>
309
+ </div>
242
310
  </div>
243
311
  </div>
244
312
 
@@ -246,8 +314,7 @@ does it check for duplicate mappings.
246
314
  <a name="M000013"></a>
247
315
 
248
316
  <div class="method-heading">
249
- <a href="FieldPredicateMap.src/M000013.html" target="Code" class="method-signature"
250
- onclick="popupCode('FieldPredicateMap.src/M000013.html');return false;">
317
+ <a href="#M000013" class="method-signature">
251
318
  <span class="method-name">get_by_name</span><span class="method-args">(name)</span>
252
319
  </a>
253
320
  </div>
@@ -257,6 +324,16 @@ does it check for duplicate mappings.
257
324
  Find the <a href="DatatypeProperty.html">DatatypeProperty</a> (if any) with
258
325
  the following name mapping
259
326
  </p>
327
+ <p><a class="source-toggle" href="#"
328
+ onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
329
+ <div class="method-source-code" id="M000013-source">
330
+ <pre>
331
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 197</span>
332
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>)
333
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@datatype_properties</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mapping</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mapping</span>.<span class="ruby-identifier">name</span> }
334
+ <span class="ruby-keyword kw">end</span>
335
+ </pre>
336
+ </div>
260
337
  </div>
261
338
  </div>
262
339
 
@@ -264,8 +341,7 @@ the following name mapping
264
341
  <a name="M000014"></a>
265
342
 
266
343
  <div class="method-heading">
267
- <a href="FieldPredicateMap.src/M000014.html" target="Code" class="method-signature"
268
- onclick="popupCode('FieldPredicateMap.src/M000014.html');return false;">
344
+ <a href="#M000014" class="method-signature">
269
345
  <span class="method-name">get_by_uri</span><span class="method-args">(uri)</span>
270
346
  </a>
271
347
  </div>
@@ -275,6 +351,16 @@ the following name mapping
275
351
  Find the <a href="DatatypeProperty.html">DatatypeProperty</a> using a
276
352
  property uri
277
353
  </p>
354
+ <p><a class="source-toggle" href="#"
355
+ onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
356
+ <div class="method-source-code" id="M000014-source">
357
+ <pre>
358
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 202</span>
359
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_by_uri</span>(<span class="ruby-identifier">uri</span>)
360
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@datatype_properties</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mapping</span><span class="ruby-operator">|</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mapping</span>.<span class="ruby-identifier">property_uri</span> }
361
+ <span class="ruby-keyword kw">end</span>
362
+ </pre>
363
+ </div>
278
364
  </div>
279
365
  </div>
280
366
 
@@ -282,8 +368,7 @@ property uri
282
368
  <a name="M000009"></a>
283
369
 
284
370
  <div class="method-heading">
285
- <a href="FieldPredicateMap.src/M000009.html" target="Code" class="method-signature"
286
- onclick="popupCode('FieldPredicateMap.src/M000009.html');return false;">
371
+ <a href="#M000009" class="method-signature">
287
372
  <span class="method-name">get_name</span><span class="method-args">(uri)</span>
288
373
  </a>
289
374
  </div>
@@ -297,6 +382,21 @@ Lookup the name mapped to the specified uri
297
382
 
298
383
  </td></tr>
299
384
  </table>
385
+ <p><a class="source-toggle" href="#"
386
+ onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
387
+ <div class="method-source-code" id="M000009-source">
388
+ <pre>
389
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 165</span>
390
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_name</span>(<span class="ruby-identifier">uri</span>)
391
+ <span class="ruby-identifier">p</span> = <span class="ruby-ivar">@datatype_properties</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mapping</span><span class="ruby-operator">|</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mapping</span>.<span class="ruby-identifier">property_uri</span> }
392
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
393
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
394
+ <span class="ruby-keyword kw">else</span>
395
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">name</span>
396
+ <span class="ruby-keyword kw">end</span>
397
+ <span class="ruby-keyword kw">end</span>
398
+ </pre>
399
+ </div>
300
400
  </div>
301
401
  </div>
302
402
 
@@ -304,8 +404,7 @@ Lookup the name mapped to the specified uri
304
404
  <a name="M000010"></a>
305
405
 
306
406
  <div class="method-heading">
307
- <a href="FieldPredicateMap.src/M000010.html" target="Code" class="method-signature"
308
- onclick="popupCode('FieldPredicateMap.src/M000010.html');return false;">
407
+ <a href="#M000010" class="method-signature">
309
408
  <span class="method-name">get_property_uri</span><span class="method-args">(name)</span>
310
409
  </a>
311
410
  </div>
@@ -319,6 +418,21 @@ Lookup the property mapped to the specified name
319
418
 
320
419
  </td></tr>
321
420
  </table>
421
+ <p><a class="source-toggle" href="#"
422
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
423
+ <div class="method-source-code" id="M000010-source">
424
+ <pre>
425
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 177</span>
426
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_property_uri</span>(<span class="ruby-identifier">name</span>)
427
+ <span class="ruby-identifier">p</span> = <span class="ruby-ivar">@datatype_properties</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mapping</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mapping</span>.<span class="ruby-identifier">name</span> }
428
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
429
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
430
+ <span class="ruby-keyword kw">else</span>
431
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">property_uri</span>
432
+ <span class="ruby-keyword kw">end</span>
433
+ <span class="ruby-keyword kw">end</span>
434
+ </pre>
435
+ </div>
322
436
  </div>
323
437
  </div>
324
438
 
@@ -326,8 +440,7 @@ Lookup the property mapped to the specified name
326
440
  <a name="M000011"></a>
327
441
 
328
442
  <div class="method-heading">
329
- <a href="FieldPredicateMap.src/M000011.html" target="Code" class="method-signature"
330
- onclick="popupCode('FieldPredicateMap.src/M000011.html');return false;">
443
+ <a href="#M000011" class="method-signature">
331
444
  <span class="method-name">mapped_name?</span><span class="method-args">(name)</span>
332
445
  </a>
333
446
  </div>
@@ -336,6 +449,16 @@ Lookup the property mapped to the specified name
336
449
  <p>
337
450
  Is there a mapping for a property with this name?
338
451
  </p>
452
+ <p><a class="source-toggle" href="#"
453
+ onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
454
+ <div class="method-source-code" id="M000011-source">
455
+ <pre>
456
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 187</span>
457
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapped_name?</span>(<span class="ruby-identifier">name</span>)
458
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">get_property_uri</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
459
+ <span class="ruby-keyword kw">end</span>
460
+ </pre>
461
+ </div>
339
462
  </div>
340
463
  </div>
341
464
 
@@ -343,8 +466,7 @@ Is there a mapping for a property with this name?
343
466
  <a name="M000012"></a>
344
467
 
345
468
  <div class="method-heading">
346
- <a href="FieldPredicateMap.src/M000012.html" target="Code" class="method-signature"
347
- onclick="popupCode('FieldPredicateMap.src/M000012.html');return false;">
469
+ <a href="#M000012" class="method-signature">
348
470
  <span class="method-name">mapped_uri?</span><span class="method-args">(uri)</span>
349
471
  </a>
350
472
  </div>
@@ -353,6 +475,16 @@ Is there a mapping for a property with this name?
353
475
  <p>
354
476
  Is there a mapping for this uri?
355
477
  </p>
478
+ <p><a class="source-toggle" href="#"
479
+ onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
480
+ <div class="method-source-code" id="M000012-source">
481
+ <pre>
482
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 192</span>
483
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapped_uri?</span>(<span class="ruby-identifier">uri</span>)
484
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">get_name</span>(<span class="ruby-identifier">uri</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
485
+ <span class="ruby-keyword kw">end</span>
486
+ </pre>
487
+ </div>
356
488
  </div>
357
489
  </div>
358
490
 
@@ -360,8 +492,7 @@ Is there a mapping for this uri?
360
492
  <a name="M000015"></a>
361
493
 
362
494
  <div class="method-heading">
363
- <a href="FieldPredicateMap.src/M000015.html" target="Code" class="method-signature"
364
- onclick="popupCode('FieldPredicateMap.src/M000015.html');return false;">
495
+ <a href="#M000015" class="method-signature">
365
496
  <span class="method-name">remove</span><span class="method-args">(datatype_property)</span>
366
497
  </a>
367
498
  </div>
@@ -371,6 +502,16 @@ Is there a mapping for this uri?
371
502
  Remove a <a href="DatatypeProperty.html">DatatypeProperty</a> from the
372
503
  collection
373
504
  </p>
505
+ <p><a class="source-toggle" href="#"
506
+ onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
507
+ <div class="method-source-code" id="M000015-source">
508
+ <pre>
509
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 207</span>
510
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">datatype_property</span>)
511
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@datatype_properties</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">datatype_property</span>)
512
+ <span class="ruby-keyword kw">end</span>
513
+ </pre>
514
+ </div>
374
515
  </div>
375
516
  </div>
376
517
 
@@ -378,8 +519,7 @@ collection
378
519
  <a name="M000016"></a>
379
520
 
380
521
  <div class="method-heading">
381
- <a href="FieldPredicateMap.src/M000016.html" target="Code" class="method-signature"
382
- onclick="popupCode('FieldPredicateMap.src/M000016.html');return false;">
522
+ <a href="#M000016" class="method-signature">
383
523
  <span class="method-name">remove_by_name</span><span class="method-args">(name)</span>
384
524
  </a>
385
525
  </div>
@@ -389,6 +529,19 @@ collection
389
529
  Remove a <a href="DatatypeProperty.html">DatatypeProperty</a> by its mapped
390
530
  name
391
531
  </p>
532
+ <p><a class="source-toggle" href="#"
533
+ onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
534
+ <div class="method-source-code" id="M000016-source">
535
+ <pre>
536
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 212</span>
537
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_by_name</span>(<span class="ruby-identifier">name</span>)
538
+ <span class="ruby-identifier">p</span> = <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>)
539
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">p</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>)
540
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">p</span>)
541
+ <span class="ruby-keyword kw">end</span>
542
+ <span class="ruby-keyword kw">end</span>
543
+ </pre>
544
+ </div>
392
545
  </div>
393
546
  </div>
394
547
 
@@ -396,8 +549,7 @@ name
396
549
  <a name="M000017"></a>
397
550
 
398
551
  <div class="method-heading">
399
- <a href="FieldPredicateMap.src/M000017.html" target="Code" class="method-signature"
400
- onclick="popupCode('FieldPredicateMap.src/M000017.html');return false;">
552
+ <a href="#M000017" class="method-signature">
401
553
  <span class="method-name">remove_by_uri</span><span class="method-args">(uri)</span>
402
554
  </a>
403
555
  </div>
@@ -407,6 +559,19 @@ name
407
559
  Remove a <a href="DatatypeProperty.html">DatatypeProperty</a> by its mapped
408
560
  uri
409
561
  </p>
562
+ <p><a class="source-toggle" href="#"
563
+ onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
564
+ <div class="method-source-code" id="M000017-source">
565
+ <pre>
566
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 220</span>
567
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_by_uri</span>(<span class="ruby-identifier">uri</span>)
568
+ <span class="ruby-identifier">p</span> = <span class="ruby-identifier">get_by_uri</span>(<span class="ruby-identifier">uri</span>)
569
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">p</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>)
570
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">p</span>)
571
+ <span class="ruby-keyword kw">end</span>
572
+ <span class="ruby-keyword kw">end</span>
573
+ </pre>
574
+ </div>
410
575
  </div>
411
576
  </div>
412
577
 
@@ -414,8 +579,7 @@ uri
414
579
  <a name="M000018"></a>
415
580
 
416
581
  <div class="method-heading">
417
- <a href="FieldPredicateMap.src/M000018.html" target="Code" class="method-signature"
418
- onclick="popupCode('FieldPredicateMap.src/M000018.html');return false;">
582
+ <a href="#M000018" class="method-signature">
419
583
  <span class="method-name">to_rdf</span><span class="method-args">()</span>
420
584
  </a>
421
585
  </div>
@@ -425,6 +589,36 @@ uri
425
589
  Dump this object to an RDF/XML representation suitable for submitting to
426
590
  the Platform
427
591
  </p>
592
+ <p><a class="source-toggle" href="#"
593
+ onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
594
+ <div class="method-source-code" id="M000018-source">
595
+ <pre>
596
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 228</span>
597
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rdf</span>
598
+ <span class="ruby-identifier">rdf</span> = <span class="ruby-node">&quot;&lt;rdf:RDF xmlns:frm=\&quot;#{Pho::Namespaces::FRAME}\&quot; &quot;</span>
599
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; xmlns:rdf=\&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#\&quot; &quot;</span>
600
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; xmlns:rdfs=\&quot;http://www.w3.org/2000/01/rdf-schema#\&quot; &quot;</span>
601
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; xmlns:bf=\&quot;#{Pho::Namespaces::CONFIG}\&quot; &gt; &quot;</span>
602
+
603
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; &lt;rdf:Description rdf:about=\&quot;#{@uri}\&quot;&gt; &quot;</span>
604
+
605
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; &lt;rdf:type rdf:resource=\&quot;#{Pho::Namespaces::CONFIG}FieldPredicateMap\&quot;/&gt; &quot;</span>
606
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; &lt;rdfs:label&gt;#{@label}&lt;/rdfs:label&gt; &quot;</span>
607
+
608
+ <span class="ruby-ivar">@datatype_properties</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span>
609
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; &lt;frm:mappedDatatypeProperty rdf:resource=\&quot;#{property.uri}\&quot;/&gt; &quot;</span>
610
+ <span class="ruby-keyword kw">end</span>
611
+
612
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &lt;/rdf:Description&gt;&quot;</span>
613
+
614
+ <span class="ruby-ivar">@datatype_properties</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span>
615
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">property</span>.<span class="ruby-identifier">to_rdf</span>(<span class="ruby-keyword kw">false</span>)
616
+ <span class="ruby-keyword kw">end</span>
617
+
618
+ <span class="ruby-identifier">rdf</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;/rdf:RDF&gt;&quot;</span>
619
+ <span class="ruby-keyword kw">end</span>
620
+ </pre>
621
+ </div>
428
622
  </div>
429
623
  </div>
430
624
 
@@ -432,8 +626,7 @@ the Platform
432
626
  <a name="M000019"></a>
433
627
 
434
628
  <div class="method-heading">
435
- <a href="FieldPredicateMap.src/M000019.html" target="Code" class="method-signature"
436
- onclick="popupCode('FieldPredicateMap.src/M000019.html');return false;">
629
+ <a href="#M000019" class="method-signature">
437
630
  <span class="method-name">upload</span><span class="method-args">(store)</span>
438
631
  </a>
439
632
  </div>
@@ -443,6 +636,16 @@ the Platform
443
636
  Upload an RDF/XML presentation of this object to the provided Platform <a
444
637
  href="Store.html">Store</a>
445
638
  </p>
639
+ <p><a class="source-toggle" href="#"
640
+ onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
641
+ <div class="method-source-code" id="M000019-source">
642
+ <pre>
643
+ <span class="ruby-comment cmt"># File lib/pho/field_predicate_map.rb, line 253</span>
644
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upload</span>(<span class="ruby-identifier">store</span>)
645
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store</span>.<span class="ruby-identifier">put_field_predicate_map</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_rdf</span>)
646
+ <span class="ruby-keyword kw">end</span>
647
+ </pre>
648
+ </div>
446
649
  </div>
447
650
  </div>
448
651