/**
  * @since 2.2
  *
  * {@inheritDoc}
  */
 public function interpretDescription(Description $description)
 {
     $joinVariable = $this->compoundConditionBuilder->getJoinVariable();
     $orderByProperty = $this->compoundConditionBuilder->getOrderByProperty();
     $dataItem = $description->getDataItem();
     $property = $description->getProperty();
     switch ($description->getComparator()) {
         case SMW_CMP_EQ:
             $comparator = '=';
             break;
         case SMW_CMP_LESS:
             $comparator = '<';
             break;
         case SMW_CMP_GRTR:
             $comparator = '>';
             break;
         case SMW_CMP_LEQ:
             $comparator = '<=';
             break;
         case SMW_CMP_GEQ:
             $comparator = '>=';
             break;
         case SMW_CMP_NEQ:
             $comparator = '!=';
             break;
         case SMW_CMP_LIKE:
             $comparator = 'regex';
             break;
         case SMW_CMP_NLKE:
             $comparator = '!regex';
             break;
         default:
             $comparator = '';
             // unkown, unsupported
     }
     if ($comparator === '') {
         return $this->createConditionForEmptyComparator($joinVariable, $orderByProperty);
     } elseif ($comparator == '=') {
         return $this->createConditionForEqualityComparator($dataItem, $property, $joinVariable, $orderByProperty);
     } elseif ($comparator == 'regex' || $comparator == '!regex') {
         return $this->createConditionForRegexComparator($dataItem, $joinVariable, $orderByProperty, $comparator);
     }
     return $this->createFilterConditionForAnyOtherComparator($dataItem, $joinVariable, $orderByProperty, $comparator);
 }
 /**
  * Recursively create an Condition from SomeProperty
  *
  * @param SomeProperty $description
  * @param string $joinVariable
  * @param DIProperty|null $orderByProperty
  *
  * @return Condition
  */
 public function buildCondition(Description $description, $joinVariable, $orderByProperty = null)
 {
     $property = $description->getProperty();
     list($innerOrderByProperty, $innerCondition, $innerJoinVariable) = $this->doResolveInnerConditionRecursively($property, $description->getDescription());
     if ($innerCondition instanceof FalseCondition) {
         return new FalseCondition();
     }
     $namespaces = $innerCondition->namespaces;
     $objectName = $this->findObjectNameFromInnerCondition($innerCondition, $innerJoinVariable, $namespaces);
     list($subjectName, $objectName, $nonInverseProperty) = $this->doExchangeForWhenInversePropertyIsUsed($property, $objectName, $joinVariable);
     $propertyName = $this->getPropertyNameByUsingTurtleSerializer($property, $nonInverseProperty, $namespaces);
     $condition = $this->concatenateToConditionString($subjectName, $propertyName, $objectName, $innerCondition);
     $result = new WhereCondition($condition, true, $namespaces);
     // Record inner ordering variable if found
     $result->orderVariables = $innerCondition->orderVariables;
     if ($innerOrderByProperty !== null && $innerCondition->orderByVariable !== '') {
         $result->orderVariables[$property->getKey()] = $innerCondition->orderByVariable;
     }
     $this->compoundConditionBuilder->addOrderByDataForProperty($result, $joinVariable, $orderByProperty, DataItem::TYPE_WIKIPAGE);
     return $result;
 }