Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php |
— | — | @@ -561,7 +561,7 @@ |
562 | 562 | $record = new ArrayRecord($o->definedMeaningAttributes->type); |
563 | 563 | |
564 | 564 | $record->objectId = $objectId; |
565 | | - $record->relations = getDefinedMeaningAttributeValuesRecordSet(array($objectId), array(), $viewInformation); |
| 565 | + $record->relations = getDefinedMeaningAttributeValuesRecordSet(array($objectId), $viewInformation); |
566 | 566 | $record->textAttributeValues = getTextAttributesValuesRecordSet(array($objectId), $viewInformation); |
567 | 567 | $record->translatedTextAttributeValues = getTranslatedTextAttributeValuesRecordSet(array($objectId), $viewInformation); |
568 | 568 | $record->linkAttributeValues = getLinkAttributeValuesRecordSet(array($objectId), $viewInformation); |
— | — | @@ -758,7 +758,7 @@ |
759 | 759 | } |
760 | 760 | |
761 | 761 | // Defined meaning attributes |
762 | | - $allDefinedMeaningAttributeValuesRecordSet = getDefinedMeaningAttributeValuesRecordSet($objectIds, array(), $viewInformation); |
| 762 | + $allDefinedMeaningAttributeValuesRecordSet = getDefinedMeaningAttributeValuesRecordSet($objectIds, $viewInformation); |
763 | 763 | $definedMeaningAttributeValuesRecordSets = |
764 | 764 | splitRecordSet( |
765 | 765 | $allDefinedMeaningAttributeValuesRecordSet, |
— | — | @@ -868,15 +868,11 @@ |
869 | 869 | return $record; |
870 | 870 | } |
871 | 871 | |
872 | | -function getDefinedMeaningAttributeValuesRecordSet(array $objectIds, array $filterRelationTypes, ViewInformation $viewInformation) { |
| 872 | +function getDefinedMeaningAttributeValuesRecordSet(array $objectIds, ViewInformation $viewInformation) { |
873 | 873 | global |
874 | 874 | $meaningRelationsTable; |
875 | 875 | |
876 | 876 | $o=OmegaWikiAttributes::getInstance(); |
877 | | -// $restrictions = array("meaning1_mid=$definedMeaningId"); |
878 | | -// |
879 | | -// if (count($filterRelationTypes) > 0) |
880 | | -// $restrictions[] = "relationtype_mid NOT IN (". implode(", ", $filterRelationTypes) .")"; |
881 | 877 | |
882 | 878 | $recordSet = queryRecordSet( |
883 | 879 | $o->relationStructure->getStructureType(), |
— | — | @@ -924,36 +920,7 @@ |
925 | 921 | return $recordSet; |
926 | 922 | } |
927 | 923 | |
928 | | -function getPossiblySynonymousRecordSet($definedMeaningId, ViewInformation $viewInformation) { |
929 | | - |
930 | | - $o=OmegaWikiAttributes::getInstance(); |
931 | | - global |
932 | | - $meaningRelationsTable; |
933 | | - |
934 | | - $recordSet = queryRecordSet( |
935 | | - null, |
936 | | - $viewInformation->queryTransactionInformation, |
937 | | - $o->possiblySynonymousId, |
938 | | - new TableColumnsToAttributesMapping( |
939 | | - new TableColumnsToAttribute(array('relation_id'), $o->possiblySynonymousId), |
940 | | - new TableColumnsToAttribute(array('meaning2_mid'), $o->possibleSynonym) |
941 | | - ), |
942 | | - $meaningRelationsTable, |
943 | | - array( |
944 | | - "meaning1_mid=$definedMeaningId", |
945 | | - "relationtype_mid=" . $viewInformation->possiblySynonymousRelationTypeId |
946 | | - ), |
947 | | - array('add_transaction_id') |
948 | | - ); |
949 | | - |
950 | | - expandDefinedMeaningReferencesInRecordSet($recordSet, array($o->possibleSynonym)); |
951 | | - expandObjectAttributesAttribute($recordSet, $o->objectAttributes, $o->possiblySynonymousId, $viewInformation); |
952 | | - |
953 | | - return $recordSet; |
954 | | -} |
955 | | - |
956 | 924 | function getGotoSourceRecord($record) { |
957 | | - |
958 | 925 | $o=OmegaWikiAttributes::getInstance(); |
959 | 926 | |
960 | 927 | $result = new ArrayRecord($o->gotoSourceStructure); |
— | — | @@ -964,11 +931,11 @@ |
965 | 932 | } |
966 | 933 | |
967 | 934 | function getDefinedMeaningCollectionMembershipRecordSet($definedMeaningId, ViewInformation $viewInformation) { |
968 | | - |
969 | | - $o=OmegaWikiAttributes::getInstance(); |
970 | 935 | global |
971 | 936 | $collectionMembershipsTable; |
972 | 937 | |
| 938 | + $o=OmegaWikiAttributes::getInstance(); |
| 939 | + |
973 | 940 | $recordSet = queryRecordSet( |
974 | 941 | $o->collectionMembershipStructure->getStructureType(), |
975 | 942 | $viewInformation->queryTransactionInformation, |
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php |
— | — | @@ -150,13 +150,6 @@ |
151 | 151 | $record->classAttributes = getClassAttributesRecordSet($id, $view); |
152 | 152 | $record->alternativeDefinitions = getAlternativeDefinitionsRecordSet($id, $view); |
153 | 153 | $record->synonymsAndTranslations = getSynonymAndTranslationRecordSet($id, $view); |
154 | | - $filterRelationTypes = array(); |
155 | | - |
156 | | - if ($view->possiblySynonymousRelationTypeId != 0) { |
157 | | - $record->possiblySynonymous = getPossiblySynonymousRecordSet($id, $view); |
158 | | - $filterRelationTypes[] = $view->possiblySynonymousRelationTypeId; |
159 | | - } |
160 | | - |
161 | 154 | $record->reciprocalRelations = getDefinedMeaningReciprocalRelationsRecordSet($id, $view); |
162 | 155 | $record->classMembership = getDefinedMeaningClassMembershipRecordSet($id, $view); |
163 | 156 | $record->collectionMembership= getDefinedMeaningCollectionMembershipRecordSet($id, $view); |
Index: trunk/extensions/Wikidata/OmegaWiki/ViewInformation.php |
— | — | @@ -13,7 +13,6 @@ |
14 | 14 | |
15 | 15 | class ViewInformation { |
16 | 16 | public $filterLanguageId; |
17 | | - public $possiblySynonymousRelationTypeId; |
18 | 17 | public $queryTransactionInformation; |
19 | 18 | public $showRecordLifeSpan; |
20 | 19 | public $viewOrEdit; |
— | — | @@ -22,7 +21,6 @@ |
23 | 22 | |
24 | 23 | public function __construct() { |
25 | 24 | $this->filterLanguageId = 0; |
26 | | - $this->possiblySynonymousRelationTypeId = 0; |
27 | 25 | $this->queryTransactionInformation; |
28 | 26 | $this->showRecordLifeSpan = false; |
29 | 27 | $this->propertyToColumnFilters = array(); |
— | — | @@ -63,7 +61,6 @@ |
64 | 62 | public function hashCode() { |
65 | 63 | return |
66 | 64 | $this->filterLanguageId.",". |
67 | | - $this->possiblySynonymousRelationTypeId.",". |
68 | 65 | $this->showRecordLifeSpan.",". |
69 | 66 | $this->viewOrEdit; |
70 | 67 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php |
— | — | @@ -41,8 +41,6 @@ |
42 | 42 | $wgOptionAttributeValuesAttributeName, |
43 | 43 | $wgOtherDefinedMeaningAttributeName, |
44 | 44 | $wgPopupAnnotationName, |
45 | | - $wgPossibleSynonymAttributeName, |
46 | | - $wgPossiblySynonymousAttributeName, |
47 | 45 | $wgRelationsAttributeName, |
48 | 46 | $wgRelationTypeAttributeName, |
49 | 47 | $wgSourceAttributeName, |
— | — | @@ -88,8 +86,6 @@ |
89 | 87 | $wgOptionAttributeValuesAttributeName = "Options"; |
90 | 88 | $wgOtherDefinedMeaningAttributeName = "Other defined meaning"; |
91 | 89 | $wgPopupAnnotationName = "Annotation"; |
92 | | -$wgPossibleSynonymAttributeName = "Possible synonym"; |
93 | | -$wgPossiblySynonymousAttributeName = "Possibly synonymous"; |
94 | 90 | $wgRelationsAttributeName = "Relations"; |
95 | 91 | $wgRelationTypeAttributeName = "Relation type"; |
96 | 92 | $wgSpellingAttributeName = "Spelling"; |
— | — | @@ -117,7 +113,6 @@ |
118 | 114 | $wgDefinedMeaningAttributesAttributeId, |
119 | 115 | $wgDefinitionAttributeId, |
120 | 116 | $wgIncomingRelationsAttributeId, |
121 | | - $wgPossiblySynonymousAttributeId, |
122 | 117 | $wgRelationsAttributeId, |
123 | 118 | $wgSynonymsAndTranslationsAttributeId; |
124 | 119 | |
— | — | @@ -128,7 +123,6 @@ |
129 | 124 | $wgDefinedMeaningAttributesAttributeId = "defined-meaning-attributes"; |
130 | 125 | $wgDefinitionAttributeId = "definition"; |
131 | 126 | $wgIncomingRelationsAttributeId = "reciprocal-relations"; |
132 | | -$wgPossiblySynonymousAttributeId = "possibly-synonymous"; |
133 | 127 | $wgRelationsAttributeId = "relations"; |
134 | 128 | $wgSynonymsAndTranslationsAttributeId = "synonyms-translations"; |
135 | 129 | |
— | — | @@ -142,7 +136,6 @@ |
143 | 137 | $wgClassAttributesAttributeId, |
144 | 138 | $wgAlternativeDefinitionsAttributeId, |
145 | 139 | $wgSynonymsAndTranslationsAttributeId, |
146 | | - $wgPossiblySynonymousAttributeId, |
147 | 140 | $wgIncomingRelationsAttributeId, |
148 | 141 | $wgClassMembershipAttributeId, |
149 | 142 | $wgCollectionMembershipAttributeId, |
Index: trunk/extensions/Wikidata/OmegaWiki/Controller.php |
— | — | @@ -227,31 +227,6 @@ |
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | | -class GroupedRelationTypeController extends DefaultUpdateController { |
232 | | - protected $relationTypeId; |
233 | | - protected $groupedRelationIdAttribute; |
234 | | - protected $otherDefinedMeaningAttribute; |
235 | | - |
236 | | - public function __construct($relationTypeId, $groupedRelationIdAttribute, $otherDefinedMeaningAttribute) { |
237 | | - $this->relationTypeId = $relationTypeId; |
238 | | - $this->groupedRelationIdAttribute = $groupedRelationIdAttribute; |
239 | | - $this->otherDefinedMeaningAttribute = $otherDefinedMeaningAttribute; |
240 | | - } |
241 | | - |
242 | | - public function add(IdStack $idPath, $record) { |
243 | | - $definedMeaningId = $idPath->getKeyStack()->peek(0)->definedMeaningId; |
244 | | - $otherDefinedMeaningId = $record->getAttributeValue($this->otherDefinedMeaningAttribute); |
245 | | - |
246 | | - if ($otherDefinedMeaningId != 0) |
247 | | - addRelation($definedMeaningId, $this->relationTypeId, $otherDefinedMeaningId); |
248 | | - } |
249 | | - |
250 | | - public function remove($keyPath) { |
251 | | - $relationId = $keyPath->peek(0)->getAttributeValue($this->groupedRelationIdAttribute); |
252 | | - removeRelationWithId($relationId); |
253 | | - } |
254 | | -} |
255 | | - |
256 | 231 | class DefinedMeaningClassMembershipController extends DefaultUpdateController { |
257 | 232 | public function add(IdStack $idPath, $record) { |
258 | 233 | $definedMeaningId = $idPath->getKeyStack()->peek(0)->definedMeaningId; |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php |
— | — | @@ -140,14 +140,6 @@ |
141 | 141 | $t->classMembership = new Attribute(null, wfMsgSc("ClassMembership"), $t->classMembershipStructure); |
142 | 142 | |
143 | 143 | global |
144 | | - $wgPossiblySynonymousAttributeId; |
145 | | - |
146 | | - $t->possiblySynonymousId = new Attribute("possibly-synonymous-id", "Possibly synonymous id", "integer"); |
147 | | - $t->possibleSynonym = new Attribute("possible-synonym", wfMsgSc("PossibleSynonym"), $t->definedMeaningReferenceStructure); |
148 | | - $t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possibleSynonym); |
149 | | - $t->possiblySynonymous = new Attribute(null, wfMsgSc("PossiblySynonymous"), $t->possiblySynonymousStructure); |
150 | | - |
151 | | - global |
152 | 144 | $relationTypeType; |
153 | 145 | |
154 | 146 | $t->relationId = new Attribute("relation-id", "Relation identifier", "object-id"); |
Index: trunk/extensions/Wikidata/OmegaWiki/Wikidata.php |
— | — | @@ -13,9 +13,8 @@ |
14 | 14 | protected $showCommunityContribution; |
15 | 15 | |
16 | 16 | // The following member variables control some application specific preferences |
17 | | - protected $filterLanguageId = 0; // Filter pages on this languageId, set to 0 to show all languages |
18 | | - protected $possiblySynonymousRelationTypeId = 0; // Put this relation type in a special section "Possibly synonymous" |
19 | | - protected $showClassicPageTitles = true; // Show classic page titles instead of prettier page titles |
| 17 | + protected $filterLanguageId = 0; // Filter pages on this languageId, set to 0 to show all languages |
| 18 | + protected $showClassicPageTitles = true; // Show classic page titles instead of prettier page titles |
20 | 19 | |
21 | 20 | protected $propertyToColumnFilters = array(); |
22 | 21 | protected $viewInformation; |
— | — | @@ -26,7 +25,7 @@ |
27 | 26 | public function __construct() { |
28 | 27 | global |
29 | 28 | $wgFilterLanguageId, |
30 | | - $wgShowClassicPageTitles, $wgPossiblySynonymousRelationTypeId, |
| 29 | + $wgShowClassicPageTitles, |
31 | 30 | $wgPropertyToColumnFilters; |
32 | 31 | |
33 | 32 | if (isset($wgFilterLanguageId)) |
— | — | @@ -35,9 +34,6 @@ |
36 | 35 | if (isset($wgShowClassicPageTitles)) |
37 | 36 | $this->showClassicPageTitles = $wgShowClassicPageTitles; |
38 | 37 | |
39 | | - if (isset($wgPossiblySynonymousRelationTypeId)) |
40 | | - $this->possiblySynonymousRelationTypeId = $wgPossiblySynonymousRelationTypeId; |
41 | | - |
42 | 38 | if (isset($wgPropertyToColumnFilters)) |
43 | 39 | $this->propertyToColumnFilters = $wgPropertyToColumnFilters; |
44 | 40 | } |
— | — | @@ -76,7 +72,6 @@ |
77 | 73 | |
78 | 74 | $viewInformation = new ViewInformation(); |
79 | 75 | $viewInformation->filterLanguageId = $this->filterLanguageId; |
80 | | - $viewInformation->possiblySynonymousRelationTypeId = $this->possiblySynonymousRelationTypeId; |
81 | 76 | $viewInformation->showRecordLifeSpan = false; |
82 | 77 | $viewInformation->queryTransactionInformation = $this->queryTransactionInformation; |
83 | 78 | $viewInformation->setPropertyToColumnFilters($this->propertyToColumnFilters); |
— | — | @@ -112,7 +107,6 @@ |
113 | 108 | protected function save($referenceQueryTransactionInformation) { |
114 | 109 | $viewInformation = new ViewInformation(); |
115 | 110 | $viewInformation->filterLanguageId = $this->filterLanguageId; |
116 | | - $viewInformation->possiblySynonymousRelationTypeId = $this->possiblySynonymousRelationTypeId; |
117 | 111 | $viewInformation->queryTransactionInformation = $referenceQueryTransactionInformation; |
118 | 112 | $viewInformation->setPropertyToColumnFilters($this->propertyToColumnFilters); |
119 | 113 | $viewInformation->viewOrEdit = "edit"; |
— | — | @@ -164,7 +158,6 @@ |
165 | 159 | |
166 | 160 | $viewInformation = new ViewInformation(); |
167 | 161 | $viewInformation->filterLanguageId = $this->filterLanguageId; |
168 | | - $viewInformation->possiblySynonymousRelationTypeId = $this->possiblySynonymousRelationTypeId; |
169 | 162 | $viewInformation->showRecordLifeSpan = false; |
170 | 163 | $viewInformation->queryTransactionInformation = new QueryLatestTransactionInformation(); |
171 | 164 | $viewInformation->viewOrEdit = "edit"; |
— | — | @@ -219,7 +212,6 @@ |
220 | 213 | |
221 | 214 | $viewInformation = new ViewInformation(); |
222 | 215 | $viewInformation->filterLanguageId = $this->filterLanguageId; |
223 | | - $viewInformation->possiblySynonymousRelationTypeId = $this->possiblySynonymousRelationTypeId; |
224 | 216 | $viewInformation->showRecordLifeSpan = $this->showRecordLifeSpan; |
225 | 217 | $viewInformation->queryTransactionInformation = $this->queryTransactionInformation; |
226 | 218 | $viewInformation->setPropertyToColumnFilters($this->propertyToColumnFilters); |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php |
— | — | @@ -607,30 +607,6 @@ |
608 | 608 | return $editor; |
609 | 609 | } |
610 | 610 | |
611 | | -function getGroupedRelationTypeEditor(Attribute $groupedRelationsAttribute, Attribute $groupedRelationIdAttribute, Attribute $otherDefinedMeaningAttribute, $relationTypeId, ViewInformation $viewInformation, Editor $objectAttributesEditor) { |
612 | | - global |
613 | | - $wgPopupAnnotationName; |
614 | | - |
615 | | - $editor = new RecordSetTableEditor( |
616 | | - $groupedRelationsAttribute, |
617 | | - new SimplePermissionController(true), |
618 | | - new ShowEditFieldChecker(true), |
619 | | - new AllowAddController(true), |
620 | | - true, |
621 | | - false, |
622 | | - new GroupedRelationTypeController($relationTypeId, $groupedRelationIdAttribute, $otherDefinedMeaningAttribute) |
623 | | - ); |
624 | | - |
625 | | - $editor->addEditor(new DefinedMeaningReferenceEditor($otherDefinedMeaningAttribute, new SimplePermissionController(false), true)); |
626 | | - |
627 | | - if ($objectAttributesEditor != null) |
628 | | - $editor->addEditor(new PopUpEditor($objectAttributesEditor, $wgPopupAnnotationName)); |
629 | | - |
630 | | - addTableMetadataEditors($editor, $viewInformation); |
631 | | - |
632 | | - return $editor; |
633 | | -} |
634 | | - |
635 | 611 | function getDefinedMeaningCollectionMembershipEditor(ViewInformation $viewInformation) { |
636 | 612 | global |
637 | 613 | $wgGotoSourceTemplates; |
— | — | @@ -828,16 +804,6 @@ |
829 | 805 | $classMembershipEditor = getDefinedMeaningClassMembershipEditor($viewInformation); |
830 | 806 | $collectionMembershipEditor = getDefinedMeaningCollectionMembershipEditor($viewInformation); |
831 | 807 | |
832 | | - #var_dump($definitionEditor); |
833 | | - $possiblySynonymousEditor = getGroupedRelationTypeEditor( |
834 | | - $o->possiblySynonymous, |
835 | | - $o->possiblySynonymousId, |
836 | | - $o->possibleSynonym, |
837 | | - $viewInformation->possiblySynonymousRelationTypeId, |
838 | | - $viewInformation, |
839 | | - createObjectAttributesEditor($viewInformation, $o->objectAttributes, wfMsgSc("Property"), wfMsgSc("Value"), $o->possiblySynonymousId, $relationMeaningName, $viewInformation->getLeftOverAttributeFilter()) |
840 | | - ); |
841 | | - |
842 | 808 | $availableEditors = new AttributeEditorMap(); |
843 | 809 | $availableEditors->addEditor($definitionEditor); |
844 | 810 | $availableEditors->addEditor($alternativeDefinitionsEditor); |
— | — | @@ -852,9 +818,6 @@ |
853 | 819 | |
854 | 820 | $availableEditors->addEditor(createObjectAttributesEditor($viewInformation, $o->definedMeaningAttributes, wfMsgSc("Property"), wfMsgSc("Value"), $o->definedMeaningId, $definedMeaningMeaningName, $viewInformation->getLeftOverAttributeFilter())); |
855 | 821 | |
856 | | - if ($viewInformation->possiblySynonymousRelationTypeId != 0) |
857 | | - $availableEditors->addEditor($possiblySynonymousEditor); |
858 | | - |
859 | 822 | $definedMeaningEditor = new RecordUnorderedListEditor($o->definedMeaning, 4); |
860 | 823 | |
861 | 824 | foreach ($wdDefinedMeaningAttributesOrder as $attributeId) { |
Index: trunk/extensions/Wikidata/App.php |
— | — | @@ -88,8 +88,7 @@ |
89 | 89 | $dbr =& wfGetDB(DB_MASTER); |
90 | 90 | $dbr->query("SET NAMES utf8"); |
91 | 91 | |
92 | | - $msgarray= |
93 | | - array( |
| 92 | + $msgarray = array( |
94 | 93 | "save" => "Save", |
95 | 94 | "history" => "History", |
96 | 95 | "datasets" => "Data-set selection", |
— | — | @@ -152,8 +151,6 @@ |
153 | 152 | "OptionAttributeValues" => "Option values", |
154 | 153 | "OtherDefinedMeaning" => "Other defined meaning", |
155 | 154 | "PopupAnnotation" => "Annotation", |
156 | | - "PossibleSynonym" => "Possible synonym", |
157 | | - "PossiblySynonymous" => "Possibly synonymous", |
158 | 155 | "Relations" => "Relations", |
159 | 156 | "RelationType" => "Relation type", |
160 | 157 | "Spelling" => "Spelling", |
— | — | @@ -170,32 +167,34 @@ |
171 | 168 | "TranslatedTextAttributeValues" => "Translatable texts", |
172 | 169 | "LinkAttribute" => "Property", |
173 | 170 | "LinkAttributeValues" => "Links", |
174 | | - ); |
| 171 | + "Property" => "Property", |
| 172 | + "Value" => "Value" |
| 173 | + ); |
175 | 174 | |
176 | 175 | $prefixedmsgarray=array(); |
177 | | - foreach($msgarray as $key=>$value) { |
| 176 | + |
| 177 | + foreach($msgarray as $key=>$value) |
178 | 178 | $prefixedmsgarray[$wdSiteContext."_".$key]=$value; |
179 | | - } |
180 | 179 | |
181 | 180 | $wgMessageCache->addMessages($prefixedmsgarray); |
182 | 181 | |
183 | | - |
184 | 182 | $datasets=wdGetDatasets(); |
185 | 183 | $datasetarray['']=wfMsgHtml('ow_none_selected'); |
186 | 184 | foreach($datasets as $datasetid=>$dataset) { |
187 | 185 | $datasetarray[$datasetid]=$dataset->fetchName(); |
188 | 186 | } |
189 | | - $wgExtensionPreferences[]=array( |
190 | | - 'name'=>'ow_uipref_datasets', |
191 | | - 'section'=>'ow_uiprefs', |
192 | | - 'type'=>PREF_OPTIONS_T, |
193 | | - 'size'=>10, |
194 | | - 'options'=>$datasetarray |
| 187 | + $wgExtensionPreferences[] = array( |
| 188 | + 'name' => 'ow_uipref_datasets', |
| 189 | + 'section' => 'ow_uiprefs', |
| 190 | + 'type' => PREF_OPTIONS_T, |
| 191 | + 'size' => 10, |
| 192 | + 'options' => $datasetarray |
195 | 193 | ); |
196 | 194 | |
197 | 195 | global |
198 | 196 | $messageCacheOK; |
199 | | - $messageCacheOK=True; |
| 197 | + |
| 198 | + $messageCacheOK = true; |
200 | 199 | |
201 | 200 | return true; |
202 | 201 | } |