RDF::R...Storage(3pm)
π RDF::Redland::Storage β the manual, but make it slay β¨
okay so bestie, buckle up, we're looking at RDF::Redland::Storage(3pm), which lives in the User Contributed Perl Documentation section of the manual (3pm, for my perl girlies πͺ). It's the Redland RDF Storage Class and honestly? iconic. Let's get into it π
β¨ NAME β¨
RDF::Redland::Storage β the Redland RDF Storage Class, periodt.
π¦ SYNOPSIS π¦
use RDF::Redland;
my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'");
...
that's it, that's the vibe check β¨
πΈ DESCRIPTION πΈ
You make these objects to hold your RDF::Redland::Model objects β either persistently (like, they survive, main character energy) or in memory (fleeting, a moment, gone). Your call, babe π«Ά
π CONSTRUCTORS π
new STORAGE_NAME [NAME [OPTIONS_STRING]]
Make a brand new RDF::Redland::Storage object, no cap. You're building it with the storage factory named STORAGE_NAME, the storage itself named NAME, and the storage options OPTIONS_STRING β and those options are specific to the storage factory type, so like, know your factory bestie π
The storage options can come in either of two forms, and both are valid:
- A Perl hash π β follows normal Perl conventions, and the boolean options use normal Perl concepts of truth.
- A string π β formatted like
key1='value1',key2='value2', and the single quotes are required. Do not skip them. I see you trying to skip them.
currently defined storage options π
new='yes'β Create a new storage, erasing any existing one. Boolean, and it's the default. bye bye old data πwrite='yes'β Provide write access to the store. Boolean, default. If you don't, it's read only, so no touching πdir='DIR'β Work inDIRdirectory when creating files.mode='MODE'β File creation mode; the default is (octal)0644. It takes decimal (123), hex (0x123) or octal (0123).contexts='yes'β Enable statement contexts. Every statement can be stored with an optional context Node, and the context gets retrieved after queries. Boolean. very demure, very mindful β¨hash-type='TYPE'β (hashes storage only) Use theTYPEhash-type for hashes storage. Currently defined types are'memory'and'bdb', but it's 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 forrdf:typerelations. Boolean. lowkey a game changer π₯bulk='no'β (mysql storage only) Whether themodel/storage-methodadd_statementsshould be optimized, until amodel/storagesync 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=>'.'});
okay so that one creates a new storage of the hashes type (that's indexed hashes btw) named test β and heads up, these will be file names or URIs if the storage is persistent β with options new='yes',hash-type='bdb',dir='.'. So a new storage gets created with BerkeleyDB (BDB) key:value hashes, i.e. persistent and sitting pretty in the current directory. obsessed π₯°
example, Perl hash form (the sequel) π
$storage=new RDF::Redland::Storage("mysql", "test", {host=>'localhost',database=>'testdb',user=>'testuser',new=>0,password=>'',contexts=>1});
this one uses an existing storage of the mysql type, named test on localhost, with database name testdb, using a user testuser and no password. and Contexts are enabled β¨
new_from_storage STORAGE
Make a new RDF::Redland::Storage object from the RDF::Redland::Storage STORAGE β this is the copy constructor, bestie. π«Ά Just know the new storage may have a new name chosen by the storage factory, so don't come for me if the name changed, that's just how she is.
π SEE ALSO π
RDF::Redland::Model β go read that one next, iykyk π
π AUTHOR π
Dave Beckett β http://www.dajobe.org/ π
and that's the whole page, no crumbs left π§ this beauty is from perl v5.42.3, dated 2026-08-20, and it's the RDF::R...Storage(3pm) page β so go forth, make your storages, and remember: single quotes are required. mwah π slay
π¦ where this page comes from
- ubuntu stonking: librdf-perl 1.0.17.1+dfsg-9build1 Β· LGPL-2.1-or-later OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms