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

πŸ¦‹ RDF::R...::Query(3pm) β€” the manual, but make it cute πŸ¦‹

okay bestie, gather round, because this one is actually useful and I am obsessed. We're talking RDF::Redland::Query, aka the Redland RDF Syntax Query Class, from the User Contributed Perl Documentation. It's giving "spreadsheet girlboss but for RDF triples". No cap. πŸ’…


✨ NAME ✨

RDF::Redland::Query β€” the Redland RDF Syntax Query Class. That's it, that's the name, and she ate. πŸŽ€


🌸 SYNOPSIS 🌸

here's the whole vibe, copy-paste blessed, character for character:

use RDF::Redland;

...
my $query=new RDF::Redland::Query($query_string); # default query language
my $results=$query->execute($model);
# or my $results=$model->query_execute($query);
while(!$results->finished) {
  for (my $i=0; $i < $results->bindings_count(); $i++) {
    my $name=$results->binding_name($i);
    my $value=$results->binding_value($i);
    # ... do something with the results
  }
  $results->next_result;
}

like. look at her go. use RDF::Redland;, make a query, execute it on a model (or use $model->query_execute($query) if that's your vibe, both slay), then loop while !$results->finished, walk $results->bindings_count() bindings, grab $results->binding_name($i) and $results->binding_value($i), do your little something with the results, and $results->next_result;. periodt. πŸ”₯


πŸ’– DESCRIPTION πŸ’–

Okay so this class? It represents queries of various syntaxes over an RDF::Redland::Model, and it hands you back a sequence of results that β€” currently β€” bind variable names to RDF::Redland::Node values. that's the whole job. she queries, she returns, she serves. πŸ‘‘


🫢 CONSTRUCTORS 🫢

🌈 new QUERY-STRING [BASE-URI [QUERY-LANG-URI [QUERY-LANG]]]

Bestie, manifest a fresh RDF::Redland::Query object for a query string QUERY-STRING, with optional base URI BASE-URI in query language QUERY-LANG or query language URI QUERY-LANG-URI. and yes, both of those can be undef, no judgment. πŸ™ˆ

Now the fine print, and I need you to actually read this part:

  • If QUERY-LANG-URI is omitted, the current directory is used as the base URI. wild, I know, but that's what it says.
  • If QUERY-LANG-NAME is undef, the default query language "rdql" is used. (yes, the manpage says QUERY-LANG-NAME right there in the constructor docs even though the signature spells it QUERY-LANG. we do not fix, we do not merge, we report. πŸ“‹)
  • If BASE-URI is omitted, no base URI is used. clean. minimalist. main character energy.

πŸ’… METHODS πŸ’…

⭐ execute MODEL

Run the query against model MODEL. She returns you an RDF::Redland::QueryResults object 🌟 β€” or undef on failure 😭. So like, please check your return value, bestie. undef is not a vibe.


πŸ¦‹ SEE ALSO πŸ¦‹

  • RDF::Redland::QueryResults β€” your results girlies live here, go say hi πŸ‘‹

πŸ‘‘ AUTHOR πŸ‘‘

Dave Beckett β€” http://www.dajobe.org/ πŸ’œ


heads up angel: this page is from the User Contributed Perl Documentation, and everything above is exactly what she says β€” every option, default, undef case, and return value included. no invented lore. 🫢

perl v5.42.3 Β· 2026-08-20 Β· and that's the whole RDF::R...::Query(3pm) page, bestie β€” go forth and query, ilysm πŸŽ€βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from