| 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>Updates</title> |
| 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> |
| 7 | <link rel="home" href="index.html" title="Rasqal RDF Query Library Manual"> |
| 8 | <link rel="up" href="reference-manual.html" title="Part I. Reference Manual"> |
| 9 | <link rel="prev" href="rasqal-section-variables-table.html" title="Variables Table"> |
| 10 | <link rel="next" href="rasqal-section-utilities.html" title="Utilities"> |
| 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="rasqal-section-variables-table.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">Rasqal RDF Query Library Manual</th> |
| 21 | <td><a accesskey="n" href="rasqal-section-utilities.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="#rasqal-section-updates.synopsis" class="shortcut">Top</a> |
| 25 | | |
| 26 | <a href="#rasqal-section-updates.description" class="shortcut">Description</a> |
| 27 | </td></tr> |
| 28 | </table> |
| 29 | <div class="refentry"> |
| 30 | <a name="rasqal-section-updates"></a><div class="titlepage"></div> |
| 31 | <div class="refnamediv"><table width="100%"><tr> |
| 32 | <td valign="top"> |
| 33 | <h2><span class="refentrytitle"><a name="rasqal-section-updates.top_of_page"></a>Updates</span></h2> |
| 34 | <p>Updates — Graph update operations</p> |
| 35 | </td> |
| 36 | <td valign="top" align="right"></td> |
| 37 | </tr></table></div> |
| 38 | <div class="refsynopsisdiv"> |
| 39 | <a name="rasqal-section-updates.synopsis"></a><h2>Synopsis</h2> |
| 40 | <pre class="synopsis"> <a class="link" href="rasqal-section-updates.html#rasqal-update-operation" title="rasqal_update_operation">rasqal_update_operation</a>; |
| 41 | enum <a class="link" href="rasqal-section-updates.html#rasqal-update-type" title="enum rasqal_update_type">rasqal_update_type</a>; |
| 42 | enum <a class="link" href="rasqal-section-updates.html#rasqal-update-flags" title="enum rasqal_update_flags">rasqal_update_flags</a>; |
| 43 | enum <a class="link" href="rasqal-section-updates.html#rasqal-update-graph-applies" title="enum rasqal_update_graph_applies">rasqal_update_graph_applies</a>; |
| 44 | </pre> |
| 45 | </div> |
| 46 | <div class="refsect1"> |
| 47 | <a name="rasqal-section-updates.description"></a><h2>Description</h2> |
| 48 | <p> |
| 49 | This class provides a object to record a graph update operation |
| 50 | with adding and/or removing triples, using a templated insert/delete |
| 51 | with optional where clause. It is designed to be able to record |
| 52 | the SPARQL 1.1 (Draft) update format, and is a work in progress |
| 53 | as of February 2010. |
| 54 | </p> |
| 55 | </div> |
| 56 | <div class="refsect1"> |
| 57 | <a name="rasqal-section-updates.details"></a><h2>Details</h2> |
| 58 | <div class="refsect2"> |
| 59 | <a name="rasqal-update-operation"></a><h3>rasqal_update_operation</h3> |
| 60 | <pre class="programlisting">typedef struct { |
| 61 | rasqal_update_type type; |
| 62 | |
| 63 | raptor_uri* graph_uri; |
| 64 | |
| 65 | raptor_uri* document_uri; |
| 66 | |
| 67 | raptor_sequence* insert_templates; |
| 68 | |
| 69 | raptor_sequence* delete_templates; |
| 70 | |
| 71 | rasqal_graph_pattern* where; |
| 72 | |
| 73 | int flags; |
| 74 | |
| 75 | rasqal_update_graph_applies applies; |
| 76 | } rasqal_update_operation; |
| 77 | </pre> |
| 78 | <p> |
| 79 | Update operation - changing the dataset |
| 80 | </p> |
| 81 | <p> |
| 82 | For LOAD and CLEAR if <em class="parameter"><code>applies</code></em> is set (not 0) then the operation |
| 83 | applies to just those <code class="function">graph()</code>, otherwise it applies to the <em class="parameter"><code>graph_uri</code></em>. |
| 84 | </p> |
| 85 | <p> |
| 86 | For ADD, MOVE and COPY the source graph is stored in <em class="parameter"><code>graph_uri</code></em> |
| 87 | field and the destination graph in the <em class="parameter"><code>document_uri</code></em> field. The |
| 88 | field names have no meaning in this case since both values are |
| 89 | always present, always graphs and a NULL value signifies the |
| 90 | default graph. |
| 91 | </p> |
| 92 | <div class="variablelist"><table border="0"> |
| 93 | <col align="left" valign="top"> |
| 94 | <tbody> |
| 95 | <tr> |
| 96 | <td><p><span class="term"><a class="link" href="rasqal-section-updates.html#rasqal-update-type" title="enum rasqal_update_type"><span class="type">rasqal_update_type</span></a> <em class="structfield"><code><a name="rasqal-update-operation.type"></a>type</code></em>;</span></p></td> |
| 97 | <td>type of update</td> |
| 98 | </tr> |
| 99 | <tr> |
| 100 | <td><p><span class="term"><span class="type">raptor_uri</span> *<em class="structfield"><code><a name="rasqal-update-operation.graph-uri"></a>graph_uri</code></em>;</span></p></td> |
| 101 | <td>optional graph URI (clear, drop, load, with ... delete, insert); source graph (add, move, copy)</td> |
| 102 | </tr> |
| 103 | <tr> |
| 104 | <td><p><span class="term"><span class="type">raptor_uri</span> *<em class="structfield"><code><a name="rasqal-update-operation.document-uri"></a>document_uri</code></em>;</span></p></td> |
| 105 | <td>optional document URI (load); destination graph (add, move, copy)</td> |
| 106 | </tr> |
| 107 | <tr> |
| 108 | <td><p><span class="term"><span class="type">raptor_sequence</span> *<em class="structfield"><code><a name="rasqal-update-operation.insert-templates"></a>insert_templates</code></em>;</span></p></td> |
| 109 | <td>optional sequence of <a class="link" href="rasqal-section-triple.html#rasqal-triple" title="rasqal_triple"><span class="type">rasqal_triple</span></a> to insert. Data triples if <em class="parameter"><code>flags</code></em> is <a class="link" href="rasqal-section-updates.html#RASQAL-UPDATE-FLAGS-DATA:CAPS"><span class="type">RASQAL_UPDATE_FLAGS_DATA</span></a> set, templates otherwise.</td> |
| 110 | </tr> |
| 111 | <tr> |
| 112 | <td><p><span class="term"><span class="type">raptor_sequence</span> *<em class="structfield"><code><a name="rasqal-update-operation.delete-templates"></a>delete_templates</code></em>;</span></p></td> |
| 113 | <td>optional sequence of <a class="link" href="rasqal-section-triple.html#rasqal-triple" title="rasqal_triple"><span class="type">rasqal_triple</span></a> templates to delete</td> |
| 114 | </tr> |
| 115 | <tr> |
| 116 | <td><p><span class="term"><a class="link" href="rasqal-section-graph-pattern.html#rasqal-graph-pattern" title="rasqal_graph_pattern"><span class="type">rasqal_graph_pattern</span></a> *<em class="structfield"><code><a name="rasqal-update-operation.where"></a>where</code></em>;</span></p></td> |
| 117 | <td>optional where template (insert/delete)</td> |
| 118 | </tr> |
| 119 | <tr> |
| 120 | <td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="rasqal-update-operation.flags"></a>flags</code></em>;</span></p></td> |
| 121 | <td>update flags - bit-or of flags defined in <a class="link" href="rasqal-section-updates.html#rasqal-update-flags" title="enum rasqal_update_flags"><span class="type">rasqal_update_flags</span></a> |
| 122 | </td> |
| 123 | </tr> |
| 124 | <tr> |
| 125 | <td><p><span class="term"><a class="link" href="rasqal-section-updates.html#rasqal-update-graph-applies" title="enum rasqal_update_graph_applies"><span class="type">rasqal_update_graph_applies</span></a> <em class="structfield"><code><a name="rasqal-update-operation.applies"></a>applies</code></em>;</span></p></td> |
| 126 | <td>the graph(s) that the update operation applies to, or <em class="parameter"><code>graph_uri</code></em> if <a class="link" href="rasqal-section-updates.html#RASQAL-UPDATE-GRAPH-ONE:CAPS"><span class="type">RASQAL_UPDATE_GRAPH_ONE</span></a> |
| 127 | </td> |
| 128 | </tr> |
| 129 | </tbody> |
| 130 | </table></div> |
| 131 | </div> |
| 132 | <hr> |
| 133 | <div class="refsect2"> |
| 134 | <a name="rasqal-update-type"></a><h3>enum rasqal_update_type</h3> |
| 135 | <pre class="programlisting">typedef enum { |
| 136 | /* internal */ |
| 137 | RASQAL_UPDATE_TYPE_UNKNOWN = 0, |
| 138 | RASQAL_UPDATE_TYPE_CLEAR = 1, |
| 139 | RASQAL_UPDATE_TYPE_CREATE = 2, |
| 140 | RASQAL_UPDATE_TYPE_DROP = 3, |
| 141 | RASQAL_UPDATE_TYPE_LOAD = 4, |
| 142 | RASQAL_UPDATE_TYPE_UPDATE = 5, |
| 143 | RASQAL_UPDATE_TYPE_ADD = 6, |
| 144 | RASQAL_UPDATE_TYPE_MOVE = 7, |
| 145 | RASQAL_UPDATE_TYPE_COPY = 8, |
| 146 | |
| 147 | /* internal */ |
| 148 | RASQAL_UPDATE_TYPE_LAST = RASQAL_UPDATE_TYPE_COPY |
| 149 | } rasqal_update_type; |
| 150 | </pre> |
| 151 | <p> |
| 152 | Update type being performed. |
| 153 | </p> |
| 154 | <div class="variablelist"><table border="0"> |
| 155 | <col align="left" valign="top"> |
| 156 | <tbody> |
| 157 | <tr> |
| 158 | <td><p><a name="RASQAL-UPDATE-TYPE-UNKNOWN:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_UNKNOWN</code></span></p></td> |
| 159 | <td>Internal |
| 160 | </td> |
| 161 | </tr> |
| 162 | <tr> |
| 163 | <td><p><a name="RASQAL-UPDATE-TYPE-CLEAR:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_CLEAR</code></span></p></td> |
| 164 | <td>Clear graph. |
| 165 | </td> |
| 166 | </tr> |
| 167 | <tr> |
| 168 | <td><p><a name="RASQAL-UPDATE-TYPE-CREATE:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_CREATE</code></span></p></td> |
| 169 | <td>Create graph. |
| 170 | </td> |
| 171 | </tr> |
| 172 | <tr> |
| 173 | <td><p><a name="RASQAL-UPDATE-TYPE-DROP:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_DROP</code></span></p></td> |
| 174 | <td>Drop graph. |
| 175 | </td> |
| 176 | </tr> |
| 177 | <tr> |
| 178 | <td><p><a name="RASQAL-UPDATE-TYPE-LOAD:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_LOAD</code></span></p></td> |
| 179 | <td>Load graph. |
| 180 | </td> |
| 181 | </tr> |
| 182 | <tr> |
| 183 | <td><p><a name="RASQAL-UPDATE-TYPE-UPDATE:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_UPDATE</code></span></p></td> |
| 184 | <td>Insert or Delete graph or triples. |
| 185 | </td> |
| 186 | </tr> |
| 187 | <tr> |
| 188 | <td><p><a name="RASQAL-UPDATE-TYPE-ADD:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_ADD</code></span></p></td> |
| 189 | <td>Add graph to another graph. |
| 190 | </td> |
| 191 | </tr> |
| 192 | <tr> |
| 193 | <td><p><a name="RASQAL-UPDATE-TYPE-MOVE:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_MOVE</code></span></p></td> |
| 194 | <td>Move graph to another grpah. |
| 195 | </td> |
| 196 | </tr> |
| 197 | <tr> |
| 198 | <td><p><a name="RASQAL-UPDATE-TYPE-COPY:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_COPY</code></span></p></td> |
| 199 | <td>Copy graph to another graph. |
| 200 | </td> |
| 201 | </tr> |
| 202 | <tr> |
| 203 | <td><p><a name="RASQAL-UPDATE-TYPE-LAST:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_TYPE_LAST</code></span></p></td> |
| 204 | <td>Internal |
| 205 | </td> |
| 206 | </tr> |
| 207 | </tbody> |
| 208 | </table></div> |
| 209 | </div> |
| 210 | <hr> |
| 211 | <div class="refsect2"> |
| 212 | <a name="rasqal-update-flags"></a><h3>enum rasqal_update_flags</h3> |
| 213 | <pre class="programlisting">typedef enum { |
| 214 | RASQAL_UPDATE_FLAGS_SILENT = 1, |
| 215 | RASQAL_UPDATE_FLAGS_DATA = 2 |
| 216 | } rasqal_update_flags; |
| 217 | </pre> |
| 218 | <p> |
| 219 | Bitflags for graph update operations |
| 220 | </p> |
| 221 | <div class="variablelist"><table border="0"> |
| 222 | <col align="left" valign="top"> |
| 223 | <tbody> |
| 224 | <tr> |
| 225 | <td><p><a name="RASQAL-UPDATE-FLAGS-SILENT:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_FLAGS_SILENT</code></span></p></td> |
| 226 | <td>the update operation should be silent |
| 227 | </td> |
| 228 | </tr> |
| 229 | <tr> |
| 230 | <td><p><a name="RASQAL-UPDATE-FLAGS-DATA:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_FLAGS_DATA</code></span></p></td> |
| 231 | <td>the update operation is triple data not templates |
| 232 | </td> |
| 233 | </tr> |
| 234 | </tbody> |
| 235 | </table></div> |
| 236 | </div> |
| 237 | <hr> |
| 238 | <div class="refsect2"> |
| 239 | <a name="rasqal-update-graph-applies"></a><h3>enum rasqal_update_graph_applies</h3> |
| 240 | <pre class="programlisting">typedef enum { |
| 241 | RASQAL_UPDATE_GRAPH_ONE = 0, |
| 242 | RASQAL_UPDATE_GRAPH_DEFAULT = 1, |
| 243 | RASQAL_UPDATE_GRAPH_NAMED = 2, |
| 244 | RASQAL_UPDATE_GRAPH_ALL = 3 |
| 245 | } rasqal_update_graph_applies; |
| 246 | </pre> |
| 247 | <p> |
| 248 | The graph(s) that the update operation applies to. |
| 249 | </p> |
| 250 | <div class="variablelist"><table border="0"> |
| 251 | <col align="left" valign="top"> |
| 252 | <tbody> |
| 253 | <tr> |
| 254 | <td><p><a name="RASQAL-UPDATE-GRAPH-ONE:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_GRAPH_ONE</code></span></p></td> |
| 255 | <td>the update operation applies to 1 graph |
| 256 | </td> |
| 257 | </tr> |
| 258 | <tr> |
| 259 | <td><p><a name="RASQAL-UPDATE-GRAPH-DEFAULT:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_GRAPH_DEFAULT</code></span></p></td> |
| 260 | <td>the update operation applies to the default graph |
| 261 | </td> |
| 262 | </tr> |
| 263 | <tr> |
| 264 | <td><p><a name="RASQAL-UPDATE-GRAPH-NAMED:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_GRAPH_NAMED</code></span></p></td> |
| 265 | <td>the update operation applies to all named graphs |
| 266 | </td> |
| 267 | </tr> |
| 268 | <tr> |
| 269 | <td><p><a name="RASQAL-UPDATE-GRAPH-ALL:CAPS"></a><span class="term"><code class="literal">RASQAL_UPDATE_GRAPH_ALL</code></span></p></td> |
| 270 | <td>the update operation applies ALL graphs |
| 271 | </td> |
| 272 | </tr> |
| 273 | </tbody> |
| 274 | </table></div> |
| 275 | </div> |
| 276 | </div> |
| 277 | </div> |
| 278 | <div class="footer"> |
| 279 | <hr> |
| 280 | Generated by GTK-Doc V1.18</div> |
| 281 | </body> |
| 282 | </html> |