r24774 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24773‎ | r24774 | r24775 >
Date:08:01, 14 August 2007
Author:proes
Status:old
Tags:
Comment:
Some refactoring, more to come.
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Attribute.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Record.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialDatasearch.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/SpecialDatasearch.php
@@ -35,7 +35,9 @@
3636
3737 function SpecialDatasearch() {
3838 SpecialPage::SpecialPage('Datasearch');
39 -
 39+ }
 40+
 41+ function execute($parameter) {
4042 require_once("WikiDataGlobals.php");
4143 require_once("forms.php");
4244 require_once("type.php");
@@ -71,9 +73,7 @@
7274 $this->collectionAttribute,
7375 $this->collectionMemberAttribute
7476 );
75 - }
76 -
77 - function execute($parameter) {
 77+
7878 global
7979 $wgOut, $wgTitle;
8080
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php
@@ -123,16 +123,16 @@
124124 $wgRelationsAttributeId,
125125 $wgSynonymsAndTranslationsAttributeId;
126126
127 -$wgAlternativeDefinitionsAttributeId = "alternative-definitions";
128 -$wgClassAttributesAttributeId = "class-attributes";
129 -$wgClassMembershipAttributeId = "class-membership";
130 -$wgCollectionMembershipAttributeId = "collection-membership";
131 -$wgDefinedMeaningAttributesAttributeId = "defined-meaning-attributes";
 127+$wgAlternativeDefinitionsAttributeId = "alternativeDefinitions";
 128+$wgClassAttributesAttributeId = "classAttributes";
 129+$wgClassMembershipAttributeId = "classMembership";
 130+$wgCollectionMembershipAttributeId = "collectionMembership";
 131+$wgDefinedMeaningAttributesAttributeId = "definedMeaningAttributes";
132132 $wgDefinitionAttributeId = "definition";
133 -$wgIncomingRelationsAttributeId = "reciprocal-relations";
134 -$wgPossiblySynonymousAttributeId = "possibly-synonymous";
 133+$wgIncomingRelationsAttributeId = "reciprocalRelations";
 134+$wgPossiblySynonymousAttributeId = "possiblySynonymous";
135135 $wgRelationsAttributeId = "relations";
136 -$wgSynonymsAndTranslationsAttributeId = "synonyms-translations";
 136+$wgSynonymsAndTranslationsAttributeId = "synonymsTranslations";
137137
138138 // Defined meaning editor
139139
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php
@@ -31,12 +31,10 @@
3232 * -this is what RecordHelpers are for.
3333 */
3434 function initializeOmegaWikiAttributes(ViewInformation $viewInformation){
35 - $init_and_discard_this= OmegaWikiAttributes::getInstance($viewInformation);
36 -
3735 initializeOmegaWikiAttributesOld($viewInformation); //backward compatibility, will be removed!
 36+ $init_and_discard_this = OmegaWikiAttributes::getInstance($viewInformation);
3837 }
3938
40 -
4139 /**
4240 * Original initializeOmegaWikiAttributes, Do not call.
4341 * @deprecated use/update OmegaWikiAttributes->hardValues instead for now.
@@ -55,14 +53,14 @@
5654 $wgDefinedMeaningAttributesAttributeName,
5755 $wgDefinedMeaningAttributesAttributeName, $wgDefinedMeaningAttributesAttributeId, $wgAnnotationAttributeName;
5856
59 - $definedMeaningAttributesAttribute = new Attribute("defined-meaning-attributes", $wgDefinedMeaningAttributesAttributeName, "will-be-specified-below");
60 - $objectAttributesAttribute = new Attribute("object-attributes", $wgAnnotationAttributeName, "will-be-specified-below");
 57+ $definedMeaningAttributesAttribute = new Attribute("definedMeaningAttributes", $wgDefinedMeaningAttributesAttributeName, "will-be-specified-below");
 58+ $objectAttributesAttribute = new Attribute("objectAttributes", $wgAnnotationAttributeName, "will-be-specified-below");
6159
6260 global
6361 $expressionIdAttribute, $identicalMeaningAttribute, $wgIdenticalMeaningAttributeName;
6462
65 - $expressionIdAttribute = new Attribute("expression-id", "Expression Id", "expression-id");
66 - $identicalMeaningAttribute = new Attribute("indentical-meaning", $wgIdenticalMeaningAttributeName, "boolean");
 63+ $expressionIdAttribute = new Attribute("expressionId", "Expression Id", "expression-id");
 64+ $identicalMeaningAttribute = new Attribute("indenticalMeaning", $wgIdenticalMeaningAttributeName, "boolean");
6765
6866 global
6967 $expressionStructure, $expressionAttribute, $wgExpressionAttributeName;
@@ -79,26 +77,24 @@
8078 $definedMeaningCompleteDefiningExpressionStructure,
8179 $definedMeaningCompleteDefiningExpressionAttribute;
8280
83 - $definedMeaningIdAttribute = new Attribute("defined-meaning-id", "Defined meaning identifier", "defined-meaning-id");
84 - $definedMeaningDefiningExpressionAttribute = new Attribute("defined-meaning-defining-expression", "Defined meaning defining expression", "short-text");
 81+ $definedMeaningIdAttribute = new Attribute("definedMeaningId", "Defined meaning identifier", "defined-meaning-id");
 82+ $definedMeaningDefiningExpressionAttribute = new Attribute("definedMeaningDefiningExpression", "Defined meaning defining expression", "short-text");
8583
8684 $definedMeaningCompleteDefiningExpressionStructure =
87 - new Structure("defined-meaning-full-defining-expression",
 85+ new Structure("definedMeaningFullDefiningExpression",
8886 $definedMeaningDefiningExpressionAttribute,
8987 $expressionIdAttribute,
9088 $languageAttribute
91 - );
 89+ );
9290
9391 # ====== refactored up to this point, do not make changes above this line ====
94 - $definedMeaningCompleteDefiningExpressionAttribute=new Attribute(null, "Defining expression", $definedMeaningCompleteDefiningExpressionStructure);
 92+ $definedMeaningCompleteDefiningExpressionAttribute = new Attribute("definedMeaningCompleteDefiningExpression", "Defining expression", $definedMeaningCompleteDefiningExpressionStructure);
9593
96 -
97 -
9894 global
9995 $definedMeaningReferenceStructure, $definedMeaningLabelAttribute, $definedMeaningReferenceType,
10096 $definedMeaningReferenceAttribute, $wgDefinedMeaningReferenceAttributeName;
10197
102 - $definedMeaningLabelAttribute = new Attribute("defined-meaning-label", "Defined meaning label", "short-text");
 98+ $definedMeaningLabelAttribute = new Attribute("definedMeaningLabel", "Defined meaning label", "short-text");
10399 $definedMeaningReferenceStructure = new Structure("defined-meaning", $definedMeaningIdAttribute, $definedMeaningLabelAttribute, $definedMeaningDefiningExpressionAttribute);
104100
105101 $definedMeaningReferenceType = $definedMeaningReferenceStructure;
@@ -110,29 +106,29 @@
111107 $wgCollectionAttributeName, $wgSourceIdentifierAttributeName, $wgGotoSourceAttributeName;
112108
113109 $collectionIdAttribute = new Attribute("collection", "Collection", "collection-id");
114 - $collectionMeaningAttribute = new Attribute("collection-meaning", $wgCollectionAttributeName, $definedMeaningReferenceStructure);
115 - $sourceIdentifierAttribute = new Attribute("source-identifier", $wgSourceIdentifierAttributeName, "short-text");
 110+ $collectionMeaningAttribute = new Attribute("collectionMeaning", $wgCollectionAttributeName, $definedMeaningReferenceStructure);
 111+ $sourceIdentifierAttribute = new Attribute("sourceIdentifier", $wgSourceIdentifierAttributeName, "short-text");
116112 $gotoSourceStructure = new Structure("goto-source",$collectionIdAttribute, $sourceIdentifierAttribute);
117 - $gotoSourceAttribute = new Attribute(null, $wgGotoSourceAttributeName, $gotoSourceStructure);
 113+ $gotoSourceAttribute = new Attribute("gotoSource", $wgGotoSourceAttributeName, $gotoSourceStructure);
118114
119115 global
120116 $collectionMembershipAttribute, $wgCollectionMembershipAttributeName, $wgCollectionMembershipAttributeId,
121117 $collectionMembershipStructure;
122118
123 - $collectionMembershipStructure = new Structure("collection-membership",$collectionIdAttribute, $collectionMeaningAttribute, $sourceIdentifierAttribute);
124 - $collectionMembershipAttribute = new Attribute(null, $wgCollectionMembershipAttributeName, $collectionMembershipStructure);
 119+ $collectionMembershipStructure = new Structure("collection-membership",$collectionIdAttribute, $collectionMeaningAttribute, $sourceIdentifierAttribute, $gotoSourceAttribute);
 120+ $collectionMembershipAttribute = new Attribute("collectionMembership", $wgCollectionMembershipAttributeName, $collectionMembershipStructure);
125121
126122 global
127123 $classMembershipIdAttribute, $classAttribute;
128124
129 - $classMembershipIdAttribute = new Attribute("class-membership-id", "Class membership id", "integer");
 125+ $classMembershipIdAttribute = new Attribute("classMembershipId", "Class membership id", "integer");
130126 $classAttribute = new Attribute("class", "Class", $definedMeaningReferenceStructure);
131127
132128 global
133129 $classMembershipStructure, $classMembershipKeyStructure, $classMembershipAttribute,
134130 $wgClassMembershipAttributeName, $wgClassMembershipAttributeId;
135131
136 - $classMembershipStructure = new Structure("class-membership", $classMembershipIdAttribute, $classAttribute);
 132+ $classMembershipStructure = new Structure("classMembership", $classMembershipIdAttribute, $classAttribute);
137133 $classMembershipAttribute = new Attribute(null, $wgClassMembershipAttributeName, $classMembershipStructure);
138134
139135 global
@@ -141,18 +137,18 @@
142138 $wgPossibleSynonymAttributeName, $possiblySynonymousStructure, $possiblySynonymousAttribute,
143139 $wgPossiblySynonymousAttributeName, $wgPossiblySynonymousAttributeId;
144140
145 - $possiblySynonymousIdAttribute = new Attribute("possibly-synonymous-id", "Possibly synonymous id", "integer");
146 - $possibleSynonymAttribute = new Attribute("possible-synonym", $wgPossibleSynonymAttributeName, $definedMeaningReferenceStructure);
147 - $possiblySynonymousStructure = new Structure("possibly-synonymous", $possiblySynonymousIdAttribute, $possiblySynonymousAttribute);
148 - $possiblySynonymousAttribute = new Attribute(null, $wgPossiblySynonymousAttributeName, $possiblySynonymousStructure);
 141+ $possiblySynonymousIdAttribute = new Attribute("possiblySynonymousId", "Possibly synonymous id", "integer");
 142+ $possibleSynonymAttribute = new Attribute("possibleSynonym", $wgPossibleSynonymAttributeName, $definedMeaningReferenceStructure);
 143+ $possiblySynonymousStructure = new Structure("possibly-synonymous", $possiblySynonymousIdAttribute, $possibleSynonymAttribute);
 144+ $possiblySynonymousAttribute = new Attribute("possiblySynonymous", $wgPossiblySynonymousAttributeName, $possiblySynonymousStructure);
149145
150146 global
151147 $relationIdAttribute, $relationTypeAttribute, $relationTypeType, $otherDefinedMeaningAttribute,
152148 $wgRelationTypeAttributeName, $wgOtherDefinedMeaningAttributeName;
153149
154 - $relationIdAttribute = new Attribute("relation-id", "Relation identifier", "object-id");
155 - $relationTypeAttribute = new Attribute("relation-type", $wgRelationTypeAttributeName, $definedMeaningReferenceStructure);
156 - $otherDefinedMeaningAttribute = new Attribute("other-defined-meaning", $wgOtherDefinedMeaningAttributeName, $definedMeaningReferenceType);
 150+ $relationIdAttribute = new Attribute("relationId", "Relation identifier", "object-id");
 151+ $relationTypeAttribute = new Attribute("relationType", $wgRelationTypeAttributeName, $definedMeaningReferenceStructure);
 152+ $otherDefinedMeaningAttribute = new Attribute("otherDefinedMeaning", $wgOtherDefinedMeaningAttributeName, $definedMeaningReferenceType);
157153
158154 global
159155 $relationsAttribute, $relationStructure, $reciprocalRelationsAttribute, $objectAttributesAttribute, $wgRelationsAttributeName, $wgIncomingRelationsAttributeName, $wgRelationsAttributeId, $wgIncomingRelationsAttributeId,
@@ -160,34 +156,33 @@
161157
162158 $relationStructure = new Structure("relations", $relationIdAttribute, $relationTypeAttribute, $otherDefinedMeaningAttribute, $objectAttributesAttribute);
163159 $relationsAttribute = new Attribute(null, $wgRelationsAttributeName, $relationStructure);
164 - $reciprocalRelationsAttribute = new Attribute("reciprocal-relations", $wgIncomingRelationsAttributeName, $relationStructure);
 160+ $reciprocalRelationsAttribute = new Attribute("reciprocalRelations", $wgIncomingRelationsAttributeName, $relationStructure);
165161
166162 global
167163 $translatedTextIdAttribute, $translatedTextStructure;
168164
169 - $translatedTextIdAttribute = new Attribute("translated-text-id", "Translated text ID", "integer");
 165+ $translatedTextIdAttribute = new Attribute("translatedTextId", "Translated text ID", "integer");
170166 $translatedTextStructure = new Structure("translated-text", $languageAttribute, $textAttribute);
171167
172168 global
173169 $definitionIdAttribute, $alternativeDefinitionAttribute, $sourceAttribute,
174170 $wgAlternativeDefinitionAttributeName, $wgSourceAttributeName;
175171
176 - $definitionIdAttribute = new Attribute("definition-id", "Definition identifier", "integer");
 172+ $definitionIdAttribute = new Attribute("definitionId", "Definition identifier", "integer");
177173
178174 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
179 - $alternativeDefinitionAttribute = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, "text");
 175+ $alternativeDefinitionAttribute = new Attribute("alternativeDefinition", $wgAlternativeDefinitionAttributeName, "text");
180176 else
181 - $alternativeDefinitionAttribute = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, $translatedTextStructure);
 177+ $alternativeDefinitionAttribute = new Attribute("alternativeDefinition", $wgAlternativeDefinitionAttributeName, $translatedTextStructure);
182178
183 - $sourceAttribute = new Attribute("source-id", $wgSourceAttributeName, $definedMeaningReferenceType);
 179+ $sourceAttribute = new Attribute("sourceId", $wgSourceAttributeName, $definedMeaningReferenceType);
184180
185181 global
186182 $alternativeDefinitionsAttribute, $wgAlternativeDefinitionsAttributeName, $wgAlternativeDefinitionsAttributeId,
187183 $alternativeDefinitionsStructure;
188184
189185 $alternativeDefinitionsStructure = new Structure("alternative-definitions", $definitionIdAttribute, $alternativeDefinitionAttribute, $sourceAttribute);
190 -
191 - $alternativeDefinitionsAttribute = new Attribute(null, $wgAlternativeDefinitionsAttributeName, $alternativeDefinitionsStructure);
 186+ $alternativeDefinitionsAttribute = new Attribute("alternativeDefinitions", $wgAlternativeDefinitionsAttributeName, $alternativeDefinitionsStructure);
192187
193188 global
194189 $synonymsAndTranslationsAttribute, $syntransIdAttribute,
@@ -199,23 +194,23 @@
200195 else
201196 $synonymsAndTranslationsCaption = $wgSynonymsAndTranslationsAttributeName;
202197
203 - $syntransIdAttribute = new Attribute("syntrans-id", "$synonymsAndTranslationsCaption identifier", "integer");
 198+ $syntransIdAttribute = new Attribute("syntransId", "$synonymsAndTranslationsCaption identifier", "integer");
204199 $synonymsTranslationsStructure = new Structure("synonyms-translations", $syntransIdAttribute, $expressionAttribute, $identicalMeaningAttribute, $objectAttributesAttribute);
205 - $synonymsAndTranslationsAttribute = new Attribute(null, "$synonymsAndTranslationsCaption", $synonymsTranslationsStructure);
 200+ $synonymsAndTranslationsAttribute = new Attribute("synonymsAndTranslations", "$synonymsAndTranslationsCaption", $synonymsTranslationsStructure);
206201
207202 global
208203 $attributeObjectAttribute;
209204
210 - $attributeObjectAttribute = new Attribute("attribute-object-id", "Attribute object", "object-id");
 205+ $attributeObjectAttribute = new Attribute("attributeObject", "Attribute object", "object-id");
211206
212207 global
213208 $translatedTextAttributeIdAttribute, $translatedTextValueIdAttribute,
214209 $translatedTextAttributeAttribute, $translatedTextValueAttribute, $translatedTextAttributeValuesAttribute,
215210 $translatedTextAttributeValuesStructure, $wgTranslatedTextAttributeValuesAttributeName, $wgTranslatedTextAttributeAttributeName, $wgTranslatedTextAttributeValueAttributeName;
216211
217 - $translatedTextAttributeIdAttribute = new Attribute("translated-text-attribute-id", "Attribute identifier", "object-id");
218 - $translatedTextAttributeAttribute = new Attribute("translated-text-attribute", $wgTranslatedTextAttributeAttributeName, $definedMeaningReferenceType);
219 - $translatedTextValueIdAttribute = new Attribute("translated-text-value-id", "Translated text value identifier", "translated-text-value-id");
 212+ $translatedTextAttributeIdAttribute = new Attribute("translatedTextAttributeId", "Attribute identifier", "object-id");
 213+ $translatedTextAttributeAttribute = new Attribute("translatedTextAttribute", $wgTranslatedTextAttributeAttributeName, $definedMeaningReferenceType);
 214+ $translatedTextValueIdAttribute = new Attribute("translatedTextValueId", "Translated text value identifier", "translated-text-value-id");
220215
221216 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
222217 $translatedTextValueAttribute = new Attribute("translated-text-value", $wgTranslatedTextAttributeValueAttributeName, "text");
@@ -223,62 +218,62 @@
224219 $translatedTextValueAttribute = new Attribute("translated-text", $wgTranslatedTextAttributeValueAttributeName, $translatedTextStructure);
225220
226221 $translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$translatedTextAttributeIdAttribute, $attributeObjectAttribute, $translatedTextAttributeAttribute, $translatedTextValueIdAttribute, $translatedTextValueAttribute, $objectAttributesAttribute);
227 - $translatedTextAttributeValuesAttribute = new Attribute(null, $wgTranslatedTextAttributeValuesAttributeName, $translatedTextAttributeValuesStructure);
 222+ $translatedTextAttributeValuesAttribute = new Attribute("translatedTextAttributeValues", $wgTranslatedTextAttributeValuesAttributeName, $translatedTextAttributeValuesStructure);
228223
229224 global
230225 $textAttributeIdAttribute, $textAttributeObjectAttribute, $textAttributeAttribute, $textAttributeValuesStructure,
231226 $textAttributeValuesAttribute,
232227 $wgTextAttributeValuesAttributeName, $wgTextAttributeAttributeName;
233228
234 - $textAttributeIdAttribute = new Attribute("text-attribute-id", "Attribute identifier", "object-id");
235 - $textAttributeObjectAttribute = new Attribute("text-attribute-object-id", "Attribute object", "object-id");
236 - $textAttributeAttribute = new Attribute("text-attribute", $wgTextAttributeAttributeName, $definedMeaningReferenceStructure);
 229+ $textAttributeIdAttribute = new Attribute("textAttributeId", "Attribute identifier", "object-id");
 230+ $textAttributeObjectAttribute = new Attribute("textAttributeObject", "Attribute object", "object-id");
 231+ $textAttributeAttribute = new Attribute("textAttribute", $wgTextAttributeAttributeName, $definedMeaningReferenceStructure);
237232 $textAttributeValuesStructure = new Structure("text-attribute-values", $textAttributeIdAttribute, $textAttributeObjectAttribute, $textAttributeAttribute, $textAttribute, $objectAttributesAttribute);
238 - $textAttributeValuesAttribute = new Attribute(null, $wgTextAttributeValuesAttributeName, $textAttributeValuesStructure);
 233+ $textAttributeValuesAttribute = new Attribute("textAttributeValues", $wgTextAttributeValuesAttributeName, $textAttributeValuesStructure);
239234
240235 global
241236 $linkAttributeIdAttribute, $linkAttributeObjectAttribute, $linkAttributeAttribute, $linkAttributeValuesStructure, $linkAttributeValuesAttribute,
242237 $wgLinkAttributeValuesAttributeName, $wgLinkAttributeAttributeName,
243238 $linkAttribute, $linkLabelAttribute, $linkURLAttribute;
244239
245 - $linkLabelAttribute = new Attribute("label", "Label", "short-text");
246 - $linkURLAttribute = new Attribute("url", "URL", "url");
 240+ $linkLabelAttribute = new Attribute("linkLabel", "Label", "short-text");
 241+ $linkURLAttribute = new Attribute("linkURL", "URL", "url");
247242 $linkAttribute = new Attribute("link", "Link", new Structure($linkLabelAttribute, $linkURLAttribute));
248243
249 - $linkAttributeIdAttribute = new Attribute("link-attribute-id", "Attribute identifier", "object-id");
250 - $linkAttributeObjectAttribute = new Attribute("link-attribute-object-id", "Attribute object", "object-id");
251 - $linkAttributeAttribute = new Attribute("link-attribute", $wgLinkAttributeAttributeName, $definedMeaningReferenceStructure);
 244+ $linkAttributeIdAttribute = new Attribute("linkAttributeId", "Attribute identifier", "object-id");
 245+ $linkAttributeObjectAttribute = new Attribute("linkAttributeObject", "Attribute object", "object-id");
 246+ $linkAttributeAttribute = new Attribute("linkAttribute", $wgLinkAttributeAttributeName, $definedMeaningReferenceStructure);
252247 $linkAttributeValuesStructure = new Structure("link-attribute-values", $linkAttributeIdAttribute, $linkAttributeObjectAttribute, $linkAttributeAttribute, $linkAttribute, $objectAttributesAttribute);
253 - $linkAttributeValuesAttribute = new Attribute(null, $wgLinkAttributeValuesAttributeName, $linkAttributeValuesStructure);
 248+ $linkAttributeValuesAttribute = new Attribute("linkAttributeValues", $wgLinkAttributeValuesAttributeName, $linkAttributeValuesStructure);
254249
255250 global
256251 $optionAttributeIdAttribute, $optionAttributeAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionAttribute, $optionAttributeValuesAttribute,
257252 $wgOptionAttributeAttributeName, $wgOptionAttributeOptionAttributeName, $wgOptionAttributeValuesAttributeName, $optionAttributeValuesStructure;
258253
259 - $optionAttributeIdAttribute = new Attribute('option-attribute-id', 'Attribute identifier', 'object-id');
260 - $optionAttributeObjectAttribute = new Attribute('option-attribute-object-id', 'Attribute object', 'object-id');
261 - $optionAttributeAttribute = new Attribute('option-attribute', $wgOptionAttributeAttributeName, $definedMeaningReferenceType);
262 - $optionAttributeOptionAttribute = new Attribute('option-attribute-option', $wgOptionAttributeOptionAttributeName, $definedMeaningReferenceType);
 254+ $optionAttributeIdAttribute = new Attribute("optionAttributeId", "Attribute identifier", "object-id");
 255+ $optionAttributeObjectAttribute = new Attribute("optionAttributeObject", "Attribute object", "object-id");
 256+ $optionAttributeAttribute = new Attribute("optionAttribute", $wgOptionAttributeAttributeName, $definedMeaningReferenceType);
 257+ $optionAttributeOptionAttribute = new Attribute("optionAttributeOption", $wgOptionAttributeOptionAttributeName, $definedMeaningReferenceType);
263258 $optionAttributeValuesStructure = new Structure('option-attribute-values', $optionAttributeIdAttribute, $optionAttributeAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionAttribute, $objectAttributesAttribute);
264 - $optionAttributeValuesAttribute = new Attribute(null, $wgOptionAttributeValuesAttributeName, $optionAttributeValuesStructure);
 259+ $optionAttributeValuesAttribute = new Attribute("optionAttributeValues", $wgOptionAttributeValuesAttributeName, $optionAttributeValuesStructure);
265260
266261 global
267262 $optionAttributeOptionIdAttribute, $optionAttributeOptionsAttribute, $wgOptionAttributeOptionsAttributeName;
268263
269 - $optionAttributeOptionIdAttribute = new Attribute('option-attribute-option-id', 'Option identifier', 'object-id');
270 - $optionAttributeOptionsStructure = new Structure('option-attribute-options', $optionAttributeOptionIdAttribute, $optionAttributeAttribute, $optionAttributeOptionAttribute, $languageAttribute);
271 - $optionAttributeOptionsAttribute = new Attribute(null, $wgOptionAttributeOptionsAttributeName, $optionAttributeOptionsStructure);
 264+ $optionAttributeOptionIdAttribute = new Attribute("optionAttributeOptionId", "Option identifier", "object-id");
 265+ $optionAttributeOptionsStructure = new Structure("option-attribute-options", $optionAttributeOptionIdAttribute, $optionAttributeAttribute, $optionAttributeOptionAttribute, $languageAttribute);
 266+ $optionAttributeOptionsAttribute = new Attribute("optionAttributeOptions", $wgOptionAttributeOptionsAttributeName, $optionAttributeOptionsStructure);
272267
273268 global
274269 $definitionAttribute, $translatedTextAttribute, $classAttributesAttribute,
275270 $wgDefinitionAttributeName, $wgTranslatedTextAttributeName;
276271
277272 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
278 - $translatedTextAttribute = new Attribute("translated-text", $wgTextAttributeName, "text");
 273+ $translatedTextAttribute = new Attribute("translatedText", $wgTextAttributeName, "text");
279274 else
280 - $translatedTextAttribute = new Attribute(null, $wgTranslatedTextAttributeName, $translatedTextStructure);
 275+ $translatedTextAttribute = new Attribute("translatedText", $wgTranslatedTextAttributeName, $translatedTextStructure);
281276
282 - $definitionAttribute = new Attribute(null, $wgDefinitionAttributeName, new Structure("definition", $translatedTextAttribute, $objectAttributesAttribute));
 277+ $definitionAttribute = new Attribute("definition", $wgDefinitionAttributeName, new Structure("definition", $translatedTextAttribute, $objectAttributesAttribute));
283278
284279 global
285280 $classAttributesStructure,
@@ -287,19 +282,20 @@
288283 $wgClassAttributeAttributeAttributeName, $wgClassAttributeLevelAttributeName,
289284 $wgClassAttributeTypeAttributeName, $wgClassAttributesAttributeName, $wgClassAttributesAttributeId;
290285
291 - $classAttributeIdAttribute = new Attribute("class-attribute-id", "Class attribute identifier", "object-id");
292 - $classAttributeAttributeAttribute = new Attribute("class-attribute-attribute", $wgClassAttributeAttributeAttributeName, $definedMeaningReferenceStructure);
293 - $classAttributeLevelAttribute = new Attribute("class-attribute-level", $wgClassAttributeLevelAttributeName, $definedMeaningReferenceStructure);
294 - $classAttributeTypeAttribute = new Attribute("class-attribute-type", $wgClassAttributeTypeAttributeName, "short-text");
 286+ $classAttributeIdAttribute = new Attribute("classAttributeId", "Class attribute identifier", "object-id");
 287+ $classAttributeAttributeAttribute = new Attribute("classAttributeAttribute", $wgClassAttributeAttributeAttributeName, $definedMeaningReferenceStructure);
 288+ $classAttributeLevelAttribute = new Attribute("classAttributeLevel", $wgClassAttributeLevelAttributeName, $definedMeaningReferenceStructure);
 289+ $classAttributeTypeAttribute = new Attribute("classAttributeType", $wgClassAttributeTypeAttributeName, "short-text");
295290 $classAttributesStructure = new Structure("class-attributes", $classAttributeIdAttribute, $classAttributeAttributeAttribute, $classAttributeLevelAttribute, $classAttributeTypeAttribute, $optionAttributeOptionsAttribute);
296 - $classAttributesAttribute = new Attribute(null, $wgClassAttributesAttributeName, $classAttributesStructure);
 291+ $classAttributesAttribute = new Attribute("classAttributes", $wgClassAttributesAttributeName, $classAttributesStructure);
297292
298293 global
299294 $definedMeaningAttribute, $wgDefinedMeaningAttributeName;
300295
301 - $definedMeaningAttribute = new Attribute(null, $wgDefinedMeaningAttributeName,
 296+ $definedMeaningAttribute = new Attribute("definedMeaning", $wgDefinedMeaningAttributeName,
302297 new Structure(
303298 "defined-meaning",
 299+ $definedMeaningCompleteDefiningExpressionAttribute,
304300 $definitionAttribute,
305301 $classAttributesAttribute,
306302 $alternativeDefinitionsAttribute,
@@ -308,7 +304,8 @@
309305 $reciprocalRelationsAttribute,
310306 $classMembershipAttribute,
311307 $collectionMembershipAttribute,
312 - $definedMeaningAttributesAttribute)
 308+ $definedMeaningAttributesAttribute
 309+ )
313310 );
314311
315312 global
@@ -316,25 +313,25 @@
317314 $wgExactMeaningsAttributeName, $wgApproximateMeaningsAttributeName;
318315
319316 $expressionMeaningStructure = new Structure("expression-exact-meanings", $definedMeaningIdAttribute, $textAttribute, $definedMeaningAttribute);
320 - $expressionExactMeaningsAttribute = new Attribute(null, $wgExactMeaningsAttributeName, $expressionMeaningStructure);
321 - $expressionApproximateMeaningsAttribute = new Attribute("expression-approximate-meanings", $wgApproximateMeaningsAttributeName, $expressionMeaningStructure);
 317+ $expressionExactMeaningsAttribute = new Attribute("expressionExactMeanings", $wgExactMeaningsAttributeName, $expressionMeaningStructure);
 318+ $expressionApproximateMeaningsAttribute = new Attribute("expressionApproximateMeanings", $wgApproximateMeaningsAttributeName, $expressionMeaningStructure);
322319
323320 global
324 - $expressionMeaningsAttribute, $expressionMeaningsStructure, $expressionApproximateMeaningAttribute,
 321+ $expressionMeaningsAttribute, $expressionMeaningsStructure,
325322 $wgExpressionMeaningsAttributeName, $wgExpressionsAttributeName,
326323 $expressionsStructure;
327324
328 - $expressionMeaningsStructure = new Structure("expression-meanings", $expressionExactMeaningsAttribute, $expressionApproximateMeaningAttribute);
329 - $expressionMeaningsAttribute = new Attribute(null, $wgExpressionMeaningsAttributeName, $expressionMeaningsStructure);
 325+ $expressionMeaningsStructure = new Structure("expression-meanings", $expressionExactMeaningsAttribute, $expressionApproximateMeaningsAttribute);
 326+ $expressionMeaningsAttribute = new Attribute("expressionMeanings", $wgExpressionMeaningsAttributeName, $expressionMeaningsStructure);
330327
331328 $expressionsStructure = new Structure("expressions", $expressionIdAttribute, $expressionAttribute, $expressionMeaningsAttribute);
332 - $expressionsAttribute = new Attribute(null, $wgExpressionsAttributeName, $expressionsStructure);
 329+ $expressionsAttribute = new Attribute("expressions", $wgExpressionsAttributeName, $expressionsStructure);
333330
334331 global
335332 $objectIdAttribute, $objectAttributesStructure, $wgAnnotationAttributeName;
336333
337 - $objectIdAttribute = new Attribute("object-id", "Object identifier", "object-id");
338 - $objectAttributesStructure = new Structure("object-attributes", $objectIdAttribute, $textAttributeValuesAttribute, $translatedTextAttributeValuesAttribute, $optionAttributeValuesAttribute);
 334+ $objectIdAttribute = new Attribute("objectId", "Object identifier", "object-id");
 335+ $objectAttributesStructure = new Structure("object-attributes", $objectIdAttribute, $textAttributeValuesAttribute, $translatedTextAttributeValuesAttribute, $linkAttributeValuesAttribute, $optionAttributeValuesAttribute);
339336 $objectAttributesAttribute->setAttributeType($objectAttributesStructure);
340337 $definedMeaningAttributesAttribute->setAttributeType($objectAttributesStructure);
341338
@@ -342,14 +339,20 @@
343340 $definitionAttribute,
344341 $synonymsAndTranslationsAttribute,
345342 $relationsAttribute,
346 - $reciprocalRelationsAttribute
 343+ $reciprocalRelationsAttribute,
 344+ $objectAttributesAttribute,
 345+ $textAttributeValuesAttribute,
 346+ $linkAttributeValuesAttribute,
 347+ $translatedTextAttributeValuesAttribute,
 348+ $optionAttributeValuesAttribute,
 349+ $definedMeaningAttribute
347350 );
348351
349352 foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter) {
350353 $attribute = $propertyToColumnFilter->getAttribute();
351354 $attribute->setAttributeType($objectAttributesStructure);
352355
353 - foreach ($annotatedAttributes as $annotatedAttribute)
 356+ foreach ($annotatedAttributes as $annotatedAttribute)
354357 $annotatedAttribute->type->addAttribute($attribute);
355358 }
356359
@@ -389,16 +392,16 @@
390393 $t->language = new Attribute("language", wfMsg("Language"), "language");
391394 $t->spelling = new Attribute("spelling", wfMsg("Spelling"), "spelling");
392395 $t->text = new Attribute("text", wfMsg("Text"), "text");
393 - $t->definedMeaningAttributes = new Attribute("defined-meaning-attributes", wfMsg("DefinedMeaningAttributes"), "will-be-specified-below");
394 - $t->objectAttributes = new Attribute("object-attributes", wfMsg("Annotation"), "will-be-specified-below");
395 - $t->expressionId = new Attribute("expression-id", "Expression Id", "expression-id");
396 - $t->identicalMeaning = new Attribute("indentical-meaning", wfMsg("IdenticalMeaning"), "boolean");
 396+ $t->definedMeaningAttributes = new Attribute("definedMeaningAttributes", wfMsg("DefinedMeaningAttributes"), "will-be-specified-below");
 397+ $t->objectAttributes = new Attribute("objectAttributes", wfMsg("Annotation"), "will-be-specified-below");
 398+ $t->expressionId = new Attribute("expressionId", "Expression Id", "expression-id");
 399+ $t->identicalMeaning = new Attribute("indenticalMeaning", wfMsg("IdenticalMeaning"), "boolean");
397400
398401 if ($viewInformation->filterOnLanguage())
399402 $t->expression = new Attribute("expression", wfMsg("Spelling"), "spelling");
400403 else {
401404 $t->expressionStructure = new Structure("expression", $t->language, $t->spelling);
402 - $t->expression = new Attribute(null, wfMsg("Expression"), $t->expressionStructure);
 405+ $t->expression = new Attribute("expression", wfMsg("Expression"), $t->expressionStructure);
403406 }
404407
405408 $t->definedMeaningId = new Attribute("defined-meaning-id", "Defined meaning identifier", "defined-meaning-id");
@@ -411,67 +414,66 @@
412415 );
413416 #try this
414417 $t->definedMeaningCompleteDefiningExpressionStructure->setStructureType("expression");
415 - $t->definedMeaningCompleteDefiningExpression=new Attribute(null, "Defining expression", $t->definedMeaningCompleteDefiningExpressionStructure);
 418+ $t->definedMeaningCompleteDefiningExpression =new Attribute("definedMeaningCompleteDefiningExpression", "Defining expression", $t->definedMeaningCompleteDefiningExpressionStructure);
416419 global
417420 $definedMeaningReferenceType;
418421
419422 $t->definedMeaningLabel = new Attribute("defined-meaning-label", "Defined meaning label", "short-text");
420423 $t->definedMeaningReferenceStructure = new Structure("defined-meaning", $t->definedMeaningId, $t->definedMeaningLabel, $t->definedMeaningDefiningExpression);
421424 $definedMeaningReferenceType = $t->definedMeaningReferenceStructure;
422 - $t->definedMeaningReference = new Attribute(null, wfMsg("DefinedMeaningReference"), $definedMeaningReferenceType);
423 - $t->collectionId = new Attribute("collection", "Collection", "collection-id");
424 - $t->collectionMeaning = new Attribute("collection-meaning", wfMsg("Collection"), $t->definedMeaningReferenceStructure);
425 - $t->sourceIdentifier = new Attribute("source-identifier", wfMsg("SourceIdentifier"), "short-text");
 425+ $t->definedMeaningReference = new Attribute("definedMeaningReference", wfMsg("DefinedMeaningReference"), $definedMeaningReferenceType);
 426+ $t->collectionId = new Attribute("collectionId", "Collection", "collection-id");
 427+ $t->collectionMeaning = new Attribute("collectionMeaning", wfMsg("Collection"), $t->definedMeaningReferenceStructure);
 428+ $t->sourceIdentifier = new Attribute("sourceIdentifier", wfMsg("SourceIdentifier"), "short-text");
426429 $t->gotoSourceStructure = new Structure("goto-source",$t->collectionId, $t->sourceIdentifier);
427 - $t->gotoSource = new Attribute(null, wfMsg("GotoSource"), $t->gotoSourceStructure);
 430+ $t->gotoSource = new Attribute("gotoSource", wfMsg("GotoSource"), $t->gotoSourceStructure);
428431 $t->collectionMembershipStructure = new Structure("collection-membership",$t->collectionId, $t->collectionMeaning, $t->sourceIdentifier);
429 - $t->collectionMembership = new Attribute(null, wfMsg("CollectionMembership"), $t->collectionMembershipStructure);
430 - $t->classMembershipId = new Attribute("class-membership-id", "Class membership id", "integer");
 432+ $t->collectionMembership = new Attribute("collectionMembership", wfMsg("CollectionMembership"), $t->collectionMembershipStructure);
 433+ $t->classMembershipId = new Attribute("classMembershipId", "Class membership id", "integer");
431434 $t->class = new Attribute("class", "Class", $t->definedMeaningReferenceStructure);
432435 $t->classMembershipStructure = new Structure("class-membership", $t->classMembershipId, $t->class);
433 - $t->classMembership = new Attribute(null, wfMsg("ClassMembership"), $t->classMembershipStructure);
 436+ $t->classMembership = new Attribute("classMembership", wfMsg("ClassMembership"), $t->classMembershipStructure);
434437
435438 global
436439 $wgPossiblySynonymousAttributeId;
437440
438 - $t->possiblySynonymousId = new Attribute("possibly-synonymous-id", "Possibly synonymous id", "integer");
439 - $t->possibleSynonym = new Attribute("possible-synonym", wfMsg("PossibleSynonym"), $t->definedMeaningReferenceStructure);
 441+ $t->possiblySynonymousId = new Attribute("possiblySynonymousId", "Possibly synonymous id", "integer");
 442+ $t->possibleSynonym = new Attribute("possibleSynonym", wfMsg("PossibleSynonym"), $t->definedMeaningReferenceStructure);
440443 # Bug found ... This never worked before: (!)
441444 #$t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possiblySynonymous);
442445 $t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possibleSynonym);
443 - $t->possiblySynonymous = new Attribute(null, wfMsg("PossiblySynonymous"), $t->possiblySynonymousStructure);
 446+ $t->possiblySynonymous = new Attribute("possiblySynonymous", wfMsg("PossiblySynonymous"), $t->possiblySynonymousStructure);
444447
445448 global
446449 $relationTypeType;
447450
448 - $t->relationId = new Attribute("relation-id", "Relation identifier", "object-id");
449 - $t->relationType = new Attribute("relation-type", wfMsg("RelationType"), $t->definedMeaningReferenceStructure);
450 - $t->otherDefinedMeaning = new Attribute("other-defined-meaning", wfMsg("OtherDefinedMeaning"), $definedMeaningReferenceType);
 451+ $t->relationId = new Attribute("relationId", "Relation identifier", "object-id");
 452+ $t->relationType = new Attribute("relationType", wfMsg("RelationType"), $t->definedMeaningReferenceStructure);
 453+ $t->otherDefinedMeaning = new Attribute("otherDefinedMeaning", wfMsg("OtherDefinedMeaning"), $definedMeaningReferenceType);
451454
452455 global
453456 $wgRelationsAttributeId, $wgIncomingRelationsAttributeId ;
454457
455458 $t->relationStructure = new Structure("relations", $t->relationId, $t->relationType, $t->otherDefinedMeaning, $t->objectAttributes);
456 - $t->relations = new Attribute(null, wfMsg("Relations"), $t->relationStructure);
457 - $t->reciprocalRelations = new Attribute("reciprocal-relations", wfMsg("IncomingRelations"), $t->relationStructure);
458 - $t->translatedTextId = new Attribute("translated-text-id", "Translated text ID", "integer");
 459+ $t->relations = new Attribute("relations", wfMsg("Relations"), $t->relationStructure);
 460+ $t->reciprocalRelations = new Attribute("reciprocalRelations", wfMsg("IncomingRelations"), $t->relationStructure);
 461+ $t->translatedTextId = new Attribute("translatedTextId", "Translated text ID", "integer");
459462 $t->translatedTextStructure = new Structure("translated-text", $t->language, $t->text);
460463
461 - $t->definitionId = new Attribute("definition-id", "Definition identifier", "integer");
 464+ $t->definitionId = new Attribute("definitionId", "Definition identifier", "integer");
462465
463466 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
464 - $t->alternativeDefinition = new Attribute("alternative-definition", wfMsg("AlternativeDefinition"), "text");
 467+ $t->alternativeDefinition = new Attribute("alternativeDefinition", wfMsg("AlternativeDefinition"), "text");
465468 else
466 - $t->alternativeDefinition = new Attribute("alternative-definition", wfMsg("AlternativeDefinition"), $t->translatedTextStructure);
 469+ $t->alternativeDefinition = new Attribute("alternativeDefinition", wfMsg("AlternativeDefinition"), $t->translatedTextStructure);
467470
468 - $t->source = new Attribute("source-id", wfMsg("Source"), $definedMeaningReferenceType);
 471+ $t->source = new Attribute("sourceId", wfMsg("Source"), $definedMeaningReferenceType);
469472
470473 global
471474 $wgAlternativeDefinitionsAttributeId;
472475
473476 $t->alternativeDefinitionsStructure = new Structure("alternative-definitions", $t->definitionId, $t->alternativeDefinition, $t->source);
474 -
475 - $t->alternativeDefinitions = new Attribute(null, wfMsg("AlternativeDefinitions"), $t->alternativeDefinitionsStructure);
 477+ $t->alternativeDefinitions = new Attribute("alternativeDefinitions", wfMsg("AlternativeDefinitions"), $t->alternativeDefinitionsStructure);
476478
477479 global
478480 $wgSynonymsAndTranslationsAttributeId;
@@ -481,66 +483,67 @@
482484 else
483485 $synonymsAndTranslationsCaption = wfMsg("SynonymsAndTranslations");
484486
485 - $t->attributeObjectId = new Attribute("attributeObjectId", "Attribute object", "object-id");
 487+ $t->attributeObject = new Attribute("attributeObject", "Attribute object", "object-id");
486488
487 - $t->syntransId = new Attribute("syntrans-id", "$synonymsAndTranslationsCaption identifier", "integer");
 489+ $t->syntransId = new Attribute("syntransId", "$synonymsAndTranslationsCaption identifier", "integer");
488490 $t->synonymsTranslationsStructure = new Structure("synonyms-translations", $t->syntransId, $t->expression, $t->identicalMeaning, $t->objectAttributes);
489 - $t->synonymsAndTranslations = new Attribute(null, "$synonymsAndTranslationsCaption", $t->synonymsTranslationsStructure);
490 - $t->translatedTextAttributeId = new Attribute("translated-text-attribute-id", "Attribute identifier", "object-id");
491 - $t->translatedTextAttribute = new Attribute("translated-text-attribute", wfMsg("TranslatedTextAttribute"), $definedMeaningReferenceType);
492 - $t->translatedTextValueId = new Attribute("translated-text-value-id", "Translated text value identifier", "translated-text-value-id");
 491+ $t->synonymsAndTranslations = new Attribute("synonymsAndTranslations", "$synonymsAndTranslationsCaption", $t->synonymsTranslationsStructure);
 492+ $t->translatedTextAttributeId = new Attribute("translatedTextAttributeId", "Attribute identifier", "object-id");
 493+ $t->translatedTextAttribute = new Attribute("translatedTextAttribute", wfMsg("TranslatedTextAttribute"), $definedMeaningReferenceType);
 494+ $t->translatedTextValueId = new Attribute("translatedTextValueId", "Translated text value identifier", "translated-text-value-id");
493495
494496 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
495 - $t->translatedTextValue = new Attribute("translated-text-value", wfMsg("TranslatedTextAttributeValue"), "text");
 497+ $t->translatedTextValue = new Attribute("translatedTextValue", wfMsg("TranslatedTextAttributeValue"), "text");
496498 else
497 - $t->translatedTextValue = new Attribute("translated-text", wfMsg("TranslatedTextAttributeValue"), $t->translatedTextStructure);
 499+ $t->translatedTextValue = new Attribute("translatedTextValue", wfMsg("TranslatedTextAttributeValue"), $t->translatedTextStructure);
498500
499 - $t->translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$t->translatedTextAttributeId, $t->attributeObjectId, $t->translatedTextAttribute, $t->translatedTextValueId, $t->translatedTextValue, $t->objectAttributes);
500 - $t->translatedTextAttributeValues = new Attribute(null, wfMsg("TranslatedTextAttributeValues"), $t->translatedTextAttributeValuesStructure);
501 - $t->textAttributeId = new Attribute("text-attribute-id", "Attribute identifier", "object-id");
502 - $t->textAttributeObject = new Attribute("text-attribute-object-id", "Attribute object", "object-id");
503 - $t->textAttribute = new Attribute("text-attribute", wfMsg("TextAttribute"), $t->definedMeaningReferenceStructure);
 501+ $t->translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$t->translatedTextAttributeId, $t->attributeObject, $t->translatedTextAttribute, $t->translatedTextValueId, $t->translatedTextValue, $t->objectAttributes);
 502+ $t->translatedTextAttributeValues = new Attribute("translatedTextAttributeValues", wfMsg("TranslatedTextAttributeValues"), $t->translatedTextAttributeValuesStructure);
 503+ $t->textAttributeId = new Attribute("textAttributeId", "Attribute identifier", "object-id");
 504+ $t->textAttributeObject = new Attribute("textAttributeObject", "Attribute object", "object-id");
 505+ $t->textAttribute = new Attribute("textAttribute", wfMsg("TextAttribute"), $t->definedMeaningReferenceStructure);
504506 $t->textAttributeValuesStructure = new Structure("text-attribute-values", $t->textAttributeId, $t->textAttributeObject, $t->textAttribute, $t->text, $t->objectAttributes);
505 - $t->textAttributeValues = new Attribute(null, wfMsg("TextAttributeValues"), $t->textAttributeValuesStructure);
506 - $t->linkLabel = new Attribute("label", "Label", "short-text");
507 - $t->linkURL = new Attribute("url", "URL", "url");
 507+ $t->textAttributeValues = new Attribute("textAttributeValues", wfMsg("TextAttributeValues"), $t->textAttributeValuesStructure);
 508+ $t->linkLabel = new Attribute("linkLabel", "Label", "short-text");
 509+ $t->linkURL = new Attribute("linkURL", "URL", "url");
508510 $t->link = new Attribute("link", "Link", new Structure($t->linkLabel, $t->linkURL));
509511
510 - $t->linkAttributeId = new Attribute("link-attribute-id", "Attribute identifier", "object-id");
511 - $t->linkAttributeObject = new Attribute("link-attribute-object-id", "Attribute object", "object-id");
512 - $t->linkAttribute = new Attribute("link-attribute", wfMsg("LinkAttribute"), $t->definedMeaningReferenceStructure);
 512+ $t->linkAttributeId = new Attribute("linkAttributeId", "Attribute identifier", "object-id");
 513+ $t->linkAttributeObject = new Attribute("linkAttributeObject", "Attribute object", "object-id");
 514+ $t->linkAttribute = new Attribute("linkAttribute", wfMsg("LinkAttribute"), $t->definedMeaningReferenceStructure);
513515 $t->linkAttributeValuesStructure = new Structure("link-attribute-values", $t->linkAttributeId, $t->linkAttributeObject, $t->linkAttribute, $t->link, $t->objectAttributes);
514 - $t->linkAttributeValues = new Attribute(null, wfMsg("LinkAttributeValues"), $t->linkAttributeValuesStructure);
515 - $t->optionAttributeId = new Attribute('option-attribute-id', 'Attribute identifier', 'object-id');
516 - $t->optionAttributeObject = new Attribute('option-attribute-object-id', 'Attribute object', 'object-id');
517 - $t->optionAttribute = new Attribute('option-attribute', wfMsg("OptionAttribute"), $definedMeaningReferenceType);
518 - $t->optionAttributeOption = new Attribute('option-attribute-option', wfMsg("OptionAttributeOption"), $definedMeaningReferenceType);
519 - $t->optionAttributeValuesStructure = new Structure('option-attribute-values', $t->optionAttributeId, $t->optionAttribute, $t->optionAttributeObject, $t->optionAttributeOption, $t->objectAttributes);
520 - $t->optionAttributeValues = new Attribute(null, wfMsg("OptionAttributeValues"), $t->optionAttributeValuesStructure);
521 - $t->optionAttributeOptionId = new Attribute('option-attribute-option-id', 'Option identifier', 'object-id');
522 - $t->optionAttributeOptionsStructure = new Structure('option-attribute-options', $t->optionAttributeOptionId, $t->optionAttribute, $t->optionAttributeOption, $t->language);
523 - $t->optionAttributeOptions = new Attribute(null, wfMsg("OptionAttributeOptions"), $t->optionAttributeOptionsStructure);
 516+ $t->linkAttributeValues = new Attribute("linkAttributeValues", wfMsg("LinkAttributeValues"), $t->linkAttributeValuesStructure);
 517+ $t->optionAttributeId = new Attribute("optionAttributeId", "Attribute identifier", "object-id");
 518+ $t->optionAttributeObject = new Attribute("optionAttributeObject", "Attribute object", "object-id");
 519+ $t->optionAttribute = new Attribute("optionAttribute", wfMsg("OptionAttribute"), $definedMeaningReferenceType);
 520+ $t->optionAttributeOption = new Attribute("optionAttributeOption", wfMsg("OptionAttributeOption"), $definedMeaningReferenceType);
 521+ $t->optionAttributeValuesStructure = new Structure("optionAttributeValues", $t->optionAttributeId, $t->optionAttribute, $t->optionAttributeObject, $t->optionAttributeOption, $t->objectAttributes);
 522+ $t->optionAttributeValues = new Attribute("optionAttributeValues", wfMsg("OptionAttributeValues"), $t->optionAttributeValuesStructure);
 523+ $t->optionAttributeOptionId = new Attribute("optionAttributeOptionId", "Option identifier", "object-id");
 524+ $t->optionAttributeOptionsStructure = new Structure("option-attribute-options", $t->optionAttributeOptionId, $t->optionAttribute, $t->optionAttributeOption, $t->language);
 525+ $t->optionAttributeOptions = new Attribute("optionAttributeOptions", wfMsg("OptionAttributeOptions"), $t->optionAttributeOptionsStructure);
524526
525527 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
526 - $t->translatedText = new Attribute("translated-text", wfMsg("Text"), "text");
 528+ $t->translatedText = new Attribute("translatedText", wfMsg("Text"), "text");
527529 else
528 - $t->translatedText = new Attribute(null, wfMsg("TranslatedText"), $t->translatedTextStructure);
 530+ $t->translatedText = new Attribute("translatedText", wfMsg("TranslatedText"), $t->translatedTextStructure);
529531
530 - $t->definition = new Attribute(null, wfMsg("Definition"), new Structure("definition", $t->translatedText, $t->objectAttributes));
 532+ $t->definition = new Attribute("definition", wfMsg("Definition"), new Structure("definition", $t->translatedText, $t->objectAttributes));
531533
532534 global
533535 $wgClassAttributesAttributeId;
534536
535 - $t->classAttributeId = new Attribute("class-attribute-id", "Class attribute identifier", "object-id");
536 - $t->classAttributeAttribute = new Attribute("class-attribute-attribute", wfMsg("ClassAttributeAttribute"), $t->definedMeaningReferenceStructure);
537 - $t->classAttributeLevel = new Attribute("class-attribute-level", wfMsg("ClassAttributeLevel"), $t->definedMeaningReferenceStructure);
538 - $t->classAttributeType = new Attribute("class-attribute-type", wfMsg("ClassAttributeType"), "short-text");
 537+ $t->classAttributeId = new Attribute("classAttributeId", "Class attribute identifier", "object-id");
 538+ $t->classAttributeAttribute = new Attribute("classAttributeAttribute", wfMsg("ClassAttributeAttribute"), $t->definedMeaningReferenceStructure);
 539+ $t->classAttributeLevel = new Attribute("classAttributeLevel", wfMsg("ClassAttributeLevel"), $t->definedMeaningReferenceStructure);
 540+ $t->classAttributeType = new Attribute("classAttributeType", wfMsg("ClassAttributeType"), "short-text");
539541 $t->classAttributesStructure = new Structure("class-attributes", $t->classAttributeId, $t->classAttributeAttribute, $t->classAttributeLevel, $t->classAttributeType, $t->optionAttributeOptions);
540 - $t->classAttributes = new Attribute(null, wfMsg("ClassAttributes"), $t->classAttributesStructure);
 542+ $t->classAttributes = new Attribute("classAttributes", wfMsg("ClassAttributes"), $t->classAttributesStructure);
541543
542 - $t->definedMeaning = new Attribute(null, wfMsg("DefinedMeaning"),
 544+ $t->definedMeaning = new Attribute("definedMeaning", wfMsg("DefinedMeaning"),
543545 new Structure(
544546 "defined-meaning",
 547+ $t->definedMeaningCompleteDefiningExpression,
545548 $t->definition,
546549 $t->classAttributes,
547550 $t->alternativeDefinitions,
@@ -549,27 +552,33 @@
550553 $t->reciprocalRelations,
551554 $t->classMembership,
552555 $t->collectionMembership,
553 - $t->definedMeaningAttributes)
 556+ $t->definedMeaningAttributes
 557+ )
554558 );
555559
556560 $t->expressionMeaningStructure = new Structure("expression-exact-meanings", $t->definedMeaningId, $t->text, $t->definedMeaning);
557 - $t->expressionExactMeanings = new Attribute(null, wfMsg("ExactMeanings"), $t->expressionMeaningStructure);
558 - $t->expressionApproximateMeanings = new Attribute("expression-approximate-meanings", wfMsg("ApproximateMeanings"), $t->expressionMeaningStructure);
 561+ $t->expressionExactMeanings = new Attribute("expressionExactMeanings", wfMsg("ExactMeanings"), $t->expressionMeaningStructure);
 562+ $t->expressionApproximateMeanings = new Attribute("expressionApproximateMeanings", wfMsg("ApproximateMeanings"), $t->expressionMeaningStructure);
559563 # bug found here also: $t->expressionAoproximateMeaning_S_
560564 $t->expressionMeaningsStructure = new Structure("expression-meanings", $t->expressionExactMeanings, $t->expressionApproximateMeanings);
561 - $t->expressionMeanings = new Attribute(null, wfMsg("ExpressionMeanings"), $t->expressionMeaningsStructure);
 565+ $t->expressionMeanings = new Attribute("expressionMeanings", wfMsg("ExpressionMeanings"), $t->expressionMeaningsStructure);
562566 $t->expressionsStructure = new Structure("expressions", $t->expressionId, $t->expression, $t->expressionMeanings);
563 - $t->expressions = new Attribute(null, wfMsg("Expressions"), $t->expressionsStructure);
564 - $t->objectId = new Attribute("object-id", "Object identifier", "object-id");
 567+ $t->expressions = new Attribute("expressions", wfMsg("Expressions"), $t->expressionsStructure);
 568+ $t->objectId = new Attribute("objectId", "Object identifier", "object-id");
565569 $t->objectAttributesStructure = new Structure("object-attributes", $t->objectId, $t->textAttributeValues, $t->translatedTextAttributeValues, $t->optionAttributeValues);
566570 $t->objectAttributes->setAttributeType($t->objectAttributesStructure);
567571 $t->definedMeaningAttributes->setAttributeType($t->objectAttributesStructure);
568572
569573 $t->annotatedAttributes = array(
 574+ $t->definedMeaning,
570575 $t->definition,
571576 $t->synonymsAndTranslations,
572577 $t->relations,
573 - $t->reciprocalRelations
 578+ $t->reciprocalRelations,
 579+ $t->objectAttributes,
 580+ $t->textAttributeValues,
 581+ $t->translatedTextAttributeValues,
 582+ $t->optionAttributeValues
574583 );
575584
576585 foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter) {
@@ -581,9 +590,12 @@
582591 }
583592 }
584593
585 - protected function __set($key,$value) {
 594+ protected function __set($key, $value) {
586595 $attributes=&$this->attributes;
587 - $attributes[$key]=$value;
 596+ $attributes[$key] = $value;
 597+
 598+ if ($value instanceof Attribute && !isset($GLOBALS[$key . "Attribute"]))
 599+ throw new Exception("Could not find attribute global with key: " . $key);
588600 }
589601
590602 public function __get($key) {
@@ -593,7 +605,4 @@
594606 }
595607 return $attributes[$key];
596608 }
597 -}
598 -
599 -
600 -
 609+}
\ No newline at end of file
Index: trunk/extensions/Wikidata/OmegaWiki/Attribute.php
@@ -42,9 +42,9 @@
4343 }
4444
4545 class Structure {
46 -
4746 private $structure;
4847 private $type;
 48+ private $attributeIds;
4949
5050 public function getAttributes() {
5151 return $this->structure;
@@ -52,6 +52,7 @@
5353
5454 public function addAttribute($attribute) {
5555 $this->structure[]=$attribute;
 56+ $this->attributeIds[] = $attribute->id;
5657 }
5758
5859 public function getStructureType() {
@@ -75,7 +76,6 @@
7677 *
7778 */
7879 public function __construct($argumentList) {
79 -
8080 # We're trying to be clever.
8181 $args=func_get_args();
8282 $this->structure=null;
@@ -111,7 +111,21 @@
112112 # WTF?
113113 throw new Exception("Invalid structure constructor: ".print_r($args,true));
114114 }
 115+
 116+ $this->attributeIds = array();
 117+
 118+ foreach ($this->structure as $attribute)
 119+ $this->attributeIds[] = $attribute->id;
115120 }
 121+
 122+ public function __toString() {
 123+ return "Structure(" . implode(", ", $this->attributeIds) . ")";
 124+ }
 125+
 126+ public function supportsAttributeId($attributeId) {
 127+ return true;
 128+// return in_array($attributeId, $this->attributeIds);
 129+ }
116130 }
117131
118132
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php
@@ -524,10 +524,10 @@
525525 $definitionAttribute, $translatedTextAttribute, $objectAttributesAttribute;
526526
527527 $definitionId = getDefinedMeaningDefinitionId($definedMeaningId);
528 - $record = new ArrayRecord(new Structure($definitionAttribute));
 528+ $record = new ArrayRecord($definitionAttribute->type);
529529 $record->setAttributeValue($translatedTextAttribute, getTranslatedContentValue($definitionId, $viewInformation));
530530
531 - $objectAttributesRecord = getObjectAttributesRecord($definitionId, $viewInformation, $objectAttributesAttribute->id);
 531+ $objectAttributesRecord = getObjectAttributesRecord($definitionId, $viewInformation);
532532 $record->setAttributeValue($objectAttributesAttribute, $objectAttributesRecord);
533533
534534 applyPropertyToColumnFiltersToRecord($record, $objectAttributesRecord, $viewInformation);
@@ -553,18 +553,14 @@
554554 }
555555 }
556556
557 -function getObjectAttributesRecord($objectId, ViewInformation $viewInformation, $structuralOverride = null) {
 557+function getObjectAttributesRecord($objectId, ViewInformation $viewInformation) {
558558 global
559559 $objectIdAttribute,
560560 $linkAttributeValuesAttribute, $textAttributeValuesAttribute,
561561 $translatedTextAttributeValuesAttribute, $optionAttributeValuesAttribute,
562 - $definedMeaningAttributesAttribute;
 562+ $objectAttributesStructure;
563563
564 - if ($structuralOverride)
565 - $record = new ArrayRecord(new Structure($structuralOverride, $definedMeaningAttributesAttribute));
566 - else
567 - $record = new ArrayRecord(new Structure($definedMeaningAttributesAttribute));
568 -
 564+ $record = new ArrayRecord($objectAttributesStructure);
569565 $record->setAttributeValue($objectIdAttribute, $objectId);
570566 $record->setAttributeValue($textAttributeValuesAttribute, getTextAttributesValuesRecordSet(array($objectId), $viewInformation));
571567 $record->setAttributeValue($translatedTextAttributeValuesAttribute, getTranslatedTextAttributeValuesRecordSet(array($objectId), $viewInformation));
@@ -739,21 +735,26 @@
740736 expandExpressionSpellingsInRecordSet($recordSet, array($expressionAttribute));
741737
742738 expandObjectAttributesAttribute($recordSet, $objectAttributesAttribute, $syntransIdAttribute, $viewInformation);
 739+
743740 return $recordSet;
744741 }
745742
746 -function expandObjectAttributesAttribute(RecordSet $recordSet, Attribute $attributeToExpand, Attribute $objectIdAttribute, ViewInformation $viewInformation) {
 743+function expandObjectAttributesAttribute(RecordSet $recordSet, Attribute $attributeToExpand, Attribute $objectIdAttributeInRecordSet, ViewInformation $viewInformation) {
747744 global
748745 $textAttributeObjectAttribute, $textAttributeValuesAttribute,
749746 $attributeObjectAttribute, $translatedTextAttributeValuesAttribute,
750747 $linkAttributeObjectAttribute, $linkAttributeValuesAttribute,
751 - $optionAttributeObjectAttribute, $optionAttributeValuesAttribute;
 748+ $optionAttributeObjectAttribute, $optionAttributeValuesAttribute,
 749+ $objectIdAttribute;
752750
753751 $recordSetStructure = $recordSet->getStructure();
754752 $recordSetStructure->addAttribute($attributeToExpand);
 753+
 754+ foreach ($viewInformation->getPropertyToColumnFilters() as $propertyToColumnFilter)
 755+ $recordSetStructure->addAttribute($propertyToColumnFilter->getAttribute());
755756
756757 $objectAttributesRecordStructure = $attributeToExpand->type;
757 - $objectIds = getUniqueIdsInRecordSet($recordSet, array($objectIdAttribute));
 758+ $objectIds = getUniqueIdsInRecordSet($recordSet, array($objectIdAttributeInRecordSet));
758759
759760 if (count($objectIds) > 0) {
760761 for ($i = 0; $i < count($objectIds); $i++)
@@ -805,7 +806,7 @@
806807
807808 for ($i = 0; $i < $recordSet->getRecordCount(); $i++) {
808809 $record = $recordSet->getRecord($i);
809 - $objectId = $record->getAttributeValue($objectIdAttribute);
 810+ $objectId = $record->getAttributeValue($objectIdAttributeInRecordSet);
810811
811812 // Text attributes
812813 if (isset($textAttributeValuesRecordSets[$objectId]))
@@ -970,6 +971,7 @@
971972 );
972973
973974 $recordSet->getStructure()->addAttribute($collectionMeaningAttribute);
 975+ $recordSet->getStructure()->addAttribute($gotoSourceAttribute);
974976
975977 for ($i = 0; $i < $recordSet->getRecordCount(); $i++) {
976978 $record = $recordSet->getRecord($i);
@@ -1088,7 +1090,7 @@
10891091
10901092 function getOptionAttributeValuesRecordSet(array $objectIds, ViewInformation $viewInformation) {
10911093 global
1092 - $optionAttributeIdAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionIdAttribute, $optionAttributeAttribute,$optionAttributeOptionAttribute, $optionAttributeValuesTable, $objectAttributesAttribute,
 1094+ $optionAttributeIdAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionIdAttribute, $optionAttributeAttribute, $optionAttributeOptionAttribute, $optionAttributeValuesTable, $objectAttributesAttribute,
10931095 $optionAttributeValuesStructure;
10941096
10951097 $recordSet = queryRecordSet(
@@ -1104,6 +1106,9 @@
11051107 array("object_id IN (" . implode(", ", $objectIds) . ")")
11061108 );
11071109
 1110+ $recordSet->getStructure()->addAttribute($optionAttributeAttribute);
 1111+ $recordSet->getStructure()->addAttribute($optionAttributeOptionAttribute);
 1112+
11081113 expandOptionsInRecordSet($recordSet, $viewInformation);
11091114 expandDefinedMeaningReferencesInRecordSet($recordSet, array($optionAttributeAttribute, $optionAttributeOptionAttribute));
11101115 expandObjectAttributesAttribute($recordSet, $objectAttributesAttribute, $optionAttributeIdAttribute, $viewInformation);
@@ -1177,7 +1182,6 @@
11781183 }
11791184
11801185 function getDefiningExpressionRecord($definedMeaningId) {
1181 -
11821186 global
11831187 $definedMeaningCompleteDefiningExpressionAttribute,
11841188 $definedMeaningDefiningExpressionAttribute,
@@ -1185,7 +1189,7 @@
11861190
11871191 $o=OmegaWikiAttributes::getInstance();
11881192
1189 - $definingExpression=definingExpressionRow($definedMeaningId);
 1193+ $definingExpression = definingExpressionRow($definedMeaningId);
11901194 $definingExpressionRecord = new ArrayRecord($definedMeaningCompleteDefiningExpressionAttribute->type);
11911195 $definingExpressionRecord->setAttributeValue($expressionIdAttribute, $definingExpression[0]);
11921196 $definingExpressionRecord->setAttributeValue($definedMeaningDefiningExpressionAttribute, $definingExpression[1]);
Index: trunk/extensions/Wikidata/OmegaWiki/Record.php
@@ -25,9 +25,23 @@
2626 return $this->structure;
2727 }
2828
 29+ protected function getValueForAttributeId($attributeId) {
 30+ if ($this->structure->supportsAttributeId($attributeId)) {
 31+ if (isset($this->values[$attributeId]))
 32+ return $this->values[$attributeId];
 33+ else
 34+ return null;
 35+ }
 36+ else
 37+ throw new Exception(
 38+ "Record does not support attribute!\n" .
 39+ " Attribute id: " . $attributeId . "\n" .
 40+ " Structure: " . $this->structure
 41+ );
 42+ }
 43+
2944 public function getAttributeValue(Attribute $attribute) {
30 - #FIXME: check if valid
31 - return @$this->values[$attribute->id];
 45+ return $this->getValueForAttributeId($attribute->id);
3246 }
3347
3448 /**
@@ -63,9 +77,19 @@
6478 return $result;
6579 }
6680
 81+ protected function setValueForAttributeId($attributeId, $value) {
 82+ if ($this->structure->supportsAttributeId($attributeId))
 83+ $this->values[$attributeId] = $value;
 84+ else
 85+ throw new Exception(
 86+ "Record does not support attribute!\n" .
 87+ " Attribute id: " . $attributeId . "\n" .
 88+ " Structure: " .$this->structure
 89+ );
 90+ }
 91+
6792 public function setAttributeValue(Attribute $attribute, $value) {
68 - #FIXME: check if valid
69 - @$this->values[$attribute->id] = $value;
 93+ $this->setValueForAttributeId($attribute->id, $value);
7094 }
7195
7296 /**
@@ -75,8 +99,9 @@
76100 */
77101 public function setAttributeValuesByOrder($values) {
78102 $atts=$this->structure->getAttributes();
 103+
79104 for ($i = 0; $i < count($atts); $i++)
80 - $this->values[$atts[$i]->id] = $values[$i];
 105+ $this->setValueForAttributeId($atts[$i]->id, $values[$i]);
81106 }
82107
83108 /*
@@ -86,7 +111,7 @@
87112 */
88113 public function setSubRecord(Record $record) {
89114 foreach($record->getStructure()->getAttributes() as $attribute)
90 - $this->values[$attribute->id] = $record->getAttributeValue($attribute);
 115+ $this->setValueForAttributeId($attribute->id, $record->getAttributeValue($attribute));
91116 }
92117
93118 /**
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -144,7 +144,7 @@
145145 $o=OmegaWikiAttributes::getInstance();
146146
147147 $record = new ArrayRecord($o->definedMeaning->type);
148 - $record->definedMeaningCompleteDefiningExpression = getDefiningExpressionRecord($id);
 148+ $record->definedMeaningCompleteDefiningExpression = getDefiningExpressionRecord($id);
149149 $record->definition = getDefinedMeaningDefinitionRecord($id, $view);
150150 $record->classAttributes = getClassAttributesRecordSet($id, $view);
151151 $record->alternativeDefinitions = getAlternativeDefinitionsRecordSet($id, $view);
@@ -167,6 +167,7 @@
168168
169169 $this->record=$record;
170170 $this->recordIsLoaded=true;
 171+
171172 return true;
172173 }
173174
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -1288,15 +1288,13 @@
12891289
12901290 public function add(IdStack $idPath) {
12911291 if ($this->isAddField) {
1292 - global
1293 - $syntransIdAttribute;
1294 -
1295 - $syntransId = $idPath->getKeyStack()->peek(0)->getAttributeValue($syntransIdAttribute);
 1292+ $objectId = $this->objectIdFetcher->fetch($idPath->getKeyStack());
12961293 $parameters = array(
12971294 'attributesLevel' => $this->attributesLevelName,
1298 - 'attributesObjectId' => $this->objectIdFetcher->fetch($idPath->getKeyStack()),
1299 - 'onUpdate' => 'updateSelectOptions(\'' . $this->addId($idPath->getId()) . '-option\',' . $syntransId
 1295+ 'attributesObjectId' => $objectId,
 1296+ 'onUpdate' => 'updateSelectOptions(\'' . $this->addId($idPath->getId()) . '-option\',' . $objectId
13001297 );
 1298+
13011299 return getSuggest($this->addId($idPath->getId()), $this->suggestType(), $parameters);
13021300 }
13031301 else

Status & tagging log