Redland RDF Application Framework - Perl RDF::Redland::Query Class

NAME

RDF::Redland::Query - Redland RDF Syntax Querys Class

SYNOPSIS

  use RDF::Redland;
  ...
  my $query=new RDF::Redland::Query("rdql", undef, $query_string);
  my $results=$model->execute($query);
  while(!$results->finished) {
    for (my $i=0; $i < $results->count(); $i++) {
      my $name=$results->binding_name($i);
      my $value=$results->binding_value($i);
      # ... do something with the results
    }
    $results->next_result;
  }

DESCRIPTION

This class represents queries of various syntaxes over an RDF::Redland::Model returning a sequence of results that (currently) bind variable names to RDF::Redland::Node values.

CONSTRUCTORS

new QUERY-STRING [URI [NAME]]
Create a new RDF::Redland::Query object for a query string QUERY-STRING IN QUERY language NAME with base URI URI (can be undef). If URI is omitted, the current directory is used as the base URI. If NAME is undef, the default query language ``rdql'' is used.

METHODS

execute MODEL
Run the query against model MODEL returning a RDF::Redland::QueryResults object or undef on failure.

SEE ALSO

the RDF::Redland::QueryResults manpage

AUTHOR

Dave Beckett - http://purl.org/net/dajobe/


Copyright 2000-2004 Dave Beckett, Institute for Learning and Research Technology, University of Bristol