Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rdf::redland::storage(3pm) [debian man page]

RDF::Redland::Storage(3pm)				User Contributed Perl Documentation				RDF::Redland::Storage(3pm)

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 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. Currently defined storage options: new='yes' Create a new storage erasing any existing one (boolean, default). write='yes' Provide write access to store (boolean, 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. Boolean. 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. Boolean. bulk='no' (mysql storage only) Whether model/storage method add_statements should be optimized, until a model/storage sync operation. Boolean. merge='no' (mysql storage only) Whether to maintain a table with merged models. Boolean. Example, string form: $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='bdb',dir='.'"); Example, Perl hash form: $storage=new RDF::Redland::Storage("hashes", "test", {new=>1,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. Example, Perl hash form: $storage=new RDF::Redland::Storage("mysql", "test", {host=>'localhost',database=>'testdb',user=>'testuser',new=>0,password=>'',contexts=>1}); Uses an existing storage of the mysql type, named test on localhost with database name testdb using a user testuser and no password. Contexts are enabled. 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
RDF::Redland::Model AUTHOR
Dave Beckett - http://www.dajobe.org/ perl v5.14.2 2011-02-04 RDF::Redland::Storage(3pm)

Check Out this Related Man Page

RDF::Redland(3pm)					User Contributed Perl Documentation					 RDF::Redland(3pm)

NAME
RDF::Redland - Redland RDF Class SYNOPSIS
use RDF::Redland; my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'"); my $model=new RDF::Redland::Model($storage, ""); ... DESCRIPTION
This class initialises the Redland RDF classes. See the main classes for full detail: RDF::Redland::Node, RDF::Redland::BlankNode, RDF::Redland::URINode, RDF::Redland::LiteralNode, RDF::Redland::XMLLiteralNode, RDF::Redland::URI, RDF::Redland::Statement, RDF::Redland::Model, RDF::Redland::Storage, RDF::Redland::Parser, RDF::Redland::Query, RDF::Redland::QueryResults, RDF::Redland::Iterator, RDF::Redland::Stream and RDF::Redland::RSS. STATIC METHODS
set_log_handler SUB Set SUB as the subroutine to be called on any Redland error, warning or log message. The subroutine must have the followign signature: sub handler ($$$$$$$$$) { my($code, $level, $facility, $message, $line, $column, $byte, $file, $uri)=@_; # int error code # int log level # int facility causing the error (parsing, serializing, ...) # string error message # int line number (<0 if not relevant) # int column number (<0 if not relevant) # int byte number (<0 if not relevant) # string file name or undef # string URI or undef # ...do something with the information ... }; RDF::Redland::set_log_handler(&handler); reset_log_handler Reset redland to use the default logging handler, typically printing the message to stdout or stderr and exiting on a fatal error. set_error_handler SUB The method set_log_handler is much more flexible than this and includes this functionality. Set SUB as the subroutine to be called on a Redland error with the error message as the single argument. For example: RDF::Redland::set_error_handler(sub { my $msg=shift; # Do something with $msg }); The default if this is not set, is to run die $msg set_warning_handler SUB The method set_log_handler is much more flexible than this and includes this functionality. Set SUB as the subroutine to be called on a Redland warning with the warning message as the single argument. For example: RDF::Redland::set_warning_handler(sub { my $msg=shift; # Do something with $msg }); The default if this is not set, is to run warn $msg SEE ALSO
RDF::Redland::Node, RDF::Redland::BlankNode, RDF::Redland::URINode, RDF::Redland::LiteralNode, RDF::Redland::XMLLiteralNode, RDF::Redland::URI, RDF::Redland::Statement, RDF::Redland::Model, RDF::Redland::Storage, RDF::Redland::Parser, RDF::Redland::Query, RDF::Redland::QueryResults, RDF::Redland::Iterator, RDF::Redland::Stream and RDF::Redland::RSS. AUTHOR
Dave Beckett - http://www.dajobe.org/ perl v5.14.2 2012-03-11 RDF::Redland(3pm)
Man Page