r87903 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87902‎ | r87903 | r87904 >
Date:11:43, 12 May 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
escape spaces in debugging output
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php
@@ -374,7 +374,7 @@
375375 $sparql = smwfGetSparqlDatabase()->getSparqlForSelect( '?' . self::RESULT_VARIABLE,
376376 $condition, $options, $namespaces );
377377 }
378 - $sparql = str_replace( array( '[',':' ), array( '[', ':' ), $sparql );
 378+ $sparql = str_replace( array( '[',':',' ' ), array( '[', ':', ' ' ), $sparql );
379379 $entries['SPARQL Query'] = "<pre>$sparql</pre>";
380380
381381 return SMWStore::formatDebugOutput( 'SMWSparqlStore', $entries, $query );
@@ -772,7 +772,6 @@
773773 */
774774 protected function buildValueCondition( SMWValueDescription $description, $joinVariable, $orderByProperty ) {
775775 $dataItem = $description->getDataItem();
776 - $expElement = SMWExporter::getDataItemExpElement( $dataItem );
777776
778777 $comparator = '';
779778 switch ( $description->getComparator() ) {
@@ -790,18 +789,21 @@
791790
792791 $namespaces = array();
793792 if ( $comparator == '=' ) {
 793+ $expElement = SMWExporter::getDataItemExpElement( $dataItem );
794794 $result = new SMWSparqlSingletonCondition( $expElement );
 795+ $this->addOrderByDataForProperty( $result, $joinVariable, $orderByProperty, $dataItem->getDIType() );
795796 } else {
 797+ $expElement = SMWExporter::getDataItemExpElement( $dataItem );
 798+ $result = new SMWSparqlFilterCondition( '', array() );
 799+ $this->addOrderByData( $result, $joinVariable, $dataItem->getDIType() );
 800+ $orderVariable = $result->orderByVariable;
796801 $valueName = SMWTurtleSerializer::getTurtleNameForExpElement( $expElement );
797802 if ( $expElement instanceof SMWExpNsResource ) {
798 - $namespaces[$expElement->getNamespaceId()] = $expElement->getNamespace();
 803+ $result->namespaces[$expElement->getNamespaceId()] = $expElement->getNamespace();
799804 }
800 - $filter = "?$joinVariable $comparator $valueName";
801 - $result = new SMWSparqlFilterCondition( $filter, $namespaces );
 805+ $result->filter = "?$orderVariable $comparator $valueName";
802806 }
803807
804 - $this->addOrderByDataForProperty( $result, $joinVariable, $orderByProperty, $dataItem->getDIType() );
805 -
806808 return $result;
807809 }
808810

Status & tagging log