Debian Codegraph @

docs/html/redland-statement.html

raw symbols SCIP
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>RDF Triple (librdf_statement)</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Redland RDF Library Manual">
8 <link rel="up" href="reference-manual.html" title="Part II. Reference Manual">
9 <link rel="prev" href="redland-serializer.html" title="Serializers">
10 <link rel="next" href="redland-storage.html" title="Triple stores">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="redland-serializer.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Redland RDF Library Manual</th>
21 <td><a accesskey="n" href="redland-storage.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#redland-statement.synopsis" class="shortcut">Top</a>
25  | 
26 <a href="#redland-statement.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="redland-statement"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="redland-statement.top_of_page"></a>RDF Triple (librdf_statement)</span></h2>
34 <p>RDF Triple (librdf_statement) — RDF Triple.</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="redland-statement.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">typedef <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a>;
41 enum <a class="link" href="redland-statement.html#librdf-statement-part" title="enum librdf_statement_part">librdf_statement_part</a>;
42 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * <a class="link" href="redland-statement.html#librdf-new-statement" title="librdf_new_statement ()">librdf_new_statement</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>);
43 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * <a class="link" href="redland-statement.html#librdf-new-statement-from-statement" title="librdf_new_statement_from_statement ()">librdf_new_statement_from_statement</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
44 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * <a class="link" href="redland-statement.html#librdf-new-statement-from-statement2" title="librdf_new_statement_from_statement2 ()">librdf_new_statement_from_statement2</a>
45 (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
46 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * <a class="link" href="redland-statement.html#librdf-new-statement-from-nodes" title="librdf_new_statement_from_nodes ()">librdf_new_statement_from_nodes</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
47 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *subject</code></em>,
48 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *predicate</code></em>,
49 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *object</code></em>);
50 <span class="returnvalue">void</span> <a class="link" href="redland-statement.html#librdf-statement-init" title="librdf_statement_init ()">librdf_statement_init</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
51 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
52 <span class="returnvalue">void</span> <a class="link" href="redland-statement.html#librdf-statement-clear" title="librdf_statement_clear ()">librdf_statement_clear</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
53 <span class="returnvalue">void</span> <a class="link" href="redland-statement.html#librdf-free-statement" title="librdf_free_statement ()">librdf_free_statement</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
54 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="returnvalue">librdf_node</span></a> * <a class="link" href="redland-statement.html#librdf-statement-get-subject" title="librdf_statement_get_subject ()">librdf_statement_get_subject</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
55 <span class="returnvalue">void</span> <a class="link" href="redland-statement.html#librdf-statement-set-subject" title="librdf_statement_set_subject ()">librdf_statement_set_subject</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
56 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *node</code></em>);
57 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="returnvalue">librdf_node</span></a> * <a class="link" href="redland-statement.html#librdf-statement-get-predicate" title="librdf_statement_get_predicate ()">librdf_statement_get_predicate</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
58 <span class="returnvalue">void</span> <a class="link" href="redland-statement.html#librdf-statement-set-predicate" title="librdf_statement_set_predicate ()">librdf_statement_set_predicate</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
59 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *node</code></em>);
60 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="returnvalue">librdf_node</span></a> * <a class="link" href="redland-statement.html#librdf-statement-get-object" title="librdf_statement_get_object ()">librdf_statement_get_object</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
61 <span class="returnvalue">void</span> <a class="link" href="redland-statement.html#librdf-statement-set-object" title="librdf_statement_set_object ()">librdf_statement_set_object</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
62 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *node</code></em>);
63 <span class="returnvalue">int</span> <a class="link" href="redland-statement.html#librdf-statement-is-complete" title="librdf_statement_is_complete ()">librdf_statement_is_complete</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
64 unsigned <span class="returnvalue">char</span> * <a class="link" href="redland-statement.html#librdf-statement-to-string" title="librdf_statement_to_string ()">librdf_statement_to_string</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);
65 <span class="returnvalue">void</span> <a class="link" href="redland-statement.html#librdf-statement-print" title="librdf_statement_print ()">librdf_statement_print</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
66 <em class="parameter"><code><span class="type">FILE</span> *fh</code></em>);
67 <span class="returnvalue">int</span> <a class="link" href="redland-statement.html#librdf-statement-equals" title="librdf_statement_equals ()">librdf_statement_equals</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement1</code></em>,
68 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement2</code></em>);
69 <span class="returnvalue">int</span> <a class="link" href="redland-statement.html#librdf-statement-match" title="librdf_statement_match ()">librdf_statement_match</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
70 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *partial_statement</code></em>);
71 <span class="returnvalue">size_t</span> <a class="link" href="redland-statement.html#librdf-statement-encode" title="librdf_statement_encode ()">librdf_statement_encode</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
72 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
73 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);
74 <span class="returnvalue">size_t</span> <a class="link" href="redland-statement.html#librdf-statement-encode2" title="librdf_statement_encode2 ()">librdf_statement_encode2</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
75 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
76 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
77 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);
78 <span class="returnvalue">size_t</span> <a class="link" href="redland-statement.html#librdf-statement-encode-parts" title="librdf_statement_encode_parts ()">librdf_statement_encode_parts</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
79 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *context_node</code></em>,
80 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
81 <em class="parameter"><code><span class="type">size_t</span> length</code></em>,
82 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement-part" title="enum librdf_statement_part"><span class="type">librdf_statement_part</span></a> fields</code></em>);
83 <span class="returnvalue">size_t</span> <a class="link" href="redland-statement.html#librdf-statement-encode-parts2" title="librdf_statement_encode_parts2 ()">librdf_statement_encode_parts2</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
84 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
85 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *context_node</code></em>,
86 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
87 <em class="parameter"><code><span class="type">size_t</span> length</code></em>,
88 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement-part" title="enum librdf_statement_part"><span class="type">librdf_statement_part</span></a> fields</code></em>);
89 <span class="returnvalue">size_t</span> <a class="link" href="redland-statement.html#librdf-statement-decode" title="librdf_statement_decode ()">librdf_statement_decode</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
90 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
91 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);
92 <span class="returnvalue">size_t</span> <a class="link" href="redland-statement.html#librdf-statement-decode2" title="librdf_statement_decode2 ()">librdf_statement_decode2</a> (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
93 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
94 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> **context_node</code></em>,
95 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
96 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);
97 <span class="returnvalue">size_t</span> <a class="link" href="redland-statement.html#librdf-statement-decode-parts" title="librdf_statement_decode_parts ()">librdf_statement_decode_parts</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
98 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> **context_node</code></em>,
99 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
100 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);
101 <span class="returnvalue">int</span> <a class="link" href="redland-statement.html#librdf-statement-write" title="librdf_statement_write ()">librdf_statement_write</a> (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
102 <em class="parameter"><code><span class="type">raptor_iostream</span> *iostr</code></em>);
103 </pre>
104 </div>
105 <div class="refsect1">
106 <a name="redland-statement.description"></a><h2>Description</h2>
107 <p>
108 An object representing an RDF Triple of three RDF terms (<a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a>).
109 Triples can be created, accessed, destroyed and en/decoded into a binary
110 form for use in storage.
111 </p>
112 </div>
113 <div class="refsect1">
114 <a name="redland-statement.details"></a><h2>Details</h2>
115 <div class="refsect2">
116 <a name="librdf-statement"></a><h3>librdf_statement</h3>
117 <pre class="programlisting">typedef raptor_statement librdf_statement;
118 </pre>
119 <p>
120 Redland statement class.
121 </p>
122 </div>
123 <hr>
124 <div class="refsect2">
125 <a name="librdf-statement-part"></a><h3>enum librdf_statement_part</h3>
126 <pre class="programlisting">typedef enum {
127 LIBRDF_STATEMENT_SUBJECT = 1 &lt;&lt; 0,
128 LIBRDF_STATEMENT_PREDICATE = 1 &lt;&lt; 1,
129 LIBRDF_STATEMENT_OBJECT = 1 &lt;&lt; 2,
130
131 /* must be a combination of all of the above */
132 LIBRDF_STATEMENT_ALL = (LIBRDF_STATEMENT_SUBJECT|
133 LIBRDF_STATEMENT_PREDICATE|
134 LIBRDF_STATEMENT_OBJECT)
135 } librdf_statement_part;
136 </pre>
137 <p>
138 Flags that are or-ed to indicate statement parts.
139 </p>
140 <p>
141 Used in fields arguments to methods such as the public
142 <a class="link" href="redland-statement.html#librdf-statement-encode-parts" title="librdf_statement_encode_parts ()"><code class="function">librdf_statement_encode_parts()</code></a> <a class="link" href="redland-statement.html#librdf-statement-decode-parts" title="librdf_statement_decode_parts ()"><code class="function">librdf_statement_decode_parts()</code></a>
143 <a class="link" href="redland-stream.html#librdf-new-stream-from-node-iterator" title="librdf_new_stream_from_node_iterator ()"><code class="function">librdf_new_stream_from_node_iterator()</code></a>.
144 </p>
145 <div class="variablelist"><table border="0">
146 <col align="left" valign="top">
147 <tbody>
148 <tr>
149 <td><p><a name="LIBRDF-STATEMENT-SUBJECT:CAPS"></a><span class="term"><code class="literal">LIBRDF_STATEMENT_SUBJECT</code></span></p></td>
150 <td>Subject of a statement.
151 </td>
152 </tr>
153 <tr>
154 <td><p><a name="LIBRDF-STATEMENT-PREDICATE:CAPS"></a><span class="term"><code class="literal">LIBRDF_STATEMENT_PREDICATE</code></span></p></td>
155 <td>Predicate of a statement.
156 </td>
157 </tr>
158 <tr>
159 <td><p><a name="LIBRDF-STATEMENT-OBJECT:CAPS"></a><span class="term"><code class="literal">LIBRDF_STATEMENT_OBJECT</code></span></p></td>
160 <td>Object of a statement.
161 </td>
162 </tr>
163 <tr>
164 <td><p><a name="LIBRDF-STATEMENT-ALL:CAPS"></a><span class="term"><code class="literal">LIBRDF_STATEMENT_ALL</code></span></p></td>
165 <td>All parts of a statement.
166 </td>
167 </tr>
168 </tbody>
169 </table></div>
170 </div>
171 <hr>
172 <div class="refsect2">
173 <a name="librdf-new-statement"></a><h3>librdf_new_statement ()</h3>
174 <pre class="programlisting"><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * librdf_new_statement (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>);</pre>
175 <p>
176 Constructor - create a new empty <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a>.
177 </p>
178 <div class="variablelist"><table border="0">
179 <col align="left" valign="top">
180 <tbody>
181 <tr>
182 <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
183 <td>redland world object</td>
184 </tr>
185 <tr>
186 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
187 <td>a new <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> or NULL on failure</td>
188 </tr>
189 </tbody>
190 </table></div>
191 </div>
192 <hr>
193 <div class="refsect2">
194 <a name="librdf-new-statement-from-statement"></a><h3>librdf_new_statement_from_statement ()</h3>
195 <pre class="programlisting"><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * librdf_new_statement_from_statement (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
196 <p>
197 Copy constructor - create a new librdf_statement from an existing librdf_statement.
198 Creates a deep copy - changes to original statement nodes are not reflected in the copy.
199 </p>
200 <div class="variablelist"><table border="0">
201 <col align="left" valign="top">
202 <tbody>
203 <tr>
204 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
205 <td>
206 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> to copy</td>
207 </tr>
208 <tr>
209 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
210 <td>a new <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> with copy or NULL on failure</td>
211 </tr>
212 </tbody>
213 </table></div>
214 </div>
215 <hr>
216 <div class="refsect2">
217 <a name="librdf-new-statement-from-statement2"></a><h3>librdf_new_statement_from_statement2 ()</h3>
218 <pre class="programlisting"><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * librdf_new_statement_from_statement2
219 (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
220 <p>
221 Copy constructor - create a new librdf_statement from an existing librdf_statement.
222 Creates a shallow copy - changes to original statement nodes are reflected in the copy.
223 </p>
224 <div class="variablelist"><table border="0">
225 <col align="left" valign="top">
226 <tbody>
227 <tr>
228 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
229 <td>
230 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> to copy</td>
231 </tr>
232 <tr>
233 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
234 <td>a new <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> with copy or NULL on failure</td>
235 </tr>
236 </tbody>
237 </table></div>
238 </div>
239 <hr>
240 <div class="refsect2">
241 <a name="librdf-new-statement-from-nodes"></a><h3>librdf_new_statement_from_nodes ()</h3>
242 <pre class="programlisting"><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="returnvalue">librdf_statement</span></a> * librdf_new_statement_from_nodes (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
243 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *subject</code></em>,
244 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *predicate</code></em>,
245 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *object</code></em>);</pre>
246 <p>
247 Constructor - create a new <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> from existing <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> objects.
248 </p>
249 <p>
250 The node objects become owned by the new statement (or freed on error).
251 </p>
252 <div class="variablelist"><table border="0">
253 <col align="left" valign="top">
254 <tbody>
255 <tr>
256 <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
257 <td>redland world object</td>
258 </tr>
259 <tr>
260 <td><p><span class="term"><em class="parameter"><code>subject</code></em> :</span></p></td>
261 <td><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a></td>
262 </tr>
263 <tr>
264 <td><p><span class="term"><em class="parameter"><code>predicate</code></em> :</span></p></td>
265 <td><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a></td>
266 </tr>
267 <tr>
268 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
269 <td><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a></td>
270 </tr>
271 <tr>
272 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
273 <td>a new <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> with copy or NULL on failure</td>
274 </tr>
275 </tbody>
276 </table></div>
277 </div>
278 <hr>
279 <div class="refsect2">
280 <a name="librdf-statement-init"></a><h3>librdf_statement_init ()</h3>
281 <pre class="programlisting"><span class="returnvalue">void</span> librdf_statement_init (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
282 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
283 <p>
284 Initialise a statically declared librdf_statement.
285 </p>
286 <p>
287 This MUST be called on a statically declared librdf_statement
288 to initialise it properly. It is the responsibility of the
289 user of the statically allocated librdf_statement to deal
290 with deallocation of any statement parts (subject, predicate, object).
291 </p>
292 <div class="variablelist"><table border="0">
293 <col align="left" valign="top">
294 <tbody>
295 <tr>
296 <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
297 <td>redland world object</td>
298 </tr>
299 <tr>
300 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
301 <td>
302 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
303 </tr>
304 </tbody>
305 </table></div>
306 </div>
307 <hr>
308 <div class="refsect2">
309 <a name="librdf-statement-clear"></a><h3>librdf_statement_clear ()</h3>
310 <pre class="programlisting"><span class="returnvalue">void</span> librdf_statement_clear (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
311 <p>
312 Empty a librdf_statement of nodes.
313 </p>
314 <div class="variablelist"><table border="0">
315 <col align="left" valign="top">
316 <tbody><tr>
317 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
318 <td>
319 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
320 </tr></tbody>
321 </table></div>
322 </div>
323 <hr>
324 <div class="refsect2">
325 <a name="librdf-free-statement"></a><h3>librdf_free_statement ()</h3>
326 <pre class="programlisting"><span class="returnvalue">void</span> librdf_free_statement (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
327 <p>
328 Destructor - destroy a <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a>.
329 </p>
330 <div class="variablelist"><table border="0">
331 <col align="left" valign="top">
332 <tbody><tr>
333 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
334 <td>
335 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
336 </tr></tbody>
337 </table></div>
338 </div>
339 <hr>
340 <div class="refsect2">
341 <a name="librdf-statement-get-subject"></a><h3>librdf_statement_get_subject ()</h3>
342 <pre class="programlisting"><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="returnvalue">librdf_node</span></a> * librdf_statement_get_subject (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
343 <p>
344 Get the statement subject.
345 </p>
346 <p>
347 This method returns a SHARED pointer to the subject which must
348 be copied by the caller if needed.
349 </p>
350 <div class="variablelist"><table border="0">
351 <col align="left" valign="top">
352 <tbody>
353 <tr>
354 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
355 <td>
356 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
357 </tr>
358 <tr>
359 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
360 <td>a pointer to the <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> of the statement subject -</td>
361 </tr>
362 </tbody>
363 </table></div>
364 </div>
365 <hr>
366 <div class="refsect2">
367 <a name="librdf-statement-set-subject"></a><h3>librdf_statement_set_subject ()</h3>
368 <pre class="programlisting"><span class="returnvalue">void</span> librdf_statement_set_subject (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
369 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *node</code></em>);</pre>
370 <p>
371 Set the statement subject.
372 </p>
373 <p>
374 The subject passed in becomes owned by
375 the statement object and must not be used by the caller after this call.
376 </p>
377 <div class="variablelist"><table border="0">
378 <col align="left" valign="top">
379 <tbody>
380 <tr>
381 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
382 <td>
383 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
384 </tr>
385 <tr>
386 <td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
387 <td>
388 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> of subject</td>
389 </tr>
390 </tbody>
391 </table></div>
392 </div>
393 <hr>
394 <div class="refsect2">
395 <a name="librdf-statement-get-predicate"></a><h3>librdf_statement_get_predicate ()</h3>
396 <pre class="programlisting"><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="returnvalue">librdf_node</span></a> * librdf_statement_get_predicate (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
397 <p>
398 Get the statement predicate.
399 </p>
400 <p>
401 This method returns a SHARED pointer to the predicate which must
402 be copied by the caller if needed.
403 </p>
404 <div class="variablelist"><table border="0">
405 <col align="left" valign="top">
406 <tbody>
407 <tr>
408 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
409 <td>
410 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
411 </tr>
412 <tr>
413 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
414 <td>a pointer to the <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> of the statement predicate -</td>
415 </tr>
416 </tbody>
417 </table></div>
418 </div>
419 <hr>
420 <div class="refsect2">
421 <a name="librdf-statement-set-predicate"></a><h3>librdf_statement_set_predicate ()</h3>
422 <pre class="programlisting"><span class="returnvalue">void</span> librdf_statement_set_predicate (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
423 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *node</code></em>);</pre>
424 <p>
425 Set the statement predicate.
426 </p>
427 <p>
428 The predicate passed in becomes owned by
429 the statement object and must not be used by the caller after this call.
430 </p>
431 <div class="variablelist"><table border="0">
432 <col align="left" valign="top">
433 <tbody>
434 <tr>
435 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
436 <td>
437 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
438 </tr>
439 <tr>
440 <td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
441 <td>
442 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> of predicate</td>
443 </tr>
444 </tbody>
445 </table></div>
446 </div>
447 <hr>
448 <div class="refsect2">
449 <a name="librdf-statement-get-object"></a><h3>librdf_statement_get_object ()</h3>
450 <pre class="programlisting"><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="returnvalue">librdf_node</span></a> * librdf_statement_get_object (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
451 <p>
452 Get the statement object.
453 </p>
454 <p>
455 This method returns a SHARED pointer to the object which must
456 be copied by the caller if needed.
457 </p>
458 <div class="variablelist"><table border="0">
459 <col align="left" valign="top">
460 <tbody>
461 <tr>
462 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
463 <td>
464 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
465 </tr>
466 <tr>
467 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
468 <td>a pointer to the <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> of the statement object -</td>
469 </tr>
470 </tbody>
471 </table></div>
472 </div>
473 <hr>
474 <div class="refsect2">
475 <a name="librdf-statement-set-object"></a><h3>librdf_statement_set_object ()</h3>
476 <pre class="programlisting"><span class="returnvalue">void</span> librdf_statement_set_object (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
477 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *node</code></em>);</pre>
478 <p>
479 Set the statement object.
480 </p>
481 <p>
482 The object passed in becomes owned by
483 the statement object and must not be used by the caller after this call.
484 </p>
485 <div class="variablelist"><table border="0">
486 <col align="left" valign="top">
487 <tbody>
488 <tr>
489 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
490 <td>
491 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
492 </tr>
493 <tr>
494 <td><p><span class="term"><em class="parameter"><code>node</code></em> :</span></p></td>
495 <td>
496 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> of object</td>
497 </tr>
498 </tbody>
499 </table></div>
500 </div>
501 <hr>
502 <div class="refsect2">
503 <a name="librdf-statement-is-complete"></a><h3>librdf_statement_is_complete ()</h3>
504 <pre class="programlisting"><span class="returnvalue">int</span> librdf_statement_is_complete (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
505 <p>
506 Check if statement is a complete and legal RDF triple.
507 </p>
508 <p>
509 Checks that all subject, predicate, object fields are present
510 and they have the allowed node types.
511 </p>
512 <div class="variablelist"><table border="0">
513 <col align="left" valign="top">
514 <tbody>
515 <tr>
516 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
517 <td>
518 <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object</td>
519 </tr>
520 <tr>
521 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
522 <td>non 0 if the statement is complete and legal</td>
523 </tr>
524 </tbody>
525 </table></div>
526 </div>
527 <hr>
528 <div class="refsect2">
529 <a name="librdf-statement-to-string"></a><h3>librdf_statement_to_string ()</h3>
530 <pre class="programlisting">unsigned <span class="returnvalue">char</span> * librdf_statement_to_string (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>);</pre>
531 <p>
532 Format the librdf_statement as a string.
533 </p>
534 <p>
535 Formats the statement as a newly allocate string that must be freed by
536 the caller.
537 </p>
538 <p>
539 <em class="parameter"><code>Deprecated</code></em>: Use <a class="link" href="redland-statement.html#librdf-statement-write" title="librdf_statement_write ()"><code class="function">librdf_statement_write()</code></a> to write to
540 <span class="type">raptor_iostream</span> which can be made to write to a string. Use a
541 <a class="link" href="redland-serializer.html#librdf-serializer" title="librdf_serializer"><span class="type">librdf_serializer</span></a> to write proper syntax formats.
542 </p>
543 <div class="variablelist"><table border="0">
544 <col align="left" valign="top">
545 <tbody>
546 <tr>
547 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
548 <td>the statement</td>
549 </tr>
550 <tr>
551 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
552 <td>the string or NULL on failure.</td>
553 </tr>
554 </tbody>
555 </table></div>
556 </div>
557 <hr>
558 <div class="refsect2">
559 <a name="librdf-statement-print"></a><h3>librdf_statement_print ()</h3>
560 <pre class="programlisting"><span class="returnvalue">void</span> librdf_statement_print (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
561 <em class="parameter"><code><span class="type">FILE</span> *fh</code></em>);</pre>
562 <p>
563 Pretty print the statement to a file descriptor.
564 </p>
565 <p>
566 This method is for debugging and the format of the output should
567 not be relied on.
568 </p>
569 <div class="variablelist"><table border="0">
570 <col align="left" valign="top">
571 <tbody>
572 <tr>
573 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
574 <td>the statement</td>
575 </tr>
576 <tr>
577 <td><p><span class="term"><em class="parameter"><code>fh</code></em> :</span></p></td>
578 <td>file handle</td>
579 </tr>
580 </tbody>
581 </table></div>
582 </div>
583 <hr>
584 <div class="refsect2">
585 <a name="librdf-statement-equals"></a><h3>librdf_statement_equals ()</h3>
586 <pre class="programlisting"><span class="returnvalue">int</span> librdf_statement_equals (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement1</code></em>,
587 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement2</code></em>);</pre>
588 <p>
589 Check if two statements are equal.
590 </p>
591 <div class="variablelist"><table border="0">
592 <col align="left" valign="top">
593 <tbody>
594 <tr>
595 <td><p><span class="term"><em class="parameter"><code>statement1</code></em> :</span></p></td>
596 <td>first <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a>
597 </td>
598 </tr>
599 <tr>
600 <td><p><span class="term"><em class="parameter"><code>statement2</code></em> :</span></p></td>
601 <td>second <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a>
602 </td>
603 </tr>
604 <tr>
605 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
606 <td>non 0 if statements are equal</td>
607 </tr>
608 </tbody>
609 </table></div>
610 </div>
611 <hr>
612 <div class="refsect2">
613 <a name="librdf-statement-match"></a><h3>librdf_statement_match ()</h3>
614 <pre class="programlisting"><span class="returnvalue">int</span> librdf_statement_match (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
615 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *partial_statement</code></em>);</pre>
616 <p>
617 Match a statement against a 'partial' statement.
618 </p>
619 <p>
620 A partial statement is where some parts of the statement -
621 subject, predicate or object can be empty (NULL).
622 Empty parts match against any value, parts with values
623 must match exactly. Node matching is done via <a class="link" href="redland-node.html#librdf-node-equals" title="librdf_node_equals ()"><code class="function">librdf_node_equals()</code></a>
624 </p>
625 <div class="variablelist"><table border="0">
626 <col align="left" valign="top">
627 <tbody>
628 <tr>
629 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
630 <td>statement</td>
631 </tr>
632 <tr>
633 <td><p><span class="term"><em class="parameter"><code>partial_statement</code></em> :</span></p></td>
634 <td>statement with possible empty parts</td>
635 </tr>
636 <tr>
637 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
638 <td>non 0 on match</td>
639 </tr>
640 </tbody>
641 </table></div>
642 </div>
643 <hr>
644 <div class="refsect2">
645 <a name="librdf-statement-encode"></a><h3>librdf_statement_encode ()</h3>
646 <pre class="programlisting"><span class="returnvalue">size_t</span> librdf_statement_encode (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
647 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
648 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);</pre>
649 <p>
650 Serialise a statement into a buffer.
651 </p>
652 <p>
653 Encodes the given statement in the buffer, which must be of sufficient
654 size. If buffer is NULL, no work is done but the size of buffer
655 required is returned.
656 </p>
657 <p>
658 <em class="parameter"><code>Deprecated</code></em>: Use <a class="link" href="redland-statement.html#librdf-statement-encode2" title="librdf_statement_encode2 ()"><code class="function">librdf_statement_encode2()</code></a>
659 </p>
660 <div class="variablelist"><table border="0">
661 <col align="left" valign="top">
662 <tbody>
663 <tr>
664 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
665 <td>the statement to serialise</td>
666 </tr>
667 <tr>
668 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
669 <td>the buffer to use</td>
670 </tr>
671 <tr>
672 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
673 <td>buffer size</td>
674 </tr>
675 <tr>
676 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
677 <td>the number of bytes written or 0 on failure.</td>
678 </tr>
679 </tbody>
680 </table></div>
681 </div>
682 <hr>
683 <div class="refsect2">
684 <a name="librdf-statement-encode2"></a><h3>librdf_statement_encode2 ()</h3>
685 <pre class="programlisting"><span class="returnvalue">size_t</span> librdf_statement_encode2 (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
686 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
687 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
688 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);</pre>
689 <p>
690 Serialise a statement into a buffer.
691 </p>
692 <p>
693 Encodes the given statement in the buffer, which must be of sufficient
694 size. If buffer is NULL, no work is done but the size of buffer
695 required is returned.
696 </p>
697 <div class="variablelist"><table border="0">
698 <col align="left" valign="top">
699 <tbody>
700 <tr>
701 <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
702 <td>redland world</td>
703 </tr>
704 <tr>
705 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
706 <td>the statement to serialise</td>
707 </tr>
708 <tr>
709 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
710 <td>the buffer to use</td>
711 </tr>
712 <tr>
713 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
714 <td>buffer size</td>
715 </tr>
716 <tr>
717 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
718 <td>the number of bytes written or 0 on failure.</td>
719 </tr>
720 </tbody>
721 </table></div>
722 </div>
723 <hr>
724 <div class="refsect2">
725 <a name="librdf-statement-encode-parts"></a><h3>librdf_statement_encode_parts ()</h3>
726 <pre class="programlisting"><span class="returnvalue">size_t</span> librdf_statement_encode_parts (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
727 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *context_node</code></em>,
728 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
729 <em class="parameter"><code><span class="type">size_t</span> length</code></em>,
730 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement-part" title="enum librdf_statement_part"><span class="type">librdf_statement_part</span></a> fields</code></em>);</pre>
731 <p>
732 Serialise parts of a statement into a buffer.
733 </p>
734 <p>
735 Encodes the given statement in the buffer, which must be of sufficient
736 size. If buffer is NULL, no work is done but the size of buffer
737 required is returned.
738 </p>
739 <p>
740 The fields values are or-ed combinations of:
741 <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-SUBJECT:CAPS"><span class="type">LIBRDF_STATEMENT_SUBJECT</span></a> <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-PREDICATE:CAPS"><span class="type">LIBRDF_STATEMENT_PREDICATE</span></a>
742 <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-OBJECT:CAPS"><span class="type">LIBRDF_STATEMENT_OBJECT</span></a>
743 or <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-ALL:CAPS"><span class="type">LIBRDF_STATEMENT_ALL</span></a> for subject,prdicate,object fields
744 </p>
745 <p>
746 If context_node is given, it is encoded also
747 </p>
748 <p>
749 <em class="parameter"><code>Deprecated</code></em>: This will no longer be a public API
750 </p>
751 <div class="variablelist"><table border="0">
752 <col align="left" valign="top">
753 <tbody>
754 <tr>
755 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
756 <td>statement to serialise</td>
757 </tr>
758 <tr>
759 <td><p><span class="term"><em class="parameter"><code>context_node</code></em> :</span></p></td>
760 <td>
761 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> context node (can be NULL)</td>
762 </tr>
763 <tr>
764 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
765 <td>the buffer to use</td>
766 </tr>
767 <tr>
768 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
769 <td>buffer size</td>
770 </tr>
771 <tr>
772 <td><p><span class="term"><em class="parameter"><code>fields</code></em> :</span></p></td>
773 <td>fields to encode</td>
774 </tr>
775 <tr>
776 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
777 <td>the number of bytes written or 0 on failure.</td>
778 </tr>
779 </tbody>
780 </table></div>
781 </div>
782 <hr>
783 <div class="refsect2">
784 <a name="librdf-statement-encode-parts2"></a><h3>librdf_statement_encode_parts2 ()</h3>
785 <pre class="programlisting"><span class="returnvalue">size_t</span> librdf_statement_encode_parts2 (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
786 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
787 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> *context_node</code></em>,
788 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
789 <em class="parameter"><code><span class="type">size_t</span> length</code></em>,
790 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement-part" title="enum librdf_statement_part"><span class="type">librdf_statement_part</span></a> fields</code></em>);</pre>
791 <p>
792 Serialise parts of a statement into a buffer.
793 </p>
794 <p>
795 Encodes the given statement in the buffer, which must be of sufficient
796 size. If buffer is NULL, no work is done but the size of buffer
797 required is returned.
798 </p>
799 <p>
800 The fields values are or-ed combinations of:
801 <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-SUBJECT:CAPS"><span class="type">LIBRDF_STATEMENT_SUBJECT</span></a> <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-PREDICATE:CAPS"><span class="type">LIBRDF_STATEMENT_PREDICATE</span></a>
802 <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-OBJECT:CAPS"><span class="type">LIBRDF_STATEMENT_OBJECT</span></a>
803 or <a class="link" href="redland-statement.html#LIBRDF-STATEMENT-ALL:CAPS"><span class="type">LIBRDF_STATEMENT_ALL</span></a> for subject,prdicate,object fields
804 </p>
805 <p>
806 If context_node is given, it is encoded also
807 </p>
808 <div class="variablelist"><table border="0">
809 <col align="left" valign="top">
810 <tbody>
811 <tr>
812 <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
813 <td>redland world object</td>
814 </tr>
815 <tr>
816 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
817 <td>statement to serialise</td>
818 </tr>
819 <tr>
820 <td><p><span class="term"><em class="parameter"><code>context_node</code></em> :</span></p></td>
821 <td>
822 <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> context node (can be NULL)</td>
823 </tr>
824 <tr>
825 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
826 <td>the buffer to use</td>
827 </tr>
828 <tr>
829 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
830 <td>buffer size</td>
831 </tr>
832 <tr>
833 <td><p><span class="term"><em class="parameter"><code>fields</code></em> :</span></p></td>
834 <td>fields to encode</td>
835 </tr>
836 <tr>
837 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
838 <td>the number of bytes written or 0 on failure.</td>
839 </tr>
840 </tbody>
841 </table></div>
842 </div>
843 <hr>
844 <div class="refsect2">
845 <a name="librdf-statement-decode"></a><h3>librdf_statement_decode ()</h3>
846 <pre class="programlisting"><span class="returnvalue">size_t</span> librdf_statement_decode (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
847 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
848 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);</pre>
849 <p>
850 Decodes a statement from a buffer. (ALWAYS FAILS)
851 </p>
852 <p>
853 Used to decode the serialised statement as created by
854 <a class="link" href="redland-statement.html#librdf-statement-encode" title="librdf_statement_encode ()"><code class="function">librdf_statement_encode()</code></a> from the given buffer.
855 </p>
856 <p>
857 <em class="parameter"><code>Deprecated</code></em>: Replaced by <a class="link" href="redland-statement.html#librdf-statement-decode2" title="librdf_statement_decode2 ()"><code class="function">librdf_statement_decode2()</code></a> which works.
858 </p>
859 <div class="variablelist"><table border="0">
860 <col align="left" valign="top">
861 <tbody>
862 <tr>
863 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
864 <td>the statement to deserialise into</td>
865 </tr>
866 <tr>
867 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
868 <td>the buffer to use</td>
869 </tr>
870 <tr>
871 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
872 <td>buffer size</td>
873 </tr>
874 <tr>
875 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
876 <td>0 signifying failure</td>
877 </tr>
878 </tbody>
879 </table></div>
880 </div>
881 <hr>
882 <div class="refsect2">
883 <a name="librdf-statement-decode2"></a><h3>librdf_statement_decode2 ()</h3>
884 <pre class="programlisting"><span class="returnvalue">size_t</span> librdf_statement_decode2 (<em class="parameter"><code><a class="link" href="redland-world.html#librdf-world" title="librdf_world"><span class="type">librdf_world</span></a> *world</code></em>,
885 <em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
886 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> **context_node</code></em>,
887 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
888 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);</pre>
889 <p>
890 Decodes a statement + context node from a buffer.
891 </p>
892 <p>
893 Decodes the serialised statement (as created by <a class="link" href="redland-statement.html#librdf-statement-encode" title="librdf_statement_encode ()"><code class="function">librdf_statement_encode()</code></a> )
894 from the given buffer. If a context node is found and context_node is
895 not NULL, a pointer to the new <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> is stored in *context_node.
896 </p>
897 <div class="variablelist"><table border="0">
898 <col align="left" valign="top">
899 <tbody>
900 <tr>
901 <td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
902 <td>redland world</td>
903 </tr>
904 <tr>
905 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
906 <td>the statement to deserialise into</td>
907 </tr>
908 <tr>
909 <td><p><span class="term"><em class="parameter"><code>context_node</code></em> :</span></p></td>
910 <td>pointer to <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> context_node to deserialise into</td>
911 </tr>
912 <tr>
913 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
914 <td>the buffer to use</td>
915 </tr>
916 <tr>
917 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
918 <td>buffer size</td>
919 </tr>
920 <tr>
921 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
922 <td>number of bytes used or 0 on failure (bad encoding, allocation failure)</td>
923 </tr>
924 </tbody>
925 </table></div>
926 </div>
927 <hr>
928 <div class="refsect2">
929 <a name="librdf-statement-decode-parts"></a><h3>librdf_statement_decode_parts ()</h3>
930 <pre class="programlisting"><span class="returnvalue">size_t</span> librdf_statement_decode_parts (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
931 <em class="parameter"><code><a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> **context_node</code></em>,
932 <em class="parameter"><code>unsigned <span class="type">char</span> *buffer</code></em>,
933 <em class="parameter"><code><span class="type">size_t</span> length</code></em>);</pre>
934 <p>
935 Decodes a statement + context node from a buffer. (ALWAYS FAILS)
936 </p>
937 <p>
938 Used to decode the serialised statement as created by
939 <a class="link" href="redland-statement.html#librdf-statement-encode" title="librdf_statement_encode ()"><code class="function">librdf_statement_encode()</code></a> from the given buffer.
940 </p>
941 <p>
942 <em class="parameter"><code>Deprecated</code></em>: Replaced by <a class="link" href="redland-statement.html#librdf-statement-decode2" title="librdf_statement_decode2 ()"><code class="function">librdf_statement_decode2()</code></a> which works.
943 </p>
944 <div class="variablelist"><table border="0">
945 <col align="left" valign="top">
946 <tbody>
947 <tr>
948 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
949 <td>the statement to deserialise into</td>
950 </tr>
951 <tr>
952 <td><p><span class="term"><em class="parameter"><code>context_node</code></em> :</span></p></td>
953 <td>pointer to <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> context_node to deserialise into</td>
954 </tr>
955 <tr>
956 <td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
957 <td>the buffer to use</td>
958 </tr>
959 <tr>
960 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
961 <td>buffer size</td>
962 </tr>
963 <tr>
964 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
965 <td>0 signifying failure</td>
966 </tr>
967 </tbody>
968 </table></div>
969 </div>
970 <hr>
971 <div class="refsect2">
972 <a name="librdf-statement-write"></a><h3>librdf_statement_write ()</h3>
973 <pre class="programlisting"><span class="returnvalue">int</span> librdf_statement_write (<em class="parameter"><code><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> *statement</code></em>,
974 <em class="parameter"><code><span class="type">raptor_iostream</span> *iostr</code></em>);</pre>
975 <p>
976 Write the statement to an iostream
977 </p>
978 <p>
979 This method is for debugging and the format of the output should
980 not be relied on.
981 </p>
982 <div class="variablelist"><table border="0">
983 <col align="left" valign="top">
984 <tbody>
985 <tr>
986 <td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
987 <td>the statement</td>
988 </tr>
989 <tr>
990 <td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
991 <td>raptor iostream to write to</td>
992 </tr>
993 <tr>
994 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
995 <td>non-0 on failure</td>
996 </tr>
997 </tbody>
998 </table></div>
999 </div>
1000 </div>
1001 </div>
1002 <div class="footer">
1003 <hr>
1004 Generated by GTK-Doc V1.18</div>
1005 </body>
1006 </html>