Index: trunk/extensions/SemanticDrilldown/includes/SD_Filter.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | if (count($properties_used) > 0) { |
26 | 26 | $f->property = $properties_used[0]; |
27 | 27 | } |
28 | | - $f->is_relation = false; |
| 28 | + $f->is_relation = true; |
29 | 29 | $proptitle = Title::newFromText($f->property, SMW_NS_PROPERTY); |
30 | 30 | if ($proptitle != NULL) { |
31 | 31 | $store = smwfGetStore(); |
— | — | @@ -36,9 +36,10 @@ |
37 | 37 | global $smwgContLang; |
38 | 38 | $datatypeLabels = $smwgContLang->getDatatypeLabels(); |
39 | 39 | if (count($types) > 0) { |
40 | | - if ($types[0]->getWikiValue() == $datatypeLabels['_wpg']) { |
41 | | - $f->is_relation = true; |
42 | | - } elseif ($types[0]->getWikiValue() == $datatypeLabels['_boo']) { |
| 40 | + if ($types[0]->getWikiValue() != $datatypeLabels['_wpg']) { |
| 41 | + $f->is_relation = false; |
| 42 | + } |
| 43 | + if ($types[0]->getWikiValue() == $datatypeLabels['_boo']) { |
43 | 44 | $f->is_boolean = true; |
44 | 45 | } |
45 | 46 | } |
— | — | @@ -86,26 +87,26 @@ |
87 | 88 | } else { |
88 | 89 | $fields = "YEAR(value_xsd)"; |
89 | 90 | } |
90 | | - if ($smwgDefaultStore == 'SMWSQLStore2') { |
91 | | - $smw_attributes = $dbr->tableName( 'smw_atts2' ); |
92 | | - $smw_ids = $dbr->tableName( 'smw_ids' ); |
| 91 | + if ($smwgDefaultStore == 'SMWSQLStore') { |
| 92 | + $smw_attributes = $dbr->tableName( 'smw_attributes' ); |
93 | 93 | $sql =<<<END |
94 | 94 | SELECT $fields, count(*) |
95 | 95 | FROM semantic_drilldown_values sdv |
96 | | - JOIN $smw_attributes a ON sdv.id = a.s_id |
97 | | - JOIN $smw_ids p_ids ON a.p_id = p_ids.smw_id |
98 | | - WHERE p_ids.smw_title = '$property_value' |
| 96 | + JOIN $smw_attributes a ON sdv.id = a.subject_id |
| 97 | + WHERE a.attribute_title = '$property_value' |
99 | 98 | GROUP BY $fields |
100 | 99 | ORDER BY $fields |
101 | 100 | |
102 | 101 | END; |
103 | 102 | } else { |
104 | | - $smw_attributes = $dbr->tableName( 'smw_attributes' ); |
| 103 | + $smw_attributes = $dbr->tableName( 'smw_atts2' ); |
| 104 | + $smw_ids = $dbr->tableName( 'smw_ids' ); |
105 | 105 | $sql =<<<END |
106 | 106 | SELECT $fields, count(*) |
107 | 107 | FROM semantic_drilldown_values sdv |
108 | | - JOIN $smw_attributes a ON sdv.id = a.subject_id |
109 | | - WHERE a.attribute_title = '$property_value' |
| 108 | + JOIN $smw_attributes a ON sdv.id = a.s_id |
| 109 | + JOIN $smw_ids p_ids ON a.p_id = p_ids.smw_id |
| 110 | + WHERE p_ids.smw_title = '$property_value' |
110 | 111 | GROUP BY $fields |
111 | 112 | ORDER BY $fields |
112 | 113 | |
— | — | @@ -135,10 +136,10 @@ |
136 | 137 | global $smwgDefaultStore; |
137 | 138 | if ($this->time_period != NULL) { |
138 | 139 | return $this->getTimePeriodValues(); |
139 | | - } elseif ($smwgDefaultStore == 'SMWSQLStore2') { |
| 140 | + } elseif ($smwgDefaultStore == 'SMWSQLStore') { |
| 141 | + return $this->getAllValues_orig(); |
| 142 | + } else { |
140 | 143 | return $this->getAllValues_2(); |
141 | | - } else { |
142 | | - return $this->getAllValues_orig(); |
143 | 144 | } |
144 | 145 | } |
145 | 146 | |
— | — | @@ -227,10 +228,10 @@ |
228 | 229 | */ |
229 | 230 | function createTempTable() { |
230 | 231 | global $smwgDefaultStore; |
231 | | - if ($smwgDefaultStore == 'SMWSQLStore2') { |
| 232 | + if ($smwgDefaultStore == 'SMWSQLStore') { |
| 233 | + $this->createTempTable_orig(); |
| 234 | + } else { |
232 | 235 | $this->createTempTable_2(); |
233 | | - } else { |
234 | | - $this->createTempTable_orig(); |
235 | 236 | } |
236 | 237 | } |
237 | 238 | |