mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-08 08:02:39 +02:00
537 lines
27 KiB
HTML
537 lines
27 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>Stream of triples (#librdf_statement).</title>
|
||
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
|
||
<link rel="start" href="index.html" title="Redland RDF Library Manual">
|
||
<link rel="up" href="reference-manual.html" title="Part II. Reference Manual">
|
||
<link rel="prev" href="redland-storage-module-uri.html" title="Store 'uri'">
|
||
<link rel="next" href="redland-unicode.html" title="Unicode">
|
||
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
|
||
<link rel="stylesheet" href="style.css" type="text/css">
|
||
<link rel="chapter" href="redland.html" title="Redland Overview">
|
||
<link rel="chapter" href="introduction.html" title="Introduction">
|
||
<link rel="part" href="tutorial.html" title="Part I. Tutorial">
|
||
<link rel="part" href="reference-manual.html" title="Part II. Reference Manual">
|
||
<link rel="chapter" href="objects.html" title="Objects in C">
|
||
<link rel="chapter" href="redland-storage-modules.html" title="Storage Modules">
|
||
<link rel="index" href="indexes.html" title="Index">
|
||
</head>
|
||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
||
<tr valign="middle">
|
||
<td><a accesskey="p" href="redland-storage-module-uri.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
||
<td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
||
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
||
<th width="100%" align="center">Redland RDF Library Manual</th>
|
||
<td><a accesskey="n" href="redland-unicode.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
||
</tr>
|
||
<tr><td colspan="5" class="shortcuts"><nobr><a href="#redland-stream.synopsis" class="shortcut">Top</a>
|
||
|
|
||
<a href="#redland-stream.description" class="shortcut">Description</a></nobr></td></tr>
|
||
</table>
|
||
<div class="refentry" lang="en">
|
||
<a name="redland-stream"></a><div class="titlepage"></div>
|
||
<div class="refnamediv"><table width="100%"><tr>
|
||
<td valign="top">
|
||
<h2><span class="refentrytitle"><a name="redland-stream.top_of_page"></a>Stream of triples (#librdf_statement).</span></h2>
|
||
<p>Stream of triples (#librdf_statement). — Sequence of RDF Triples.</p>
|
||
</td>
|
||
<td valign="top" align="right"></td>
|
||
</tr></table></div>
|
||
<div class="refsynopsisdiv">
|
||
<a name="redland-stream.synopsis"></a><h2>Synopsis</h2>
|
||
<pre class="synopsis">
|
||
typedef <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a>;
|
||
<a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a>* (<a class="link" href="redland-stream.html#librdf-stream-map-handler" title="librdf_stream_map_handler ()">*librdf_stream_map_handler</a>) (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream,
|
||
void *map_context,
|
||
<a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a> *item);
|
||
void (<a class="link" href="redland-stream.html#librdf-stream-map-free-context-handler" title="librdf_stream_map_free_context_handler ()">*librdf_stream_map_free_context_handler</a>)
|
||
(void *map_context);
|
||
<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a>* <a class="link" href="redland-stream.html#librdf-new-stream" title="librdf_new_stream ()">librdf_new_stream</a> (<a class="link" href="redland-world.html#librdf-world" title="librdf_world">librdf_world</a> *world,
|
||
void *context,
|
||
int (is_end_methodvoid*) (),
|
||
int (next_methodvoid*) (),
|
||
void* (get_methodvoid*, int) (),
|
||
void (finished_methodvoid*) ());
|
||
<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a>* <a class="link" href="redland-stream.html#librdf-new-stream-from-node-iterator" title="librdf_new_stream_from_node_iterator ()">librdf_new_stream_from_node_iterator</a>
|
||
(<a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator">librdf_iterator</a> *iterator,
|
||
<a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a> *statement,
|
||
<a class="link" href="redland-statement.html#librdf-statement-part" title="enum librdf_statement_part">librdf_statement_part</a> field);
|
||
<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a>* <a class="link" href="redland-stream.html#librdf-new-empty-stream" title="librdf_new_empty_stream ()">librdf_new_empty_stream</a> (<a class="link" href="redland-world.html#librdf-world" title="librdf_world">librdf_world</a> *world);
|
||
void <a class="link" href="redland-stream.html#librdf-free-stream" title="librdf_free_stream ()">librdf_free_stream</a> (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);
|
||
int <a class="link" href="redland-stream.html#librdf-stream-end" title="librdf_stream_end ()">librdf_stream_end</a> (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);
|
||
int <a class="link" href="redland-stream.html#librdf-stream-next" title="librdf_stream_next ()">librdf_stream_next</a> (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);
|
||
<a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a>* <a class="link" href="redland-stream.html#librdf-stream-get-object" title="librdf_stream_get_object ()">librdf_stream_get_object</a> (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);
|
||
void* <a class="link" href="redland-stream.html#librdf-stream-get-context" title="librdf_stream_get_context ()">librdf_stream_get_context</a> (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);
|
||
int <a class="link" href="redland-stream.html#librdf-stream-add-map" title="librdf_stream_add_map ()">librdf_stream_add_map</a> (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream,
|
||
<a class="link" href="redland-stream.html#librdf-stream-map-handler" title="librdf_stream_map_handler ()">librdf_stream_map_handler</a> map_function,
|
||
<a class="link" href="redland-stream.html#librdf-stream-map-free-context-handler" title="librdf_stream_map_free_context_handler ()">librdf_stream_map_free_context_handler</a> free_context,
|
||
void *map_context);
|
||
void <a class="link" href="redland-stream.html#librdf-stream-print" title="librdf_stream_print ()">librdf_stream_print</a> (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream,
|
||
FILE *fh);
|
||
</pre>
|
||
</div>
|
||
<div class="refsect1" lang="en">
|
||
<a name="redland-stream.description"></a><h2>Description</h2>
|
||
<p>
|
||
Iterate a sequence of RDF triples from some object.
|
||
</p>
|
||
</div>
|
||
<div class="refsect1" lang="en">
|
||
<a name="redland-stream.details"></a><h2>Details</h2>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream"></a><h3>librdf_stream</h3>
|
||
<pre class="programlisting">typedef struct librdf_stream_s librdf_stream;
|
||
</pre>
|
||
<p>
|
||
Redland stream class.</p>
|
||
<p>
|
||
|
||
</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-map-handler"></a><h3>librdf_stream_map_handler ()</h3>
|
||
<pre class="programlisting"><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a>* (*librdf_stream_map_handler) (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream,
|
||
void *map_context,
|
||
<a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a> *item);</pre>
|
||
<p>
|
||
Map function for a <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> map operation.
|
||
</p>
|
||
<p>
|
||
See <a class="link" href="redland-stream.html#librdf-stream-add-map" title="librdf_stream_add_map ()"><code class="function">librdf_stream_add_map()</code></a>.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> Stream that this map is operating over.
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>map_context</code></em> :</span></p></td>
|
||
<td> Map data context pointer.
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
|
||
<td> Pointer to the current item in the iteration.
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> item in keep the iteration or NULL to remove it
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-map-free-context-handler"></a><h3>librdf_stream_map_free_context_handler ()</h3>
|
||
<pre class="programlisting">void (*librdf_stream_map_free_context_handler)
|
||
(void *map_context);</pre>
|
||
<p>
|
||
Free handler function for a <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> map operation.
|
||
</p>
|
||
<p>
|
||
See <a class="link" href="redland-stream.html#librdf-stream-add-map" title="librdf_stream_add_map ()"><code class="function">librdf_stream_add_map()</code></a>.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody><tr>
|
||
<td><p><span class="term"><em class="parameter"><code>map_context</code></em> :</span></p></td>
|
||
<td> Map data context pointer.
|
||
</td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-new-stream"></a><h3>librdf_new_stream ()</h3>
|
||
<pre class="programlisting"><a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a>* librdf_new_stream (<a class="link" href="redland-world.html#librdf-world" title="librdf_world">librdf_world</a> *world,
|
||
void *context,
|
||
int (is_end_methodvoid*) (),
|
||
int (next_methodvoid*) (),
|
||
void* (get_methodvoid*, int) (),
|
||
void (finished_methodvoid*) ());</pre>
|
||
<p>
|
||
Constructor - create a new <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a>.
|
||
</p>
|
||
<p>
|
||
Creates a new stream with an implementation based on the passed in
|
||
functions. The functions next_statement and end_of_stream will be called
|
||
multiple times until either of them signify the end of stream by
|
||
returning NULL or non 0 respectively. The finished function is called
|
||
once only when the stream object is destroyed with <a class="link" href="redland-stream.html#librdf-free-stream" title="librdf_free_stream ()"><code class="function">librdf_free_stream()</code></a>
|
||
</p>
|
||
<p>
|
||
A mapping function can be set for the stream using <a class="link" href="redland-stream.html#librdf-stream-add-map" title="librdf_stream_add_map ()"><code class="function">librdf_stream_add_map()</code></a>
|
||
function which allows the statements generated by the stream to be
|
||
filtered and/or altered as they are generated before passing back
|
||
to the user.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
|
||
<td> redland world object
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
|
||
<td> context to pass to the stream implementing objects
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>is_end_method</code></em> :</span></p></td>
|
||
<td> pointer to function to test for end of stream
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>next_method</code></em> :</span></p></td>
|
||
<td> pointer to function to move to the next statement in stream
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>get_method</code></em> :</span></p></td>
|
||
<td> pointer to function to get the current statement
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>finished_method</code></em> :</span></p></td>
|
||
<td> pointer to function to finish the stream.
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> a new <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object or NULL on failure
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-new-stream-from-node-iterator"></a><h3>librdf_new_stream_from_node_iterator ()</h3>
|
||
<pre class="programlisting"><a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a>* librdf_new_stream_from_node_iterator
|
||
(<a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator">librdf_iterator</a> *iterator,
|
||
<a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a> *statement,
|
||
<a class="link" href="redland-statement.html#librdf-statement-part" title="enum librdf_statement_part">librdf_statement_part</a> field);</pre>
|
||
<p>
|
||
Constructor - create a new <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> from an iterator of nodes.
|
||
</p>
|
||
<p>
|
||
Creates a new <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> using the passed in <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a>
|
||
which generates a series of <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> objects. The resulting
|
||
nodes are then inserted into the given statement and returned.
|
||
The field attribute indicates which statement node is being generated.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>iterator</code></em> :</span></p></td>
|
||
<td> <a class="link" href="redland-iterator.html#librdf-iterator" title="librdf_iterator"><span class="type">librdf_iterator</span></a> of <a class="link" href="redland-node.html#librdf-node" title="librdf_node"><span class="type">librdf_node</span></a> objects
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
|
||
<td> <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> prototype with one NULL node space
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>field</code></em> :</span></p></td>
|
||
<td> node part of statement
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> a new <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object or NULL on failure
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-new-empty-stream"></a><h3>librdf_new_empty_stream ()</h3>
|
||
<pre class="programlisting"><a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a>* librdf_new_empty_stream (<a class="link" href="redland-world.html#librdf-world" title="librdf_world">librdf_world</a> *world);</pre>
|
||
<p>
|
||
Constructor - create a new <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> with no content.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>world</code></em> :</span></p></td>
|
||
<td> redland world object
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> a new <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object or NULL on failure
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-free-stream"></a><h3>librdf_free_stream ()</h3>
|
||
<pre class="programlisting">void librdf_free_stream (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);</pre>
|
||
<p>
|
||
Destructor - destroy an <span class="type">libdf_stream</span> object.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody><tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object
|
||
</td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-end"></a><h3>librdf_stream_end ()</h3>
|
||
<pre class="programlisting">int librdf_stream_end (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);</pre>
|
||
<p>
|
||
Test if the stream has ended.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> non 0 at end of stream.
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-next"></a><h3>librdf_stream_next ()</h3>
|
||
<pre class="programlisting">int librdf_stream_next (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);</pre>
|
||
<p>
|
||
Move to the next librdf_statement in the stream.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> non 0 if the stream has finished
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-get-object"></a><h3>librdf_stream_get_object ()</h3>
|
||
<pre class="programlisting"><a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement">librdf_statement</a>* librdf_stream_get_object (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);</pre>
|
||
<p>
|
||
Get the current librdf_statement in the stream.
|
||
</p>
|
||
<p>
|
||
This method returns a SHARED pointer to the current statement object
|
||
which should be copied by the caller to preserve it if the stream
|
||
is moved on librdf_stream_next or if it should last after the
|
||
stream is closed.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> the current <a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a> object or NULL at end of stream.
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-get-context"></a><h3>librdf_stream_get_context ()</h3>
|
||
<pre class="programlisting">void* librdf_stream_get_context (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream);</pre>
|
||
<p>
|
||
Get the context of the current object on the stream.
|
||
</p>
|
||
<p>
|
||
This method returns a SHARED pointer to the current context node object
|
||
which should be copied by the caller to preserve it if the stream
|
||
is moved on librdf_stream_next or if it should last after the
|
||
stream is closed.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> the <a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream"><span class="type">librdf_stream</span></a> object
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> The context node (can be NULL) or NULL if the stream has finished.
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-add-map"></a><h3>librdf_stream_add_map ()</h3>
|
||
<pre class="programlisting">int librdf_stream_add_map (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream,
|
||
<a class="link" href="redland-stream.html#librdf-stream-map-handler" title="librdf_stream_map_handler ()">librdf_stream_map_handler</a> map_function,
|
||
<a class="link" href="redland-stream.html#librdf-stream-map-free-context-handler" title="librdf_stream_map_free_context_handler ()">librdf_stream_map_free_context_handler</a> free_context,
|
||
void *map_context);</pre>
|
||
<p>
|
||
Add a librdf_stream mapping function.
|
||
</p>
|
||
<p>
|
||
Adds an stream mapping function which operates over the stream to
|
||
select which elements are returned; it will be applied as soon as
|
||
this method is called.
|
||
</p>
|
||
<p>
|
||
Several mapping functions can be added and they are applied in
|
||
the order given.
|
||
</p>
|
||
<p>
|
||
The mapping function should return the statement to return, or NULL
|
||
to remove it from the stream.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> the stream
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>map_function</code></em> :</span></p></td>
|
||
<td> the function to perform the mapping
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>free_context</code></em> :</span></p></td>
|
||
<td> the function to use to free the context (or NULL)
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>map_context</code></em> :</span></p></td>
|
||
<td> the context to pass to the map function
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
|
||
<td> Non 0 on failure
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2" lang="en">
|
||
<a name="librdf-stream-print"></a><h3>librdf_stream_print ()</h3>
|
||
<pre class="programlisting">void librdf_stream_print (<a class="link" href="redland-stream.html#librdf-stream" title="librdf_stream">librdf_stream</a> *stream,
|
||
FILE *fh);</pre>
|
||
<p>
|
||
Print the stream.
|
||
</p>
|
||
<p>
|
||
This prints the remaining statements of the stream to the given
|
||
file handle. Note that after this method is called the stream
|
||
will be empty so that <a class="link" href="redland-stream.html#librdf-stream-end" title="librdf_stream_end ()"><code class="function">librdf_stream_end()</code></a> will always be true
|
||
and <a class="link" href="redland-stream.html#librdf-stream-next" title="librdf_stream_next ()"><code class="function">librdf_stream_next()</code></a> will always return NULL. The only
|
||
useful operation is to dispose of the stream with the
|
||
<a class="link" href="redland-stream.html#librdf-free-stream" title="librdf_free_stream ()"><code class="function">librdf_free_stream()</code></a> destructor.
|
||
</p>
|
||
<p>
|
||
This method is for debugging and the format of the output should
|
||
not be relied on.</p>
|
||
<p>
|
||
|
||
</p>
|
||
<div class="variablelist"><table border="0">
|
||
<col align="left" valign="top">
|
||
<tbody>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
|
||
<td> the stream object
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><p><span class="term"><em class="parameter"><code>fh</code></em> :</span></p></td>
|
||
<td> the FILE stream to print to
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<div class="refsect1" lang="en">
|
||
<a name="redland-stream.see-also"></a><h2>See Also</h2>
|
||
<p>
|
||
Provides a way to operate across a sequence of RDF Triples that are
|
||
generated one-by-one on demand. The generated triples can be from
|
||
some API call in the <a class="link" href="redland-model.html#librdf-model" title="librdf_model"><span class="type">librdf_model</span></a> class, from listing a graph content
|
||
as individual triples, from parsing a syntax or returning an RDF graph
|
||
result from a query. Streams can be passed into methods for the reverse
|
||
operations such as adding to a graph, serializing a graph to a syntax.
|
||
Streams pass individual triples (<a class="link" href="redland-statement.html#librdf-statement" title="librdf_statement"><span class="type">librdf_statement</span></a>) between objects
|
||
and are usually lazily generated and consumed.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="footer">
|
||
<hr>
|
||
Generated by GTK-Doc V1.10</div>
|
||
</body>
|
||
</html>
|