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
- ubuntu stonking: librdf-perl 1.0.17.1+dfsg-9build1 Β· LGPL-2.1-or-later OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms