Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct (Description $description=null, $context=false) | |
isEmbedded () | |
setQueryMode ( $queryMode) | |
getQueryMode () | |
setContextPage (DIWikiPage $contextPage=null) | |
getContextPage () | |
setQuerySource ( $querySource) | |
getQuerySource () | |
setQueryToken (QueryToken $queryToken=null) | |
getQueryToken () | |
setMainLabel ( $mainlabel) | |
getMainLabel () | |
setDescription (SMWDescription $description) | |
getDescription () | |
setExtraPrintouts ( $extraprintouts) | |
getExtraPrintouts () | |
clearErrors () | |
getErrors () | |
addErrors ( $errors) | |
setQueryString ( $querystring) | |
setOption ( $key, $value) | |
getOption ( $key) | |
getQueryString ( $fresh=false) | |
getOffset () | |
setOffset ( $offset) | |
setUnboundOffset ( $offset) | |
getLimit () | |
setLimit ( $limit, $restrictinline=true) | |
setUnboundLimit ( $limit) | |
setSortKeys (array $sortKeys) | |
getSortKeys () | |
applyRestrictions () | |
toArray () | |
getHash () | |
toString () | |
getQueryId () | |
Public Attributes | |
const | ID_PREFIX = '_QUERY' |
const | PROC_QUERY_TIME = 'proc.query.time' |
const | PROC_PRINT_TIME = 'proc.print.time' |
const | PROC_CONTEXT = 'proc.context' |
const | PROC_STATUS_CODE = 'proc.status.code' |
const | OPT_PARAMETERS = 'proc.parameters' |
const | NO_CACHE = 'no.cache' |
const | NO_DEPENDENCY_TRACE = 'no.dependency.trace' |
const | SCORE_SORT = 'score.sort' |
$sort = false | |
$sortkeys = [] | |
$querymode = self::MODE_INSTANCES | |
Public Attributes inherited from SMW\Query\QueryContext | |
const | SPECIAL_PAGE = 1000 |
const | INLINE_QUERY = 1001 |
const | DEFERRED_QUERY = 1002 |
const | CONCEPT_DESC = 1003 |
const | CURTAILMENT_MODE = 1004 |
const | MODE_INSTANCES = 1 |
const | MODE_COUNT = 2 |
const | MODE_DEBUG = 3 |
const | MODE_NONE = 4 |
Representation of queries in SMW, each consisting of a query description and various parameters. Some settings might also lead to changes in the query description.
Most additional query parameters (limit, sort, ascending, ...) are interpreted as in SMWRequestOptions (though the latter contains some additional settings).
SMWQuery::__construct | ( | Description | $description = null , |
$context = false |
|||
) |
Description | $description | |
integer | boolean | $context |
SMWQuery::applyRestrictions | ( | ) |
Apply structural restrictions to the current description.
SMWQuery::clearErrors | ( | ) |
SMWQuery::getContextPage | ( | ) |
SMWQuery::getExtraPrintouts | ( | ) |
SMWQuery::getHash | ( | ) |
SMWQuery::getMainLabel | ( | ) |
Gets the mainlabel.
SMWQuery::getOption | ( | $key | ) |
string | integer | $key |
SMWQuery::getQueryId | ( | ) |
SMWQuery::getQueryMode | ( | ) |
integer |
SMWQuery::getQuerySource | ( | ) |
SMWQuery::getQueryString | ( | $fresh = false | ) |
boolean | $fresh |
SMWQuery::getQueryToken | ( | ) |
SMWQuery::getSortKeys | ( | ) |
SMWQuery::isEmbedded | ( | ) |
boolean |
SMWQuery::setContextPage | ( | DIWikiPage | $contextPage = null | ) |
DIWikiPage | null | $contextPage |
SMWQuery::setLimit | ( | $limit, | |
$restrictinline = true |
|||
) |
Set a limit for number of query results. The set limit might be restricted by the current offset so as to ensure that the number of the last considered result does not exceed the maximum amount of supported results. The function returns the chosen limit.
SMWQuery::setMainLabel | ( | $mainlabel | ) |
Sets the mainlabel.
string | $mainlabel |
SMWQuery::setOffset | ( | $offset | ) |
Set an offset for the returned query results. No offset beyond the maximal query limit will be set, and the current query limit might be reduced in order to ensure that no results beyond the maximal limit are returned. The function returns the chosen offset.
SMWQuery::setOption | ( | $key, | |
$value | |||
) |
string | integer | $key | |
mixed | $value |
SMWQuery::setQueryMode | ( | $queryMode | ) |
integer |
SMWQuery::setQuerySource | ( | $querySource | ) |
string |
SMWQuery::setQueryToken | ( | QueryToken | $queryToken = null | ) |
QueryToken | null | $queryToken |
SMWQuery::setSortKeys | ( | array | $sortKeys | ) |
array | $sortKeys |
SMWQuery::setUnboundLimit | ( | $limit | ) |
integer | $limit |
SMWQuery::setUnboundOffset | ( | $offset | ) |
integer | $offset |
SMWQuery::toArray | ( | ) |
Returns serialized query details
The output is following the askargs api module convention
conditions The query conditions (requirements for a subject to be included) printouts The query printouts (which properties to show per subject) parameters The query parameters (non-condition and non-printout arguments)
SMWQuery::toString | ( | ) |
const SMWQuery::NO_CACHE = 'no.cache' |
Suppress a possible cache request
const SMWQuery::NO_DEPENDENCY_TRACE = 'no.dependency.trace' |
Indicates no dependency trace
const SMWQuery::OPT_PARAMETERS = 'proc.parameters' |
The processing parameters
const SMWQuery::PROC_CONTEXT = 'proc.context' |
The processing context in which the query is being executed
const SMWQuery::PROC_PRINT_TIME = 'proc.print.time' |
The time a ResultPrinter required to build the final result including all PrintRequests
const SMWQuery::PROC_QUERY_TIME = 'proc.query.time' |
The time the QueryEngine required to answer a query condition
const SMWQuery::PROC_STATUS_CODE = 'proc.status.code' |
Status code information
const SMWQuery::SCORE_SORT = 'score.sort' |
Sort by score if the query engine supports it.