Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -315,6 +315,18 @@ |
316 | 316 | $query->where = "$query->alias.smw_title$comp" . $this->m_dbs->addQuotes($value); |
317 | 317 | } |
318 | 318 | } |
| 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 | + } |
319 | 331 | } else { // (e.g. SMWThingDescription, SMWValueList is also treated elswhere) |
320 | 332 | $qid = -1; // no condition |
321 | 333 | } |