class EasyRdf_Sparql_Result extends ArrayIterator
Class for returned for SPARQL SELECT and ASK query responses.
Constants
SPARQL_XML_RESULTS_NS |
A constant for the SPARQL Query Results XML Format namespace
|
Methods
__construct(string $data, string $mimeType)
Create a new SPARQL Result object |
||
string |
getType()
Get the query result type (boolean/bindings) |
|
boolean |
getBoolean()
Return the boolean value of the query result |
|
boolean |
isTrue()
Return true if the result of the query was true. |
|
boolean |
isFalse()
Return false if the result of the query was false. |
|
integer |
numFields()
Return the number of fields in a query result of type bindings. |
|
integer |
numRows()
Return the number of rows in a query result of type bindings. |
|
array |
getFields()
Get the field names in a query result of type bindings. |
|
dump(string $format = 'html')
Return a human readable view of the query result. |
||
string |
__toString()
Magic method to return value of the result to string |
Details
at line 66
public
__construct(string $data, string $mimeType)
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 EasyRdfSparqlClient.
at line 86
public string
getType()
Get the query result type (boolean/bindings)
ASK queries return a result of type 'boolean'. SELECT query return a result of type 'bindings'.
at line 99
public boolean
getBoolean()
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.
at line 108
public boolean
isTrue()
Return true if the result of the query was true.
at line 117
public boolean
isFalse()
Return false if the result of the query was false.
at line 126
public integer
numFields()
Return the number of fields in a query result of type bindings.
at line 135
public integer
numRows()
Return the number of rows in a query result of type bindings.
at line 144
public array
getFields()
Get the field names in a query result of type bindings.
at line 156
public
dump(string $format = 'html')
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.
at line 376
public string
__toString()
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.