Docs For Class EasyRdf_Sparql_Result

## Class EasyRdf_Sparql_Result

Description

Class for returned for SPARQL SELECT and ASK query responses.

- copyright: Copyright (c) 2009-2011 Nicholas J Humfrey
- license: http://www.opensource.org/licenses/bsd-license.php

Located in /EasyRdf/Sparql/Result.php (line 46)

    ArrayIterator
       |
       --EasyRdf_Sparql_Result

Method Summary
EasyRdf_Sparql_Result __construct ( $data, $mimeType, string $uri)
void dump ([bool $html = true])
boolean getBoolean ()
array getFields ()
string getType ()
boolean isFalse ()
boolean isTrue ()
integer numFields ()
integer numRows ()
string __toString ()
Methods
Constructor __construct (line 63)

Create a new SPARQL Result object

You should not normally need to create a SPARQL result object directly - it will be constructed automatically for you by EasyRdf_Sparql_Client.

- access: public

EasyRdf_Sparql_Result __construct ( $data, $mimeType, string $uri)

- string $uri: The address of the SPARQL Endpoint
- $data
- $mimeType

Redefinition of:

ArrayIterator::constructor __construct ( $array )

dump (line 153)

Return a human readable view of the query result.

This method is intended to be a debugging aid and will return a pretty-print view of the query result.

- access: public

void dump ([bool $html = true])

- bool $html: Set to true to format the dump using HTML

getBoolean (line 96)

Return the boolean value of the query result

If the query was of type boolean then this method will return either true or false. If the query was of some other type then this method will return null.

- return: The result of the query.
- access: public

boolean getBoolean ()
getFields (line 141)

Get the field names in a query result of type bindings.

- return: The names of the fields in the result.
- access: public

array getFields ()
getType (line 83)

Get the query result type (boolean/bindings)

ASK queries return a result of type 'boolean'. SELECT query return a result of type 'bindings'.

- return: The query result type.
- access: public

string getType ()
isFalse (line 114)

Return false if the result of the query was false.

- return: True if the query result was false.
- access: public

boolean isFalse ()
isTrue (line 105)

Return true if the result of the query was true.

- return: True if the query result was true.
- access: public

boolean isTrue ()
numFields (line 123)

Return the number of fields in a query result of type bindings.

- return: The number of fields.
- access: public

integer numFields ()
numRows (line 132)

Return the number of rows in a query result of type bindings.

- return: The number of rows.
- access: public

integer numRows ()
__toString (line 354)

Magic method to return value of the result to string

If this is a boolean result then it will return 'true' or 'false'. If it is a bindings type, then it will dump as a text based table.

- return: A string representation of the result.
- access: public

string __toString ()

#### Inherited Methods

Inherited From ArrayIterator (Internal Class)

> constructor __construct ( $array )
> append ( $value )
> asort ( )
> count ( )
> current ( )
> getArrayCopy ( )
> getFlags ( )
> key ( )
> ksort ( )
> natcasesort ( )
> natsort ( )
> next ( )
> offsetExists ( $index )
> offsetGet ( $index )
> offsetSet ( $index, $newval )
> offsetUnset ( $index )
> rewind ( )
> seek ( $position )
> serialize ( )
> setFlags ( $flags )
> uasort ( $cmp_function )
> uksort ( $cmp_function )
> unserialize ( $serialized )
> valid ( )

Class Constants

#### Inherited Constants

Inherited from ArrayIterator (Internal Class)

> ARRAY_AS_PROPS = 2
> STD_PROP_LIST = 1

Documentation generated on Wed, 20 Jul 2011 19:54:05 +0100 by phpDocumentor 1.4.3