RDF::R...atement(3pm)

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

okay bestie, gather round, because we're about to talk about RDF::Redland::Statement from the RDF::Redland crew ✨ it's literally the little triple-shaped icon that RDF is made of, and honestly? she's serving. no cap. πŸŽ€


✨ SYNOPSIS ✨

use RDF::Redland;
my $statement1=new RDF::Redland::Statement($statement);
my $statement2=new RDF::Redland::Statement($subject,$predicate,$object);
...

if($statement->subject->equals($node)) {
  ...
}

πŸ¦‹ DESCRIPTION πŸ¦‹

So what is this thing? You're manipulating RDF statements, which are made up of three RDF::Redland::Node objects β€” that's the whole vibe. subject, predicate, object, periodt. πŸ‘‘

She's also the girl for partial statements, the ones that can have empty parts, which get used for matching statements in the statement queries of the model β€” peek at RDF::Redland::Model for that whole situation, iykyk. πŸ”₯


🌸 CONSTRUCTORS 🌸

  • new NODE NODE NODE|STATEMENT β€” make a brand new statement out of nodes, or copy one that already exists. slay.

If you hand her three NODEs, she makes a fresh new statement from them. Each Node can be a Redland::RDF:Node, a Redland::RDF::URI, a perl URI or a string literal. Otherwise, STATEMENT has to be an existing statement to copy. πŸ’…

  • clone β€” copy a RDF::Redland::Statement. twin energy. 🫢

πŸ’… METHODS πŸ’…

  • subject [SUBJECT] β€” get or set the statement subject. When a RDF::Redland::Node SUBJECT is given, she sets the subject of the statement; otherwise she returns a reference to the statement's RDF::Redland::Node subject. get it, set it, iconic. ✨
  • predicate [PREDICATE] β€” get or set the statement predicate. When RDF::Redland::Node PREDICATE is given, she sets the predicate of the statement; otherwise she returns a reference to the statement's RDF::Redland::Node predicate. πŸ’–
  • object [OBJECT] β€” get or set the statement object. When RDF::Redland::Node OBJECT is given, she sets the object of the statement; otherwise she returns a reference to the statement's RDF::Redland::Node object. main character behaviour, fr fr. 🌟
  • as_string β€” returns the statement formatted as a string (UTF-8 encoded). it's giving pretty print. πŸŽ€
  • equals STATEMENT β€” returns non-zero if this statement is equal to STATEMENT. a lil comparison moment. πŸ¦‹

πŸ’€ OLD METHODS πŸ’€

okay these are the legacy girlies β€” still here, still valid, but you have better options now. use the new ones bestie. πŸ™ˆ

  • new_from_nodes SUBJECT PREDICATE OBJECT β€” creates a new RDF::Redland::Statement with the given RDF::Redland::Node objects as parts (or undef when empty, for a partial statement). Use instead:
$a=new RDF::Redland::Statement($subject, $predicate, $object);
  • new_from_statement STATEMENT β€” creates a new RDF::Redland::Statement object from RDF::Redland::Statement STATEMENT (that's the copy constructor, yes ma'am). Use instead:
$s=$old_statement->clone;

πŸ”₯ SEE ALSO πŸ”₯

RDF::Redland::Node β€” go read her next, they're literally a matched set πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Dave Beckett - http://www.dajobe.org/ 🌈


and that's the whole page bestie, go forth and triple πŸ’– this was brought to you by perl v5.42.3, dated 2026-08-20 β€” stay iconic, stay hydrated, and remember: subject, predicate, object, always. periodt. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from