Index: trunk/extensions/Wikidata/TODO |
— | — | @@ -6,6 +6,7 @@ |
7 | 7 | * complete |
8 | 8 | * robust |
9 | 9 | * debug |
| 10 | +* Conceptmapper will use specialsuggest |
10 | 11 | |
11 | 12 | |
12 | 13 | General Tidying (refactoring) |
— | — | @@ -20,3 +21,9 @@ |
21 | 22 | but currently cheats and allows one to access any stored item |
22 | 23 | by key. This should be revisited when the attribute system |
23 | 24 | is refurbished. |
| 25 | + |
| 26 | +Unit Testing |
| 27 | +========================= |
| 28 | +* Extend unit testing framework to also safely test on its own database. |
| 29 | + Since wikidata is somewhat database based, this should allow testing |
| 30 | + of a majority of the code. |
Index: trunk/extensions/Wikidata/App.php |
— | — | @@ -116,6 +116,55 @@ |
117 | 117 | 'ow_concept_panel'=>'Concept Panel', |
118 | 118 | 'ow_dm_badtitle'=>'This page does not point to any DefinedMeaning (concept). Please check the web address.', |
119 | 119 | 'ow_dm_missing'=>'This page seems to point to a non-existent DefinedMeaning (concept). Please check the web address.', |
| 120 | + "AlternativeDefinition" => "Alternative definition", |
| 121 | + "AlternativeDefinitions" => "Alternative definitions", |
| 122 | + "Annotation" => "Annotation", |
| 123 | + "ApproximateMeanings" => "Approximate meanings", |
| 124 | + "ClassAttributeAttribute" => "Attribute", |
| 125 | + "ClassAttributes" => "Class attributes", |
| 126 | + "ClassAttributeLevel" => "Level", |
| 127 | + "ClassAttributeType" => "Type", |
| 128 | + "ClassMembership" => "Class membership", |
| 129 | + "Collection" => "Collection", |
| 130 | + "CollectionMembership" => "Collection membership", |
| 131 | + "Definition" => "Definition", |
| 132 | + "DefinedMeaningAttributes" => "Annotation", |
| 133 | + "DefinedMeaning" => "Defined meaning", |
| 134 | + "DefinedMeaningReference" => "Defined meaning", |
| 135 | + "ExactMeanings" => "Exact meanings", |
| 136 | + "Expression" => "Expression", |
| 137 | + "ExpressionMeanings" => "Expression meanings", |
| 138 | + "Expressions" => "Expressions", |
| 139 | + "IdenticalMeaning" => "Identical meaning?", |
| 140 | + "IncomingRelations" => "Incoming relations", |
| 141 | + "GotoSource" => "Go to source", |
| 142 | + "Language" => "Language", |
| 143 | + "LevelAnnotation" => "Annotation", |
| 144 | + "OptionAttribute" => "Property", |
| 145 | + "OptionAttributeOption" => "Option", |
| 146 | + "OptionAttributeOptions" => "Options", |
| 147 | + "OptionAttributeValues" => "Option properties", |
| 148 | + "OtherDefinedMeaning" => "Other defined meaning", |
| 149 | + "PopupAnnotation" => "Annotation", |
| 150 | + "PossibleSynonym" => "Possible synonym", |
| 151 | + "PossiblySynonymous" => "Possibly synonymous", |
| 152 | + "Relations" => "Relations", |
| 153 | + "RelationType" => "Relation type", |
| 154 | + "Spelling" => "Spelling", |
| 155 | + "Synonyms" => "Synonyms", |
| 156 | + "SynonymsAndTranslations" => "Synonyms and translations", |
| 157 | + "Source" => "Source", |
| 158 | + "SourceIdentifier" => "Source identifier", |
| 159 | + "TextAttribute" => "Property", |
| 160 | + "Text" => "Text", |
| 161 | + "TextAttributeValues" => "String properties", |
| 162 | + "TranslatedTextAttribute" => "Property", |
| 163 | + "TranslatedText" => "Translated text", |
| 164 | + "TranslatedTextAttributeValue" => "Text", |
| 165 | + "TranslatedTextAttributeValues" => "Text properties", |
| 166 | + "LinkAttribute" => "Property", |
| 167 | + "LinkAttributeValues" => "Links" |
| 168 | + |
120 | 169 | ) |
121 | 170 | ); |
122 | 171 | |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php |
— | — | @@ -1,6 +1,13 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -// Attribute names |
| 4 | +require_once("Wikidata.php"); |
| 5 | +// Attribute names (OLD) |
| 6 | +// deprecated/ legacy code |
| 7 | +// these definitions can now be found in App.php |
| 8 | +// would replace all now, but I'd also need to go through |
| 9 | +// OmegaWikiEditors.php with a fine-toothed comb, which I don't |
| 10 | +// feel like doing right now:-P |
| 11 | +//do not use for new items |
5 | 12 | |
6 | 13 | global |
7 | 14 | $wgAlternativeDefinitionAttributeName, |
— | — | @@ -191,4 +198,4 @@ |
192 | 199 | * |
193 | 200 | */ |
194 | 201 | $wgPropertyToColumnFilters = array(); |
195 | | -?> |
\ No newline at end of file |
| 202 | +?> |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | * @deprecated use/update OmegaWikiAttributes->hardValues instead for now. |
47 | 47 | */ |
48 | 48 | function initializeOmegaWikiAttributesOld(ViewInformation $viewInformation) { |
49 | | - global |
| 49 | + global |
50 | 50 | $languageAttribute, $spellingAttribute, $textAttribute, |
51 | 51 | $wgLanguageAttributeName, $wgSpellingAttributeName, $wgTextAttributeName; |
52 | 52 | |
— | — | @@ -351,6 +351,7 @@ |
352 | 352 | foreach ($annotatedAttributes as $annotatedAttribute) |
353 | 353 | $annotatedAttribute->type->addAttribute($attribute); |
354 | 354 | } |
| 355 | + |
355 | 356 | } |
356 | 357 | |
357 | 358 | |
— | — | @@ -368,226 +369,156 @@ |
369 | 370 | */ |
370 | 371 | private function hardValues($viewInformation) { |
371 | 372 | |
372 | | - $a=&$this->attributes; # <- wrist/RSI protection |
373 | | - $t=$this; #<-idem |
| 373 | + $t=$this; #<-keep things short to declutter |
374 | 374 | |
375 | | - global |
376 | | - $wgLanguageAttributeName, $wgSpellingAttributeName, $wgTextAttributeName; |
377 | | - |
378 | | - $t->language = new Attribute("language", $wgLanguageAttributeName, "language"); |
379 | | - $t->spelling = new Attribute("spelling", $wgSpellingAttributeName, "spelling"); |
380 | | - $t->text = new Attribute("text", $wgTextAttributeName, "text"); |
381 | | - |
382 | | - global |
383 | | - $wgDefinedMeaningAttributesAttributeName, |
384 | | - $wgDefinedMeaningAttributesAttributeName, $wgDefinedMeaningAttributesAttributeId, $wgAnnotationAttributeName; |
385 | | - |
386 | | - $t->definedMeaningAttributes = new Attribute("defined-meaning-attributes", $wgDefinedMeaningAttributesAttributeName, "will-be-specified-below"); |
387 | | - $t->objectAttributes = new Attribute("object-attributes", $wgAnnotationAttributeName, "will-be-specified-below"); |
388 | | - |
389 | | - global |
390 | | - $wgIdenticalMeaningAttributeName; |
391 | | - |
| 375 | + $t->language = new Attribute("language", wfMsg("Language"), "language"); |
| 376 | + $t->spelling = new Attribute("spelling", wfMsg("Spelling"), "spelling"); |
| 377 | + $t->text = new Attribute("text", wfMsg("Text"), "text"); |
| 378 | + $t->definedMeaningAttributes = new Attribute("defined-meaning-attributes", wfMsg("DefinedMeaningAttributes"), "will-be-specified-below"); |
| 379 | + $t->objectAttributes = new Attribute("object-attributes", wfMsg("Annotation"), "will-be-specified-below"); |
392 | 380 | $t->expressionId = new Attribute("expression-id", "Expression Id", "expression-id"); |
393 | | - $t->identicalMeaning = new Attribute("indentical-meaning", $wgIdenticalMeaningAttributeName, "boolean"); |
| 381 | + $t->identicalMeaning = new Attribute("indentical-meaning", wfMsg("IdenticalMeaning"), "boolean"); |
394 | 382 | |
395 | | - global |
396 | | - $wgExpressionAttributeName; |
397 | | - |
398 | 383 | if ($viewInformation->filterOnLanguage()) |
399 | | - $t->expression = new Attribute("expression", $wgSpellingAttributeName, "spelling"); |
| 384 | + $t->expression = new Attribute("expression", wfMsg("Spelling"), "spelling"); |
400 | 385 | else { |
401 | 386 | $t->expressionStructure = new Structure("expression", $t->language, $t->spelling); |
402 | | - $t->expression = new Attribute(null, $wgExpressionAttributeName, $t->expressionStructure); |
| 387 | + $t->expression = new Attribute(null, wfMsg("Expression"), $t->expressionStructure); |
403 | 388 | } |
404 | 389 | |
405 | 390 | $t->definedMeaningId = new Attribute("defined-meaning-id", "Defined meaning identifier", "defined-meaning-id"); |
406 | 391 | $t->definedMeaningDefiningExpression = new Attribute("defined-meaning-defining-expression", "Defined meaning defining expression", "short-text"); |
407 | | - |
408 | 392 | $t->definedMeaningCompleteDefiningExpressionStructure = |
409 | | - new Structure("defined-meaning-full-defining-expression", |
410 | | - $t->definedMeaningDefiningExpression, |
411 | | - $t->expressionId, |
412 | | - $t->language |
413 | | - ); |
414 | | - |
| 393 | + new Structure("defined-meaning-full-defining-expression", |
| 394 | + $t->definedMeaningDefiningExpression, |
| 395 | + $t->expressionId, |
| 396 | + $t->language |
| 397 | + ); |
415 | 398 | $t->definedMeaningCompleteDefiningExpression=new Attribute(null, "Defining expression", $t->definedMeaningCompleteDefiningExpressionStructure); |
416 | | - |
417 | | - |
418 | | - |
419 | 399 | global |
420 | | - $definedMeaningReferenceType, $wgDefinedMeaningReferenceAttributeName; |
| 400 | + $definedMeaningReferenceType; |
421 | 401 | |
422 | 402 | $t->definedMeaningLabel = new Attribute("defined-meaning-label", "Defined meaning label", "short-text"); |
423 | 403 | $t->definedMeaningReferenceStructure = new Structure("defined-meaning", $t->definedMeaningId, $t->definedMeaningLabel, $t->definedMeaningDefiningExpression); |
424 | | - |
425 | 404 | $definedMeaningReferenceType = $t->definedMeaningReferenceStructure; |
426 | | - $t->definedMeaningReference = new Attribute(null, $wgDefinedMeaningReferenceAttributeName, $definedMeaningReferenceType); |
427 | | - |
428 | | - global |
429 | | - $wgCollectionAttributeName, $wgSourceIdentifierAttributeName, $wgGotoSourceAttributeName; |
430 | | - |
| 405 | + $t->definedMeaningReference = new Attribute(null, wfMsg("DefinedMeaningReference"), $definedMeaningReferenceType); |
431 | 406 | $t->collectionId = new Attribute("collection", "Collection", "collection-id"); |
432 | | - $t->collectionMeaning = new Attribute("collection-meaning", $wgCollectionAttributeName, $t->definedMeaningReferenceStructure); |
433 | | - $t->sourceIdentifier = new Attribute("source-identifier", $wgSourceIdentifierAttributeName, "short-text"); |
| 407 | + $t->collectionMeaning = new Attribute("collection-meaning", wfMsg("Collection"), $t->definedMeaningReferenceStructure); |
| 408 | + $t->sourceIdentifier = new Attribute("source-identifier", wfMsg("SourceIdentifier"), "short-text"); |
434 | 409 | $t->gotoSourceStructure = new Structure("goto-source",$t->collectionId, $t->sourceIdentifier); |
435 | | - $t->gotoSource = new Attribute(null, $wgGotoSourceAttributeName, $t->gotoSourceStructure); |
436 | | - |
437 | | - global |
438 | | - $wgCollectionMembershipAttributeName, $wgCollectionMembershipAttributeId; |
439 | | - |
| 410 | + $t->gotoSource = new Attribute(null, wfMsg("GotoSource"), $t->gotoSourceStructure); |
440 | 411 | $t->collectionMembershipStructure = new Structure("collection-membership",$t->collectionId, $t->collectionMeaning, $t->sourceIdentifier); |
441 | | - $t->collectionMembership = new Attribute(null, $wgCollectionMembershipAttributeName, $t->collectionMembershipStructure); |
442 | | - |
| 412 | + $t->collectionMembership = new Attribute(null, wfMsg("CollectionMembership"), $t->collectionMembershipStructure); |
443 | 413 | $t->classMembershipId = new Attribute("class-membership-id", "Class membership id", "integer"); |
444 | 414 | $t->class = new Attribute("class", "Class", $t->definedMeaningReferenceStructure); |
445 | | - |
446 | | - global |
447 | | - $wgClassMembershipAttributeName, $wgClassMembershipAttributeId; |
448 | | - |
449 | 415 | $t->classMembershipStructure = new Structure("class-membership", $t->classMembershipId, $t->class); |
450 | | - $t->classMembership = new Attribute(null, $wgClassMembershipAttributeName, $t->classMembershipStructure); |
451 | | - |
| 416 | + $t->classMembership = new Attribute(null, wfMsg("ClassMembership"), $t->classMembershipStructure); |
452 | 417 | global |
453 | | - $wgPossibleSynonymAttributeName, |
454 | | - $wgPossiblySynonymousAttributeName, $wgPossiblySynonymousAttributeId; |
| 418 | + $wgPossiblySynonymousAttributeId; |
455 | 419 | |
456 | 420 | $t->possiblySynonymousId = new Attribute("possibly-synonymous-id", "Possibly synonymous id", "integer"); |
457 | | - $t->possibleSynonym = new Attribute("possible-synonym", $wgPossibleSynonymAttributeName, $t->definedMeaningReferenceStructure); |
| 421 | + $t->possibleSynonym = new Attribute("possible-synonym", wfMsg("PossibleSynonym"), $t->definedMeaningReferenceStructure); |
458 | 422 | # Bug found ... This never worked before: (!) |
459 | 423 | #$t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possiblySynonymous); |
460 | 424 | $t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possibleSynonym); |
461 | | - $t->possiblySynonymous = new Attribute(null, $wgPossiblySynonymousAttributeName, $t->possiblySynonymousStructure); |
| 425 | + $t->possiblySynonymous = new Attribute(null, wfMsg("PossiblySynonymous"), $t->possiblySynonymousStructure); |
462 | 426 | |
463 | 427 | global |
464 | | - $relationTypeType, |
465 | | - $wgRelationTypeAttributeName, $wgOtherDefinedMeaningAttributeName; |
| 428 | + $relationTypeType; |
466 | 429 | |
467 | 430 | $t->relationId = new Attribute("relation-id", "Relation identifier", "object-id"); |
468 | | - $t->relationType = new Attribute("relation-type", $wgRelationTypeAttributeName, $t->definedMeaningReferenceStructure); |
469 | | - $t->otherDefinedMeaning = new Attribute("other-defined-meaning", $wgOtherDefinedMeaningAttributeName, $definedMeaningReferenceType); |
| 431 | + $t->relationType = new Attribute("relation-type", wfMsg("RelationType"), $t->definedMeaningReferenceStructure); |
| 432 | + $t->otherDefinedMeaning = new Attribute("other-defined-meaning", wfMsg("OtherDefinedMeaning"), $definedMeaningReferenceType); |
470 | 433 | |
471 | 434 | global |
472 | | - $wgRelationsAttributeName, $wgIncomingRelationsAttributeName, $wgRelationsAttributeId, $wgIncomingRelationsAttributeId ; |
| 435 | + $wgRelationsAttributeId, $wgIncomingRelationsAttributeId ; |
473 | 436 | |
474 | 437 | $t->relationStructure = new Structure("relations", $t->relationId, $t->relationType, $t->otherDefinedMeaning, $t->objectAttributes); |
475 | | - $t->relations = new Attribute(null, $wgRelationsAttributeName, $t->relationStructure); |
476 | | - $t->reciprocalRelations = new Attribute("reciprocal-relations", $wgIncomingRelationsAttributeName, $t->relationStructure); |
477 | | - |
| 438 | + $t->relations = new Attribute(null, wfMsg("Relations"), $t->relationStructure); |
| 439 | + $t->reciprocalRelations = new Attribute("reciprocal-relations", wfMsg("IncomingRelations"), $t->relationStructure); |
478 | 440 | $t->translatedTextId = new Attribute("translated-text-id", "Translated text ID", "integer"); |
479 | 441 | $t->translatedTextStructure = new Structure("translated-text", $t->language, $t->text); |
480 | 442 | |
481 | | - global |
482 | | - $wgAlternativeDefinitionAttributeName, $wgSourceAttributeName; |
483 | | - |
484 | 443 | $t->definitionId = new Attribute("definition-id", "Definition identifier", "integer"); |
485 | 444 | |
486 | 445 | if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes()) |
487 | | - $t->alternativeDefinition = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, "text"); |
| 446 | + $t->alternativeDefinition = new Attribute("alternative-definition", wfMsg("AlternativeDefinition"), "text"); |
488 | 447 | else |
489 | | - $t->alternativeDefinition = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, $t->translatedTextStructure); |
| 448 | + $t->alternativeDefinition = new Attribute("alternative-definition", wfMsg("AlternativeDefinition"), $t->translatedTextStructure); |
490 | 449 | |
491 | | - $t->source = new Attribute("source-id", $wgSourceAttributeName, $definedMeaningReferenceType); |
| 450 | + $t->source = new Attribute("source-id", wfMsg("Source"), $definedMeaningReferenceType); |
492 | 451 | |
493 | 452 | global |
494 | | - $wgAlternativeDefinitionsAttributeName, $wgAlternativeDefinitionsAttributeId; |
| 453 | + $wgAlternativeDefinitionsAttributeId; |
495 | 454 | |
496 | 455 | $t->alternativeDefinitionsStructure = new Structure("alternative-definitions", $t->definitionId, $t->alternativeDefinition, $t->source); |
497 | 456 | |
498 | | - $t->alternativeDefinitions = new Attribute(null, $wgAlternativeDefinitionsAttributeName, $t->alternativeDefinitionsStructure); |
| 457 | + $t->alternativeDefinitions = new Attribute(null, wfMsg("AlternativeDefinitions"), $t->alternativeDefinitionsStructure); |
499 | 458 | |
500 | 459 | global |
501 | | - $wgSynonymsAttributeName, $wgSynonymsAndTranslationsAttributeName, $wgSynonymsAndTranslationsAttributeId; |
| 460 | + $wgSynonymsAndTranslationsAttributeId; |
502 | 461 | |
503 | 462 | if ($viewInformation->filterOnLanguage()) |
504 | | - $synonymsAndTranslationsCaption = $wgSynonymsAttributeName; |
| 463 | + $synonymsAndTranslationsCaption = wfMsg("Synonyms"); |
505 | 464 | else |
506 | | - $synonymsAndTranslationsCaption = $wgSynonymsAndTranslationsAttributeName; |
| 465 | + $synonymsAndTranslationsCaption = wfMsg("SynonymsAndTranslations"); |
507 | 466 | |
508 | 467 | $t->syntransId = new Attribute("syntrans-id", "$synonymsAndTranslationsCaption identifier", "integer"); |
509 | 468 | $t->synonymsTranslationsStructure = new Structure("synonyms-translations", $t->syntransId, $t->expression, $t->identicalMeaning, $t->objectAttributes); |
510 | 469 | $t->synonymsAndTranslations = new Attribute(null, "$synonymsAndTranslationsCaption", $t->synonymsTranslationsStructure); |
511 | | - |
512 | | - global |
513 | | - $wgTranslatedTextAttributeValuesAttributeName, $wgTranslatedTextAttributeAttributeName, $wgTranslatedTextAttributeValueAttributeName; |
514 | | - |
515 | 470 | $t->translatedTextAttributeId = new Attribute("translated-text-attribute-id", "Attribute identifier", "object-id"); |
516 | 471 | $t->translatedTextAttributeObject = new Attribute("translated-text-attribute-object-id", "Attribute object", "object-id"); |
517 | | - $t->translatedTextAttribute = new Attribute("translated-text-attribute", $wgTranslatedTextAttributeAttributeName, $definedMeaningReferenceType); |
| 472 | + $t->translatedTextAttribute = new Attribute("translated-text-attribute", wfMsg("TranslatedTextAttribute"), $definedMeaningReferenceType); |
518 | 473 | $t->translatedTextValueId = new Attribute("translated-text-value-id", "Translated text value identifier", "translated-text-value-id"); |
519 | 474 | |
520 | 475 | if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes()) |
521 | | - $t->translatedTextValue = new Attribute("translated-text-value", $wgTranslatedTextAttributeValueAttributeName, "text"); |
| 476 | + $t->translatedTextValue = new Attribute("translated-text-value", wfMsg("TranslatedTextAttributeValue"), "text"); |
522 | 477 | else |
523 | | - $t->translatedTextValue = new Attribute("translated-text", $wgTranslatedTextAttributeValueAttributeName, $t->translatedTextStructure); |
| 478 | + $t->translatedTextValue = new Attribute("translated-text", wfMsg("TranslatedTextAttributeValue"), $t->translatedTextStructure); |
524 | 479 | |
525 | 480 | $t->translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$t->translatedTextAttributeId, $t->translatedTextAttributeObject, $t->translatedTextAttribute, $t->translatedTextValueId, $t->translatedTextValue, $t->objectAttributes); |
526 | | - $t->translatedTextAttributeValues = new Attribute(null, $wgTranslatedTextAttributeValuesAttributeName, $t->translatedTextAttributeValuesStructure); |
527 | | - |
528 | | - global |
529 | | - $wgTextAttributeValuesAttributeName, $wgTextAttributeAttributeName; |
530 | | - |
| 481 | + $t->translatedTextAttributeValues = new Attribute(null, wfMsg("TranslatedTextAttributeValues"), $t->translatedTextAttributeValuesStructure); |
531 | 482 | $t->textAttributeId = new Attribute("text-attribute-id", "Attribute identifier", "object-id"); |
532 | 483 | $t->textAttributeObject = new Attribute("text-attribute-object-id", "Attribute object", "object-id"); |
533 | | - $t->textAttribute = new Attribute("text-attribute", $wgTextAttributeAttributeName, $t->definedMeaningReferenceStructure); |
| 484 | + $t->textAttribute = new Attribute("text-attribute", wfMsg("TextAttribute"), $t->definedMeaningReferenceStructure); |
534 | 485 | $t->textAttributeValuesStructure = new Structure("text-attribute-values", $t->textAttributeId, $t->textAttributeObject, $t->textAttribute, $t->text, $t->objectAttributes); |
535 | | - $t->textAttributeValues = new Attribute(null, $wgTextAttributeValuesAttributeName, $t->textAttributeValuesStructure); |
536 | | - |
537 | | - global |
538 | | - $wgLinkAttributeValuesAttributeName, $wgLinkAttributeAttributeName; |
539 | | - |
| 486 | + $t->textAttributeValues = new Attribute(null, wfMsg("TextAttributeValues"), $t->textAttributeValuesStructure); |
540 | 487 | $t->linkLabel = new Attribute("label", "Label", "short-text"); |
541 | 488 | $t->linkURL = new Attribute("url", "URL", "url"); |
542 | 489 | $t->link = new Attribute("link", "Link", new Structure($t->linkLabel, $t->linkURL)); |
543 | 490 | |
544 | 491 | $t->linkAttributeId = new Attribute("link-attribute-id", "Attribute identifier", "object-id"); |
545 | 492 | $t->linkAttributeObject = new Attribute("link-attribute-object-id", "Attribute object", "object-id"); |
546 | | - $t->linkAttribute = new Attribute("link-attribute", $wgLinkAttributeAttributeName, $t->definedMeaningReferenceStructure); |
| 493 | + $t->linkAttribute = new Attribute("link-attribute", wfMsg("LinkAttribute"), $t->definedMeaningReferenceStructure); |
547 | 494 | $t->linkAttributeValuesStructure = new Structure("link-attribute-values", $t->linkAttributeId, $t->linkAttributeObject, $t->linkAttribute, $t->link, $t->objectAttributes); |
548 | | - $t->linkAttributeValues = new Attribute(null, $wgLinkAttributeValuesAttributeName, $t->linkAttributeValuesStructure); |
549 | | - |
550 | | - global |
551 | | - $wgOptionAttributeAttributeName, $wgOptionAttributeOptionAttributeName, $wgOptionAttributeValuesAttributeName; |
552 | | - |
| 495 | + $t->linkAttributeValues = new Attribute(null, wfMsg("LinkAttributeValues"), $t->linkAttributeValuesStructure); |
553 | 496 | $t->optionAttributeId = new Attribute('option-attribute-id', 'Attribute identifier', 'object-id'); |
554 | 497 | $t->optionAttributeObject = new Attribute('option-attribute-object-id', 'Attribute object', 'object-id'); |
555 | | - $t->optionAttribute = new Attribute('option-attribute', $wgOptionAttributeAttributeName, $definedMeaningReferenceType); |
556 | | - $t->optionAttributeOption = new Attribute('option-attribute-option', $wgOptionAttributeOptionAttributeName, $definedMeaningReferenceType); |
| 498 | + $t->optionAttribute = new Attribute('option-attribute', wfMsg("OptionAttribute"), $definedMeaningReferenceType); |
| 499 | + $t->optionAttributeOption = new Attribute('option-attribute-option', wfMsg("OptionAttributeOption"), $definedMeaningReferenceType); |
557 | 500 | $t->optionAttributeValuesStructure = new Structure('option-attribute-values', $t->optionAttributeId, $t->optionAttribute, $t->optionAttributeObject, $t->optionAttributeOption, $t->objectAttributes); |
558 | | - $t->optionAttributeValues = new Attribute(null, $wgOptionAttributeValuesAttributeName, $t->optionAttributeValuesStructure); |
559 | | - |
560 | | - global |
561 | | - $wgOptionAttributeOptionsAttributeName; |
562 | | - |
| 501 | + $t->optionAttributeValues = new Attribute(null, wfMsg("OptionAttributeValues"), $t->optionAttributeValuesStructure); |
563 | 502 | $t->optionAttributeOptionId = new Attribute('option-attribute-option-id', 'Option identifier', 'object-id'); |
564 | 503 | $t->optionAttributeOptionsStructure = new Structure('option-attribute-options', $t->optionAttributeOptionId, $t->optionAttribute, $t->optionAttributeOption, $t->language); |
565 | | - $t->optionAttributeOptions = new Attribute(null, $wgOptionAttributeOptionsAttributeName, $t->optionAttributeOptionsStructure); |
566 | | - |
567 | | - global |
568 | | - $wgDefinitionAttributeName, $wgTranslatedTextAttributeName; |
569 | | - |
| 504 | + $t->optionAttributeOptions = new Attribute(null, wfMsg("OptionAttributeOptions"), $t->optionAttributeOptionsStructure); |
570 | 505 | if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes()) |
571 | | - $t->translatedText = new Attribute("translated-text", $wgTextAttributeName, "text"); |
| 506 | + $t->translatedText = new Attribute("translated-text", wfMsg("Text"), "text"); |
572 | 507 | else |
573 | | - $t->translatedText = new Attribute(null, $wgTranslatedTextAttributeName, $t->translatedTextStructure); |
| 508 | + $t->translatedText = new Attribute(null, wfMsg("TranslatedText"), $t->translatedTextStructure); |
574 | 509 | |
575 | | - $t->definition = new Attribute(null, $wgDefinitionAttributeName, new Structure("definition", $t->translatedText, $t->objectAttributes)); |
| 510 | + $t->definition = new Attribute(null, wfMsg("Definition"), new Structure("definition", $t->translatedText, $t->objectAttributes)); |
576 | 511 | |
577 | 512 | global |
578 | | - $wgClassAttributeAttributeAttributeName, $wgClassAttributeLevelAttributeName, |
579 | | - $wgClassAttributeTypeAttributeName, $wgClassAttributesAttributeName, $wgClassAttributesAttributeId; |
| 513 | + $wgClassAttributesAttributeId; |
580 | 514 | |
581 | 515 | $t->classAttributeId = new Attribute("class-attribute-id", "Class attribute identifier", "object-id"); |
582 | | - $t->classAttributeAttribute = new Attribute("class-attribute-attribute", $wgClassAttributeAttributeAttributeName, $t->definedMeaningReferenceStructure); |
583 | | - $t->classAttributeLevel = new Attribute("class-attribute-level", $wgClassAttributeLevelAttributeName, $t->definedMeaningReferenceStructure); |
584 | | - $t->classAttributeType = new Attribute("class-attribute-type", $wgClassAttributeTypeAttributeName, "short-text"); |
| 516 | + $t->classAttributeAttribute = new Attribute("class-attribute-attribute", wfMsg("ClassAttributeAttribute"), $t->definedMeaningReferenceStructure); |
| 517 | + $t->classAttributeLevel = new Attribute("class-attribute-level", wfMsg("ClassAttributeLevel"), $t->definedMeaningReferenceStructure); |
| 518 | + $t->classAttributeType = new Attribute("class-attribute-type", wfMsg("ClassAttributeType"), "short-text"); |
585 | 519 | $t->classAttributesStructure = new Structure("class-attributes", $t->classAttributeId, $t->classAttributeAttribute, $t->classAttributeLevel, $t->classAttributeType, $t->optionAttributeOptions); |
586 | | - $t->classAttributes = new Attribute(null, $wgClassAttributesAttributeName, $t->classAttributesStructure); |
587 | | - |
588 | | - global |
589 | | - $wgDefinedMeaningAttributeName; |
| 520 | + $t->classAttributes = new Attribute(null, wfMsg("ClassAttributes"), $t->classAttributesStructure); |
590 | 521 | |
591 | | - $t->definedMeaning = new Attribute(null, $wgDefinedMeaningAttributeName, |
| 522 | + $t->definedMeaning = new Attribute(null, wfMsg("DefinedMeaning"), |
592 | 523 | new Structure( |
593 | 524 | "defined-meaning", |
594 | 525 | $t->definition, |
— | — | @@ -601,26 +532,14 @@ |
602 | 533 | $t->definedMeaningAttributes) |
603 | 534 | ); |
604 | 535 | |
605 | | - global |
606 | | - $wgExactMeaningsAttributeName, $wgApproximateMeaningsAttributeName; |
607 | | - |
608 | 536 | $t->expressionMeaningStructure = new Structure("expression-exact-meanings", $t->definedMeaningId, $t->text, $t->definedMeaning); |
609 | | - $t->expressionExactMeanings = new Attribute(null, $wgExactMeaningsAttributeName, $t->expressionMeaningStructure); |
610 | | - $t->expressionApproximateMeanings = new Attribute("expression-approximate-meanings", $wgApproximateMeaningsAttributeName, $t->expressionMeaningStructure); |
611 | | - |
612 | | - global |
613 | | - $wgExpressionMeaningsAttributeName, $wgExpressionsAttributeName; |
614 | | - |
| 537 | + $t->expressionExactMeanings = new Attribute(null, wfMsg("ExactMeanings"), $t->expressionMeaningStructure); |
| 538 | + $t->expressionApproximateMeanings = new Attribute("expression-approximate-meanings", wfMsg("ApproximateMeanings"), $t->expressionMeaningStructure); |
615 | 539 | # bug found here also: $t->expressionAoproximateMeaning_S_ |
616 | 540 | $t->expressionMeaningsStructure = new Structure("expression-meanings", $t->expressionExactMeanings, $t->expressionApproximateMeanings); |
617 | | - $t->expressionMeanings = new Attribute(null, $wgExpressionMeaningsAttributeName, $t->expressionMeaningsStructure); |
618 | | - |
| 541 | + $t->expressionMeanings = new Attribute(null, wfMsg("ExpressionMeanings"), $t->expressionMeaningsStructure); |
619 | 542 | $t->expressionsStructure = new Structure("expressions", $t->expressionId, $t->expression, $t->expressionMeanings); |
620 | | - $t->expressions = new Attribute(null, $wgExpressionsAttributeName, $t->expressionsStructure); |
621 | | - |
622 | | - global |
623 | | - $wgAnnotationAttributeName; |
624 | | - |
| 543 | + $t->expressions = new Attribute(null, wfMsg("Expressions"), $t->expressionsStructure); |
625 | 544 | $t->objectId = new Attribute("object-id", "Object identifier", "object-id"); |
626 | 545 | $t->objectAttributesStructure = new Structure("object-attributes", $t->objectId, $t->textAttributeValues, $t->translatedTextAttributeValues, $t->optionAttributeValues); |
627 | 546 | $t->objectAttributes->setAttributeType($t->objectAttributesStructure); |
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php |
— | — | @@ -137,44 +137,34 @@ |
138 | 138 | return false; |
139 | 139 | } |
140 | 140 | |
141 | | - global |
142 | | - $definedMeaningAttribute, |
143 | | - $definitionAttribute, |
144 | | - $classAttributesAttribute, |
145 | | - $alternativeDefinitionsAttribute, |
146 | | - $synonymsAndTranslationsAttribute, |
147 | | - $relationsAttribute, |
148 | | - $reciprocalRelationsAttribute, |
149 | | - $classMembershipAttribute, |
150 | | - $collectionMembershipAttribute, |
151 | | - $definedMeaningAttributesAttribute, |
152 | | - $possiblySynonymousAttribute, |
153 | | - $definedMeaningCompleteDefiningExpressionAttribute; |
154 | | - |
155 | 141 | $id=$this->getId(); |
156 | 142 | $view=$this->getViewInformation(); |
157 | 143 | /** FIXME: Records should be loaded using helpers rather than |
158 | 144 | global functions! */ |
159 | | - $record = new ArrayRecord($definedMeaningAttribute->type); |
160 | | - $record->setAttributeValue($definedMeaningCompleteDefiningExpressionAttribute, getDefiningExpressionRecord($id)); |
161 | | - $record->setAttributeValue($definitionAttribute, getDefinedMeaningDefinitionRecord($id, $view)); |
162 | | - $record->setAttributeValue($classAttributesAttribute, getClassAttributesRecordSet($id, $view)); |
163 | | - $record->setAttributeValue($alternativeDefinitionsAttribute, getAlternativeDefinitionsRecordSet($id, $view)); |
164 | | - $record->setAttributeValue($synonymsAndTranslationsAttribute, getSynonymAndTranslationRecordSet($id, $view)); |
| 145 | + global |
| 146 | + $omegaWikiAttributes; |
| 147 | + $o=$omegaWikiAttributes; |
| 148 | + |
| 149 | + $record = new ArrayRecord($o->definedMeaning->type); |
| 150 | + $record->definedMeaningCompleteDefiningExpression = getDefiningExpressionRecord($id); |
| 151 | + $record->definition = getDefinedMeaningDefinitionRecord($id, $view); |
| 152 | + $record->classAttributes = getClassAttributesRecordSet($id, $view); |
| 153 | + $record->alternativeDefinitions = getAlternativeDefinitionsRecordSet($id, $view); |
| 154 | + $record->synonymsAndTranslations = getSynonymAndTranslationRecordSet($id, $view); |
165 | 155 | $filterRelationTypes = array(); |
166 | 156 | |
167 | 157 | if ($view->possiblySynonymousRelationTypeId != 0) { |
168 | | - $record->setAttributeValue($possiblySynonymousAttribute, getPossiblySynonymousRecordSet($id, $view)); |
| 158 | + $record->possiblySynonymous = getPossiblySynonymousRecordSet($id, $view); |
169 | 159 | $filterRelationTypes[] = $view->possiblySynonymousRelationTypeId; |
170 | 160 | } |
171 | 161 | |
172 | | - $record->setAttributeValue($relationsAttribute, getDefinedMeaningRelationsRecordSet($id, $filterRelationTypes, $view)); |
173 | | - $record->setAttributeValue($reciprocalRelationsAttribute, getDefinedMeaningReciprocalRelationsRecordSet($id, $view)); |
174 | | - $record->setAttributeValue($classMembershipAttribute, getDefinedMeaningClassMembershipRecordSet($id, $view)); |
175 | | - $record->setAttributeValue($collectionMembershipAttribute, getDefinedMeaningCollectionMembershipRecordSet($id, $view)); |
| 162 | + $record->relations = getDefinedMeaningRelationsRecordSet($id, $filterRelationTypes, $view); |
| 163 | + $record->reciprocalRelations = getDefinedMeaningReciprocalRelationsRecordSet($id, $view); |
| 164 | + $record->classMembership = getDefinedMeaningClassMembershipRecordSet($id, $view); |
| 165 | + $record->collectionMembership= getDefinedMeaningCollectionMembershipRecordSet($id, $view); |
176 | 166 | |
177 | 167 | $objectAttributesRecord = getObjectAttributesRecord($id, $view); |
178 | | - $record->setAttributeValue($definedMeaningAttributesAttribute, $objectAttributesRecord); |
| 168 | + $record->definedMeaningAttributes = $objectAttributesRecord; |
179 | 169 | applyPropertyToColumnFiltersToRecord($record, $objectAttributesRecord, $view); |
180 | 170 | |
181 | 171 | $this->record=$record; |
Index: trunk/extensions/Wikidata/OmegaWiki/small/overload.php |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +<?PHP |
| 3 | + |
| 4 | + |
| 5 | +class bla { |
| 6 | + protected $foo = array(); |
| 7 | + |
| 8 | + function __set($key,$value) { |
| 9 | + $this->foo[$key]=$value; |
| 10 | + } |
| 11 | + |
| 12 | + function __get($key) { |
| 13 | + return $this->foo[$key]; |
| 14 | + } |
| 15 | +} |
| 16 | + |
| 17 | +$b=new bla(); |
| 18 | +$baz="bar"; |
| 19 | +$b->$baz="hello"; |
| 20 | +echo $b->bar; |
| 21 | + |
| 22 | +?> |
Index: trunk/extensions/Wikidata/OmegaWiki/small/functionvar.php |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class bla { |
| 5 | + |
| 6 | + |
| 7 | + static function a($hello) { |
| 8 | + echo $hello; |
| 9 | + } |
| 10 | + |
| 11 | + function b() { |
| 12 | + $a="a"; |
| 13 | + $x=$this->$a; |
| 14 | + $x("hello world"); |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +$c=new bla(); |
| 19 | +$c->b(); |
| 20 | + |
| 21 | + |
| 22 | +?> |
Index: trunk/extensions/Wikidata/OmegaWiki/small/scoping.php |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +<?php |
| 3 | +static $bla="hello"; |
| 4 | + |
| 5 | +function a($foo) { |
| 6 | + final $bla=$foo; |
| 7 | + echo $bla; |
| 8 | +} |
| 9 | + |
| 10 | +a("hello"); |
| 11 | +a("bye"); |
| 12 | + |
| 13 | + |
| 14 | +?> |
Index: trunk/extensions/Wikidata/OmegaWiki/small/searchterms.sh |
— | — | @@ -0,0 +1,50 @@ |
| 2 | +#!/bin/sh |
| 3 | + |
| 4 | + |
| 5 | +grep -l 'wgAlternativeDefinitionAttributeName' * |
| 6 | +grep -l 'wgAlternativeDefinitionsAttributeName' * |
| 7 | +grep -l 'wgAnnotationAttributeName' * |
| 8 | +grep -l 'wgApproximateMeaningsAttributeName' * |
| 9 | +grep -l 'wgClassAttributeAttributeAttributeName' * |
| 10 | +grep -l 'wgClassAttributesAttributeName' * |
| 11 | +grep -l 'wgClassAttributeLevelAttributeName' * |
| 12 | +grep -l 'wgClassAttributeTypeAttributeName' * |
| 13 | +grep -l 'wgClassMembershipAttributeName' * |
| 14 | +grep -l 'wgCollectionAttributeName' * |
| 15 | +grep -l 'wgCollectionMembershipAttributeName' * |
| 16 | +grep -l 'wgDefinedMeaningAttributesAttributeName' * |
| 17 | +grep -l 'wgDefinedMeaningAttributeName' * |
| 18 | +grep -l 'wgDefinedMeaningReferenceAttributeName' * |
| 19 | +grep -l 'wgDefinitionAttributeName' * |
| 20 | +grep -l 'wgLanguageAttributeName' * |
| 21 | +grep -l 'wgExactMeaningsAttributeName' * |
| 22 | +grep -l 'wgExpressionAttributeName' * |
| 23 | +grep -l 'wgExpressionMeaningsAttributeName' * |
| 24 | +grep -l 'wgExpressionsAttributeName' * |
| 25 | +grep -l 'wgGotoSourceAttributeName' * |
| 26 | +grep -l 'wgIdenticalMeaningAttributeName' * |
| 27 | +grep -l 'wgIncomingRelationsAttributeName' * |
| 28 | +grep -l 'wgLevelAnnotationAttributeName' * |
| 29 | +grep -l 'wgLinkAttributeAttributeName' * |
| 30 | +grep -l 'wgLinkAttributeValuesAttributeName' * |
| 31 | +grep -l 'wgOptionAttributeOptionAttributeName' * |
| 32 | +grep -l 'wgOptionAttributeOptionsAttributeName' * |
| 33 | +grep -l 'wgOptionAttributeValuesAttributeName' * |
| 34 | +grep -l 'wgOtherDefinedMeaningAttributeName' * |
| 35 | +grep -l 'wgPopupAnnotationName' * |
| 36 | +grep -l 'wgPossibleSynonymAttributeName' * |
| 37 | +grep -l 'wgPossiblySynonymousAttributeName' * |
| 38 | +grep -l 'wgRelationsAttributeName' * |
| 39 | +grep -l 'wgRelationTypeAttributeName' * |
| 40 | +grep -l 'wgSourceAttributeName' * |
| 41 | +grep -l 'wgSourceIdentifierAttributeName' * |
| 42 | +grep -l 'wgSpellingAttributeName' * |
| 43 | +grep -l 'wgSynonymsAttributeName' * |
| 44 | +grep -l 'wgSynonymsAndTranslationsAttributeName' * |
| 45 | +grep -l 'wgTextAttributeAttributeName' * |
| 46 | +grep -l 'wgTextAttributeName' * |
| 47 | +grep -l 'wgTextAttributeValuesAttributeName' * |
| 48 | +grep -l 'wgTranslatedTextAttributeAttributeName' * |
| 49 | +grep -l 'wgTranslatedTextAttributeName' * |
| 50 | +grep -l 'wgTranslatedTextAttributeValueAttributeName' * |
| 51 | +grep -l 'wgTranslatedTextAttributeValuesAttributeName' * |
Property changes on: trunk/extensions/Wikidata/OmegaWiki/small/searchterms.sh |
___________________________________________________________________ |
Added: svn:executable |
1 | 52 | + * |