r23689 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23688‎ | r23689 | r23690 >
Date:21:57, 3 July 2007
Author:erik
Status:old
Tags:
Comment:
add DM defining expression to record
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php
@@ -1119,4 +1119,19 @@
11201120 return $recordSet;
11211121 }
11221122
 1123+function getDefiningExpressionRecord($definedMeaningId) {
11231124
 1125+ global
 1126+ $definedMeaningCompleteDefiningExpressionAttribute,
 1127+ $definedMeaningDefiningExpressionAttribute,
 1128+ $expressionIdAttribute,
 1129+ $languageAttribute;
 1130+
 1131+ $definingExpression=definingExpressionRow($definedMeaningId);
 1132+ $definingExpressionRecord = new ArrayRecord($definedMeaningCompleteDefiningExpressionAttribute->type);
 1133+ $definingExpressionRecord->setAttributeValue($expressionIdAttribute, $definingExpression[0]);
 1134+ $definingExpressionRecord->setAttributeValue($definedMeaningDefiningExpressionAttribute, $definingExpression[1]);
 1135+ $definingExpressionRecord->setAttributeValue($languageAttribute, $definingExpression[2]);
 1136+ return $definingExpressionRecord;
 1137+
 1138+}
\ No newline at end of file
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -30,8 +30,8 @@
3131 $alternativeDefinitionsAttribute, $synonymsAndTranslationsAttribute,
3232 $relationsAttribute, $reciprocalRelationsAttribute,
3333 $classMembershipAttribute, $collectionMembershipAttribute, $definedMeaningAttributesAttribute,
34 - $possiblySynonymousAttribute;
35 -
 34+ $possiblySynonymousAttribute, $definedMeaningCompleteDefiningExpressionAttribute;
 35+
3636 if (is_null($viewInformation)) {
3737 $viewInformation = new ViewInformation();
3838 $viewInformation->queryTransactionInformation= new QueryLatestTransactionInformation();
@@ -40,6 +40,7 @@
4141 #wfDebug("definedMeaningId:$definedMeaningId, filterLanguageId:$viewInformation->filterLanguageId, possiblySynonymousRelationTypeId:$viewInformation->possiblySynonymousRelationTypeId, queryTransactionInformation:$viewInformation->queryTransactionInformation\n");
4242 $this->setDefinedMeaningID($definedMeaningId);
4343 $record = new ArrayRecord($definedMeaningAttribute->type);
 44+ $record->setAttributeValue($definedMeaningCompleteDefiningExpressionAttribute, getDefiningExpressionRecord($definedMeaningId));
4445 $record->setAttributeValue($definitionAttribute, getDefinedMeaningDefinitionRecord($definedMeaningId, $viewInformation));
4546 $record->setAttributeValue($classAttributesAttribute, getClassAttributesRecordSet($definedMeaningId, $viewInformation));
4647 $record->setAttributeValue($alternativeDefinitionsAttribute, getAlternativeDefinitionsRecordSet($definedMeaningId, $viewInformation));
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php
@@ -59,10 +59,22 @@
6060 }
6161
6262 global
63 - $definedMeaningIdAttribute, $definedMeaningDefiningExpressionAttribute;
 63+ $definedMeaningIdAttribute, $definedMeaningDefiningExpressionAttribute,
 64+ $definedMeaningCompleteDefiningExpressionStructure,
 65+ $definedMeaningCompleteDefiningExpressionAttribute;
6466
6567 $definedMeaningIdAttribute = new Attribute("defined-meaning-id", "Defined meaning identifier", "defined-meaning-id");
6668 $definedMeaningDefiningExpressionAttribute = new Attribute("defined-meaning-defining-expression", "Defined meaning defining expression", "short-text");
 69+
 70+ $definedMeaningCompleteDefiningExpressionStructure =
 71+ new Structure("defined-meaning-full-defining-expression",
 72+ $definedMeaningDefiningExpressionAttribute,
 73+ $expressionIdAttribute,
 74+ $languageAttribute
 75+ );
 76+ $definedMeaningCompleteDefiningExpressionAttribute=new Attribute(null, "Defining expression", $definedMeaningCompleteDefiningExpressionStructure);
 77+
 78+
6779
6880 global
6981 $definedMeaningReferenceStructure, $definedMeaningLabelAttribute, $definedMeaningReferenceType,

Status & tagging log