Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct (array $header=[], array $data=[], array $comments=[], $errorCode=self::ERROR_NOERROR) | |
numRows () | |
getErrorCode () | |
setErrorCode ( $errorCode) | |
getComments () | |
isBooleanTrue () | |
getNumericValue () | |
rewind () | |
current () | |
next () | |
key () | |
valid () | |
Public Attributes | |
const | ERROR_NOERROR = 0 |
Error code: no errors occurred. | |
const | ERROR_UNREACHABLE = 1 |
Error code: service unreachable; result will be empty. | |
const | ERROR_INCOMPLETE = 2 |
Error code: results might be incomplete (e.g. due to some resource limit being reached) | |
Protected Attributes | |
$header | |
$data | |
$comments | |
$errorCode | |
Class for accessing SPARQL query results in a unified form. The data is structured in tabular form, with each cell containing some SMWExpElement. Rows should always have the same number of columns, but the datatype of the cells in each column may not be uniform throughout the result.
GNU GPL v2+
SMW\SPARQLStore\QueryEngine\RepositoryResult::__construct | ( | array | $header = [] , |
array | $data = [] , |
||
array | $comments = [] , |
||
$errorCode = self::ERROR_NOERROR |
|||
) |
Initialise a result set from a result string in SPARQL XML format.
$header | array mapping SPARQL variable names to column indices |
$data | array of array of (SMWExpElement or null) |
$comments | array of string comments if the result contained any |
$errorCode | integer an error code |
SMW\SPARQLStore\QueryEngine\RepositoryResult::current | ( | ) |
Return the current result row. Standard method of Iterator.
SMW\SPARQLStore\QueryEngine\RepositoryResult::getComments | ( | ) |
Return a list of comment strings found in the SPARQL result. Comments are used by some RDF stores to provide additional information or warnings that can thus be accessed.
SMW\SPARQLStore\QueryEngine\RepositoryResult::getErrorCode | ( | ) |
Return error code. SMWSparqlResultWrapper::ERROR_NOERROR (0) indicates that no error occurred.
SMW\SPARQLStore\QueryEngine\RepositoryResult::getNumericValue | ( | ) |
Check if the result is what one would get for a SPARQL SELECT COUNT query, and return the corresponding integer value. Returns 0 in all other cases (including the case that the results do not look at all like the result of a SELECT COUNT query).
SMW\SPARQLStore\QueryEngine\RepositoryResult::isBooleanTrue | ( | ) |
Check if the result is what one would get for a SPARQL ASK query that returned true. Returns false in all other cases (including the case that the results do not look at all like the result of an ASK query).
SMW\SPARQLStore\QueryEngine\RepositoryResult::key | ( | ) |
Return the next result row and advance the internal pointer. Standard method of Iterator.
SMW\SPARQLStore\QueryEngine\RepositoryResult::next | ( | ) |
Return the next result row and advance the internal pointer. Standard method of Iterator.
SMW\SPARQLStore\QueryEngine\RepositoryResult::numRows | ( | ) |
Get the number of rows in the result object.
SMW\SPARQLStore\QueryEngine\RepositoryResult::rewind | ( | ) |
Reset iterator to position 0. Standard method of Iterator.
SMW\SPARQLStore\QueryEngine\RepositoryResult::setErrorCode | ( | $errorCode | ) |
Set the error code of this result set. This is used for allowing callers to add additional errors discovered only later on. It does not allow removing existing errors, since it will not accept SMWSparqlResultWrapper::ERROR_NOERROR as a parameter.
$errorCode | integer error code |
SMW\SPARQLStore\QueryEngine\RepositoryResult::valid | ( | ) |
Return true if the internal pointer refers to a valid element. Standard method of Iterator.