Class LibRDF_QueryResults

Description

Implements interfaces:

  • Iterator (internal interface)

A wrapper around the librdf_query_results datatype.

This is the generic query results wrapper. There are three possible types of query results--boolean (those returned by SPARQL "ASK"), bindings (returned by "SELECT" in SPARQL and RDQL) and graph (such as those returned by SPARQL "CONSTRUCT" and "DESCRIBE")--each with a specialized class, but each is an iterable object. This creates an odd case for booleans, which are an iterator containing one element. As a special concession for this single-result case, LibRDF_BooleanQueryResults objects also have a method to simply retrieve the boolean value without iteration.

Located in /QueryResults.php (line 59)


	
			
Direct descendents
Class Description
LibRDF_BooleanQueryResults A specialized librdf_query_results wrapper for boolean results.
LibRDF_GraphQueryResults A specialized librdf_query_results wrapper for graph results.
LibRDF_BindingsQueryResults A specialized librdf_query_results wrapper for bindings results.
Variable Summary
resource $query_results
Method Summary
static LibRDF_QueryResults makeQueryResults (resource $query_results)
void __destruct ()
string to_string ([string $uri = NULL], [string $base_uri = NULL])
void __clone ()
string __toString ()
Variables
resource $query_results (line 69)

The wrapped librdf_query_results datatype.

This resource must be set by the concrete query results classes.

  • access: protected
Methods
static method makeQueryResults (line 160)

Make a specialized query results object.

This function is intended for use by LibRDF_Query, allowing the creating of a specific query results object from a librdf_query_results resource.

  • return: The wrapped query results
  • access: public
  • throws: LibRDF_Error If unable to wrap the object
static LibRDF_QueryResults makeQueryResults (resource $query_results)
  • resource $query_results: The librdf_query_results resource to wrap
Destructor __destruct (line 77)

Free the query result resources.

  • access: public
void __destruct ()
to_string (line 126)

Serialize the results to a string.

  • return: The results as a string
  • access: public
  • throws: LibRDF_Error If unable to create a string from the results
string to_string ([string $uri = NULL], [string $base_uri = NULL])
  • string $uri: The uri of the target syntax or NULL
  • string $base_uri: The base URI for the output or NULL
__clone (line 95)

Clone the query.

Clonining a query is not supported, so this function disables the use of the clone keyword by setting the underlying resource to NULL and throwing an exception.

  • access: public
  • throws: LibRDF_Error Always
void __clone ()
__toString (line 112)

Return the query results as a string.

The language of the results depends on the query type.

  • return: The query results as a string
  • access: public
string __toString ()

Documentation generated on Thu, 15 Jun 2006 19:25:13 -0400 by phpDocumentor 1.3.0