Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct (DescriptionInterpreterFactory $descriptionInterpreterFactory, EngineOptions $engineOptions=null) | |
setResultVariable ( $resultVariable) | |
getNextVariable ( $prefix='v') | |
setSortKeys ( $sortKeys) | |
getSortKeys () | |
getErrors () | |
addError ( $error, $type=Message::TEXT) | |
setCircularReferenceGuard (CircularReferenceGuard $circularReferenceGuard) | |
getCircularReferenceGuard () | |
setHierarchyLookup (HierarchyLookup $hierarchyLookup) | |
getHierarchyLookup () | |
setJoinVariable ( $joinVariable) | |
getJoinVariable () | |
setOrderByProperty ( $orderByProperty) | |
getOrderByProperty () | |
getConditionFrom (Description $description) | |
mapDescriptionToCondition (Description $description) | |
convertConditionToString (Condition &$condition) | |
newTrueCondition ( $joinVariable, $orderByProperty) | |
tryToFindRedirectVariableForDataItem (DataItem $dataItem=null) | |
isSetFlag ( $featureFlag) | |
addOrderByDataForProperty (Condition &$sparqlCondition, $mainVariable, $orderByProperty, $diType=DataItem::TYPE_NOTYPE) | |
addOrderByData (Condition &$condition, $mainVariable, $diType) | |
Protected Member Functions | |
addMissingOrderByConditions (Condition &$condition) | |
Build an internal representation for a SPARQL condition from individual query descriptions
GNU GPL v2+
SMW\SPARQLStore\QueryEngine\ConditionBuilder::__construct | ( | DescriptionInterpreterFactory | $descriptionInterpreterFactory, |
EngineOptions | $engineOptions = null |
||
) |
DescriptionInterpreterFactory | $descriptionInterpreterFactory | |
EngineOptions | null | $engineOptions |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::addError | ( | $error, | |
$type = Message::TEXT |
|||
) |
string | $error |
|
protected |
Extend the given Condition with additional conditions to ensure that it can be ordered by all requested properties. After this operation, every key in sortKeys is assigned to a query variable by $sparqlCondition->orderVariables.
Condition | $condition | condition to modify |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::addOrderByData | ( | Condition & | $condition, |
$mainVariable, | |||
$diType | |||
) |
Extend the given SPARQL condition by a suitable order by variable, possibly adding conditions if required for the type of data.
Condition | $sparqlCondition | condition to modify |
string | $mainVariable | the variable that represents the value to be ordered |
integer | $diType | DataItem type id |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::addOrderByDataForProperty | ( | Condition & | $sparqlCondition, |
$mainVariable, | |||
$orderByProperty, | |||
$diType = DataItem::TYPE_NOTYPE |
|||
) |
Extend the given SPARQL condition by a suitable order by variable, if an order by property is set.
Condition | $sparqlCondition | condition to modify |
string | $mainVariable | the variable that represents the value to be ordered |
mixed | $orderByProperty | DIProperty or null |
integer | $diType | DataItem type id if known, or DataItem::TYPE_NOTYPE to determine it from the property |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::convertConditionToString | ( | Condition & | $condition | ) |
Build the condition (WHERE) string for a given Condition. The function also expresses the single value of SingletonCondition objects in the condition, which may lead to additional namespaces for serializing its URI.
Condition | $condition |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getCircularReferenceGuard | ( | ) |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getConditionFrom | ( | Description | $description | ) |
Get a Condition object for a Description.
This conversion is implemented by a number of recursive functions, and this is the main entry point for this recursion. In particular, it resets global variables that are used for the construction.
If property value variables should be recorded for ordering results later on, the keys of the respective properties need to be given in sortKeys earlier.
Description | $description |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getErrors | ( | ) |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getHierarchyLookup | ( | ) |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getJoinVariable | ( | ) |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getNextVariable | ( | $prefix = 'v' | ) |
Get a fresh unused variable name for building SPARQL conditions.
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getOrderByProperty | ( | ) |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::getSortKeys | ( | ) |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::isSetFlag | ( | $featureFlag | ) |
integer | $featureFlag |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::mapDescriptionToCondition | ( | Description | $description | ) |
Recursively create a Condition from a Description
Description | $description |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::newTrueCondition | ( | $joinVariable, | |
$orderByProperty | |||
) |
Create an Condition from an empty (true) description. May still require helper conditions for ordering.
$joinVariable | string name, see mapDescriptionToCondition() |
$orderByProperty | mixed DIProperty or null, see mapDescriptionToCondition() |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::setCircularReferenceGuard | ( | CircularReferenceGuard | $circularReferenceGuard | ) |
CircularReferenceGuard | $circularReferenceGuard |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::setHierarchyLookup | ( | HierarchyLookup | $hierarchyLookup | ) |
HierarchyLookup | $hierarchyLookup |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::setJoinVariable | ( | $joinVariable | ) |
string | $joinVariable | name of the variable that conditions will refer to |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::setOrderByProperty | ( | $orderByProperty | ) |
DIProperty | null | $orderByProperty | if given then this is the property the values of which this condition will refer to, and the condition should also enable ordering by this value |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::setResultVariable | ( | $resultVariable | ) |
string | $resultVariable |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::setSortKeys | ( | $sortKeys | ) |
array | $sortKeys |
SMW\SPARQLStore\QueryEngine\ConditionBuilder::tryToFindRedirectVariableForDataItem | ( | DataItem | $dataItem = null | ) |
DataItem | null | $dataItem |