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

πŸ¦‹ RDF::Redland::QueryResults β€” the Redland RDF Syntax Query Results Class πŸ’…

okay bestie, come sit with me because this one is actually iconic. this is the RDF::Redland::QueryResults page from the User Contributed Perl Documentation, and it's giving "I run SPARQL queries and hand you back the receipts." no cap.


✨ NAME ✨

RDF::Redland::QueryResults β€” the Redland RDF Syntax Query Results Class. that's the whole name, that's the whole vibe. πŸŽ€


🌈 SYNOPSIS 🌈

here's the little movie trailer of how you'd actually use it:

  use RDF::Redland;

  ...
  my $query=new RDF::Redland::Query("query string", undef, undef, "sparql");
  my $results=$model->query_execute($query);
  # or my $results=$query->execute($model);
  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;
  }

and the tea: that $results in the example is an object of class RDF::Redland::QueryResults. periodt. πŸ’–


🌸 DESCRIPTION 🌸

okay so picture this β€” this class represents queries of various syntaxes running over an RDF::Redland::Model, and it hands you back a sequence of results that bind variable names to RDF::Redland::Node values. it's the little matchmaker between your variable names and your actual node values. obsessed. 🫢


🧚 CONSTRUCTOR 🧚

There are no public constructors. nope, not one. not a single one. you do not build these yourself, bestie β€” you get them from your query. move along. πŸ™ˆ

πŸ”₯ METHODS πŸ”₯

count

Return the number of current results from the query. a little headcount for your result set. ✨

finished

Return non-0 if the results have been exhausted. aka "are we done here?" and non-0 means yes bestie we are done. πŸ’€

binding_name INDEX

Get the name of variable binding INDEX in the array of variable names.

binding_names

Get the names all of the variable bindings as an array. all of them. the whole roster. πŸ‘‘

binding_value INDEX

Get the value of the variable binding INDEX in the current query result.

binding_values

Get the values of all of the variable bindings in the current query result. the matching set to binding_names, slay. πŸ’…

binding_value_by_name NAME

Get the value of the variable binding NAME in the current query result. no index math required, you just ask for it by name. main character energy.

bindings

Get the variable names and values of the current query result as a hash. one handy hash, everything in it. πŸ“

bindings_count

Return the number of variable bindings. (that's how many variables, not how many results β€” keep up bestie 😭)

next_result

Move to the next query result. one step at a time, we love a girl who advances. 🌈

as_stream

Return a new RDF::Redland::Stream object representing the query results as an RDF Graph. turn those results into a stream, iconic.

to_string [FORMAT-URI [BASE-URI]]

Serialize to a string syntax in format FORMAT-URI using the optional BASE-URI. The default format when none is given is determined by librdf_query_results_to_string. so if you don't specify, librdf picks for you, and that's just how it is. ⭐

is_bindings

Return non-0 if the query results format is variable bindings.

is_boolean

Return non-0 if the query results format is a boolean.

is_graph

Return non-0 if the query results format is an RDF graph.

get_boolean

Get the boolean query result; non-0 is true. yes/no energy, but make it ints. πŸ’œ


πŸ’– SEE ALSO πŸ’–

  • RDF::Redland::Query β€” go read that one next, bestie, they're a matching set πŸ¦‹

πŸŽ€ AUTHOR πŸŽ€

Dave Beckett β€” http://www.dajobe.org/


and that's the whole page, fr fr. this gorgeousness is perl v5.42.3, dated 2026-08-20, and it lives under the name RDF::R...esults(3pm) in the User Contributed Perl Documentation. go forth and bind some variables. πŸ’…βœ¨

πŸ“¦ where this page comes from