Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZ.php |
— | — | @@ -547,7 +547,7 @@ |
548 | 548 | |
549 | 549 | while($definedMeaningRelation = $dbr->fetchObject($queryResult)) |
550 | 550 | $relation->addTuple(array($this->getExpressionForMeaningId($definedMeaningRelation->relationtype_mid, 85), |
551 | | - $this->getExpressionForMeaningId($definedMeaningRelation->meaning2_mid, 85))); |
| 551 | + $this->getDefiningExpressionForDefinedMeaningId($definedMeaningRelation->meaning2_mid))); |
552 | 552 | |
553 | 553 | return $relation; |
554 | 554 | } |
— | — | @@ -694,6 +694,16 @@ |
695 | 695 | |
696 | 696 | } |
697 | 697 | |
| 698 | + function getDefiningExpressionForDefinedMeaningId($definedMeaningId) { |
| 699 | + $dbr =& wfGetDB(DB_SLAVE); |
| 700 | + $queryResult = $dbr->query("SELECT spelling from uw_defined_meaning, uw_expression_ns where uw_defined_meaning.defined_meaning_id=$definedMeaningId and uw_expression_ns.expression_id=uw_defined_meaning.expression_id and uw_defined_meaning.is_latest_ver=1 and uw_expression_ns.is_latest=1"); |
| 701 | + |
| 702 | + while ($spelling = $dbr->fetchObject($queryResult)) |
| 703 | + $result = $spelling->spelling; |
| 704 | + |
| 705 | + return $result; |
| 706 | + } |
| 707 | + |
698 | 708 | function getExpressionForMeaningId($mid, $langcode) { |
699 | 709 | // $dbr =& wfGetDB(DB_SLAVE); |
700 | 710 | // $sql="SELECT spelling from uw_syntrans,uw_expression_ns where defined_meaning_id=".$mid." and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.language_id=".$langcode." limit 1"; |