pho 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +12 -1
- data/Rakefile +2 -2
- data/doc/index.html +15 -1
- data/doc/rdoc/classes/Pho.html +14 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +12 -12
- data/doc/rdoc/classes/Pho/Etags.html +36 -36
- data/doc/rdoc/classes/Pho/Facet/Results.html +19 -19
- data/doc/rdoc/classes/Pho/Facet/Term.html +6 -6
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +90 -90
- data/doc/rdoc/classes/Pho/FieldWeighting.html +12 -12
- data/doc/rdoc/classes/Pho/Job.html +64 -64
- data/doc/rdoc/classes/Pho/Jobs.html +61 -61
- data/doc/rdoc/classes/Pho/Namespaces.html +6 -1
- data/doc/rdoc/classes/Pho/QueryProfile.html +61 -61
- data/doc/rdoc/classes/Pho/RDFCollection.html +71 -71
- data/doc/rdoc/classes/Pho/RDF_JSON.html +118 -0
- data/doc/rdoc/classes/Pho/RDF_JSON/SetAlgebra.html +240 -0
- data/doc/rdoc/classes/Pho/Snapshot.html +35 -35
- data/doc/rdoc/classes/Pho/Status.html +26 -26
- data/doc/rdoc/classes/Pho/Store.html +342 -264
- data/doc/rdoc/classes/Pho/Update.html +127 -0
- data/doc/rdoc/classes/Pho/Update/Changeset.html +520 -0
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +330 -0
- data/doc/rdoc/classes/Pho/Update/Changesets.html +204 -0
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +248 -0
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +213 -0
- data/doc/rdoc/classes/Pho/Update/Statement.html +302 -0
- data/doc/rdoc/classes/String.html +146 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +33 -2
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/changeset_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/job_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/rdf_json_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +4 -1
- data/doc/rdoc/fr_class_index.html +10 -0
- data/doc/rdoc/fr_file_index.html +3 -0
- data/doc/rdoc/fr_method_index.html +140 -110
- data/lib/pho.rb +14 -1
- data/lib/pho/changeset.rb +312 -0
- data/lib/pho/changeset_builder.rb +118 -0
- data/lib/pho/job.rb +1 -1
- data/lib/pho/query_profile.rb +1 -1
- data/lib/pho/rdf_json.rb +81 -0
- data/lib/pho/store.rb +63 -25
- data/tests/tc_changeset.rb +273 -0
- data/tests/tc_changeset_builder.rb +151 -0
- data/tests/tc_changesets.rb +96 -0
- data/tests/tc_metabox.rb +20 -2
- data/tests/tc_query_profile.rb +4 -2
- data/tests/tc_rdf_json.rb +273 -0
- data/tests/tc_search.rb +5 -5
- data/tests/tc_sparql.rb +12 -0
- data/tests/ts_pho.rb +5 -1
- metadata +25 -3
@@ -0,0 +1,118 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Pho::RDF_JSON</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::RDF_JSON</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/pho/rdf_json_rb.html">
|
59
|
+
lib/pho/rdf_json.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
Module providing code for manipulating triple hashes structured according
|
78
|
+
to the RDF in JSON spec
|
79
|
+
</p>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if includes -->
|
91
|
+
|
92
|
+
<div id="section">
|
93
|
+
|
94
|
+
<div id="class-list">
|
95
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
96
|
+
|
97
|
+
Class <a href="RDF_JSON/SetAlgebra.html" class="link">Pho::RDF_JSON::SetAlgebra</a><br />
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if method_list -->
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<div id="validator-badges">
|
114
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
</body>
|
118
|
+
</html>
|
@@ -0,0 +1,240 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Pho::RDF_JSON::SetAlgebra</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::RDF_JSON::SetAlgebra</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/pho/rdf_json_rb.html">
|
59
|
+
lib/pho/rdf_json.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Class providing set algebra methods over triple hashes
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div id="method-list">
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
93
|
+
|
94
|
+
<div class="name-list">
|
95
|
+
<a href="#M000032">minus</a>
|
96
|
+
<a href="#M000033">object_in_array?</a>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if includes -->
|
104
|
+
|
105
|
+
<div id="section">
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<!-- if method_list -->
|
115
|
+
<div id="methods">
|
116
|
+
<h3 class="section-bar">Public Class methods</h3>
|
117
|
+
|
118
|
+
<div id="method-M000032" class="method-detail">
|
119
|
+
<a name="M000032"></a>
|
120
|
+
|
121
|
+
<div class="method-heading">
|
122
|
+
<a href="#M000032" class="method-signature">
|
123
|
+
<span class="method-name">minus</span><span class="method-args">(first, second)</span>
|
124
|
+
</a>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div class="method-description">
|
128
|
+
<p>
|
129
|
+
Accepts two triple hashes, expressed as RDF-in-JSON and returns a new Ruby
|
130
|
+
data structure that constitutes the different between the two graphs
|
131
|
+
</p>
|
132
|
+
<p>
|
133
|
+
i.e. the return value will be a hash containing the triples that are in the
|
134
|
+
first graph but which are not present in the second.
|
135
|
+
</p>
|
136
|
+
<pre>
|
137
|
+
first:: the first graph
|
138
|
+
second:: the second graph.
|
139
|
+
</pre>
|
140
|
+
<p><a class="source-toggle" href="#"
|
141
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
142
|
+
<div class="method-source-code" id="M000032-source">
|
143
|
+
<pre>
|
144
|
+
<span class="ruby-comment cmt"># File lib/pho/rdf_json.rb, line 21</span>
|
145
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">SetAlgebra</span>.<span class="ruby-identifier">minus</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>)
|
146
|
+
|
147
|
+
<span class="ruby-identifier">difference</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
148
|
+
<span class="ruby-identifier">first</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span>,<span class="ruby-identifier">properties</span><span class="ruby-operator">|</span>
|
149
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">second</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">uri</span>)
|
150
|
+
<span class="ruby-identifier">properties</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">predicate</span>,<span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
151
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">second</span>[<span class="ruby-identifier">uri</span>].<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">predicate</span>)
|
152
|
+
<span class="ruby-comment cmt">#second hash has same uri and predicate, so check value arrays </span>
|
153
|
+
<span class="ruby-identifier">second_value</span> = <span class="ruby-identifier">second</span>[<span class="ruby-identifier">uri</span>][<span class="ruby-identifier">predicate</span>]
|
154
|
+
<span class="ruby-identifier">value</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
155
|
+
|
156
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">object_in_array?</span>(<span class="ruby-identifier">second_value</span>, <span class="ruby-identifier">val</span>)
|
157
|
+
|
158
|
+
<span class="ruby-identifier">difference</span>[<span class="ruby-identifier">uri</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
159
|
+
<span class="ruby-identifier">difference</span>[<span class="ruby-identifier">uri</span>][<span class="ruby-identifier">predicate</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
160
|
+
<span class="ruby-identifier">difference</span>[<span class="ruby-identifier">uri</span>][<span class="ruby-identifier">predicate</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">val</span>
|
161
|
+
<span class="ruby-keyword kw">end</span>
|
162
|
+
<span class="ruby-keyword kw">end</span>
|
163
|
+
|
164
|
+
<span class="ruby-keyword kw">else</span>
|
165
|
+
<span class="ruby-comment cmt">#uri is in second, but not this property and value</span>
|
166
|
+
<span class="ruby-identifier">difference</span>[<span class="ruby-identifier">uri</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
167
|
+
<span class="ruby-identifier">difference</span>[<span class="ruby-identifier">uri</span>][<span class="ruby-identifier">predicate</span>] = <span class="ruby-identifier">value</span>
|
168
|
+
<span class="ruby-keyword kw">end</span>
|
169
|
+
<span class="ruby-keyword kw">end</span>
|
170
|
+
<span class="ruby-keyword kw">else</span>
|
171
|
+
<span class="ruby-comment cmt">#uri not in second, so pass all straight-through</span>
|
172
|
+
<span class="ruby-identifier">difference</span>[<span class="ruby-identifier">uri</span>] = <span class="ruby-identifier">properties</span>
|
173
|
+
<span class="ruby-keyword kw">end</span>
|
174
|
+
|
175
|
+
<span class="ruby-keyword kw">end</span>
|
176
|
+
|
177
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">difference</span>
|
178
|
+
|
179
|
+
<span class="ruby-keyword kw">end</span>
|
180
|
+
</pre>
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
<div id="method-M000033" class="method-detail">
|
186
|
+
<a name="M000033"></a>
|
187
|
+
|
188
|
+
<div class="method-heading">
|
189
|
+
<a href="#M000033" class="method-signature">
|
190
|
+
<span class="method-name">object_in_array?</span><span class="method-args">(array, val)</span>
|
191
|
+
</a>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
<p>
|
196
|
+
Is there an object in the specified array, that matches the provided
|
197
|
+
description
|
198
|
+
</p>
|
199
|
+
<p><a class="source-toggle" href="#"
|
200
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
201
|
+
<div class="method-source-code" id="M000033-source">
|
202
|
+
<pre>
|
203
|
+
<span class="ruby-comment cmt"># File lib/pho/rdf_json.rb, line 58</span>
|
204
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">SetAlgebra</span>.<span class="ruby-identifier">object_in_array?</span>(<span class="ruby-identifier">array</span>, <span class="ruby-identifier">val</span>)
|
205
|
+
<span class="ruby-identifier">array</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
|
206
|
+
|
207
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">entry</span>[<span class="ruby-value str">"type"</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">val</span>[<span class="ruby-value str">"type"</span>]
|
208
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">entry</span>[<span class="ruby-value str">"value"</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">val</span>[<span class="ruby-value str">"value"</span>]
|
209
|
+
|
210
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">entry</span>[<span class="ruby-value str">"type"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"literal"</span>
|
211
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">entry</span>[<span class="ruby-value str">"datatype"</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">val</span>[<span class="ruby-value str">"datatype"</span>] <span class="ruby-operator">&&</span>
|
212
|
+
<span class="ruby-identifier">entry</span>[<span class="ruby-value str">"lang"</span>] = <span class="ruby-identifier">val</span>[<span class="ruby-value str">"lang"</span>]
|
213
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
214
|
+
<span class="ruby-keyword kw">end</span>
|
215
|
+
<span class="ruby-keyword kw">end</span>
|
216
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
217
|
+
<span class="ruby-keyword kw">end</span>
|
218
|
+
|
219
|
+
<span class="ruby-keyword kw">end</span>
|
220
|
+
<span class="ruby-keyword kw">end</span>
|
221
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
222
|
+
<span class="ruby-keyword kw">end</span>
|
223
|
+
</pre>
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
</div>
|
230
|
+
|
231
|
+
|
232
|
+
</div>
|
233
|
+
|
234
|
+
|
235
|
+
<div id="validator-badges">
|
236
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
</body>
|
240
|
+
</html>
|
@@ -81,7 +81,7 @@
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
83
|
In the Talis Platform a "snapshot" is an <a
|
84
|
-
href="Snapshot.html#
|
84
|
+
href="Snapshot.html#M000111">backup</a> of the contents of a <a
|
85
85
|
href="Store.html">Store</a>
|
86
86
|
</p>
|
87
87
|
<p>
|
@@ -102,11 +102,11 @@ A snapshot can be generated (or scheduled) using the Store.snapshot method.
|
|
102
102
|
<h3 class="section-bar">Methods</h3>
|
103
103
|
|
104
104
|
<div class="name-list">
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
105
|
+
<a href="#M000111">backup</a>
|
106
|
+
<a href="#M000109">new</a>
|
107
|
+
<a href="#M000108">parse</a>
|
108
|
+
<a href="#M000107">read_from_store</a>
|
109
|
+
<a href="#M000110">read_md5</a>
|
110
110
|
</div>
|
111
111
|
</div>
|
112
112
|
|
@@ -176,19 +176,19 @@ The URL from which the snapshot can be retrieved
|
|
176
176
|
<div id="methods">
|
177
177
|
<h3 class="section-bar">Public Class methods</h3>
|
178
178
|
|
179
|
-
<div id="method-
|
180
|
-
<a name="
|
179
|
+
<div id="method-M000109" class="method-detail">
|
180
|
+
<a name="M000109"></a>
|
181
181
|
|
182
182
|
<div class="method-heading">
|
183
|
-
<a href="#
|
183
|
+
<a href="#M000109" class="method-signature">
|
184
184
|
<span class="method-name">new</span><span class="method-args">(url, md5_url, size, units, date)</span>
|
185
185
|
</a>
|
186
186
|
</div>
|
187
187
|
|
188
188
|
<div class="method-description">
|
189
189
|
<p><a class="source-toggle" href="#"
|
190
|
-
onclick="toggleCode('
|
191
|
-
<div class="method-source-code" id="
|
190
|
+
onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
|
191
|
+
<div class="method-source-code" id="M000109-source">
|
192
192
|
<pre>
|
193
193
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 76</span>
|
194
194
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">md5_url</span>, <span class="ruby-identifier">size</span>, <span class="ruby-identifier">units</span>, <span class="ruby-identifier">date</span>)
|
@@ -203,21 +203,21 @@ The URL from which the snapshot can be retrieved
|
|
203
203
|
</div>
|
204
204
|
</div>
|
205
205
|
|
206
|
-
<div id="method-
|
207
|
-
<a name="
|
206
|
+
<div id="method-M000108" class="method-detail">
|
207
|
+
<a name="M000108"></a>
|
208
208
|
|
209
209
|
<div class="method-heading">
|
210
|
-
<a href="#
|
210
|
+
<a href="#M000108" class="method-signature">
|
211
211
|
<span class="method-name">parse</span><span class="method-args">(storeuri, content)</span>
|
212
212
|
</a>
|
213
213
|
</div>
|
214
214
|
|
215
215
|
<div class="method-description">
|
216
216
|
<p>
|
217
|
-
Class method to <a href="Snapshot.html#
|
217
|
+
Class method to <a href="Snapshot.html#M000108">parse</a> the RDF response
|
218
218
|
from the API, e.g. as produced by the <a
|
219
|
-
href="Store.html#
|
220
|
-
href="Snapshot.html#
|
219
|
+
href="Store.html#M000102">Store.get_snapshots</a> method and create a <a
|
220
|
+
href="Snapshot.html#M000109">new</a> <a href="Snapshot.html">Snapshot</a>
|
221
221
|
object. At the moment the Platform only supports single snapshot.
|
222
222
|
</p>
|
223
223
|
<p>
|
@@ -228,8 +228,8 @@ If the response was an error, then an exception will be thrown
|
|
228
228
|
content:: response from the API
|
229
229
|
</pre>
|
230
230
|
<p><a class="source-toggle" href="#"
|
231
|
-
onclick="toggleCode('
|
232
|
-
<div class="method-source-code" id="
|
231
|
+
onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
|
232
|
+
<div class="method-source-code" id="M000108-source">
|
233
233
|
<pre>
|
234
234
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 52</span>
|
235
235
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Snapshot</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">storeuri</span>, <span class="ruby-identifier">content</span>)
|
@@ -260,11 +260,11 @@ If the response was an error, then an exception will be thrown
|
|
260
260
|
</div>
|
261
261
|
</div>
|
262
262
|
|
263
|
-
<div id="method-
|
264
|
-
<a name="
|
263
|
+
<div id="method-M000107" class="method-detail">
|
264
|
+
<a name="M000107"></a>
|
265
265
|
|
266
266
|
<div class="method-heading">
|
267
|
-
<a href="#
|
267
|
+
<a href="#M000107" class="method-signature">
|
268
268
|
<span class="method-name">read_from_store</span><span class="method-args">(store)</span>
|
269
269
|
</a>
|
270
270
|
</div>
|
@@ -279,8 +279,8 @@ Read snapshot data from the given store
|
|
279
279
|
</td></tr>
|
280
280
|
</table>
|
281
281
|
<p><a class="source-toggle" href="#"
|
282
|
-
onclick="toggleCode('
|
283
|
-
<div class="method-source-code" id="
|
282
|
+
onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
|
283
|
+
<div class="method-source-code" id="M000107-source">
|
284
284
|
<pre>
|
285
285
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 34</span>
|
286
286
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Snapshot</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>)
|
@@ -300,11 +300,11 @@ Read snapshot data from the given store
|
|
300
300
|
|
301
301
|
<h3 class="section-bar">Public Instance methods</h3>
|
302
302
|
|
303
|
-
<div id="method-
|
304
|
-
<a name="
|
303
|
+
<div id="method-M000111" class="method-detail">
|
304
|
+
<a name="M000111"></a>
|
305
305
|
|
306
306
|
<div class="method-heading">
|
307
|
-
<a href="#
|
307
|
+
<a href="#M000111" class="method-signature">
|
308
308
|
<span class="method-name">backup</span><span class="method-args">(store, dir=Dir.tmpdir)</span>
|
309
309
|
</a>
|
310
310
|
</div>
|
@@ -317,7 +317,7 @@ published value. If they don‘t match then a RuntimeError will be
|
|
317
317
|
raised
|
318
318
|
</p>
|
319
319
|
<table>
|
320
|
-
<tr><td valign="top">store:</td><td>the store to <a href="Snapshot.html#
|
320
|
+
<tr><td valign="top">store:</td><td>the store to <a href="Snapshot.html#M000111">backup</a>
|
321
321
|
|
322
322
|
</td></tr>
|
323
323
|
<tr><td valign="top">dir:</td><td>directory in which snapshot will be stored
|
@@ -325,8 +325,8 @@ raised
|
|
325
325
|
</td></tr>
|
326
326
|
</table>
|
327
327
|
<p><a class="source-toggle" href="#"
|
328
|
-
onclick="toggleCode('
|
329
|
-
<div class="method-source-code" id="
|
328
|
+
onclick="toggleCode('M000111-source');return false;">[Source]</a></p>
|
329
|
+
<div class="method-source-code" id="M000111-source">
|
330
330
|
<pre>
|
331
331
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 96</span>
|
332
332
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backup</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>=<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>)
|
@@ -356,11 +356,11 @@ raised
|
|
356
356
|
</div>
|
357
357
|
</div>
|
358
358
|
|
359
|
-
<div id="method-
|
360
|
-
<a name="
|
359
|
+
<div id="method-M000110" class="method-detail">
|
360
|
+
<a name="M000110"></a>
|
361
361
|
|
362
362
|
<div class="method-heading">
|
363
|
-
<a href="#
|
363
|
+
<a href="#M000110" class="method-signature">
|
364
364
|
<span class="method-name">read_md5</span><span class="method-args">(client=HttpClient.new())</span>
|
365
365
|
</a>
|
366
366
|
</div>
|
@@ -370,8 +370,8 @@ raised
|
|
370
370
|
Read the published MD5 value
|
371
371
|
</p>
|
372
372
|
<p><a class="source-toggle" href="#"
|
373
|
-
onclick="toggleCode('
|
374
|
-
<div class="method-source-code" id="
|
373
|
+
onclick="toggleCode('M000110-source');return false;">[Source]</a></p>
|
374
|
+
<div class="method-source-code" id="M000110-source">
|
375
375
|
<pre>
|
376
376
|
<span class="ruby-comment cmt"># File lib/pho/snapshot.rb, line 86</span>
|
377
377
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_md5</span>(<span class="ruby-identifier">client</span>=<span class="ruby-constant">HttpClient</span>.<span class="ruby-identifier">new</span>())
|