r37033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37032‎ | r37033 | r37034 >
Date:08:52, 4 July 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
implemented concept queries [[Concept:Something]] works like [[Catgory:Something]] in queries ("dynamic
categories")
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php
@@ -315,6 +315,18 @@
316316 $query->where = "$query->alias.smw_title$comp" . $this->m_dbs->addQuotes($value);
317317 }
318318 }
 319+ } elseif ($description instanceof SMWConceptDescription) { // fetch concept definition and insert it here
 320+ $dv = end($this->m_store->getSpecialValues($description->getConcept(), SMW_SP_CONCEPT_DESC));
 321+ $desctxt = ($dv!==false)?$dv->getXSDValue():false;
 322+ if ($desctxt == false) { // no description found, no condition
 323+ $qid = -1; ///TODO: announce an error here?
 324+ } else { // parse description and process it recursively
 325+ $qp = new SMWQueryParser();
 326+ // no defaultnamespaces here; if any, these are already in the concept
 327+ $desc = $qp->getQueryDescription($desctxt);
 328+ $qid = $this->compileQueries($desc);
 329+ $query = $this->m_queries[$qid];
 330+ }
319331 } else { // (e.g. SMWThingDescription, SMWValueList is also treated elswhere)
320332 $qid = -1; // no condition
321333 }

Status & tagging log