Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes2.php |
— | — | @@ -0,0 +1,351 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +require_once("Attribute.php"); |
| 5 | +require_once("WikiDataGlobals.php"); |
| 6 | +require_once("ViewInformation.php"); |
| 7 | + |
| 8 | +/** |
| 9 | + * Replacement OmegaWikiAttributes. |
| 10 | + * |
| 11 | + * This file models the structure of the OmegaWiki database in a |
| 12 | + * database-independent fashion. To do so, it follows a simplified |
| 13 | + * relational model, consisting of Attribute objects which are hierarchically |
| 14 | + * grouped together using Structure objects. See Attribute.php for details. |
| 15 | + * |
| 16 | + * The actual data is stored in Records, grouped together as RecordSets. |
| 17 | + * See Record.php and RecordSet.php for details. |
| 18 | + * |
| 19 | + * TODO: |
| 20 | + * - The current model of a ton of hardcoded globals is highly inadequate |
| 21 | + * and should be replaced with a more abstract schema description. |
| 22 | + * - Replacing with a single associative array. |
| 23 | + * |
| 24 | + * - Attribute names are in WikidataGlobals.php, but should really be |
| 25 | + * localizable through MediaWiki's wfMsg() function. |
| 26 | + * -This is step 2 |
| 27 | + * - Records and RecordSets are currently capable of storing most (not all) |
| 28 | + * data, but can't actually commit them to the database again. To achieve |
| 29 | + * proper separation of architectural layers, the Records should learn |
| 30 | + * to talk directly with the DB layer. |
| 31 | + * -This is potentially what RecordHelpers are for. |
| 32 | + * |
| 33 | + */ |
| 34 | +function initializeOmegaWikiAttributes(ViewInformation $viewInformation) { |
| 35 | + global |
| 36 | + $omegaWikiAttributes; |
| 37 | + $omegaWikiAttributes= new OmegaWikiAttributes($viewInformation); |
| 38 | +} |
| 39 | + |
| 40 | +class OmegaWikiAttributes { |
| 41 | + protected $attributes = null; |
| 42 | + function __construct(ViewInformation $viewInformation) { |
| 43 | + $a=$this->attributes; # <- wrist/RSI protection |
| 44 | + |
| 45 | + global |
| 46 | + $languageAttribute, $spellingAttribute, $textAttribute, |
| 47 | + $wgLanguageAttributeName, $wgSpellingAttributeName, $wgTextAttributeName; |
| 48 | + |
| 49 | + $languageAttribute = new Attribute("language", $wgLanguageAttributeName, "language"); |
| 50 | + $spellingAttribute = new Attribute("spelling", $wgSpellingAttributeName, "spelling"); |
| 51 | + $textAttribute = new Attribute("text", $wgTextAttributeName, "text"); |
| 52 | + |
| 53 | + global |
| 54 | + $objectAttributesAttribute, $definedMeaningAttributesAttribute, |
| 55 | + $wgDefinedMeaningAttributesAttributeName, |
| 56 | + $wgDefinedMeaningAttributesAttributeName, $wgDefinedMeaningAttributesAttributeId, $wgAnnotationAttributeName; |
| 57 | + |
| 58 | + $definedMeaningAttributesAttribute = new Attribute("defined-meaning-attributes", $wgDefinedMeaningAttributesAttributeName, "will-be-specified-below"); |
| 59 | + $objectAttributesAttribute = new Attribute("object-attributes", $wgAnnotationAttributeName, "will-be-specified-below"); |
| 60 | + |
| 61 | + global |
| 62 | + $expressionIdAttribute, $identicalMeaningAttribute, $wgIdenticalMeaningAttributeName; |
| 63 | + |
| 64 | + $expressionIdAttribute = new Attribute("expression-id", "Expression Id", "expression-id"); |
| 65 | + $identicalMeaningAttribute = new Attribute("indentical-meaning", $wgIdenticalMeaningAttributeName, "boolean"); |
| 66 | + |
| 67 | + global |
| 68 | + $expressionStructure, $expressionAttribute, $wgExpressionAttributeName; |
| 69 | + |
| 70 | + if ($viewInformation->filterOnLanguage()) |
| 71 | + $expressionAttribute = new Attribute("expression", $wgSpellingAttributeName, "spelling"); |
| 72 | + else { |
| 73 | + $expressionStructure = new Structure("expression", $languageAttribute, $spellingAttribute); |
| 74 | + $expressionAttribute = new Attribute(null, $wgExpressionAttributeName, $expressionStructure); |
| 75 | + } |
| 76 | + |
| 77 | + global |
| 78 | + $definedMeaningIdAttribute, $definedMeaningDefiningExpressionAttribute, |
| 79 | + $definedMeaningCompleteDefiningExpressionStructure, |
| 80 | + $definedMeaningCompleteDefiningExpressionAttribute; |
| 81 | + |
| 82 | + $definedMeaningIdAttribute = new Attribute("defined-meaning-id", "Defined meaning identifier", "defined-meaning-id"); |
| 83 | + $definedMeaningDefiningExpressionAttribute = new Attribute("defined-meaning-defining-expression", "Defined meaning defining expression", "short-text"); |
| 84 | + |
| 85 | + $definedMeaningCompleteDefiningExpressionStructure = |
| 86 | + new Structure("defined-meaning-full-defining-expression", |
| 87 | + $definedMeaningDefiningExpressionAttribute, |
| 88 | + $expressionIdAttribute, |
| 89 | + $languageAttribute |
| 90 | + ); |
| 91 | + $definedMeaningCompleteDefiningExpressionAttribute=new Attribute(null, "Defining expression", $definedMeaningCompleteDefiningExpressionStructure); |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + global |
| 96 | + $definedMeaningReferenceStructure, $definedMeaningLabelAttribute, $definedMeaningReferenceType, |
| 97 | + $definedMeaningReferenceAttribute, $wgDefinedMeaningReferenceAttributeName; |
| 98 | + |
| 99 | + $definedMeaningLabelAttribute = new Attribute("defined-meaning-label", "Defined meaning label", "short-text"); |
| 100 | + $definedMeaningReferenceStructure = new Structure("defined-meaning", $definedMeaningIdAttribute, $definedMeaningLabelAttribute, $definedMeaningDefiningExpressionAttribute); |
| 101 | + |
| 102 | + $definedMeaningReferenceType = $definedMeaningReferenceStructure; |
| 103 | + $definedMeaningReferenceAttribute = new Attribute(null, $wgDefinedMeaningReferenceAttributeName, $definedMeaningReferenceType); |
| 104 | + |
| 105 | + global |
| 106 | + $collectionIdAttribute, $collectionMeaningAttribute, $sourceIdentifierAttribute, |
| 107 | + $gotoSourceStructure, $gotoSourceAttribute, |
| 108 | + $wgCollectionAttributeName, $wgSourceIdentifierAttributeName, $wgGotoSourceAttributeName; |
| 109 | + |
| 110 | + $collectionIdAttribute = new Attribute("collection", "Collection", "collection-id"); |
| 111 | + $collectionMeaningAttribute = new Attribute("collection-meaning", $wgCollectionAttributeName, $definedMeaningReferenceStructure); |
| 112 | + $sourceIdentifierAttribute = new Attribute("source-identifier", $wgSourceIdentifierAttributeName, "short-text"); |
| 113 | + $gotoSourceStructure = new Structure("goto-source",$collectionIdAttribute, $sourceIdentifierAttribute); |
| 114 | + $gotoSourceAttribute = new Attribute(null, $wgGotoSourceAttributeName, $gotoSourceStructure); |
| 115 | + |
| 116 | + global |
| 117 | + $collectionMembershipAttribute, $wgCollectionMembershipAttributeName, $wgCollectionMembershipAttributeId, |
| 118 | + $collectionMembershipStructure; |
| 119 | + |
| 120 | + $collectionMembershipStructure = new Structure("collection-membership",$collectionIdAttribute, $collectionMeaningAttribute, $sourceIdentifierAttribute); |
| 121 | + $collectionMembershipAttribute = new Attribute(null, $wgCollectionMembershipAttributeName, $collectionMembershipStructure); |
| 122 | + |
| 123 | + global |
| 124 | + $classMembershipIdAttribute, $classAttribute; |
| 125 | + |
| 126 | + $classMembershipIdAttribute = new Attribute("class-membership-id", "Class membership id", "integer"); |
| 127 | + $classAttribute = new Attribute("class", "Class", $definedMeaningReferenceStructure); |
| 128 | + |
| 129 | + global |
| 130 | + $classMembershipStructure, $classMembershipKeyStructure, $classMembershipAttribute, |
| 131 | + $wgClassMembershipAttributeName, $wgClassMembershipAttributeId; |
| 132 | + |
| 133 | + $classMembershipStructure = new Structure("class-membership", $classMembershipIdAttribute, $classAttribute); |
| 134 | + $classMembershipAttribute = new Attribute(null, $wgClassMembershipAttributeName, $classMembershipStructure); |
| 135 | + |
| 136 | + global |
| 137 | + $possiblySynonymousIdAttribute, |
| 138 | + $possibleSynonymAttribute, |
| 139 | + $wgPossibleSynonymAttributeName, $possiblySynonymousStructure, $possiblySynonymousAttribute, |
| 140 | + $wgPossiblySynonymousAttributeName, $wgPossiblySynonymousAttributeId; |
| 141 | + |
| 142 | + $possiblySynonymousIdAttribute = new Attribute("possibly-synonymous-id", "Possibly synonymous id", "integer"); |
| 143 | + $possibleSynonymAttribute = new Attribute("possible-synonym", $wgPossibleSynonymAttributeName, $definedMeaningReferenceStructure); |
| 144 | + $possiblySynonymousStructure = new Structure("possibly-synonymous", $possiblySynonymousIdAttribute, $possiblySynonymousAttribute); |
| 145 | + $possiblySynonymousAttribute = new Attribute(null, $wgPossiblySynonymousAttributeName, $possiblySynonymousStructure); |
| 146 | + |
| 147 | + global |
| 148 | + $relationIdAttribute, $relationTypeAttribute, $relationTypeType, $otherDefinedMeaningAttribute, |
| 149 | + $wgRelationTypeAttributeName, $wgOtherDefinedMeaningAttributeName; |
| 150 | + |
| 151 | + $relationIdAttribute = new Attribute("relation-id", "Relation identifier", "object-id"); |
| 152 | + $relationTypeAttribute = new Attribute("relation-type", $wgRelationTypeAttributeName, $definedMeaningReferenceStructure); |
| 153 | + $otherDefinedMeaningAttribute = new Attribute("other-defined-meaning", $wgOtherDefinedMeaningAttributeName, $definedMeaningReferenceType); |
| 154 | + |
| 155 | + global |
| 156 | + $relationsAttribute, $relationStructure, $reciprocalRelationsAttribute, $objectAttributesAttribute, $wgRelationsAttributeName, $wgIncomingRelationsAttributeName, $wgRelationsAttributeId, $wgIncomingRelationsAttributeId, |
| 157 | + $repRelStructure; |
| 158 | + |
| 159 | + $relationStructure = new Structure("relations", $relationIdAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, $objectAttributesAttribute); |
| 160 | + $relationsAttribute = new Attribute(null, $wgRelationsAttributeName, $relationStructure); |
| 161 | + $reciprocalRelationsAttribute = new Attribute("reciprocal-relations", $wgIncomingRelationsAttributeName, $relationStructure); |
| 162 | + |
| 163 | + global |
| 164 | + $translatedTextIdAttribute, $translatedTextStructure; |
| 165 | + |
| 166 | + $translatedTextIdAttribute = new Attribute("translated-text-id", "Translated text ID", "integer"); |
| 167 | + $translatedTextStructure = new Structure("translated-text", $languageAttribute, $textAttribute); |
| 168 | + |
| 169 | + global |
| 170 | + $definitionIdAttribute, $alternativeDefinitionAttribute, $sourceAttribute, |
| 171 | + $wgAlternativeDefinitionAttributeName, $wgSourceAttributeName; |
| 172 | + |
| 173 | + $definitionIdAttribute = new Attribute("definition-id", "Definition identifier", "integer"); |
| 174 | + |
| 175 | + if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes()) |
| 176 | + $alternativeDefinitionAttribute = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, "text"); |
| 177 | + else |
| 178 | + $alternativeDefinitionAttribute = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, $translatedTextStructure); |
| 179 | + |
| 180 | + $sourceAttribute = new Attribute("source-id", $wgSourceAttributeName, $definedMeaningReferenceType); |
| 181 | + |
| 182 | + global |
| 183 | + $alternativeDefinitionsAttribute, $wgAlternativeDefinitionsAttributeName, $wgAlternativeDefinitionsAttributeId, |
| 184 | + $alternativeDefinitionsStructure; |
| 185 | + |
| 186 | + $alternativeDefinitionsStructure = new Structure("alternative-definitions", $definitionIdAttribute, $alternativeDefinitionAttribute, $sourceAttribute); |
| 187 | + |
| 188 | + $alternativeDefinitionsAttribute = new Attribute(null, $wgAlternativeDefinitionsAttributeName, $alternativeDefinitionsStructure); |
| 189 | + |
| 190 | + global |
| 191 | + $synonymsAndTranslationsAttribute, $syntransIdAttribute, |
| 192 | + $wgSynonymsAttributeName, $wgSynonymsAndTranslationsAttributeName, $wgSynonymsAndTranslationsAttributeId, |
| 193 | + $synonymsTranslationsStructure; |
| 194 | + |
| 195 | + if ($viewInformation->filterOnLanguage()) |
| 196 | + $synonymsAndTranslationsCaption = $wgSynonymsAttributeName; |
| 197 | + else |
| 198 | + $synonymsAndTranslationsCaption = $wgSynonymsAndTranslationsAttributeName; |
| 199 | + |
| 200 | + $syntransIdAttribute = new Attribute("syntrans-id", "$synonymsAndTranslationsCaption identifier", "integer"); |
| 201 | + $synonymsTranslationsStructure = new Structure("synonyms-translations", $syntransIdAttribute, $expressionAttribute, $identicalMeaningAttribute, $objectAttributesAttribute); |
| 202 | + $synonymsAndTranslationsAttribute = new Attribute(null, "$synonymsAndTranslationsCaption", $synonymsTranslationsStructure); |
| 203 | + |
| 204 | + global |
| 205 | + $translatedTextAttributeIdAttribute, $translatedTextValueIdAttribute, |
| 206 | + $translatedTextAttributeObjectAttribute, $translatedTextAttributeAttribute, $translatedTextValueAttribute, $translatedTextAttributeValuesAttribute, |
| 207 | + $translatedTextAttributeValuesStructure, $wgTranslatedTextAttributeValuesAttributeName, $wgTranslatedTextAttributeAttributeName, $wgTranslatedTextAttributeValueAttributeName; |
| 208 | + |
| 209 | + $translatedTextAttributeIdAttribute = new Attribute("translated-text-attribute-id", "Attribute identifier", "object-id"); |
| 210 | + $translatedTextAttributeObjectAttribute = new Attribute("translated-text-attribute-object-id", "Attribute object", "object-id"); |
| 211 | + $translatedTextAttributeAttribute = new Attribute("translated-text-attribute", $wgTranslatedTextAttributeAttributeName, $definedMeaningReferenceType); |
| 212 | + $translatedTextValueIdAttribute = new Attribute("translated-text-value-id", "Translated text value identifier", "translated-text-value-id"); |
| 213 | + |
| 214 | + if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes()) |
| 215 | + $translatedTextValueAttribute = new Attribute("translated-text-value", $wgTranslatedTextAttributeValueAttributeName, "text"); |
| 216 | + else |
| 217 | + $translatedTextValueAttribute = new Attribute("translated-text", $wgTranslatedTextAttributeValueAttributeName, $translatedTextStructure); |
| 218 | + |
| 219 | + $translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$translatedTextAttributeIdAttribute, $translatedTextAttributeObjectAttribute, $translatedTextAttributeAttribute, $translatedTextValueIdAttribute, $translatedTextValueAttribute, $objectAttributesAttribute); |
| 220 | + $translatedTextAttributeValuesAttribute = new Attribute(null, $wgTranslatedTextAttributeValuesAttributeName, $translatedTextAttributeValuesStructure); |
| 221 | + |
| 222 | + global |
| 223 | + $textAttributeIdAttribute, $textAttributeObjectAttribute, $textAttributeAttribute, $textAttributeValuesStructure, |
| 224 | + $textAttributeValuesAttribute, |
| 225 | + $wgTextAttributeValuesAttributeName, $wgTextAttributeAttributeName; |
| 226 | + |
| 227 | + $textAttributeIdAttribute = new Attribute("text-attribute-id", "Attribute identifier", "object-id"); |
| 228 | + $textAttributeObjectAttribute = new Attribute("text-attribute-object-id", "Attribute object", "object-id"); |
| 229 | + $textAttributeAttribute = new Attribute("text-attribute", $wgTextAttributeAttributeName, $definedMeaningReferenceStructure); |
| 230 | + $textAttributeValuesStructure = new Structure("text-attribute-values", $textAttributeIdAttribute, $textAttributeObjectAttribute, $textAttributeAttribute, $textAttribute, $objectAttributesAttribute); |
| 231 | + $textAttributeValuesAttribute = new Attribute(null, $wgTextAttributeValuesAttributeName, $textAttributeValuesStructure); |
| 232 | + |
| 233 | + global |
| 234 | + $urlAttribute, $urlAttributeIdAttribute, $urlAttributeObjectAttribute, $urlAttributeAttribute, $urlAttributeValuesStructure, $urlAttributeValuesAttribute, |
| 235 | + $wgUrlAttributeValuesAttributeName, $wgUrlAttributeAttributeName; |
| 236 | + |
| 237 | + $urlAttribute = new Attribute("url", "URL", "url"); |
| 238 | + $urlAttributeIdAttribute = new Attribute("url-attribute-id", "Attribute identifier", "object-id"); |
| 239 | + $urlAttributeObjectAttribute = new Attribute("url-attribute-object-id", "Attribute object", "object-id"); |
| 240 | + $urlAttributeAttribute = new Attribute("url-attribute", $wgUrlAttributeAttributeName, $definedMeaningReferenceStructure); |
| 241 | + $urlAttributeValuesStructure = new Structure("url-attribute-values", $urlAttributeIdAttribute, $urlAttributeObjectAttribute, $urlAttributeAttribute, $urlAttribute, $objectAttributesAttribute); |
| 242 | + $urlAttributeValuesAttribute = new Attribute(null, $wgUrlAttributeValuesAttributeName, $urlAttributeValuesStructure); |
| 243 | + |
| 244 | + global |
| 245 | + $optionAttributeIdAttribute, $optionAttributeAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionAttribute, $optionAttributeValuesAttribute, |
| 246 | + $wgOptionAttributeAttributeName, $wgOptionAttributeOptionAttributeName, $wgOptionAttributeValuesAttributeName, $optionAttributeValuesStructure; |
| 247 | + |
| 248 | + $optionAttributeIdAttribute = new Attribute('option-attribute-id', 'Attribute identifier', 'object-id'); |
| 249 | + $optionAttributeObjectAttribute = new Attribute('option-attribute-object-id', 'Attribute object', 'object-id'); |
| 250 | + $optionAttributeAttribute = new Attribute('option-attribute', $wgOptionAttributeAttributeName, $definedMeaningReferenceType); |
| 251 | + $optionAttributeOptionAttribute = new Attribute('option-attribute-option', $wgOptionAttributeOptionAttributeName, $definedMeaningReferenceType); |
| 252 | + $optionAttributeValuesStructure = new Structure('option-attribute-values', $optionAttributeIdAttribute, $optionAttributeAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionAttribute, $objectAttributesAttribute); |
| 253 | + $optionAttributeValuesAttribute = new Attribute(null, $wgOptionAttributeValuesAttributeName, $optionAttributeValuesStructure); |
| 254 | + |
| 255 | + global |
| 256 | + $optionAttributeOptionIdAttribute, $optionAttributeOptionsAttribute, $wgOptionAttributeOptionsAttributeName; |
| 257 | + |
| 258 | + $optionAttributeOptionIdAttribute = new Attribute('option-attribute-option-id', 'Option identifier', 'object-id'); |
| 259 | + $optionAttributeOptionsStructure = new Structure('option-attribute-options', $optionAttributeOptionIdAttribute, $optionAttributeAttribute, $optionAttributeOptionAttribute, $languageAttribute); |
| 260 | + $optionAttributeOptionsAttribute = new Attribute(null, $wgOptionAttributeOptionsAttributeName, $optionAttributeOptionsStructure); |
| 261 | + |
| 262 | + global |
| 263 | + $definitionAttribute, $translatedTextAttribute, $classAttributesAttribute, |
| 264 | + $wgDefinitionAttributeName, $wgTranslatedTextAttributeName; |
| 265 | + |
| 266 | + if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes()) |
| 267 | + $translatedTextAttribute = new Attribute("translated-text", $wgTextAttributeName, "text"); |
| 268 | + else |
| 269 | + $translatedTextAttribute = new Attribute(null, $wgTranslatedTextAttributeName, $translatedTextStructure); |
| 270 | + |
| 271 | + $definitionAttribute = new Attribute(null, $wgDefinitionAttributeName, new Structure("definition", $translatedTextAttribute, $objectAttributesAttribute)); |
| 272 | + |
| 273 | + global |
| 274 | + $classAttributesStructure, |
| 275 | + // $classAttributeClassAttribute, |
| 276 | + $classAttributeIdAttribute, $classAttributeAttributeAttribute, $classAttributeLevelAttribute, $classAttributeTypeAttribute, |
| 277 | + $wgClassAttributeAttributeAttributeName, $wgClassAttributeLevelAttributeName, |
| 278 | + $wgClassAttributeTypeAttributeName, $wgClassAttributesAttributeName, $wgClassAttributesAttributeId; |
| 279 | + |
| 280 | + $classAttributeIdAttribute = new Attribute("class-attribute-id", "Class attribute identifier", "object-id"); |
| 281 | + $classAttributeAttributeAttribute = new Attribute("class-attribute-attribute", $wgClassAttributeAttributeAttributeName, $definedMeaningReferenceStructure); |
| 282 | + $classAttributeLevelAttribute = new Attribute("class-attribute-level", $wgClassAttributeLevelAttributeName, $definedMeaningReferenceStructure); |
| 283 | + $classAttributeTypeAttribute = new Attribute("class-attribute-type", $wgClassAttributeTypeAttributeName, "short-text"); |
| 284 | + $classAttributesStructure = new Structure("class-attributes", $classAttributeIdAttribute, $classAttributeAttributeAttribute, $classAttributeLevelAttribute, $classAttributeTypeAttribute, $optionAttributeOptionsAttribute); |
| 285 | + $classAttributesAttribute = new Attribute(null, $wgClassAttributesAttributeName, $classAttributesStructure); |
| 286 | + |
| 287 | + global |
| 288 | + $definedMeaningAttribute, $wgDefinedMeaningAttributeName; |
| 289 | + |
| 290 | + $definedMeaningAttribute = new Attribute(null, $wgDefinedMeaningAttributeName, |
| 291 | + new Structure( |
| 292 | + "defined-meaning", |
| 293 | + $definitionAttribute, |
| 294 | + $classAttributesAttribute, |
| 295 | + $alternativeDefinitionsAttribute, |
| 296 | + $synonymsAndTranslationsAttribute, |
| 297 | + $relationsAttribute, |
| 298 | + $reciprocalRelationsAttribute, |
| 299 | + $classMembershipAttribute, |
| 300 | + $collectionMembershipAttribute, |
| 301 | + $definedMeaningAttributesAttribute) |
| 302 | + ); |
| 303 | + |
| 304 | + global |
| 305 | + $expressionsAttribute, $expressionMeaningStructure, $expressionExactMeaningsAttribute, $expressionApproximateMeaningsAttribute, |
| 306 | + $wgExactMeaningsAttributeName, $wgApproximateMeaningsAttributeName; |
| 307 | + |
| 308 | + $expressionMeaningStructure = new Structure("expression-exact-meanings", $definedMeaningIdAttribute, $textAttribute, $definedMeaningAttribute); |
| 309 | + $expressionExactMeaningsAttribute = new Attribute(null, $wgExactMeaningsAttributeName, $expressionMeaningStructure); |
| 310 | + $expressionApproximateMeaningsAttribute = new Attribute("expression-approximate-meanings", $wgApproximateMeaningsAttributeName, $expressionMeaningStructure); |
| 311 | + |
| 312 | + global |
| 313 | + $expressionMeaningsAttribute, $expressionMeaningsStructure, $expressionApproximateMeaningAttribute, |
| 314 | + $wgExpressionMeaningsAttributeName, $wgExpressionsAttributeName, |
| 315 | + $expressionsStructure; |
| 316 | + |
| 317 | + $expressionMeaningsStructure = new Structure("expression-meanings", $expressionExactMeaningsAttribute, $expressionApproximateMeaningAttribute); |
| 318 | + $expressionMeaningsAttribute = new Attribute(null, $wgExpressionMeaningsAttributeName, $expressionMeaningsStructure); |
| 319 | + |
| 320 | + $expressionsStructure = new Structure("expressions", $expressionIdAttribute, $expressionAttribute, $expressionMeaningsAttribute); |
| 321 | + $expressionsAttribute = new Attribute(null, $wgExpressionsAttributeName, $expressionsStructure); |
| 322 | + |
| 323 | + global |
| 324 | + $objectIdAttribute, $objectAttributesStructure, $wgAnnotationAttributeName; |
| 325 | + |
| 326 | + $objectIdAttribute = new Attribute("object-id", "Object identifier", "object-id"); |
| 327 | + $objectAttributesStructure = new Structure("object-attributes", $objectIdAttribute, $textAttributeValuesAttribute, $translatedTextAttributeValuesAttribute, $optionAttributeValuesAttribute); |
| 328 | + $objectAttributesAttribute->setAttributeType($objectAttributesStructure); |
| 329 | + $definedMeaningAttributesAttribute->setAttributeType($objectAttributesStructure); |
| 330 | + |
| 331 | + global $wdDefinedMeaningAttributesOrder; |
| 332 | + |
| 333 | + /** |
| 334 | + * This global determines the order of the different |
| 335 | + * attributes in the user interface. |
| 336 | + */ |
| 337 | + $wdDefinedMeaningAttributesOrder=array( |
| 338 | + $definitionAttribute->id, |
| 339 | + $classAttributesAttribute->id, |
| 340 | + $alternativeDefinitionsAttribute->id, |
| 341 | + $synonymsAndTranslationsAttribute->id, |
| 342 | + $possiblySynonymousAttribute->id, |
| 343 | + $relationsAttribute->id, |
| 344 | + $reciprocalRelationsAttribute->id, |
| 345 | + $classMembershipAttribute->id, |
| 346 | + $collectionMembershipAttribute->id, |
| 347 | + $definedMeaningAttributesAttribute->id |
| 348 | + ); |
| 349 | + } |
| 350 | +} |
| 351 | + |
| 352 | + |