67
67
<div id="contextContent"></div>
68
68
<div id="method-list">
69
69
<h3 class="section-bar">Methods</h3>
70
<div class="name-list"><a href="#M000059">add</a> <a href="#M000058">add_statement</a> <a href="#M000060">add_statements</a> <a href="#M000067">as_stream</a> <a href="#M000078">contexts</a> <a href="#M000054">create_finalizer</a> <a href="#M000055">create_resource</a> <a href="#M000063">delete</a> <a href="#M000064">delete_context</a> <a href="#M000062">delete_statement</a> <a href="#M000080">dump_model</a> <a href="#M000071">find</a> <a href="#M000056">get_resource</a> <a href="#M000066">include?</a> <a href="#M000065">include_statement?</a> <a href="#M000053">new</a> <a href="#M000073">object</a> <a href="#M000081">parse_and_merge</a> <a href="#M000076">predicates</a> <a href="#M000083">query_execute</a> <a href="#M000082">rewrite</a>
71
<a href="#M000079">save</a> <a href="#M000057">size</a> <a href="#M000061">smush</a> <a href="#M000072">statement_array_or_yield</a> <a href="#M000069">statements</a> <a href="#M000075">subject</a> <a href="#M000074">subjects</a> <a href="#M000084">to_string</a> <a href="#M000068">triples</a> <a href="#M000070">triples_with_context</a> <a href="#M000077">yield_node_or_array</a> </div>
70
<div class="name-list"><a href="#M000048">add</a> <a href="#M000047">add_statement</a> <a href="#M000049">add_statements</a> <a href="#M000056">as_stream</a> <a href="#M000067">contexts</a> <a href="#M000043">create_finalizer</a> <a href="#M000044">create_resource</a> <a href="#M000052">delete</a> <a href="#M000053">delete_context</a> <a href="#M000051">delete_statement</a> <a href="#M000069">dump_model</a> <a href="#M000060">find</a> <a href="#M000045">get_resource</a> <a href="#M000055">include?</a> <a href="#M000054">include_statement?</a> <a href="#M000042">new</a> <a href="#M000062">object</a> <a href="#M000070">parse_and_merge</a> <a href="#M000065">predicates</a> <a href="#M000072">query_execute</a> <a href="#M000071">rewrite</a>
71
<a href="#M000068">save</a> <a href="#M000046">size</a> <a href="#M000050">smush</a> <a href="#M000061">statement_array_or_yield</a> <a href="#M000058">statements</a> <a href="#M000064">subject</a> <a href="#M000063">subjects</a> <a href="#M000073">to_string</a> <a href="#M000057">triples</a> <a href="#M000059">triples_with_context</a> <a href="#M000066">yield_node_or_array</a> </div>
74
74
<!-- if includes -->
92
92
<!-- if method_list -->
94
94
<h3 class="section-bar">Public Class methods</h3>
95
<div id="method-M000054" class="method-detail"><a name="M000054" id="M000054"></a>
96
<div class="method-heading"><a href="#M000054" class="method-signature"><span class="method-name">create_finalizer</span><span class="method-args">(model)</span></a></div>
95
<div id="method-M000043" class="method-detail"><a name="M000043" id="M000043"></a>
96
<div class="method-heading"><a href="#M000043" class="method-signature"><span class="method-name">create_finalizer</span><span class="method-args">(model)</span></a></div>
97
97
<div class="method-description">
98
98
<p>You shouldn‘t use this. Used internally for cleanup.</p>
99
<p><a class="source-toggle" href="#" onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
100
<div class="method-source-code" id="M000054-source">
99
<p><a class="source-toggle" href="#" onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
100
<div class="method-source-code" id="M000043-source">
102
102
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 27</span>
103
103
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Model</span>.<span class="ruby-identifier">create_finalizer</span>(<span class="ruby-identifier">model</span>)
104
104
<span class="ruby-identifier">proc</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span> <span class="ruby-node">"Finalizer on #{id}"</span>
105
<span class="ruby-identifier">$log_final</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">"closing model"</span>
105
<span class="ruby-comment cmt">#$log_final.info "closing model"</span>
106
106
<span class="ruby-constant">Redland</span><span class="ruby-operator">::</span><span class="ruby-identifier">librdf_free_model</span>(<span class="ruby-identifier">model</span>)
108
108
<span class="ruby-keyword kw">end</span>
112
<div id="method-M000053" class="method-detail"><a name="M000053" id="M000053"></a>
113
<div class="method-heading"><a href="#M000053" class="method-signature"><span class="method-name">new</span><span class="method-args">(store=nil)</span></a></div>
112
<div id="method-M000042" class="method-detail"><a name="M000042" id="M000042"></a>
113
<div class="method-heading"><a href="#M000042" class="method-signature"><span class="method-name">new</span><span class="method-args">(store=nil)</span></a></div>
114
114
<div class="method-description">
115
115
<p>Constructor - takes an optional argument store, which should be one of the storage classes (all derived from <a href="TripleStore.html">TripleStore</a>)</p>
116
<p><a class="source-toggle" href="#" onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
117
<div class="method-source-code" id="M000053-source">
116
<p><a class="source-toggle" href="#" onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
117
<div class="method-source-code" id="M000042-source">
119
119
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 17</span>
120
120
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">store</span>=<span class="ruby-keyword kw">nil</span>)
131
131
<h3 class="section-bar">Public Instance methods</h3>
132
<div id="method-M000059" class="method-detail"><a name="M000059" id="M000059"></a>
133
<div class="method-heading"><a href="#M000059" class="method-signature"><span class="method-name">add</span><span class="method-args">(subject,predicate,object,context=nil)</span></a></div>
132
<div id="method-M000048" class="method-detail"><a name="M000048" id="M000048"></a>
133
<div class="method-heading"><a href="#M000048" class="method-signature"><span class="method-name">add</span><span class="method-args">(subject,predicate,object,context=nil)</span></a></div>
134
134
<div class="method-description">
135
<p>Add the <a href="Model.html#M000068">triples</a> (s,p,o) to the model with the optional context</p>
136
<p><a class="source-toggle" href="#" onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
137
<div class="method-source-code" id="M000059-source">
135
<p>Add the <a href="Model.html#M000057">triples</a> (s,p,o) to the model with the optional context</p>
136
<p><a class="source-toggle" href="#" onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
137
<div class="method-source-code" id="M000048-source">
139
139
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 71</span>
140
140
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">subject</span>,<span class="ruby-identifier">predicate</span>,<span class="ruby-identifier">object</span>,<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
147
<div id="method-M000058" class="method-detail"><a name="M000058" id="M000058"></a>
148
<div class="method-heading"><a href="#M000058" class="method-signature"><span class="method-name">add_statement</span><span class="method-args">(statement,context=nil)</span></a></div>
147
<div id="method-M000047" class="method-detail"><a name="M000047" id="M000047"></a>
148
<div class="method-heading"><a href="#M000047" class="method-signature"><span class="method-name">add_statement</span><span class="method-args">(statement,context=nil)</span></a></div>
149
149
<div class="method-description">
150
150
<p>Add the <a href="Statement.html">Statement</a> to the <a href="Model.html">Model</a> with optional context <a href="Node.html">Node</a></p>
151
<p><a class="source-toggle" href="#" onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
152
<div class="method-source-code" id="M000058-source">
151
<p><a class="source-toggle" href="#" onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
152
<div class="method-source-code" id="M000047-source">
154
154
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 60</span>
155
155
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_statement</span>(<span class="ruby-identifier">statement</span>,<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
167
<div id="method-M000060" class="method-detail"><a name="M000060" id="M000060"></a>
168
<div class="method-heading"><a href="#M000060" class="method-signature"><span class="method-name">add_statements</span><span class="method-args">(statement_stream,context=nil)</span></a></div>
167
<div id="method-M000049" class="method-detail"><a name="M000049" id="M000049"></a>
168
<div class="method-heading"><a href="#M000049" class="method-signature"><span class="method-name">add_statements</span><span class="method-args">(statement_stream,context=nil)</span></a></div>
169
169
<div class="method-description">
170
170
<p>Add the <a href="Stream.html">Stream</a> of Statements to the <a href="Model.html">Model</a> with optional context <a href="Node.html">Node</a></p>
171
<p><a class="source-toggle" href="#" onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
172
<div class="method-source-code" id="M000060-source">
171
<p><a class="source-toggle" href="#" onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
172
<div class="method-source-code" id="M000049-source">
174
174
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 78</span>
175
175
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_statements</span>(<span class="ruby-identifier">statement_stream</span>,<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
187
<div id="method-M000067" class="method-detail"><a name="M000067" id="M000067"></a>
188
<div class="method-heading"><a href="#M000067" class="method-signature"><span class="method-name">as_stream</span><span class="method-args">(context=nil)</span></a></div>
187
<div id="method-M000056" class="method-detail"><a name="M000056" id="M000056"></a>
188
<div class="method-heading"><a href="#M000056" class="method-signature"><span class="method-name">as_stream</span><span class="method-args">(context=nil)</span></a></div>
189
189
<div class="method-description">
190
<p>list the model contents as a stream of <a href="Model.html#M000069">statements</a></p>
191
<p><a class="source-toggle" href="#" onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
192
<div class="method-source-code" id="M000067-source">
190
<p>list the model contents as a stream of <a href="Model.html#M000058">statements</a></p>
191
<p><a class="source-toggle" href="#" onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
192
<div class="method-source-code" id="M000056-source">
194
194
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 180</span>
195
195
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as_stream</span>(<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
208
<div id="method-M000078" class="method-detail"><a name="M000078" id="M000078"></a>
209
<div class="method-heading"><a href="#M000078" class="method-signature"><span class="method-name">contexts</span><span class="method-args">() {|iterator.current| ...}</span></a></div>
208
<div id="method-M000067" class="method-detail"><a name="M000067" id="M000067"></a>
209
<div class="method-heading"><a href="#M000067" class="method-signature"><span class="method-name">contexts</span><span class="method-args">() {|iterator.current| ...}</span></a></div>
210
210
<div class="method-description">
211
<p>yield the <a href="Model.html#M000078">contexts</a> defined in the model. If the store wasn‘t set up for <a href="Model.html#M000078">contexts</a> raises a <a href="RedlandError.html">RedlandError</a>. If no block_given returns an array of the <a href="Model.html#M000078">contexts</a></p>
212
<p><a class="source-toggle" href="#" onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
213
<div class="method-source-code" id="M000078-source">
211
<p>yield the <a href="Model.html#M000067">contexts</a> defined in the model. If the store wasn‘t set up for <a href="Model.html#M000067">contexts</a> raises a <a href="RedlandError.html">RedlandError</a>. If no block_given returns an array of the <a href="Model.html#M000067">contexts</a></p>
212
<p><a class="source-toggle" href="#" onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
213
<div class="method-source-code" id="M000067-source">
215
215
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 345</span>
216
216
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contexts</span>()
237
<div id="method-M000055" class="method-detail"><a name="M000055" id="M000055"></a>
238
<div class="method-heading"><a href="#M000055" class="method-signature"><span class="method-name">create_resource</span><span class="method-args">(str=nil,context=nil)</span></a></div>
237
<div id="method-M000044" class="method-detail"><a name="M000044" id="M000044"></a>
238
<div class="method-heading"><a href="#M000044" class="method-signature"><span class="method-name">create_resource</span><span class="method-args">(str=nil,context=nil)</span></a></div>
239
239
<div class="method-description">
240
240
<p>create a resource for this model. The str can be a String, or a <a href="Uri.html">Redland::Uri</a></p>
241
<p><a class="source-toggle" href="#" onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
242
<div class="method-source-code" id="M000055-source">
241
<p><a class="source-toggle" href="#" onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
242
<div class="method-source-code" id="M000044-source">
244
244
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 36</span>
245
245
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_resource</span>(<span class="ruby-identifier">str</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
255
<div id="method-M000063" class="method-detail"><a name="M000063" id="M000063"></a>
256
<div class="method-heading"><a href="#M000063" class="method-signature"><span class="method-name">delete</span><span class="method-args">(s,p,o,context=nil)</span></a></div>
255
<div id="method-M000052" class="method-detail"><a name="M000052" id="M000052"></a>
256
<div class="method-heading"><a href="#M000052" class="method-signature"><span class="method-name">delete</span><span class="method-args">(s,p,o,context=nil)</span></a></div>
257
257
<div class="method-description">
258
<p>Remove the statement made of the <a href="Model.html#M000068">triples</a> (s,p,o) with the optional context <a href="Node.html">Node</a></p>
259
<p><a class="source-toggle" href="#" onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
260
<div class="method-source-code" id="M000063-source">
258
<p>Remove the statement made of the <a href="Model.html#M000057">triples</a> (s,p,o) with the optional context <a href="Node.html">Node</a></p>
259
<p><a class="source-toggle" href="#" onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
260
<div class="method-source-code" id="M000052-source">
262
262
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 156</span>
263
263
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">s</span>,<span class="ruby-identifier">p</span>,<span class="ruby-identifier">o</span>,<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
270
<div id="method-M000064" class="method-detail"><a name="M000064" id="M000064"></a>
271
<div class="method-heading"><a href="#M000064" class="method-signature"><span class="method-name">delete_context</span><span class="method-args">(context)</span></a></div>
270
<div id="method-M000053" class="method-detail"><a name="M000053" id="M000053"></a>
271
<div class="method-heading"><a href="#M000053" class="method-signature"><span class="method-name">delete_context</span><span class="method-args">(context)</span></a></div>
272
272
<div class="method-description">
273
273
<p>Remove the Statements from the <a href="Model.html">Model</a> with the given context <a href="Node.html">Node</a></p>
274
<p><a class="source-toggle" href="#" onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
275
<div class="method-source-code" id="M000064-source">
274
<p><a class="source-toggle" href="#" onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
275
<div class="method-source-code" id="M000053-source">
277
277
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 162</span>
278
278
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_context</span>(<span class="ruby-identifier">context</span>)
286
<div id="method-M000062" class="method-detail"><a name="M000062" id="M000062"></a>
287
<div class="method-heading"><a href="#M000062" class="method-signature"><span class="method-name">delete_statement</span><span class="method-args">(statement,context=nil)</span></a></div>
286
<div id="method-M000051" class="method-detail"><a name="M000051" id="M000051"></a>
287
<div class="method-heading"><a href="#M000051" class="method-signature"><span class="method-name">delete_statement</span><span class="method-args">(statement,context=nil)</span></a></div>
288
288
<div class="method-description">
289
289
<p>Remove the <a href="Statement.html">Statement</a> from the <a href="Model.html">Model</a> with the optional context <a href="Node.html">Node</a></p>
290
<p><a class="source-toggle" href="#" onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
291
<div class="method-source-code" id="M000062-source">
290
<p><a class="source-toggle" href="#" onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
291
<div class="method-source-code" id="M000051-source">
293
293
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 145</span>
294
294
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_statement</span>(<span class="ruby-identifier">statement</span>,<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
306
<div id="method-M000080" class="method-detail"><a name="M000080" id="M000080"></a>
307
<div class="method-heading"><a href="#M000080" class="method-signature"><span class="method-name">dump_model</span><span class="method-args">(context=nil)</span></a></div>
306
<div id="method-M000069" class="method-detail"><a name="M000069" id="M000069"></a>
307
<div class="method-heading"><a href="#M000069" class="method-signature"><span class="method-name">dump_model</span><span class="method-args">(context=nil)</span></a></div>
308
308
<div class="method-description">
309
<p>a screen dump of the <a href="Model.html#M000068">triples</a>, if context is included a screen dump of the <a href="Model.html#M000068">triples</a> for the given context</p>
310
<p><a class="source-toggle" href="#" onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
311
<div class="method-source-code" id="M000080-source">
309
<p>a screen dump of the <a href="Model.html#M000057">triples</a>, if context is included a screen dump of the <a href="Model.html#M000057">triples</a> for the given context</p>
310
<p><a class="source-toggle" href="#" onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
311
<div class="method-source-code" id="M000069-source">
313
313
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 373</span>
314
314
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dump_model</span>(<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
320
<div id="method-M000071" class="method-detail"><a name="M000071" id="M000071"></a>
321
<div class="method-heading"><a href="#M000071" class="method-signature"><span class="method-name">find</span><span class="method-args">(s=nil,p=nil,o=nil,context=nil) {|my_statement.subject,my_statement.predicate,my_statement.object| ...}</span></a></div>
320
<div id="method-M000060" class="method-detail"><a name="M000060" id="M000060"></a>
321
<div class="method-heading"><a href="#M000060" class="method-signature"><span class="method-name">find</span><span class="method-args">(s=nil,p=nil,o=nil,context=nil) {|my_statement.subject,my_statement.predicate,my_statement.object| ...}</span></a></div>
322
322
<div class="method-description">
323
<p><a href="Model.html#M000071">find</a> the <a href="Model.html#M000069">statements</a> matching the given triple. The <a href="Model.html#M000068">triples</a> can be nil</p>
324
<p>Find all <a href="Model.html#M000068">triples</a> with <a href="../FOAF.html">FOAF</a>[‘firstName’] of Dominic</p>
323
<p><a href="Model.html#M000060">find</a> the <a href="Model.html#M000058">statements</a> matching the given triple. The <a href="Model.html#M000057">triples</a> can be nil</p>
324
<p>Find all <a href="Model.html#M000057">triples</a> with <a href="../FOAF.html">FOAF</a>[‘firstName’] of Dominic</p>
326
326
model.find(nil,FOAF['firstName'],'Dominic Sisneros'){|s,p,o ...}
328
<p><a class="source-toggle" href="#" onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
329
<div class="method-source-code" id="M000071-source">
328
<p><a class="source-toggle" href="#" onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
329
<div class="method-source-code" id="M000060-source">
331
331
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 231</span>
332
332
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">s</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">p</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">o</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
356
<div id="method-M000056" class="method-detail"><a name="M000056" id="M000056"></a>
357
<div class="method-heading"><a href="#M000056" class="method-signature"><span class="method-name">get_resource</span><span class="method-args">(arg)</span></a></div>
356
<div id="method-M000045" class="method-detail"><a name="M000045" id="M000045"></a>
357
<div class="method-heading"><a href="#M000045" class="method-signature"><span class="method-name">get_resource</span><span class="method-args">(arg)</span></a></div>
358
358
<div class="method-description">
359
359
<p>get a resource given by str. If arg is a string it will create a <a href="Resource.html">Resource</a> from it.</p>
360
<p><a class="source-toggle" href="#" onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
361
<div class="method-source-code" id="M000056-source">
360
<p><a class="source-toggle" href="#" onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
361
<div class="method-source-code" id="M000045-source">
363
363
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 46</span>
364
364
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_resource</span>(<span class="ruby-identifier">arg</span>)
371
<div id="method-M000066" class="method-detail"><a name="M000066" id="M000066"></a>
372
<div class="method-heading"><a href="#M000066" class="method-signature"><span class="method-name">include?</span><span class="method-args">(s,p,o)</span></a></div>
371
<div id="method-M000055" class="method-detail"><a name="M000055" id="M000055"></a>
372
<div class="method-heading"><a href="#M000055" class="method-signature"><span class="method-name">include?</span><span class="method-args">(s,p,o)</span></a></div>
373
373
<div class="method-description">
374
374
<p>Returns true if the given Triple is in the model</p>
375
<p><a class="source-toggle" href="#" onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
376
<div class="method-source-code" id="M000066-source">
375
<p><a class="source-toggle" href="#" onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
376
<div class="method-source-code" id="M000055-source">
378
378
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 174</span>
379
379
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">s</span>,<span class="ruby-identifier">p</span>,<span class="ruby-identifier">o</span>)
386
<div id="method-M000065" class="method-detail"><a name="M000065" id="M000065"></a>
387
<div class="method-heading"><a href="#M000065" class="method-signature"><span class="method-name">include_statement?</span><span class="method-args">(statement)</span></a></div>
386
<div id="method-M000054" class="method-detail"><a name="M000054" id="M000054"></a>
387
<div class="method-heading"><a href="#M000054" class="method-signature"><span class="method-name">include_statement?</span><span class="method-args">(statement)</span></a></div>
388
388
<div class="method-description">
389
389
<p>Returns true if the <a href="Statement.html">Statement</a> is in the <a href="Model.html">Model</a></p>
390
<p><a class="source-toggle" href="#" onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
391
<div class="method-source-code" id="M000065-source">
390
<p><a class="source-toggle" href="#" onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
391
<div class="method-source-code" id="M000054-source">
393
393
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 169</span>
394
394
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include_statement?</span>(<span class="ruby-identifier">statement</span>)
400
<div id="method-M000073" class="method-detail"><a name="M000073" id="M000073"></a>
401
<div class="method-heading"><a href="#M000073" class="method-signature"><span class="method-name">object</span><span class="method-args">(source,predicate)</span></a></div>
400
<div id="method-M000062" class="method-detail"><a name="M000062" id="M000062"></a>
401
<div class="method-heading"><a href="#M000062" class="method-signature"><span class="method-name">object</span><span class="method-args">(source,predicate)</span></a></div>
402
402
<div class="method-description">
403
403
<p>Return one <a href="Node.html">Node</a> in the <a href="Model.html">Model</a> matching (source, predicate,?) The source and predicate can be a <a href="Node.html">Node</a> or <a href="Uri.html">Uri</a></p>
404
<p><a class="source-toggle" href="#" onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
405
<div class="method-source-code" id="M000073-source">
404
<p><a class="source-toggle" href="#" onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
405
<div class="method-source-code" id="M000062-source">
407
407
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 259</span>
408
408
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">object</span>(<span class="ruby-identifier">source</span>,<span class="ruby-identifier">predicate</span>)
419
<div id="method-M000081" class="method-detail"><a name="M000081" id="M000081"></a>
420
<div class="method-heading"><a href="#M000081" class="method-signature"><span class="method-name">parse_and_merge</span><span class="method-args">(parser,uri,predlist,context=uri,st=nil)</span></a></div>
419
<div id="method-M000070" class="method-detail"><a name="M000070" id="M000070"></a>
420
<div class="method-heading"><a href="#M000070" class="method-signature"><span class="method-name">parse_and_merge</span><span class="method-args">(parser,uri,predlist,context=uri,st=nil)</span></a></div>
421
421
<div class="method-description">
422
<p>parser the file with the given parser and uri and smushes the file with the model on the <a href="Model.html#M000069">statements</a> with the given predlist</p>
423
<p><a class="source-toggle" href="#" onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
424
<div class="method-source-code" id="M000081-source">
422
<p>parser the file with the given parser and uri and smushes the file with the model on the <a href="Model.html#M000058">statements</a> with the given predlist</p>
423
<p><a class="source-toggle" href="#" onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
424
<div class="method-source-code" id="M000070-source">
426
426
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 380</span>
427
427
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_and_merge</span>(<span class="ruby-identifier">parser</span>,<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">predlist</span>,<span class="ruby-identifier">context</span>=<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">st</span>=<span class="ruby-keyword kw">nil</span>)
445
<div id="method-M000076" class="method-detail"><a name="M000076" id="M000076"></a>
446
<div class="method-heading"><a href="#M000076" class="method-signature"><span class="method-name">predicates</span><span class="method-args">(source,target) {|iterator.current| ...}</span></a></div>
445
<div id="method-M000065" class="method-detail"><a name="M000065" id="M000065"></a>
446
<div class="method-heading"><a href="#M000065" class="method-signature"><span class="method-name">predicates</span><span class="method-args">(source,target) {|iterator.current| ...}</span></a></div>
447
447
<div class="method-description">
448
<p>Return an array of Predicate Nodes in the <a href="Model.html">Model</a> matching (<a href="Model.html#M000075">subject</a>,?,target) The <a href="Model.html#M000075">subject</a> and target can be a <a href="Node.html">Node</a> or <a href="Uri.html">Uri</a> If block_given? yields the Subject <a href="Node.html">Node</a></p>
449
<p><a class="source-toggle" href="#" onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
450
<div class="method-source-code" id="M000076-source">
448
<p>Return an array of Predicate Nodes in the <a href="Model.html">Model</a> matching (<a href="Model.html#M000064">subject</a>,?,target) The <a href="Model.html#M000064">subject</a> and target can be a <a href="Node.html">Node</a> or <a href="Uri.html">Uri</a> If block_given? yields the Subject <a href="Node.html">Node</a></p>
449
<p><a class="source-toggle" href="#" onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
450
<div class="method-source-code" id="M000065-source">
452
452
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 310</span>
453
453
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">predicates</span>(<span class="ruby-identifier">source</span>,<span class="ruby-identifier">target</span>)
475
<div id="method-M000083" class="method-detail"><a name="M000083" id="M000083"></a>
476
<div class="method-heading"><a href="#M000083" class="method-signature"><span class="method-name">query_execute</span><span class="method-args">(query)</span></a></div>
475
<div id="method-M000072" class="method-detail"><a name="M000072" id="M000072"></a>
476
<div class="method-heading"><a href="#M000072" class="method-signature"><span class="method-name">query_execute</span><span class="method-args">(query)</span></a></div>
477
477
<div class="method-description">
478
478
<p>execute a query</p>
479
<p><a class="source-toggle" href="#" onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
480
<div class="method-source-code" id="M000083-source">
479
<p><a class="source-toggle" href="#" onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
480
<div class="method-source-code" id="M000072-source">
482
482
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 409</span>
483
483
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query_execute</span>(<span class="ruby-identifier">query</span>)
494
<div id="method-M000082" class="method-detail"><a name="M000082" id="M000082"></a>
495
<div class="method-heading"><a href="#M000082" class="method-signature"><span class="method-name">rewrite</span><span class="method-args">(change_hash)</span></a></div>
494
<div id="method-M000071" class="method-detail"><a name="M000071" id="M000071"></a>
495
<div class="method-heading"><a href="#M000071" class="method-signature"><span class="method-name">rewrite</span><span class="method-args">(change_hash)</span></a></div>
496
496
<div class="method-description">
497
497
<p>clears the transactions (?? confirm)</p>
498
<p><a class="source-toggle" href="#" onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
499
<div class="method-source-code" id="M000082-source">
498
<p><a class="source-toggle" href="#" onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
499
<div class="method-source-code" id="M000071-source">
501
501
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 397</span>
502
502
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rewrite</span>(<span class="ruby-identifier">change_hash</span>)
508
<div id="method-M000079" class="method-detail"><a name="M000079" id="M000079"></a>
509
<div class="method-heading"><a href="#M000079" class="method-signature"><span class="method-name">save</span><span class="method-args">(filename)</span></a></div>
508
<div id="method-M000068" class="method-detail"><a name="M000068" id="M000068"></a>
509
<div class="method-heading"><a href="#M000068" class="method-signature"><span class="method-name">save</span><span class="method-args">(filename)</span></a></div>
510
510
<div class="method-description">
511
511
<p>saves this model to the specified filename</p>
512
<p><a class="source-toggle" href="#" onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
513
<div class="method-source-code" id="M000079-source">
512
<p><a class="source-toggle" href="#" onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
513
<div class="method-source-code" id="M000068-source">
515
515
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 366</span>
516
516
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>(<span class="ruby-identifier">filename</span>)
523
<div id="method-M000057" class="method-detail"><a name="M000057" id="M000057"></a>
524
<div class="method-heading"><a href="#M000057" class="method-signature"><span class="method-name">size</span><span class="method-args">()</span></a></div>
523
<div id="method-M000046" class="method-detail"><a name="M000046" id="M000046"></a>
524
<div class="method-heading"><a href="#M000046" class="method-signature"><span class="method-name">size</span><span class="method-args">()</span></a></div>
525
525
<div class="method-description">
526
<p>Return the <a href="Model.html#M000057">size</a> of the Storage <a href="Model.html">Model</a>. Raises a redland error if the model has non countable storage</p>
527
<p><a class="source-toggle" href="#" onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
528
<div class="method-source-code" id="M000057-source">
526
<p>Return the <a href="Model.html#M000046">size</a> of the Storage <a href="Model.html">Model</a>. Raises a redland error if the model has non countable storage</p>
527
<p><a class="source-toggle" href="#" onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
528
<div class="method-source-code" id="M000046-source">
530
530
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 53</span>
531
531
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">size</span>()
539
<div id="method-M000061" class="method-detail"><a name="M000061" id="M000061"></a>
540
<div class="method-heading"><a href="#M000061" class="method-signature"><span class="method-name">smush</span><span class="method-args">(pred)</span></a></div>
539
<div id="method-M000050" class="method-detail"><a name="M000050" id="M000050"></a>
540
<div class="method-heading"><a href="#M000050" class="method-signature"><span class="method-name">smush</span><span class="method-args">(pred)</span></a></div>
541
541
<div class="method-description">
542
542
<p>Effectively removes a Predicate from the <a href="Model.html">Model</a> by replacing all occurrences with a blank node (?? confirm)</p>
543
<p><a class="source-toggle" href="#" onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
544
<div class="method-source-code" id="M000061-source">
543
<p><a class="source-toggle" href="#" onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
544
<div class="method-source-code" id="M000050-source">
546
546
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 90</span>
547
547
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">smush</span>(<span class="ruby-identifier">pred</span>)
601
<div id="method-M000072" class="method-detail"><a name="M000072" id="M000072"></a>
602
<div class="method-heading"><a href="#M000072" class="method-signature"><span class="method-name">statement_array_or_yield</span><span class="method-args">(stream)</span></a></div>
601
<div id="method-M000061" class="method-detail"><a name="M000061" id="M000061"></a>
602
<div class="method-heading"><a href="#M000061" class="method-signature"><span class="method-name">statement_array_or_yield</span><span class="method-args">(stream)</span></a></div>
603
603
<div class="method-description">
604
<p><a class="source-toggle" href="#" onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
605
<div class="method-source-code" id="M000072-source">
604
<p><a class="source-toggle" href="#" onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
605
<div class="method-source-code" id="M000061-source">
607
607
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 253</span>
608
608
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">statement_array_or_yield</span>(<span class="ruby-identifier">stream</span>)
614
<div id="method-M000069" class="method-detail"><a name="M000069" id="M000069"></a>
615
<div class="method-heading"><a href="#M000069" class="method-signature"><span class="method-name">statements</span><span class="method-args">(context = nil) {|stream.current| ...}</span></a></div>
614
<div id="method-M000058" class="method-detail"><a name="M000058" id="M000058"></a>
615
<div class="method-heading"><a href="#M000058" class="method-signature"><span class="method-name">statements</span><span class="method-args">(context = nil) {|stream.current| ...}</span></a></div>
616
616
<div class="method-description">
617
<p>Yield the <a href="Model.html#M000069">statements</a> if a block is given.</p>
618
<p><a class="source-toggle" href="#" onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
619
<div class="method-source-code" id="M000069-source">
617
<p>Yield the <a href="Model.html#M000058">statements</a> if a block is given.</p>
618
<p><a class="source-toggle" href="#" onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
619
<div class="method-source-code" id="M000058-source">
621
621
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 208</span>
622
622
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">statements</span>(<span class="ruby-identifier">context</span> = <span class="ruby-keyword kw">nil</span>)
632
<div id="method-M000075" class="method-detail"><a name="M000075" id="M000075"></a>
633
<div class="method-heading"><a href="#M000075" class="method-signature"><span class="method-name">subject</span><span class="method-args">(predicate,target)</span></a></div>
632
<div id="method-M000064" class="method-detail"><a name="M000064" id="M000064"></a>
633
<div class="method-heading"><a href="#M000064" class="method-signature"><span class="method-name">subject</span><span class="method-args">(predicate,target)</span></a></div>
634
634
<div class="method-description">
635
635
<p>Return one <a href="Node.html">Node</a> in the <a href="Model.html">Model</a> matching (?,predicate,target) The source and predicate can be a <a href="Node.html">Node</a> or <a href="Uri.html">Uri</a></p>
636
<p><a class="source-toggle" href="#" onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
637
<div class="method-source-code" id="M000075-source">
636
<p><a class="source-toggle" href="#" onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
637
<div class="method-source-code" id="M000064-source">
639
639
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 294</span>
640
640
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">subject</span>(<span class="ruby-identifier">predicate</span>,<span class="ruby-identifier">target</span>)
655
<div id="method-M000074" class="method-detail"><a name="M000074" id="M000074"></a>
656
<div class="method-heading"><a href="#M000074" class="method-signature"><span class="method-name">subjects</span><span class="method-args">(predicate,target) {|iterator.current| ...}</span></a></div>
655
<div id="method-M000063" class="method-detail"><a name="M000063" id="M000063"></a>
656
<div class="method-heading"><a href="#M000063" class="method-signature"><span class="method-name">subjects</span><span class="method-args">(predicate,target) {|iterator.current| ...}</span></a></div>
657
657
<div class="method-description">
658
658
<p>Return an array of Subject Nodes in the <a href="Model.html">Model</a> matching (?,predicate,target) The predicate and target can be a <a href="Node.html">Node</a> or <a href="Uri.html">Uri</a> If block_given? yields the Subject <a href="Node.html">Node</a></p>
659
<p><a class="source-toggle" href="#" onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
660
<div class="method-source-code" id="M000074-source">
659
<p><a class="source-toggle" href="#" onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
660
<div class="method-source-code" id="M000063-source">
662
662
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 271</span>
663
663
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">subjects</span>(<span class="ruby-identifier">predicate</span>,<span class="ruby-identifier">target</span>)
686
<div id="method-M000084" class="method-detail"><a name="M000084" id="M000084"></a>
687
<div class="method-heading"><a href="#M000084" class="method-signature"><span class="method-name">to_string</span><span class="method-args">(name="", base_uri=nil, mime_type="", type_uri=nil)</span></a></div>
686
<div id="method-M000073" class="method-detail"><a name="M000073" id="M000073"></a>
687
<div class="method-heading"><a href="#M000073" class="method-signature"><span class="method-name">to_string</span><span class="method-args">(name="", base_uri=nil, mime_type="", type_uri=nil)</span></a></div>
688
688
<div class="method-description">
689
689
<p>Serialize the <a href="Model.html">Model</a> to a syntax</p>
690
<p><a class="source-toggle" href="#" onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
691
<div class="method-source-code" id="M000084-source">
690
<p><a class="source-toggle" href="#" onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
691
<div class="method-source-code" id="M000073-source">
693
693
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 419</span>
694
694
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_string</span>(<span class="ruby-identifier">name</span>=<span class="ruby-value str">""</span>, <span class="ruby-identifier">base_uri</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">mime_type</span>=<span class="ruby-value str">""</span>, <span class="ruby-identifier">type_uri</span>=<span class="ruby-keyword kw">nil</span>)
703
<div id="method-M000068" class="method-detail"><a name="M000068" id="M000068"></a>
704
<div class="method-heading"><a href="#M000068" class="method-signature"><span class="method-name">triples</span><span class="method-args">(context=nil) {|stream.current.subject ,stream.current.predicate,stream.current.object| ...}</span></a></div>
703
<div id="method-M000057" class="method-detail"><a name="M000057" id="M000057"></a>
704
<div class="method-heading"><a href="#M000057" class="method-signature"><span class="method-name">triples</span><span class="method-args">(context=nil) {|stream.current.subject ,stream.current.predicate,stream.current.object| ...}</span></a></div>
705
705
<div class="method-description">
706
<p>Yield the <a href="Model.html#M000068">triples</a> <a href="Model.html#M000075">subject</a>, predicate, and <a href="Model.html#M000073">object</a> if a block is given. Otherwise return an array of the <a href="Model.html#M000069">statements</a></p>
707
<p><a class="source-toggle" href="#" onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
708
<div class="method-source-code" id="M000068-source">
706
<p>Yield the <a href="Model.html#M000057">triples</a> <a href="Model.html#M000064">subject</a>, predicate, and <a href="Model.html#M000062">object</a> if a block is given. Otherwise return an array of the <a href="Model.html#M000058">statements</a></p>
707
<p><a class="source-toggle" href="#" onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
708
<div class="method-source-code" id="M000057-source">
710
710
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 194</span>
711
711
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">triples</span>(<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
726
<div id="method-M000070" class="method-detail"><a name="M000070" id="M000070"></a>
727
<div class="method-heading"><a href="#M000070" class="method-signature"><span class="method-name">triples_with_context</span><span class="method-args">(context=nil) {|my_statement.subject,my_statement.predicate,my_statement.object,mystream.context| ...}</span></a></div>
726
<div id="method-M000059" class="method-detail"><a name="M000059" id="M000059"></a>
727
<div class="method-heading"><a href="#M000059" class="method-signature"><span class="method-name">triples_with_context</span><span class="method-args">(context=nil) {|my_statement.subject,my_statement.predicate,my_statement.object,mystream.context| ...}</span></a></div>
728
728
<div class="method-description">
729
<p>Yield the <a href="Model.html#M000068">triples</a> as well as the context</p>
730
<p><a class="source-toggle" href="#" onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
731
<div class="method-source-code" id="M000070-source">
729
<p>Yield the <a href="Model.html#M000057">triples</a> as well as the context</p>
730
<p><a class="source-toggle" href="#" onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
731
<div class="method-source-code" id="M000059-source">
733
733
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 217</span>
734
734
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">triples_with_context</span>(<span class="ruby-identifier">context</span>=<span class="ruby-keyword kw">nil</span>)
746
<div id="method-M000077" class="method-detail"><a name="M000077" id="M000077"></a>
747
<div class="method-heading"><a href="#M000077" class="method-signature"><span class="method-name">yield_node_or_array</span><span class="method-args">(iterator) {|iterator.current| ...}</span></a></div>
746
<div id="method-M000066" class="method-detail"><a name="M000066" id="M000066"></a>
747
<div class="method-heading"><a href="#M000066" class="method-signature"><span class="method-name">yield_node_or_array</span><span class="method-args">(iterator) {|iterator.current| ...}</span></a></div>
748
748
<div class="method-description">
749
<p><a class="source-toggle" href="#" onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
750
<div class="method-source-code" id="M000077-source">
749
<p><a class="source-toggle" href="#" onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
750
<div class="method-source-code" id="M000066-source">
752
752
<span class="ruby-comment cmt"># File rdf/redland/model.rb, line 330</span>
753
753
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">yield_node_or_array</span>(<span class="ruby-identifier">iterator</span>)
774
774
<a href="/docs/ruby.html" target="_parent">Ruby API Home</a>
777
<p>(C) Copyright 2004-2007 <a href="http://purl.org/net/dajobe/" target="_parent">Dave Beckett</a>, (C) Copyright 2004-2005 <a href="http://www.bristol.ac.uk/" target="_parent">University of Bristol</a></p>
777
<p>(C) Copyright 2004-2008 <a href="http://www.dajobe.org/" target="_parent">Dave Beckett</a>, (C) Copyright 2004-2005 <a href="http://www.bristol.ac.uk/" target="_parent">University of Bristol</a></p>
779
779
</div> <!-- end outerBlock -->