Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php |
— | — | @@ -144,8 +144,6 @@ |
145 | 145 | |
146 | 146 | $t->possiblySynonymousId = new Attribute("possibly-synonymous-id", "Possibly synonymous id", "integer"); |
147 | 147 | $t->possibleSynonym = new Attribute("possible-synonym", wfMsgSc("PossibleSynonym"), $t->definedMeaningReferenceStructure); |
148 | | - # Bug found ... This never worked before: (!) |
149 | | - #$t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possiblySynonymous); |
150 | 148 | $t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possibleSynonym); |
151 | 149 | $t->possiblySynonymous = new Attribute(null, wfMsgSc("PossiblySynonymous"), $t->possiblySynonymousStructure); |
152 | 150 | |
— | — | @@ -157,9 +155,9 @@ |
158 | 156 | $t->otherDefinedMeaning = new Attribute("other-defined-meaning", wfMsgSc("OtherDefinedMeaning"), $definedMeaningReferenceType); |
159 | 157 | |
160 | 158 | global |
161 | | - $wgRelationsAttributeId, $wgIncomingRelationsAttributeId ; |
| 159 | + $wgRelationsAttributeId, $wgIncomingRelationsAttributeId; |
162 | 160 | |
163 | | - $t->relationStructure = new Structure("relations", $t->relationId, $t->relationType, $t->otherDefinedMeaning, $t->objectAttributes); |
| 161 | + $t->relationStructure = new Structure("relations", $t->relationId, $t->relationType, $t->otherDefinedMeaning); |
164 | 162 | $t->relations = new Attribute("relations", wfMsgSc("Relations"), $t->relationStructure); |
165 | 163 | $t->reciprocalRelations = new Attribute("reciprocal-relations", wfMsgSc("IncomingRelations"), $t->relationStructure); |
166 | 164 | $t->translatedTextId = new Attribute("translated-text-id", "Translated text ID", "integer"); |
— | — | @@ -188,27 +186,27 @@ |
189 | 187 | else |
190 | 188 | $synonymsAndTranslationsCaption = wfMsgSc("SynonymsAndTranslations"); |
191 | 189 | |
192 | | - $t->attributeObjectId = new Attribute("attributeObjectId", "Attribute object", "object-id"); |
193 | | - |
194 | 190 | $t->syntransId = new Attribute("syntrans-id", "$synonymsAndTranslationsCaption identifier", "integer"); |
195 | | - $t->synonymsTranslationsStructure = new Structure("synonyms-translations", $t->syntransId, $t->expression, $t->identicalMeaning, $t->objectAttributes); |
| 191 | + $t->synonymsTranslationsStructure = new Structure("synonyms-translations", $t->syntransId, $t->expression, $t->identicalMeaning); |
196 | 192 | $t->synonymsAndTranslations = new Attribute(null, "$synonymsAndTranslationsCaption", $t->synonymsTranslationsStructure); |
197 | 193 | $t->translatedTextAttributeId = new Attribute("translated-text-attribute-id", "Attribute identifier", "object-id"); |
198 | 194 | $t->translatedTextAttribute = new Attribute("translated-text-attribute", wfMsgSc("TranslatedTextAttribute"), $definedMeaningReferenceType); |
199 | 195 | $t->translatedTextValueId = new Attribute("translated-text-value-id", "Translated text value identifier", "translated-text-value-id"); |
200 | 196 | |
| 197 | + $t->attributeObjectId = new Attribute("attributeObjectId", "Attribute object", "object-id"); |
| 198 | + |
201 | 199 | if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes()) |
202 | 200 | $t->translatedTextValue = new Attribute("translated-text-value", wfMsgSc("TranslatedTextAttributeValue"), "text"); |
203 | 201 | else |
204 | 202 | $t->translatedTextValue = new Attribute("translated-text-value", wfMsgSc("TranslatedTextAttributeValue"), $t->translatedTextStructure); |
205 | 203 | |
206 | | - $t->translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$t->translatedTextAttributeId, $t->attributeObjectId, $t->translatedTextAttribute, $t->translatedTextValueId, $t->translatedTextValue, $t->objectAttributes); |
| 204 | + $t->translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$t->translatedTextAttributeId, $t->attributeObjectId, $t->translatedTextAttribute, $t->translatedTextValueId, $t->translatedTextValue); |
207 | 205 | $t->translatedTextAttributeValues = new Attribute(null, wfMsgSc("TranslatedTextAttributeValues"), $t->translatedTextAttributeValuesStructure); |
208 | 206 | $t->attributeObject = new Attribute("attribute-object-id", "Attribute object", "object-id"); |
209 | 207 | $t->textAttributeId = new Attribute("text-attribute-id", "Attribute identifier", "object-id"); |
210 | 208 | $t->textAttributeObject = new Attribute("text-attribute-object-id", "Attribute object", "object-id"); |
211 | 209 | $t->textAttribute = new Attribute("text-attribute", wfMsgSc("TextAttribute"), $t->definedMeaningReferenceStructure); |
212 | | - $t->textAttributeValuesStructure = new Structure("text-attribute-values", $t->textAttributeId, $t->textAttributeObject, $t->textAttribute, $t->text, $t->objectAttributes); |
| 210 | + $t->textAttributeValuesStructure = new Structure("text-attribute-values", $t->textAttributeId, $t->textAttributeObject, $t->textAttribute, $t->text); |
213 | 211 | $t->textAttributeValues = new Attribute(null, wfMsgSc("TextAttributeValues"), $t->textAttributeValuesStructure); |
214 | 212 | $t->linkLabel = new Attribute("label", "Label", "short-text"); |
215 | 213 | $t->linkURL = new Attribute("url", "URL", "url"); |
— | — | @@ -217,13 +215,13 @@ |
218 | 216 | $t->linkAttributeId = new Attribute("link-attribute-id", "Attribute identifier", "object-id"); |
219 | 217 | $t->linkAttributeObject = new Attribute("link-attribute-object-id", "Attribute object", "object-id"); |
220 | 218 | $t->linkAttribute = new Attribute("link-attribute", wfMsgSc("LinkAttribute"), $t->definedMeaningReferenceStructure); |
221 | | - $t->linkAttributeValuesStructure = new Structure("link-attribute-values", $t->linkAttributeId, $t->linkAttributeObject, $t->linkAttribute, $t->link, $t->objectAttributes); |
| 219 | + $t->linkAttributeValuesStructure = new Structure("link-attribute-values", $t->linkAttributeId, $t->linkAttributeObject, $t->linkAttribute, $t->link); |
222 | 220 | $t->linkAttributeValues = new Attribute(null, wfMsgSc("LinkAttributeValues"), $t->linkAttributeValuesStructure); |
223 | 221 | $t->optionAttributeId = new Attribute("option-attribute-id", "Attribute identifier", "object-id"); |
224 | 222 | $t->optionAttributeObject = new Attribute("option-attribute-object-id", "Attribute object", "object-id"); |
225 | 223 | $t->optionAttribute = new Attribute("option-attribute", wfMsgSc("OptionAttribute"), $definedMeaningReferenceType); |
226 | 224 | $t->optionAttributeOption = new Attribute("option-attribute-option", wfMsgSc("OptionAttributeOption"), $definedMeaningReferenceType); |
227 | | - $t->optionAttributeValuesStructure = new Structure("option-attribute-values", $t->optionAttributeId, $t->optionAttribute, $t->optionAttributeObject, $t->optionAttributeOption, $t->objectAttributes); |
| 225 | + $t->optionAttributeValuesStructure = new Structure("option-attribute-values", $t->optionAttributeId, $t->optionAttribute, $t->optionAttributeObject, $t->optionAttributeOption); |
228 | 226 | $t->optionAttributeValues = new Attribute(null, wfMsgSc("OptionAttributeValues"), $t->optionAttributeValuesStructure); |
229 | 227 | $t->optionAttributeOptionId = new Attribute("option-attribute-option-id", "Option identifier", "object-id"); |
230 | 228 | $t->optionAttributeOptionsStructure = new Structure("option-attribute-options", $t->optionAttributeOptionId, $t->optionAttribute, $t->optionAttributeOption, $t->language); |
— | — | @@ -234,7 +232,7 @@ |
235 | 233 | else |
236 | 234 | $t->translatedText = new Attribute("translated-text", wfMsgSc("TranslatedText"), $t->translatedTextStructure); |
237 | 235 | |
238 | | - $t->definition = new Attribute(null, wfMsgSc("Definition"), new Structure("definition", $t->translatedText, $t->objectAttributes)); |
| 236 | + $t->definition = new Attribute(null, wfMsgSc("Definition"), new Structure("definition", $t->translatedText)); |
239 | 237 | |
240 | 238 | global |
241 | 239 | $wgClassAttributesAttributeId; |
— | — | @@ -265,7 +263,6 @@ |
266 | 264 | $t->expressionMeaningStructure = new Structure($t->definedMeaningId, $t->text, $t->definedMeaning); |
267 | 265 | $t->expressionExactMeanings = new Attribute("expression-exact-meanings", wfMsgSc("ExactMeanings"), $t->expressionMeaningStructure); |
268 | 266 | $t->expressionApproximateMeanings = new Attribute("expression-approximate-meanings", wfMsgSc("ApproximateMeanings"), $t->expressionMeaningStructure); |
269 | | - # bug found here also: $t->expressionAoproximateMeaning_S_ |
270 | 267 | $t->expressionMeaningsStructure = new Structure("expression-meanings", $t->expressionExactMeanings, $t->expressionApproximateMeanings); |
271 | 268 | $t->expressionMeanings = new Attribute(null, wfMsgSc("ExpressionMeanings"), $t->expressionMeaningsStructure); |
272 | 269 | $t->expressionsStructure = new Structure("expressions", $t->expressionId, $t->expression, $t->expressionMeanings); |
— | — | @@ -287,6 +284,9 @@ |
288 | 285 | $t->optionAttributeValues |
289 | 286 | ); |
290 | 287 | |
| 288 | + foreach ($annotatedAttributes as $annotatedAttribute) |
| 289 | + $annotatedAttribute->type->addAttribute($t->objectAttributes); |
| 290 | + |
291 | 291 | foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter) { |
292 | 292 | $attribute = $propertyToColumnFilter->getAttribute(); |
293 | 293 | $attribute->setAttributeType($t->objectAttributesStructure); |
— | — | @@ -294,6 +294,7 @@ |
295 | 295 | foreach ($annotatedAttributes as $annotatedAttribute) |
296 | 296 | $annotatedAttribute->type->addAttribute($attribute); |
297 | 297 | } |
| 298 | + |
298 | 299 | $t->in_setup=False; |
299 | 300 | } |
300 | 301 | |