Help:Fixed properties

This page provides information about fixed properties which were introduced with. To use this feature you must be using the " " database backend.

Introduction
The SQL store provides a feature called fixed properties. Fixed properties are properties which are used heavily within a wiki with a minimum of 1,000 or better even more data value assignements using a dedicated database table. A property with a usage level of 25,000+ value assignments should be considered for being changed to fixed properties. The general idea is that fixed properties allow to save disk space and memory usage.

For example a wiki about people will have a property called "Has age" used extensively within the wiki. To optimize operations on this property there is support to have property-value tuples of these properties stored in a separate dedicated database table rather than in the generic table used for their datatypes. This potentially speeds up some comparisons at query time through smaller indexes which means that there are less things to compare when searching a data value.

See also the help page on property usage count.

Configuration
The configuration of fixed properties is done in the "LocalSettings.php" file of your wiki below the inclusion of Semantic MediaWiki.CiteRef::gh:smw:2135 The following steps show an example on how to define a fixed property called "Has age" which is of. If the datatype for a property already set up as a fixed property is changed only the steps 3 and 4 have to be taken otherwise the data will become inaccessible to Semantic MediaWiki and thus errors will occur.

Step 1 - Create a property page
Create the page in namespace "Property" and name it e.g. "Has age" (page "Property:Has age") and assign datatype to it with.

Step 2 - Configure the fixed property
Add to your "LocalSettings.php" file like e.g.

Step 3 - Create the dedicated database table
Create the required database table by running the via the command line or by triggering the special task "Database installation and upgrade" on  to initialize and create the dedicated database table for the property.

Now you can use this fixed property on you wiki as you use every other user defined property.

Step 4 - Rebuild the semantic data
The three steps described above can also be taken to convert an already used property into a fixed property. However as a fourth step the semantic data has to rebuild to populate the new dedicated database table. Rebuild the required database table by running via the command line or by triggering the special task "Data repair and update" by clicking the button labeled "Start updating data" in the "Data repair and update" section on  to populate the dedicated database table for the property with the existing value assignments.