RDF::T...ndings(3pm)
π 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 getundef. not a crash, not a vibe, justundef. π
π 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 π
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
- debian trixie: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms