Class EasyRdf_Sparql_Result

Description

Class for returned for SPARQL SELECT and ASK query responses.

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

ArrayIterator
   |
   --EasyRdf_Sparql_Result
Class Constant Summary
SPARQL_XML_RESULTS_NS = 'http://www.w3.org/2005/sparql-results#'
Method Summary
EasyRdf_Sparql_Result __construct (string $data, string $mimeType)
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 67)

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 (string $data, string $mimeType)
  • string $data: The SPARQL result body
  • string $mimeType: The MIME type of the result

Redefinition of:
ArrayIterator::constructor __construct ( $array )
dump (line 157)

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 100)

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 145)

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 87)

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 118)

Return false if the result of the query was false.

  • return: True if the query result was false.
  • access: public
boolean isFalse ()
isTrue (line 109)

Return true if the result of the query was true.

  • return: True if the query result was true.
  • access: public
boolean isTrue ()
numFields (line 127)

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

  • return: The number of fields.
  • access: public
integer numFields ()
numRows (line 136)

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

  • return: The number of rows.
  • access: public
integer numRows ()
__toString (line 372)

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
SPARQL_XML_RESULTS_NS = 'http://www.w3.org/2005/sparql-results#' (line 56)

A constant for the SPARQL Query Results XML Format namespace

Inherited Constants

Inherited from ArrayIterator (Internal Class)

ARRAY_AS_PROPS = 2
STD_PROP_LIST = 1

Documentation generated on Wed, 16 Jan 2013 19:16:38 +0000 by phpDocumentor 1.4.4