r24783 MediaWiki - Code Review archive (original) (raw)

Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php
@@ -416,20 +416,20 @@
417 417 global
418 418 $definedMeaningReferenceType;
419 419
420 - $t->definedMeaningLabel = new Attribute("defined-meaning-label", "Defined meaning label", "short-text");
421 - t−>definedMeaningReferenceStructure=newStructure("defined−meaning",t->definedMeaningReferenceStructure = new Structure("defined-meaning", t>definedMeaningReferenceStructure=newStructure("definedmeaning",t->definedMeaningId, t−>definedMeaningLabel,t->definedMeaningLabel, t>definedMeaningLabel,t->definedMeaningDefiningExpression);
420 + $t->definedMeaningLabel = new Attribute("definedMeaningLabel", "Defined meaning label", "short-text");
421 + t−>definedMeaningReferenceStructure=newStructure("definedMeaning",t->definedMeaningReferenceStructure = new Structure("definedMeaning", t>definedMeaningReferenceStructure=newStructure("definedMeaning",t->definedMeaningId, t−>definedMeaningLabel,t->definedMeaningLabel, t>definedMeaningLabel,t->definedMeaningDefiningExpression);
422 422 definedMeaningReferenceType=definedMeaningReferenceType = definedMeaningReferenceType=t->definedMeaningReferenceStructure;
423 423 t−>definedMeaningReference=newAttribute("definedMeaningReference",wfMsg("DefinedMeaningReference"),t->definedMeaningReference = new Attribute("definedMeaningReference", wfMsg("DefinedMeaningReference"), t>definedMeaningReference=newAttribute("definedMeaningReference",wfMsg("DefinedMeaningReference"),definedMeaningReferenceType);
424 424 $t->collectionId = new Attribute("collectionId", "Collection", "collection-id");
425 425 t−>collectionMeaning=newAttribute("collectionMeaning",wfMsg("Collection"),t->collectionMeaning = new Attribute("collectionMeaning", wfMsg("Collection"), t>collectionMeaning=newAttribute("collectionMeaning",wfMsg("Collection"),t->definedMeaningReferenceStructure);
426 426 $t->sourceIdentifier = new Attribute("sourceIdentifier", wfMsg("SourceIdentifier"), "short-text");
427 - t−>gotoSourceStructure=newStructure("goto−source",t->gotoSourceStructure = new Structure("goto-source",t>gotoSourceStructure=newStructure("gotosource",t->collectionId, $t->sourceIdentifier);
427 + t−>gotoSourceStructure=newStructure("gotoSource",t->gotoSourceStructure = new Structure("gotoSource", t>gotoSourceStructure=newStructure("gotoSource",t->collectionId, $t->sourceIdentifier);
428 428 t−>gotoSource=newAttribute("gotoSource",wfMsg("GotoSource"),t->gotoSource = new Attribute("gotoSource", wfMsg("GotoSource"), t>gotoSource=newAttribute("gotoSource",wfMsg("GotoSource"),t->gotoSourceStructure);
429 - t−>collectionMembershipStructure=newStructure("collection−membership",t->collectionMembershipStructure = new Structure("collection-membership",t>collectionMembershipStructure=newStructure("collectionmembership",t->collectionId, t−>collectionMeaning,t->collectionMeaning, t>collectionMeaning,t->sourceIdentifier);
429 + t−>collectionMembershipStructure=newStructure("collectionMembership",t->collectionMembershipStructure = new Structure("collectionMembership",t>collectionMembershipStructure=newStructure("collectionMembership",t->collectionId, t−>collectionMeaning,t->collectionMeaning, t>collectionMeaning,t->sourceIdentifier);
430 430 t−>collectionMembership=newAttribute("collectionMembership",wfMsg("CollectionMembership"),t->collectionMembership = new Attribute("collectionMembership", wfMsg("CollectionMembership"), t>collectionMembership=newAttribute("collectionMembership",wfMsg("CollectionMembership"),t->collectionMembershipStructure);
431 431 $t->classMembershipId = new Attribute("classMembershipId", "Class membership id", "integer");
432 432 t−>class=newAttribute("class","Class",t->class = new Attribute("class", "Class", t>class=newAttribute("class","Class",t->definedMeaningReferenceStructure);
433 - t−>classMembershipStructure=newStructure("class−membership",t->classMembershipStructure = new Structure("class-membership", t>classMembershipStructure=newStructure("classmembership",t->classMembershipId, $t->class);
433 + t−>classMembershipStructure=newStructure("classMembership",t->classMembershipStructure = new Structure("classMembership", t>classMembershipStructure=newStructure("classMembership",t->classMembershipId, $t->class);
434 434 t−>classMembership=newAttribute("classMembership",wfMsg("ClassMembership"),t->classMembership = new Attribute("classMembership", wfMsg("ClassMembership"), t>classMembership=newAttribute("classMembership",wfMsg("ClassMembership"),t->classMembershipStructure);
435 435
436 436 global
@@ -437,9 +437,7 @@
438 438
439 439 $t->possiblySynonymousId = new Attribute("possiblySynonymousId", "Possibly synonymous id", "integer");
440 440 t−>possibleSynonym=newAttribute("possibleSynonym",wfMsg("PossibleSynonym"),t->possibleSynonym = new Attribute("possibleSynonym", wfMsg("PossibleSynonym"), t>possibleSynonym=newAttribute("possibleSynonym",wfMsg("PossibleSynonym"),t->definedMeaningReferenceStructure);
441 - # Bug found ... This never worked before: (!)
442 - #$t->possiblySynonymousStructure = new Structure("possibly-synonymous", t−>possiblySynonymousId,t->possiblySynonymousId, t>possiblySynonymousId,t->possiblySynonymous);
443 - t−>possiblySynonymousStructure=newStructure("possibly−synonymous",t->possiblySynonymousStructure = new Structure("possibly-synonymous", t>possiblySynonymousStructure=newStructure("possiblysynonymous",t->possiblySynonymousId, $t->possibleSynonym);
441 + t−>possiblySynonymousStructure=newStructure("possiblySynonymous",t->possiblySynonymousStructure = new Structure("possiblySynonymous", t>possiblySynonymousStructure=newStructure("possiblySynonymous",t->possiblySynonymousId, $t->possibleSynonym);
444 442 t−>possiblySynonymous=newAttribute("possiblySynonymous",wfMsg("PossiblySynonymous"),t->possiblySynonymous = new Attribute("possiblySynonymous", wfMsg("PossiblySynonymous"), t>possiblySynonymous=newAttribute("possiblySynonymous",wfMsg("PossiblySynonymous"),t->possiblySynonymousStructure);
445 443
446 444 global
@@ -456,7 +454,7 @@
457 455 t−>relations=newAttribute("relations",wfMsg("Relations"),t->relations = new Attribute("relations", wfMsg("Relations"), t>relations=newAttribute("relations",wfMsg("Relations"),t->relationStructure);
458 456 t−>reciprocalRelations=newAttribute("reciprocalRelations",wfMsg("IncomingRelations"),t->reciprocalRelations = new Attribute("reciprocalRelations", wfMsg("IncomingRelations"), t>reciprocalRelations=newAttribute("reciprocalRelations",wfMsg("IncomingRelations"),t->relationStructure);
459 457 $t->translatedTextId = new Attribute("translatedTextId", "Translated text ID", "integer");
460 - t−>translatedTextStructure=newStructure("translated−text",t->translatedTextStructure = new Structure("translated-text", t>translatedTextStructure=newStructure("translatedtext",t->language, $t->text);
458 + t−>translatedTextStructure=newStructure("translatedText",t->translatedTextStructure = new Structure("translatedText", t>translatedTextStructure=newStructure("translatedText",t->language, $t->text);
461 459
462 460 $t->definitionId = new Attribute("definitionId", "Definition identifier", "integer");
463 461
@@ -470,7 +468,7 @@
471 469 global
472 470 $wgAlternativeDefinitionsAttributeId;
473 471
474 - t−>alternativeDefinitionsStructure=newStructure("alternative−definitions",t->alternativeDefinitionsStructure = new Structure("alternative-definitions", t>alternativeDefinitionsStructure=newStructure("alternativedefinitions",t->definitionId, t−>alternativeDefinition,t->alternativeDefinition, t>alternativeDefinition,t->source);
472 + t−>alternativeDefinitionsStructure=newStructure("alternativeDefinitions",t->alternativeDefinitionsStructure = new Structure("alternativeDefinitions", t>alternativeDefinitionsStructure=newStructure("alternativeDefinitions",t->definitionId, t−>alternativeDefinition,t->alternativeDefinition, t>alternativeDefinition,t->source);
475 473 t−>alternativeDefinitions=newAttribute("alternativeDefinitions",wfMsg("AlternativeDefinitions"),t->alternativeDefinitions = new Attribute("alternativeDefinitions", wfMsg("AlternativeDefinitions"), t>alternativeDefinitions=newAttribute("alternativeDefinitions",wfMsg("AlternativeDefinitions"),t->alternativeDefinitionsStructure);
476 474
477 475 global
@@ -484,7 +482,7 @@
485 483 $t->attributeObject = new Attribute("attributeObject", "Attribute object", "object-id");
486 484
487 485 t−>syntransId=newAttribute("syntransId","t->syntransId = new Attribute("syntransId", "t>syntransId=newAttribute("syntransId","synonymsAndTranslationsCaption identifier", "integer");
488 - t−>synonymsTranslationsStructure=newStructure("synonyms−translations",t->synonymsTranslationsStructure = new Structure("synonyms-translations", t>synonymsTranslationsStructure=newStructure("synonymstranslations",t->syntransId, t−>expression,t->expression, t>expression,t->identicalMeaning, $t->objectAttributes);
486 + t−>synonymsTranslationsStructure=newStructure("synonymsTranslations",t->synonymsTranslationsStructure = new Structure("synonymsTranslations", t>synonymsTranslationsStructure=newStructure("synonymsTranslations",t->syntransId, t−>expression,t->expression, t>expression,t->identicalMeaning, $t->objectAttributes);
489 487 t−>synonymsAndTranslations=newAttribute("synonymsAndTranslations","t->synonymsAndTranslations = new Attribute("synonymsAndTranslations", "t>synonymsAndTranslations=newAttribute("synonymsAndTranslations","synonymsAndTranslationsCaption", $t->synonymsTranslationsStructure);
490 488 $t->translatedTextAttributeId = new Attribute("translatedTextAttributeId", "Attribute identifier", "object-id");
491 489 t−>translatedTextAttribute=newAttribute("translatedTextAttribute",wfMsg("TranslatedTextAttribute"),t->translatedTextAttribute = new Attribute("translatedTextAttribute", wfMsg("TranslatedTextAttribute"), t>translatedTextAttribute=newAttribute("translatedTextAttribute",wfMsg("TranslatedTextAttribute"),definedMeaningReferenceType);
@@ -500,7 +498,7 @@
501 499 $t->textAttributeId = new Attribute("textAttributeId", "Attribute identifier", "object-id");
502 500 $t->textAttributeObject = new Attribute("textAttributeObject", "Attribute object", "object-id");
503 501 t−>textAttribute=newAttribute("textAttribute",wfMsg("TextAttribute"),t->textAttribute = new Attribute("textAttribute", wfMsg("TextAttribute"), t>textAttribute=newAttribute("textAttribute",wfMsg("TextAttribute"),t->definedMeaningReferenceStructure);
504 - t−>textAttributeValuesStructure=newStructure("text−attribute−values",t->textAttributeValuesStructure = new Structure("text-attribute-values", t>textAttributeValuesStructure=newStructure("textattributevalues",t->textAttributeId, t−>textAttributeObject,t->textAttributeObject, t>textAttributeObject,t->textAttribute, t−>text,t->text, t>text,t->objectAttributes);
502 + t−>textAttributeValuesStructure=newStructure("textAttributeValues",t->textAttributeValuesStructure = new Structure("textAttributeValues", t>textAttributeValuesStructure=newStructure("textAttributeValues",t->textAttributeId, t−>textAttributeObject,t->textAttributeObject, t>textAttributeObject,t->textAttribute, t−>text,t->text, t>text,t->objectAttributes);
505 503 t−>textAttributeValues=newAttribute("textAttributeValues",wfMsg("TextAttributeValues"),t->textAttributeValues = new Attribute("textAttributeValues", wfMsg("TextAttributeValues"), t>textAttributeValues=newAttribute("textAttributeValues",wfMsg("TextAttributeValues"),t->textAttributeValuesStructure);
506 504 $t->linkLabel = new Attribute("linkLabel", "Label", "short-text");
507 505 $t->linkURL = new Attribute("linkURL", "URL", "url");
@@ -518,7 +516,7 @@
519 517 t−>optionAttributeValuesStructure=newStructure("optionAttributeValues",t->optionAttributeValuesStructure = new Structure("optionAttributeValues", t>optionAttributeValuesStructure=newStructure("optionAttributeValues",t->optionAttributeId, t−>optionAttribute,t->optionAttribute, t>optionAttribute,t->optionAttributeObject, t−>optionAttributeOption,t->optionAttributeOption, t>optionAttributeOption,t->objectAttributes);
520 518 t−>optionAttributeValues=newAttribute("optionAttributeValues",wfMsg("OptionAttributeValues"),t->optionAttributeValues = new Attribute("optionAttributeValues", wfMsg("OptionAttributeValues"), t>optionAttributeValues=newAttribute("optionAttributeValues",wfMsg("OptionAttributeValues"),t->optionAttributeValuesStructure);
521 519 $t->optionAttributeOptionId = new Attribute("optionAttributeOptionId", "Option identifier", "object-id");
522 - t−>optionAttributeOptionsStructure=newStructure("option−attribute−options",t->optionAttributeOptionsStructure = new Structure("option-attribute-options", t>optionAttributeOptionsStructure=newStructure("optionattributeoptions",t->optionAttributeOptionId, t−>optionAttribute,t->optionAttribute, t>optionAttribute,t->optionAttributeOption, $t->language);
520 + t−>optionAttributeOptionsStructure=newStructure("optionAttributeOptions",t->optionAttributeOptionsStructure = new Structure("optionAttributeOptions", t>optionAttributeOptionsStructure=newStructure("optionAttributeOptions",t->optionAttributeOptionId, t−>optionAttribute,t->optionAttribute, t>optionAttribute,t->optionAttributeOption, $t->language);
523 521 t−>optionAttributeOptions=newAttribute("optionAttributeOptions",wfMsg("OptionAttributeOptions"),t->optionAttributeOptions = new Attribute("optionAttributeOptions", wfMsg("OptionAttributeOptions"), t>optionAttributeOptions=newAttribute("optionAttributeOptions",wfMsg("OptionAttributeOptions"),t->optionAttributeOptionsStructure);
524 522
525 523 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
@@ -535,7 +533,7 @@
536 534 t−>classAttributeAttribute=newAttribute("classAttributeAttribute",wfMsg("ClassAttributeAttribute"),t->classAttributeAttribute = new Attribute("classAttributeAttribute", wfMsg("ClassAttributeAttribute"), t>classAttributeAttribute=newAttribute("classAttributeAttribute",wfMsg("ClassAttributeAttribute"),t->definedMeaningReferenceStructure);
537 535 t−>classAttributeLevel=newAttribute("classAttributeLevel",wfMsg("ClassAttributeLevel"),t->classAttributeLevel = new Attribute("classAttributeLevel", wfMsg("ClassAttributeLevel"), t>classAttributeLevel=newAttribute("classAttributeLevel",wfMsg("ClassAttributeLevel"),t->definedMeaningReferenceStructure);
538 536 $t->classAttributeType = new Attribute("classAttributeType", wfMsg("ClassAttributeType"), "short-text");
539 - t−>classAttributesStructure=newStructure("class−attributes",t->classAttributesStructure = new Structure("class-attributes", t>classAttributesStructure=newStructure("classattributes",t->classAttributeId, t−>classAttributeAttribute,t->classAttributeAttribute, t>classAttributeAttribute,t->classAttributeLevel, t−>classAttributeType,t->classAttributeType, t>classAttributeType,t->optionAttributeOptions);
537 + t−>classAttributesStructure=newStructure("classAttributes",t->classAttributesStructure = new Structure("classAttributes", t>classAttributesStructure=newStructure("classAttributes",t->classAttributeId, t−>classAttributeAttribute,t->classAttributeAttribute, t>classAttributeAttribute,t->classAttributeLevel, t−>classAttributeType,t->classAttributeType, t>classAttributeType,t->optionAttributeOptions);
540 538 t−>classAttributes=newAttribute("classAttributes",wfMsg("ClassAttributes"),t->classAttributes = new Attribute("classAttributes", wfMsg("ClassAttributes"), t>classAttributes=newAttribute("classAttributes",wfMsg("ClassAttributes"),t->classAttributesStructure);
541 539
542 540 $t->definedMeaning = new Attribute("definedMeaning", wfMsg("DefinedMeaning"),
@@ -554,20 +552,19 @@
555 553 )
556 554 );
557 555
558 - t−>expressionMeaningStructure=newStructure("expression−exact−meanings",t->expressionMeaningStructure = new Structure("expression-exact-meanings", t>expressionMeaningStructure=newStructure("expressionexactmeanings",t->definedMeaningId, t−>text,t->text, t>text,t->definedMeaning);
556 + t−>expressionMeaningStructure=newStructure("expressionExactMeanings",t->expressionMeaningStructure = new Structure("expressionExactMeanings", t>expressionMeaningStructure=newStructure("expressionExactMeanings",t->definedMeaningId, t−>text,t->text, t>text,t->definedMeaning);
559 557 t−>expressionExactMeanings=newAttribute("expressionExactMeanings",wfMsg("ExactMeanings"),t->expressionExactMeanings = new Attribute("expressionExactMeanings", wfMsg("ExactMeanings"), t>expressionExactMeanings=newAttribute("expressionExactMeanings",wfMsg("ExactMeanings"),t->expressionMeaningStructure);
560 558 t−>expressionApproximateMeanings=newAttribute("expressionApproximateMeanings",wfMsg("ApproximateMeanings"),t->expressionApproximateMeanings = new Attribute("expressionApproximateMeanings", wfMsg("ApproximateMeanings"), t>expressionApproximateMeanings=newAttribute("expressionApproximateMeanings",wfMsg("ApproximateMeanings"),t->expressionMeaningStructure);
561 - # bug found here also: $t->expressionAoproximateMeaning_S_
562 - t−>expressionMeaningsStructure=newStructure("expression−meanings",t->expressionMeaningsStructure = new Structure("expression-meanings", t>expressionMeaningsStructure=newStructure("expressionmeanings",t->expressionExactMeanings, $t->expressionApproximateMeanings);
559 + t−>expressionMeaningsStructure=newStructure("expressionMeanings",t->expressionMeaningsStructure = new Structure("expressionMeanings", t>expressionMeaningsStructure=newStructure("expressionMeanings",t->expressionExactMeanings, $t->expressionApproximateMeanings);
563 560 t−>expressionMeanings=newAttribute("expressionMeanings",wfMsg("ExpressionMeanings"),t->expressionMeanings = new Attribute("expressionMeanings", wfMsg("ExpressionMeanings"), t>expressionMeanings=newAttribute("expressionMeanings",wfMsg("ExpressionMeanings"),t->expressionMeaningsStructure);
564 561 t−>expressionsStructure=newStructure("expressions",t->expressionsStructure = new Structure("expressions", t>expressionsStructure=newStructure("expressions",t->expressionId, t−>expression,t->expression, t>expression,t->expressionMeanings);
565 562 t−>expressions=newAttribute("expressions",wfMsg("Expressions"),t->expressions = new Attribute("expressions", wfMsg("Expressions"), t>expressions=newAttribute("expressions",wfMsg("Expressions"),t->expressionsStructure);
566 563 $t->objectId = new Attribute("objectId", "Object identifier", "object-id");
567 - t−>objectAttributesStructure=newStructure("object−attributes",t->objectAttributesStructure = new Structure("object-attributes", t>objectAttributesStructure=newStructure("objectattributes",t->objectId, t−>textAttributeValues,t->textAttributeValues, t>textAttributeValues,t->translatedTextAttributeValues, t−>optionAttributeValues,t->optionAttributeValues, t>optionAttributeValues,t->linkAttributeValues);
564 + t−>objectAttributesStructure=newStructure("objectAttributes",t->objectAttributesStructure = new Structure("objectAttributes", t>objectAttributesStructure=newStructure("objectAttributes",t->objectId, t−>textAttributeValues,t->textAttributeValues, t>textAttributeValues,t->translatedTextAttributeValues, t−>optionAttributeValues,t->optionAttributeValues, t>optionAttributeValues,t->linkAttributeValues);
568 565 t−>objectAttributes−>setAttributeType(t->objectAttributes->setAttributeType(t>objectAttributes>setAttributeType(t->objectAttributesStructure);
569 566 t−>definedMeaningAttributes−>setAttributeType(t->definedMeaningAttributes->setAttributeType(t>definedMeaningAttributes>setAttributeType(t->objectAttributesStructure);
570 567
571 - $t->annotatedAttributes = array(
568 + $annotatedAttributes = array(
572 569 $t->definedMeaning,
573 570 $t->definition,
574 571 $t->synonymsAndTranslations,
@@ -583,7 +580,7 @@
584 581 attribute=attribute = attribute=propertyToColumnFilter->getAttribute();
585 582 attribute−>setAttributeType(attribute->setAttributeType(attribute>setAttributeType(t->objectAttributesStructure);
586 583
587 - foreach ($t->annotatedAttributes as $annotatedAttribute)
584 + foreach ($annotatedAttributes as $annotatedAttribute)
588 585 annotatedAttribute−>type−>addAttribute(annotatedAttribute->type->addAttribute(annotatedAttribute>type>addAttribute(attribute);
589 586 }
590 587 }