r43619 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43618‎ | r43619 | r43620 >
Date:18:46, 17 November 2008
Author:mkroetzsch
Status:deferred
Tags:
Comment:
add support for SF special properties, improving their performance
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DV_WikiPage.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -65,7 +65,9 @@
6666 '_REDI' => 15,
6767 '_SUBP' => 17,
6868 '_SUBC' => 18,
69 - '_CONC' => 19
 69+ '_CONC' => 19,
 70+ '_SF_DF' => 20, // Semantic Form's default form property
 71+ '_SF_AF' => 21 // Semantic Form's alternate form property
7072 );
7173
7274 /// This array defines how various datatypes should be handled internally. This
@@ -84,6 +86,7 @@
8587 '_wpg' => SMW_SQL2_RELS2, // Page type
8688 '_wpp' => SMW_SQL2_RELS2, // Property page type
8789 '_wpc' => SMW_SQL2_RELS2, // Category page type
 90+ '_wpf' => SMW_SQL2_RELS2, // Form page type (for Semantic Forms)
8891 '_num' => SMW_SQL2_ATTS2, // Number type
8992 '_tem' => SMW_SQL2_ATTS2, // Temperature type
9093 '_dat' => SMW_SQL2_ATTS2, // Time type
@@ -96,6 +99,7 @@
97100 '__spu' => SMW_SQL2_SPEC2, // Special uri type
98101 '__sup' => SMW_SQL2_SUBS2, // Special subproperty type
99102 '__suc' => SMW_SQL2_SUBS2, // Special subcategory type
 103+ '__spf' => SMW_SQL2_SPEC2, // Special form type (for Semantic Forms)
100104 '__sin' => SMW_SQL2_INST2, // Special instance of type
101105 '__red' => SMW_SQL2_REDI2, // Special redirect type
102106 '__lin' => SMW_SQL2_SPEC2, // Special linear unit conversion type
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php
@@ -323,7 +323,9 @@
324324 define('SMW_NS_PROPERTY_TALK', $smwgNamespaceIndex+3);
325325 define('SMW_NS_TYPE', $smwgNamespaceIndex+4);
326326 define('SMW_NS_TYPE_TALK', $smwgNamespaceIndex+5);
327 - // 106 and 107 are occupied by the Semantic Forms
 327+ // 106 and 107 are occupied by the Semantic Forms, we define them here to offer some (easy but useful) support to SF
 328+ define('SF_NS_FORM', $smwgNamespaceIndex+6);
 329+ define('SF_NS_FORM_TALK', $smwgNamespaceIndex+7);
328330 define('SMW_NS_CONCEPT', $smwgNamespaceIndex+8);
329331 define('SMW_NS_CONCEPT_TALK', $smwgNamespaceIndex+9);
330332
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_WikiPage.php
@@ -57,11 +57,14 @@
5858 parent::__construct($typeid);
5959 switch ($typeid) {
6060 case '_wpp' : case '__sup':
61 - $this->m_fixNamespace = SMW_NS_PROPERTY;
 61+ $this->m_fixNamespace = SMW_NS_PROPERTY;
6262 break;
6363 case '_wpc' : case '__suc':
64 - $this->m_fixNamespace = NS_CATEGORY;
 64+ $this->m_fixNamespace = NS_CATEGORY;
6565 break;
 66+ case '_wpf' : case '__spf':
 67+ $this->m_fixNamespace = SF_NS_FORM;
 68+ break;
6669 default: //case '_wpg':
6770 $this->m_fixNamespace = NS_MAIN;
6871 }

Status & tagging log