.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RDF::Redland::Storage 3pm" .TH RDF::Redland::Storage 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RDF::Redland::Storage \- Redland RDF Storage Class .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use RDF::Redland; \& my $storage=new RDF::Redland::Storage("hashes", "test", "new=\*(Aqyes\*(Aq,hash\-type=\*(Aqmemory\*(Aq"); \& ... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Create objects for storing RDF::Redland::Model objects either persistently or in memory. .SH "CONSTRUCTORS" .IX Header "CONSTRUCTORS" .IP "new \s-1STORAGE_NAME\s0 [\s-1NAME\s0 [\s-1OPTIONS_STRING\s0]]" 4 .IX Item "new STORAGE_NAME [NAME [OPTIONS_STRING]]" Create a new RDF::Redland::Storage object for the storage factory named \&\fI\s-1STORAGE_NAME\s0\fR with storage named \fI\s-1NAME\s0\fR and storage options \&\fI\s-1OPTIONS_STRING\s0\fR which are specific to the storage factory type. .Sp 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. .Sp Currently defined storage options: .RS 4 .IP "new='yes'" 4 .IX Item "new='yes'" Create a new storage erasing any existing one (boolean, default). .IP "write='yes'" 4 .IX Item "write='yes'" Provide write access to store (boolean, default) otherwise is read only. .IP "dir='\s-1DIR\s0'" 4 .IX Item "dir='DIR'" Work in \s-1DIR\s0 directory when creating files. .IP "mode='\s-1MODE\s0'" 4 .IX Item "mode='MODE'" File creation mode, default is (octal) 0644 Takes decimal (123), hex (0x123) or octal (0123). .IP "contexts='yes'" 4 .IX Item "contexts='yes'" Enable statement contexts. Each statement can be stored with an optional context Node and the context retrieved after queries. Boolean. .IP "hash\-type='\s-1TYPE\s0' (\fIhashes\fR storage only)" 4 .IX Item "hash-type='TYPE' (hashes storage only)" Use the \s-1TYPE\s0 hash-type for \fIhashes\fR storage. Current defined types are 'memory' and 'bdb' but is dependent on the hash factories available. .IP "index\-predicates='yes' (\fIhashes\fR storage only)" 4 .IX Item "index-predicates='yes' (hashes storage only)" Enable indexing from predicates to (subject,object) which can in particular be useful for rdf:type relations. Boolean. .IP "bulk='no' (\fImysql\fR storage only)" 4 .IX Item "bulk='no' (mysql storage only)" Whether model/storage method add_statements should be optimized, until a model/storage sync operation. Boolean. .IP "merge='no' (\fImysql\fR storage only)" 4 .IX Item "merge='no' (mysql storage only)" Whether to maintain a table with merged models. Boolean. .RE .RS 4 .Sp Example, string form: .Sp .Vb 2 \& $storage=new RDF::Redland::Storage("hashes", "test", \& "new=\*(Aqyes\*(Aq,hash\-type=\*(Aqbdb\*(Aq,dir=\*(Aq.\*(Aq"); .Ve .Sp Example, Perl hash form: .Sp .Vb 2 \& $storage=new RDF::Redland::Storage("hashes", "test", \& {new=>1,hash\-type=>\*(Aqbdb\*(Aq,dir=>\*(Aq.\*(Aq}); .Ve .Sp Creates a new storage of the \fIhashes\fR type (indexed hashes) named \&\fItest\fR (these will be file names or URIs if the storage is persistent) and with options \fInew='yes',hash\-type='bdb',dir='.'\fR so a new storage is created with BerkeleyDB (\s-1BDB\s0) key:value hashes i.e. persistent and in the current directory. .Sp Example, Perl hash form: .Sp .Vb 1 \& $storage=new RDF::Redland::Storage("mysql", "test", {host=>\*(Aqlocalhost\*(Aq,database=>\*(Aqtestdb\*(Aq,user=>\*(Aqtestuser\*(Aq,new=>0,password=>\*(Aq\*(Aq,contexts=>1}); .Ve .Sp Uses an existing storage of the \fImysql\fR type, named \fItest\fR on localhost with database name \fItestdb\fR using a user \fItestuser\fR and no password. Contexts are enabled. .RE .IP "new_from_storage \s-1STORAGE\s0" 4 .IX Item "new_from_storage STORAGE" Create a new RDF::Redland::Storage object from RDF::Redland::Storage \fI\s-1STORAGE\s0\fR (copy constructor). The new storage may have a new name chosen by the storage factory. .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::Redland::Model .SH "AUTHOR" .IX Header "AUTHOR" Dave Beckett \- http://www.dajobe.org/