Class LibRDF_BooleanQueryResults

Description

A specialized librdf_query_results wrapper for boolean results.

Boolean results are returned when using an "ASK" query form to test whether triples exist that satisfy certain conditions. For example,

PREFIX dc: <http://purl.org/dc/elements/1.1/><br> ASK WHERE { ?book dc:creator ?author }

in SPARQL will return a boolean result representing whether there is any triple with the http://purl.org/dc/elements/1.1/creator predicate.

In addition to iteration (which will iterate over a single boolean element), a function getValue is provided to simply retrieve the result the query.

Located in /QueryResults.php (line 201)

LibRDF_QueryResults
   |
   --LibRDF_BooleanQueryResults
Method Summary
void __construct (resource $query_results)
boolean current ()
boolean getValue ()
integer key ()
void next ()
void rewind ()
boolean valid ()
Variables

Inherited Variables

Inherited from LibRDF_QueryResults

LibRDF_QueryResults::$query_results
Methods
Constructor __construct (line 220)

Create a new boolean query result object.

  • access: public
  • throws: LibRDF_Error If unable to wrap the query results
void __construct (resource $query_results)
  • resource $query_results: The query results to wrap
current (line 262)

Return the current (and only) boolean value.

  • return: The current value
  • access: public
boolean current ()
getValue (line 236)

Return the boolean value of the result.

  • return: The value of the query
  • access: public
boolean getValue ()
key (line 278)

Return the iterator key (always 0).

  • return: The current key
  • access: public
integer key ()
next (line 292)

Advance the iterator.

Since boolean results have only one result, this function renders the iterator invalid.

  • access: public
void next ()
rewind (line 251)

Rewind the iterator.

  • access: public
void rewind ()
valid (line 303)

Test whether the iterator is still valid.

  • return: Whether the iterator is valid
  • access: public
boolean valid ()

Inherited Methods

Inherited From LibRDF_QueryResults

LibRDF_QueryResults::makeQueryResults()
LibRDF_QueryResults::to_string()
LibRDF_QueryResults::__clone()
LibRDF_QueryResults::__destruct()
LibRDF_QueryResults::__toString()

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