NAME
RDF::Redland::Storage - Redland RDF Storage Class
SYNOPSIS
use RDF::Redland;
my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'");
...
DESCRIPTION
Create objects for storing RDF::Redland::Model objects either persistently or in memory.
CONSTRUCTORS
- new STORAGE_NAME NAME OPTIONS_STRING
-
Create a new RDF::Redland::Storage object for the storage factory named STORAGE_NAME with storage named NAME and storage options OPTIONS_STRING which are specific to the storage factory type.
The storage options are formatted in the form key1='value1',key2='value2' and the single quotes are required.
Currently defined storage options:
- new='yes'
-
Create a new storage erasing any existing one (default).
- write='yes'
-
Provide write access to store (default) otherwise is read only.
- dir='DIR'
-
Work in DIR directory when creating files.
- mode='MODE'
-
File creation mode, default is (octal) 0644 Takes decimal (123), hex (0x123) or octal (0123).
- contexts='yes'
-
Enable statement contexts. Each statement can be stored with an optional context Node and the context retrieved after queries.
- hash-type='TYPE' (hashes storage only)
-
Use the TYPE hash-type for hashes storage. Current defined types are 'memory' and 'bdb' but is dependent on the hash factories available.
- index-predicates='yes' (hashes storage only)
-
Enable indexing from predicates to (subject,object) which can in particular be useful for rdf:type relations.
Example:
$storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='bdb',dir='.'");
Creates a new storage of the hashes type (indexed hashes) named test (these will be file names or URIs if the storage is persistent) and with options new='yes',hash-type='bdb',dir='.' so a new storage is created with BerkeleyDB (BDB) key:value hashes i.e. persistent and in the current directory.
- new_from_storage STORAGE
-
Create a new RDF::Redland::Storage object from RDF::Redland::Storage STORAGE (copy constructor). The new storage may have a new name chosen by the storage factory.
SEE ALSO
AUTHOR
Dave Beckett - http://purl.org/net/dajobe/