pho 0.4 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,127 @@
|
|
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::Update</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::Update</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/pho/changeset_builder_rb.html">
|
59
|
+
lib/pho/changeset_builder.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../../files/lib/pho/changeset_rb.html">
|
63
|
+
lib/pho/changeset.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
</table>
|
70
|
+
</div>
|
71
|
+
<!-- banner header -->
|
72
|
+
|
73
|
+
<div id="bodyContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<div id="contextContent">
|
78
|
+
|
79
|
+
<div id="description">
|
80
|
+
<p>
|
81
|
+
Module organizing classes related to <a
|
82
|
+
href="Update/Changeset.html">Changeset</a> handling.
|
83
|
+
</p>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
<!-- if includes -->
|
95
|
+
|
96
|
+
<div id="section">
|
97
|
+
|
98
|
+
<div id="class-list">
|
99
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
100
|
+
|
101
|
+
Class <a href="Update/Changeset.html" class="link">Pho::Update::Changeset</a><br />
|
102
|
+
Class <a href="Update/ChangesetBuilder.html" class="link">Pho::Update::ChangesetBuilder</a><br />
|
103
|
+
Class <a href="Update/Changesets.html" class="link">Pho::Update::Changesets</a><br />
|
104
|
+
Class <a href="Update/LiteralStatement.html" class="link">Pho::Update::LiteralStatement</a><br />
|
105
|
+
Class <a href="Update/ResourceStatement.html" class="link">Pho::Update::ResourceStatement</a><br />
|
106
|
+
Class <a href="Update/Statement.html" class="link">Pho::Update::Statement</a><br />
|
107
|
+
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<!-- if method_list -->
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
<div id="validator-badges">
|
123
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
</body>
|
127
|
+
</html>
|
@@ -0,0 +1,520 @@
|
|
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::Update::Changeset</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::Update::Changeset</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/pho/changeset_rb.html">
|
59
|
+
lib/pho/changeset.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
|
+
Models a <a href="Changeset.html">Changeset</a>: a delta to an RDF graph
|
84
|
+
</p>
|
85
|
+
<p>
|
86
|
+
The RDF Schema for <a href="Changesets.html">Changesets</a> can be found
|
87
|
+
at:
|
88
|
+
</p>
|
89
|
+
<pre>
|
90
|
+
http://vocab.org/changeset/schema
|
91
|
+
</pre>
|
92
|
+
<p>
|
93
|
+
Further reading:
|
94
|
+
</p>
|
95
|
+
<pre>
|
96
|
+
http://n2.talis.com/wiki/Changesets
|
97
|
+
</pre>
|
98
|
+
<p>
|
99
|
+
The Platform <a href="Changeset.html">Changeset</a> protocol is described
|
100
|
+
at:
|
101
|
+
</p>
|
102
|
+
<pre>
|
103
|
+
http://n2.talis.com/wiki/Changeset_Protocol
|
104
|
+
</pre>
|
105
|
+
<p>
|
106
|
+
Processing of batch changesets is described at:
|
107
|
+
</p>
|
108
|
+
<pre>
|
109
|
+
http://n2.talis.com/wiki/Metabox
|
110
|
+
</pre>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div id="method-list">
|
118
|
+
<h3 class="section-bar">Methods</h3>
|
119
|
+
|
120
|
+
<div class="name-list">
|
121
|
+
<a href="#M000022">add_addition</a>
|
122
|
+
<a href="#M000023">add_additions</a>
|
123
|
+
<a href="#M000025">add_removal</a>
|
124
|
+
<a href="#M000026">add_removals</a>
|
125
|
+
<a href="#M000021">additions</a>
|
126
|
+
<a href="#M000018">new</a>
|
127
|
+
<a href="#M000024">removals</a>
|
128
|
+
<a href="#M000027">submit</a>
|
129
|
+
<a href="#M000020">to_rdf</a>
|
130
|
+
<a href="#M000019">to_s</a>
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
<!-- if includes -->
|
138
|
+
|
139
|
+
<div id="section">
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<div id="attribute-list">
|
146
|
+
<h3 class="section-bar">Attributes</h3>
|
147
|
+
|
148
|
+
<div class="name-list">
|
149
|
+
<table>
|
150
|
+
<tr class="top-aligned-row context-row">
|
151
|
+
<td class="context-item-name">change_reason</td>
|
152
|
+
<td class="context-item-value"> [RW] </td>
|
153
|
+
<td class="context-item-desc">
|
154
|
+
Reason for the change being made
|
155
|
+
|
156
|
+
</td>
|
157
|
+
</tr>
|
158
|
+
<tr class="top-aligned-row context-row">
|
159
|
+
<td class="context-item-name">creator_name</td>
|
160
|
+
<td class="context-item-value"> [RW] </td>
|
161
|
+
<td class="context-item-desc">
|
162
|
+
Creator name
|
163
|
+
|
164
|
+
</td>
|
165
|
+
</tr>
|
166
|
+
<tr class="top-aligned-row context-row">
|
167
|
+
<td class="context-item-name">subject_of_change</td>
|
168
|
+
<td class="context-item-value"> [R] </td>
|
169
|
+
<td class="context-item-desc">
|
170
|
+
URI of the subject of change for this changeset
|
171
|
+
|
172
|
+
</td>
|
173
|
+
</tr>
|
174
|
+
</table>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<!-- if method_list -->
|
181
|
+
<div id="methods">
|
182
|
+
<h3 class="section-bar">Public Class methods</h3>
|
183
|
+
|
184
|
+
<div id="method-M000018" class="method-detail">
|
185
|
+
<a name="M000018"></a>
|
186
|
+
|
187
|
+
<div class="method-heading">
|
188
|
+
<a href="#M000018" class="method-signature">
|
189
|
+
<span class="method-name">new</span><span class="method-args">(subject_of_change, creator_name=nil, change_reason=nil) {|self if block_given?| ...}</span>
|
190
|
+
</a>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
<p>
|
195
|
+
Constructor. Parameter should be the URI of the subject of change
|
196
|
+
</p>
|
197
|
+
<pre>
|
198
|
+
subject_of_change:: the URI of the resource being changed
|
199
|
+
creator_name:: the name of the creator of this change (optional)
|
200
|
+
change_reason:: the reason for the change (optional)
|
201
|
+
</pre>
|
202
|
+
<p><a class="source-toggle" href="#"
|
203
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
204
|
+
<div class="method-source-code" id="M000018-source">
|
205
|
+
<pre>
|
206
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 206</span>
|
207
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">subject_of_change</span>, <span class="ruby-identifier">creator_name</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">change_reason</span>=<span class="ruby-keyword kw">nil</span>)
|
208
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">subject_of_change</span>)
|
209
|
+
<span class="ruby-comment cmt">#this should catch literals</span>
|
210
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">u</span>.<span class="ruby-identifier">scheme</span>() <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
211
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">InvalidURIError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Invalid URI"</span>)
|
212
|
+
<span class="ruby-keyword kw">end</span>
|
213
|
+
<span class="ruby-ivar">@subject_of_change</span> = <span class="ruby-identifier">subject_of_change</span>
|
214
|
+
<span class="ruby-ivar">@creator_name</span> = <span class="ruby-identifier">creator_name</span>
|
215
|
+
<span class="ruby-ivar">@change_reason</span> = <span class="ruby-identifier">change_reason</span>
|
216
|
+
<span class="ruby-ivar">@additions</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
217
|
+
<span class="ruby-ivar">@removals</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
218
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
219
|
+
<span class="ruby-keyword kw">end</span>
|
220
|
+
</pre>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
226
|
+
|
227
|
+
<div id="method-M000022" class="method-detail">
|
228
|
+
<a name="M000022"></a>
|
229
|
+
|
230
|
+
<div class="method-heading">
|
231
|
+
<a href="#M000022" class="method-signature">
|
232
|
+
<span class="method-name">add_addition</span><span class="method-args">(statement)</span>
|
233
|
+
</a>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
<p>
|
238
|
+
Include a <a href="Statement.html">Statement</a> in the <a
|
239
|
+
href="Changeset.html">Changeset</a> as an addition
|
240
|
+
</p>
|
241
|
+
<p><a class="source-toggle" href="#"
|
242
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
243
|
+
<div class="method-source-code" id="M000022-source">
|
244
|
+
<pre>
|
245
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 265</span>
|
246
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_addition</span>(<span class="ruby-identifier">statement</span>)
|
247
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>.<span class="ruby-identifier">subject</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@subject_of_change</span>
|
248
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Subject of statement must match subject of change of changeset"</span>
|
249
|
+
<span class="ruby-keyword kw">end</span>
|
250
|
+
<span class="ruby-ivar">@additions</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">statement</span>
|
251
|
+
<span class="ruby-keyword kw">end</span>
|
252
|
+
</pre>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<div id="method-M000023" class="method-detail">
|
258
|
+
<a name="M000023"></a>
|
259
|
+
|
260
|
+
<div class="method-heading">
|
261
|
+
<a href="#M000023" class="method-signature">
|
262
|
+
<span class="method-name">add_additions</span><span class="method-args">(statements)</span>
|
263
|
+
</a>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
<div class="method-description">
|
267
|
+
<p>
|
268
|
+
Add an array of statements as <a
|
269
|
+
href="Changeset.html#M000021">additions</a>
|
270
|
+
</p>
|
271
|
+
<p><a class="source-toggle" href="#"
|
272
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
273
|
+
<div class="method-source-code" id="M000023-source">
|
274
|
+
<pre>
|
275
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 273</span>
|
276
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_additions</span>(<span class="ruby-identifier">statements</span>)
|
277
|
+
<span class="ruby-identifier">statements</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">statement</span><span class="ruby-operator">|</span>
|
278
|
+
<span class="ruby-identifier">add_addition</span>(<span class="ruby-identifier">statement</span>)
|
279
|
+
<span class="ruby-keyword kw">end</span>
|
280
|
+
<span class="ruby-keyword kw">end</span>
|
281
|
+
</pre>
|
282
|
+
</div>
|
283
|
+
</div>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
<div id="method-M000025" class="method-detail">
|
287
|
+
<a name="M000025"></a>
|
288
|
+
|
289
|
+
<div class="method-heading">
|
290
|
+
<a href="#M000025" class="method-signature">
|
291
|
+
<span class="method-name">add_removal</span><span class="method-args">(statement)</span>
|
292
|
+
</a>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
<div class="method-description">
|
296
|
+
<p>
|
297
|
+
Include a <a href="Statement.html">Statement</a> in the <a
|
298
|
+
href="Changeset.html">Changeset</a> as a removal
|
299
|
+
</p>
|
300
|
+
<p><a class="source-toggle" href="#"
|
301
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
302
|
+
<div class="method-source-code" id="M000025-source">
|
303
|
+
<pre>
|
304
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 285</span>
|
305
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_removal</span>(<span class="ruby-identifier">statement</span>)
|
306
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>.<span class="ruby-identifier">subject</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@subject_of_change</span>
|
307
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Subject of statement must match subject of change of changeset"</span>
|
308
|
+
<span class="ruby-keyword kw">end</span>
|
309
|
+
<span class="ruby-ivar">@removals</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">statement</span>
|
310
|
+
<span class="ruby-keyword kw">end</span>
|
311
|
+
</pre>
|
312
|
+
</div>
|
313
|
+
</div>
|
314
|
+
</div>
|
315
|
+
|
316
|
+
<div id="method-M000026" class="method-detail">
|
317
|
+
<a name="M000026"></a>
|
318
|
+
|
319
|
+
<div class="method-heading">
|
320
|
+
<a href="#M000026" class="method-signature">
|
321
|
+
<span class="method-name">add_removals</span><span class="method-args">(statements)</span>
|
322
|
+
</a>
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div class="method-description">
|
326
|
+
<p>
|
327
|
+
Add an array of statements as <a href="Changeset.html#M000024">removals</a>
|
328
|
+
</p>
|
329
|
+
<p><a class="source-toggle" href="#"
|
330
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
331
|
+
<div class="method-source-code" id="M000026-source">
|
332
|
+
<pre>
|
333
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 293</span>
|
334
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_removals</span>(<span class="ruby-identifier">statements</span>)
|
335
|
+
<span class="ruby-identifier">statements</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">statement</span><span class="ruby-operator">|</span>
|
336
|
+
<span class="ruby-identifier">add_removal</span>(<span class="ruby-identifier">statement</span>)
|
337
|
+
<span class="ruby-keyword kw">end</span>
|
338
|
+
<span class="ruby-keyword kw">end</span>
|
339
|
+
</pre>
|
340
|
+
</div>
|
341
|
+
</div>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
<div id="method-M000021" class="method-detail">
|
345
|
+
<a name="M000021"></a>
|
346
|
+
|
347
|
+
<div class="method-heading">
|
348
|
+
<a href="#M000021" class="method-signature">
|
349
|
+
<span class="method-name">additions</span><span class="method-args">()</span>
|
350
|
+
</a>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
<div class="method-description">
|
354
|
+
<p>
|
355
|
+
Return the <a href="Statement.html">Statement</a> describing the addition
|
356
|
+
in this <a href="Changeset.html">Changeset</a>
|
357
|
+
</p>
|
358
|
+
<p><a class="source-toggle" href="#"
|
359
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
360
|
+
<div class="method-source-code" id="M000021-source">
|
361
|
+
<pre>
|
362
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 260</span>
|
363
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">additions</span>()
|
364
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@additions</span>
|
365
|
+
<span class="ruby-keyword kw">end</span>
|
366
|
+
</pre>
|
367
|
+
</div>
|
368
|
+
</div>
|
369
|
+
</div>
|
370
|
+
|
371
|
+
<div id="method-M000024" class="method-detail">
|
372
|
+
<a name="M000024"></a>
|
373
|
+
|
374
|
+
<div class="method-heading">
|
375
|
+
<a href="#M000024" class="method-signature">
|
376
|
+
<span class="method-name">removals</span><span class="method-args">()</span>
|
377
|
+
</a>
|
378
|
+
</div>
|
379
|
+
|
380
|
+
<div class="method-description">
|
381
|
+
<p>
|
382
|
+
Return the list of Statements describing the <a
|
383
|
+
href="Changeset.html#M000024">removals</a> in this <a
|
384
|
+
href="Changeset.html">Changeset</a>
|
385
|
+
</p>
|
386
|
+
<p><a class="source-toggle" href="#"
|
387
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
388
|
+
<div class="method-source-code" id="M000024-source">
|
389
|
+
<pre>
|
390
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 280</span>
|
391
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">removals</span>()
|
392
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@removals</span>
|
393
|
+
<span class="ruby-keyword kw">end</span>
|
394
|
+
</pre>
|
395
|
+
</div>
|
396
|
+
</div>
|
397
|
+
</div>
|
398
|
+
|
399
|
+
<div id="method-M000027" class="method-detail">
|
400
|
+
<a name="M000027"></a>
|
401
|
+
|
402
|
+
<div class="method-heading">
|
403
|
+
<a href="#M000027" class="method-signature">
|
404
|
+
<span class="method-name">submit</span><span class="method-args">(store, versioned=false)</span>
|
405
|
+
</a>
|
406
|
+
</div>
|
407
|
+
|
408
|
+
<div class="method-description">
|
409
|
+
<p>
|
410
|
+
Submit this changeset to the specified store
|
411
|
+
</p>
|
412
|
+
<pre>
|
413
|
+
store:: the store to which the changeset should be applied
|
414
|
+
</pre>
|
415
|
+
<p><a class="source-toggle" href="#"
|
416
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
417
|
+
<div class="method-source-code" id="M000027-source">
|
418
|
+
<pre>
|
419
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 302</span>
|
420
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">versioned</span>=<span class="ruby-keyword kw">false</span>)
|
421
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store</span>.<span class="ruby-identifier">submit_changeset</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_rdf</span>, <span class="ruby-identifier">versioned</span>)
|
422
|
+
<span class="ruby-keyword kw">end</span>
|
423
|
+
</pre>
|
424
|
+
</div>
|
425
|
+
</div>
|
426
|
+
</div>
|
427
|
+
|
428
|
+
<div id="method-M000020" class="method-detail">
|
429
|
+
<a name="M000020"></a>
|
430
|
+
|
431
|
+
<div class="method-heading">
|
432
|
+
<a href="#M000020" class="method-signature">
|
433
|
+
<span class="method-name">to_rdf</span><span class="method-args">(include_root=true)</span>
|
434
|
+
</a>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
<div class="method-description">
|
438
|
+
<p>
|
439
|
+
Serialize this changeset as RDF/XML suitable for submitting to the
|
440
|
+
Platform.
|
441
|
+
</p>
|
442
|
+
<p><a class="source-toggle" href="#"
|
443
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
444
|
+
<div class="method-source-code" id="M000020-source">
|
445
|
+
<pre>
|
446
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 225</span>
|
447
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rdf</span>(<span class="ruby-identifier">include_root</span>=<span class="ruby-keyword kw">true</span>)
|
448
|
+
<span class="ruby-identifier">rdf</span> = <span class="ruby-value str">""</span>
|
449
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">include_root</span>
|
450
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<rdf:RDF xmlns:cs=\"http://purl.org/vocab/changeset/schema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">"</span>
|
451
|
+
<span class="ruby-keyword kw">end</span>
|
452
|
+
|
453
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" <cs:ChangeSet>"</span>
|
454
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <cs:subjectOfChange rdf:resource=\"#{@subject_of_change}\"/>"</span>
|
455
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@creator_name</span>
|
456
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <cs:creatorName>#{@creator_name}</cs:creatorName>"</span>
|
457
|
+
<span class="ruby-keyword kw">end</span>
|
458
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@change_reason</span>
|
459
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <cs:changeReason>#{@change_reason}</cs:changeReason>"</span>
|
460
|
+
<span class="ruby-keyword kw">end</span>
|
461
|
+
<span class="ruby-ivar">@additions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">add</span><span class="ruby-operator">|</span>
|
462
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" <cs:addition>"</span>
|
463
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">add</span>.<span class="ruby-identifier">to_rdf</span>
|
464
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" </cs:addition>"</span>
|
465
|
+
<span class="ruby-keyword kw">end</span>
|
466
|
+
<span class="ruby-ivar">@removals</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">remove</span><span class="ruby-operator">|</span>
|
467
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" <cs:removal>"</span>
|
468
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">remove</span>.<span class="ruby-identifier">to_rdf</span>
|
469
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" </cs:removal>"</span>
|
470
|
+
<span class="ruby-keyword kw">end</span>
|
471
|
+
|
472
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" </cs:ChangeSet>"</span>
|
473
|
+
|
474
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">include_root</span>
|
475
|
+
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</rdf:RDF>"</span>
|
476
|
+
<span class="ruby-keyword kw">end</span>
|
477
|
+
|
478
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">rdf</span>
|
479
|
+
<span class="ruby-keyword kw">end</span>
|
480
|
+
</pre>
|
481
|
+
</div>
|
482
|
+
</div>
|
483
|
+
</div>
|
484
|
+
|
485
|
+
<div id="method-M000019" class="method-detail">
|
486
|
+
<a name="M000019"></a>
|
487
|
+
|
488
|
+
<div class="method-heading">
|
489
|
+
<a href="#M000019" class="method-signature">
|
490
|
+
<span class="method-name">to_s</span><span class="method-args">()</span>
|
491
|
+
</a>
|
492
|
+
</div>
|
493
|
+
|
494
|
+
<div class="method-description">
|
495
|
+
<p><a class="source-toggle" href="#"
|
496
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
497
|
+
<div class="method-source-code" id="M000019-source">
|
498
|
+
<pre>
|
499
|
+
<span class="ruby-comment cmt"># File lib/pho/changeset.rb, line 220</span>
|
500
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
501
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_rdf</span>
|
502
|
+
<span class="ruby-keyword kw">end</span>
|
503
|
+
</pre>
|
504
|
+
</div>
|
505
|
+
</div>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
|
509
|
+
</div>
|
510
|
+
|
511
|
+
|
512
|
+
</div>
|
513
|
+
|
514
|
+
|
515
|
+
<div id="validator-badges">
|
516
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
517
|
+
</div>
|
518
|
+
|
519
|
+
</body>
|
520
|
+
</html>
|