RDF::Redland(3pm)

πŸ’– RDF::Redland β€” Redland RDF Class πŸ’–

okay bestie, so this page is from the User Contributed Perl Documentation crew, and it's the manual for RDF::Redland(3pm) πŸ¦‹ β€” the class that gets the whole Redland RDF party started. It's a small page but it's doing a big job, gatekeeping all the actual classes, so let's get into it ✨


✨ NAME ✨

RDF::Redland β€” the Redland RDF Class, periodt πŸ‘‘


🌸 SYNOPSIS 🌸

this is the vibe, literally, here's what using it looks like:

use RDF::Redland;
my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'");
my $model=new RDF::Redland::Model($storage, "");

...

and then the ... is where you go be the main character, no cap πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

So the tea is: this class initialises the Redland RDF classes. That's its whole thing. It's the opening act, the hype girl, the one that sets everything up so the rest can slay πŸ”₯

And then it's like "okay but for the real detail, go read the main classes" β€” and it lists all of them for you so you can't get lost:

  • 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

collect them all, it's giving full set 🌈


⭐ STATIC METHODS ⭐

these are the static ones β€” no object needed, they just happen πŸ’«

  • set_log_handler SUB β€” sets SUB as the subroutine that gets called on any Redland error, warning or log message. Yeah, all of it. One sub to catch them all 🫢

And listen, the sub has to have the followign signature (yes, 'followign', the typo is canon, we don't fix history πŸ’€):

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);

so yeah, nine arguments, all accounted for, don't lose count πŸ‘€

  • reset_log_handler β€” puts Redland back on the default logging handler, which typically means printing the message to stdout or stderr and, on a fatal error, straight up exiting πŸ’€ dramatic but valid.
  • set_error_handler SUB β€” okay so heads up: set_log_handler is much more flexible than this one and already includes this functionality, so like, know your options bestie πŸ’…

Still, this sets SUB as the subroutine called on a Redland error, with the error message as the single argument. Like so:

RDF::Redland::set_error_handler(sub {
  my $msg=shift;
  # Do something with $msg
});
if you don't set it, the default is to run die $msg 😭 so yeah, it will simply end you.
  • set_warning_handler SUB β€” same deal, same disclaimer: set_log_handler is much more flexible than this and includes this functionality.

This one sets SUB as the subroutine called on a Redland warning, with the warning message as the single argument. Example:

RDF::Redland::set_warning_handler(sub {
  my $msg=shift;
  # Do something with $msg
});
default if you don't set it? warn $msg. gentle chaos, not fatal 🌸

πŸ’œ SEE ALSO πŸ’œ

go read these next, they're the whole rest of the friend group:

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/ 🫑 the icon, the legend, the one who wrote this.


and that's the whole page bestie!! this one came to you from perl v5.42.3, dated 2026-08-20, under RDF::Redland(3pm) ✨ mwah, go initialise some RDF πŸ’–πŸ¦‹

πŸ“¦ where this page comes from