RDF::T...ndings(3pm)

πŸ“¦
version 1.019 Β· 7 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– RDF::T...ndings(3pm) β€” the manual, but make it cute πŸ’–

okay bestie, gather round, because we're talking about RDF::Trine::VariableBindings and it's literally the little hash-with-extra-steps that keeps your RDF variables from spiraling. no cap. 🫢


✨ NAME ✨

RDF::Trine::VariableBindings β€” variable bindings, periodt. πŸ’…


🌸 VERSION 🌸

This document describes RDF::Trine::VariableBindings version 1.019. yes, 1.019, iconic number behavior. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

  use RDF::Trine qw(literal);
  use RDF::Trine::VariableBindings;
  my $vb = RDF::Trine::VariableBindings->new( {} );
  $vb->set( foo => literal("bar") );
  $vb->set( baz => literal("blee") );
  $vb->variables; # qw(foo baz)

  my $x = RDF::Trine::VariableBindings->new( { foo => literal("bar") } );
  $x->set( greeting => literal("hello") );

  my $j = $vb->join( $x ); # { foo => "bar", baz => "blee", greeting => "hello" }

  my @keys = qw(baz greeting);
  my $p = $j->project( @keys ); # { baz => "blee", greeting => "hello" }
  print $p->{greeting}->literal_value; # "hello"

like, look at her go. creating bindings, setting values, joining, projecting, printing. main character energy fr fr. πŸ”₯


πŸ’œ DESCRIPTION πŸ’œ

RDF::Trine::VariableBindings objects provide a mapping from variable names to RDF::Trine::Node objects. The objects may be used as a hash reference, with variable names used as hash keys.

so yes, it's giving "hash but make it RDF." you can literally treat it like a hashref and the variable names are the keys. lowkey obsessed. πŸŽ€


πŸ‘‘ METHODS πŸ‘‘

🌈 new ( \%bindings )

the constructor, the moment, the beginning of the era. πŸ’–

🌈 set ( $variable_name => $node )

sets a variable name to a node. slay. ✨

🌈 join ( $row )

Returns a new VariableBindings object based on the join of this object and $row. If the two variable binding objects cannot be joined, returns undef.

bestie if they can't join, you get undef. not a crash, not a vibe, just undef. 😭

🌈 variables

gives you the variables. no thoughts, just names. πŸ’…

🌈 project ( @keys )

Returns a new binding with values for only the keys listed.

so it's like "we're keeping only these keys, everyone else can go." selective, focused, very demure. 🧚

🌈 as_string

Returns a string representation of the variable bindings.

for when you need to look at it in text form. she contains multitudes. πŸ“

🌈 label ( $label => $value )

Sets the named $label to $value for this variable bindings object. If no $value is given, returns the current label value, or undef if none exists.

so if you pass a value, it sets. if you don't, it reads. and if there's nothing there? undef, obviously. πŸ™ˆ

🌈 copy_labels_from ( $vb )

Copies the labels from $vb, adding them to the labels for this object.

sharing is caring, and labels are apparently shareable. 🫢


πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>.

not me asking you to file an issue, but like, if something's broken, that's the place. the GitHub web interface. at that exact URL. no cap. πŸ”₯

🌟 AUTHOR 🌟

Gregory Todd Williams <gwilliams@cpan.org>

the author. the legend. the one who wrote this. we stan. πŸ‘‘


Copyright (c) 2006-2012 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

so like, free software, same terms as Perl itself, 2006-2012. respect the copyright bestie. πŸ’–


and that's the whole page, bestie. this was RDF::T...ndings(3pm), from perl v5.38.2, dated 2024-01-13. go forth and bind your variables. slay. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from