Help:Maintenance script "rebuildPropertyStatistics.php"

Jump to: navigation, search
Allows to rebuild the property usage statistics
Further Information
Provided by: Semantic MediaWiki
Added: 1.9.0
Removed: still in use
Location (path): ./extensions/Semantic­MediaWiki/maintenance/
Class docu: Rebuild­Property­Statistics
Table of Contents

The "rebuildPropertyStatistics.php" maintenance script rebuilds the statistics for property data shown as the property usage count on the property pages as well as on the related special pages "Properties", "WantedProperties", "UnusedProperties" and "Statistics". The script was introduced in Semantic MediaWiki 1.9.0 and currently only works if the configuration parameter $smwgDefaultStore is set to SMWSQLStore3 (= default setting), i.e. SPARQL stores are currently not supported. Since this maintenance script provides means of updating statistical data the real time updating of these data through intense immediate data base operations is no longer done by Semantic MediaWiki. Thus the performance of the wiki is improved.

It is recommended to run this script in daily intervals as part of the general wiki maintenance.

NoteNote: The display of statistical data on the special pages mentioned above is also influenced by the $smwgCacheUsage configuration setting, i.e. the information displayed is not immediately updated at the time this maintenance script is run. This may take up to one hour if the default settings are used.
Important noteImportant Note: If Semantic MediaWiki is not installed in its standard path then the "MW_INSTALL_PATH" environment variable must be set. See README in the maintenance directory.


php rebuildPropertyStatistics.php [--with-maintenance-log]
NoteNote: This only shows the script specific parameters.


Generic parameters

Parameter Description
--help (-h) Display this help message
--quiet (-q) Whether to supress non-error output
--conf: Location of "LocalSettings.php", if not default
--wiki For specifying the wiki ID
--globals Output globals at the end of processing for debugging
--memory-limit Set a specific memory limit for the script, "max" for no limit or "default" to avoid changing it
--server: The protocol and server name to use in URLs, e.g. This is sometimes necessary because server name detection may fail in command line scripts.

Script dependant parameters

Parameter Description
--dbuser The DB user to use for this script
--dbpass The password to use for this script

Script specific parameters

Parameter Description
--with-maintenance-log Adds a log entry to the "Semantic MediaWiki log" on special page "Log" (&type=smw). Available since Semantic MediaWiki

NoteNote:  If you are using this parameter make sure that MediaWiki's configuration parameter $wgMaxNameChars is set to a value not lower than "31".3 Otherwise an exception will be issued informing about the minimum value for this setting ("32" or higher is recommended).4


This documentation page applies to all SMW versions from 1.9.0 to the most current version.

Help:RebuildPropertyStatistics.php en 1.9.0


  1. ^  Semantic MediaWiki: GitHub issue #832
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:1361
  3. ^  Semantic MediaWiki: GitHub issue gh:smw:1983
  4. ^  Semantic MediaWiki: GitHub pull request gh:smw:1985