mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-07 23:32:53 +02:00
101 lines
5.0 KiB
HTML
101 lines
5.0 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>Store 'hashes'</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="redland-storage-modules.html" title="Storage Modules">
|
||
<link rel="prev" href="redland-storage-modules.html" title="Storage Modules">
|
||
<link rel="next" href="redland-storage-module-memory.html" title="Store 'memory'">
|
||
<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-modules.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
||
<td><a accesskey="u" href="redland-storage-modules.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-storage-module-memory.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
||
</tr></table>
|
||
<div class="section" lang="en">
|
||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||
<a name="redland-storage-module-hashes"></a>Store 'hashes'</h2></div></div></div>
|
||
<p>This module is always present (cannot be removed) and provides
|
||
indexed storage using Redland <a class="xref" href="redland-storage.html" title="Triple stores."><span class="refentrytitle"><a name="redland-storage.top_of_page"></a>Triple stores.</span>(3)</a> to
|
||
store various combinations of subject, predicate and object for
|
||
faster access. Context nodes are also stored in a hash when used.
|
||
The hashes may be in-memory (always availabe) or persistent via
|
||
Sleepycat/Berkeley DB (BDB) versions 2-4. It is the most mature and
|
||
primary persistent store and suitable for large models, tested in the
|
||
2-3 million range..</p>
|
||
<p>The main option requiring setting is the
|
||
<code class="literal">hash-type</code> which must be one of the supported
|
||
Redland hashes. Hash type <code class="literal">memory</code> is always
|
||
available and if BDB has been compiled in, <code class="literal">bdb</code> is
|
||
also available. Option <code class="literal">dir</code> can be used to set the
|
||
destination directory for the BDB files when used. Boolean option
|
||
<code class="literal">new</code> can be set to force creation or truncation
|
||
of a persistent hashed store. The storage
|
||
name must be given for hash type <code class="literal">bdb</code> since
|
||
it is used for a filename.
|
||
</p>
|
||
<p>The module provides optional contexts support enabled when
|
||
boolean storage option <code class="literal">contexts</code> is set. This
|
||
can be used with any hash type.</p>
|
||
<p>Examples:</p>
|
||
<pre class="programlisting">
|
||
/* A new BDB hashed persistent store in the current directory */
|
||
storage=librdf_new_storage(world, "hashes", "db1",
|
||
"new='yes',hash-type='bdb',dir='.'");
|
||
|
||
/* Hashed in-memory store */
|
||
storage=librdf_new_storage(world, "hashes", NULL,
|
||
"hash-type='memory'");
|
||
|
||
/* An existing BDB hashed persistent store in dir /somewhere */
|
||
storage=librdf_new_storage(world, "hashes", "dv2",
|
||
"hash-type='bdb',dir='/somewhere'");
|
||
|
||
/* An existing BDB hashed store with contexts */
|
||
storage=librdf_new_storage(world, "hashes", "db3",
|
||
"hash-type='bdb',contexts='yes'");
|
||
</pre>
|
||
<p>In Python:</p>
|
||
<pre class="programlisting">
|
||
from RDF import *
|
||
...
|
||
# Create a new BDB store
|
||
storage = HashStorage("db4", options="new='yes',hash-type='bdb'")
|
||
</pre>
|
||
<p>In Perl:</p>
|
||
<pre class="programlisting">
|
||
use RDF::Redland;
|
||
...
|
||
# Open an existing BDB store
|
||
$storage=new RDF::Redland::Storage("hashes", "db5",
|
||
"hash-type='bdb',dir='.'");
|
||
</pre>
|
||
<p>Summary:</p>
|
||
<div class="itemizedlist"><ul type="disc">
|
||
<li><p>Persistent or in-memory</p></li>
|
||
<li><p>Suitable for larger models</p></li>
|
||
<li><p>Indexed</p></li>
|
||
<li><p>Large disk usage with BDB</p></li>
|
||
<li><p>Optional contexts (with option <code class="literal">contexts</code> set)</p></li>
|
||
</ul></div>
|
||
</div>
|
||
<div class="footer">
|
||
<hr>
|
||
Generated by GTK-Doc V1.10</div>
|
||
</body>
|
||
</html>
|