| 1 |
<?xml version="1.0" encoding="iso-8859-1"?> |
| 2 |
<?xml version="1.0"?> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<title>Redland RDF Application Framework - Perl RDF::Redland::Storage Class</title> |
| 6 |
</head> |
| 7 |
<body> |
| 8 |
|
| 9 |
<h1 style="text-align:center">Redland RDF Application Framework - Perl RDF::Redland::Storage Class</h1> |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
<div name="index"> |
| 14 |
<p><a name="__index__"></a></p> |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
</div> |
| 28 |
|
| 29 |
|
| 30 |
<h2><a name="name">NAME</a></h2> |
| 31 |
<p>RDF::Redland::Storage - Redland RDF Storage Class</p> |
| 32 |
|
| 33 |
<h2><a name="synopsis">SYNOPSIS</a></h2> |
| 34 |
<pre> |
| 35 |
use RDF::Redland; |
| 36 |
my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'"); |
| 37 |
... |
| 38 |
</pre> |
| 39 |
|
| 40 |
<h2><a name="description">DESCRIPTION</a></h2> |
| 41 |
<p>Create objects for storing RDF::Redland::Model objects either persistently or in memory.</p> |
| 42 |
|
| 43 |
<h2><a name="constructors">CONSTRUCTORS</a></h2> |
| 44 |
<dl> |
| 45 |
<dt><strong><a name="new_storage_name_name_options_string" class="item">new STORAGE_NAME [NAME [OPTIONS_STRING]]</a></strong></dt> |
| 46 |
<dd> |
| 47 |
<p>Create a new RDF::Redland::Storage object for the storage factory named <em>STORAGE_NAME</em> with storage named <em>NAME</em> and storage options <em>OPTIONS_STRING</em> which are specific to the storage factory type.</p> |
| 48 |
<p>The storage options may be given either as a Perl hash or as a string. The string form are formatted in the form key1='value1',key2='value2' and the single quotes are required. The Perl hash form follows normal Perl conventions, and the boolean options use normal Perl concepts of truth.</p> |
| 49 |
<p>Currently defined storage options:</p> |
| 50 |
<dl> |
| 51 |
<dt><strong><a name="new_yes" class="item">new='yes'</a></strong></dt> |
| 52 |
<dd> |
| 53 |
<p>Create a new storage erasing any existing one (boolean, default).</p> |
| 54 |
</dd> |
| 55 |
<dt><strong><a name="write_yes" class="item">write='yes'</a></strong></dt> |
| 56 |
<dd> |
| 57 |
<p>Provide write access to store (boolean, default) otherwise is read only.</p> |
| 58 |
</dd> |
| 59 |
<dt><strong><a name="dir_dir" class="item">dir='DIR'</a></strong></dt> |
| 60 |
<dd> |
| 61 |
<p>Work in DIR directory when creating files.</p> |
| 62 |
</dd> |
| 63 |
<dt><strong><a name="mode_mode" class="item">mode='MODE'</a></strong></dt> |
| 64 |
<dd> |
| 65 |
<p>File creation mode, default is (octal) 0644 Takes decimal (123), hex (0x123) or octal (0123).</p> |
| 66 |
</dd> |
| 67 |
<dt><strong><a name="contexts_yes" class="item">contexts='yes'</a></strong></dt> |
| 68 |
<dd> |
| 69 |
<p>Enable statement contexts. Each statement can be stored with an optional context Node and the context retrieved after queries. Boolean.</p> |
| 70 |
</dd> |
| 71 |
<dt><strong><a name="hash_type_type_hashes_storage_only" class="item">hash-type='TYPE' (<em>hashes</em> storage only)</a></strong></dt> |
| 72 |
<dd> |
| 73 |
<p>Use the TYPE hash-type for <em>hashes</em> storage. Current defined types are 'memory' and 'bdb' but is dependent on the hash factories available.</p> |
| 74 |
</dd> |
| 75 |
<dt><strong><a name="index_predicates_yes_hashes_storage_only" class="item">index-predicates='yes' (<em>hashes</em> storage only)</a></strong></dt> |
| 76 |
<dd> |
| 77 |
<p>Enable indexing from predicates to (subject,object) which can in particular be useful for rdf:type relations. Boolean.</p> |
| 78 |
</dd> |
| 79 |
<dt><strong><a name="bulk_no_mysql_storage_only" class="item">bulk='no' (<em>mysql</em> storage only)</a></strong></dt> |
| 80 |
<dd> |
| 81 |
<p>Whether model/storage method add_statements should be optimized, until a model/storage sync operation. Boolean.</p> |
| 82 |
</dd> |
| 83 |
<dt><strong><a name="merge_no_mysql_storage_only" class="item">merge='no' (<em>mysql</em> storage only)</a></strong></dt> |
| 84 |
<dd> |
| 85 |
<p>Whether to maintain a table with merged models. Boolean.</p> |
| 86 |
</dd> |
| 87 |
</dl> |
| 88 |
<p>Example, string form:</p> |
| 89 |
<pre> |
| 90 |
$storage=new RDF::Redland::Storage("hashes", "test", |
| 91 |
"new='yes',hash-type='bdb',dir='.'"); |
| 92 |
</pre> |
| 93 |
<p>Example, Perl hash form:</p> |
| 94 |
<pre> |
| 95 |
$storage=new RDF::Redland::Storage("hashes", "test", |
| 96 |
{new=>1,hash-type=>'bdb',dir=>'.'}); |
| 97 |
</pre> |
| 98 |
<p>Creates a new storage of the <em>hashes</em> type (indexed hashes) named <em>test</em> (these will be file names or URIs if the storage is persistent) and with options <em>new='yes',hash-type='bdb',dir='.'</em> so a new storage is created with BerkeleyDB (BDB) key:value hashes i.e. persistent and in the current directory.</p> |
| 99 |
<p>Example, Perl hash form:</p> |
| 100 |
<pre> |
| 101 |
$storage=new RDF::Redland::Storage("mysql", "test", {host=>'localhost',database=>'testdb',user=>'testuser',new=>0,password=>'',contexts=>1}); |
| 102 |
</pre> |
| 103 |
<p>Uses an existing storage of the <em>mysql</em> type, named <em>test</em> on localhost with database name <em>testdb</em> using a user <em>testuser</em> and no password. Contexts are enabled.</p> |
| 104 |
</dd> |
| 105 |
<dt><strong><a name="new_from_storage" class="item">new_from_storage STORAGE</a></strong></dt> |
| 106 |
<dd> |
| 107 |
<p>Create a new RDF::Redland::Storage object from RDF::Redland::Storage <em>STORAGE</em> (copy constructor). The new storage may have a new name chosen by the storage factory.</p> |
| 108 |
</dd> |
| 109 |
</dl> |
| 110 |
|
| 111 |
<h2><a name="see_also">SEE ALSO</a></h2> |
| 112 |
<p><a href="Model.html">the RDF::Redland::Model manpage</a></p> |
| 113 |
|
| 114 |
<h2><a name="author">AUTHOR</a></h2> |
| 115 |
<p>Dave Beckett - <a href="http://www.dajobe.org/">http://www.dajobe.org/</a></p> |
| 116 |
<hr /> |
| 117 |
|
| 118 |
<p>(C) Copyright 2000-2011 <a href="http://www.dajobe.org/">Dave Beckett</a>, (C) Copyright 2000-2005 <a href="http://www.bristol.ac.uk/">University of Bristol</a></p> |
| 119 |
|
| 120 |
</body> |
| 121 |
</html> |