If the data should ever get out of date or contain any errors, then it is always possible to completely rebuild the data from the wiki.
No data is ever lost. Refreshing data is also needed on some software upgrades, and after the first installation since it also gathers some existing meta data.
The data of a single page can be refreshed by simply editing and saving it. If there are many pages it is more convenient to use a feature of Special: SMWAdmin for doing this automatically. There is also a maintenance script for doing this from the command line: To make sure that all wiki pages display the new data after the repair, you can run touch LocalSettings.
This will invalidate any MediaWiki page caches that may otherwise make you see old versions of wiki pages. Using a maintenance script This is the recommended way in case the wiki operator has shell access to the server running the wiki. The maintenance script to rebuild and thus repair the semantic data added to the wiki is called "rebuildData. It directly refreshes selected portions of the wiki without any prior access to it.
The basic operation of "rebuildData. If this does not work on your site e. The above script goes through all pages in the order they are stored in your wiki database, and refreshes their data. The parameter -v makes sure that the script's progress is printed. The parameter -d 50 will add delay of 50 ms between every data item.
The index numbers shown by the script refer not only to page indices as used in MediaWiki, but also to indices SMW uses in its semantic data. For this reason, the script may process indices that are higher than the maximal page index in the wiki. If you have a large number of pages then the script may consume a lot of memory during its execution, and it is better to stop after, say, pages. This is due to a PHP memory leak. As a workaround, the script can be run for only part of the pages at a time: You can run the script with parameters -tp to refresh only type and property pages at first, so that these are already available when doing the second refresh.
Overall, more than two refreshes should not be required in normal cases. To make sure that all wiki pages display the new data after the refresh, you can run touch LocalSettings. Using a special page Loading By default all users who are administrators user group "sysop" or Semantic MediaWiki administrators user group "smwadministrator" may use this feature. See the linked help page for information on how this is done. To initiate the rebuild of the semantic data the button labelled "Start updating data" provided in the "Rebuild data" section of the "SemanticMediaWiki" special page has to be clicked.
After doing so the system message "An update is already in progress. Also a button labelled "Stop this update" together with a checkbox field requesting confirmation "Yes, I am sure" appears at the same time.
This allows to cancel the process in case it has mistakenly been initiated or if the process halted for some technical reason.
Once initiated, the update takes time varying from wiki to wiki. The more data is stored on the wiki the longer this process will take. Moreover since the update progresses during each page view it will be faster if many people view your wiki. You can speed up the process by using one of the following options: If you have shell access, you can use the MediaWiki maintenance script "runJobs. Please consider specifying a parameter --maxjobs or similar so that each run of the script is bounded in duration.
Otherwise the script tends to occupy increasing amounts of memory. This increases the speed of the update process. Please note that it also increases the load on the system which may have an negative effect on the performance of your wiki. You can also run a script to automatically hit the web site a certain number of times, so that you don't have to either wait for the site to be hit or keep reloading it in the browser. You can find an example of such a script here: Rebuilding everything The above methods should be able to fix data records in SMW in most cases.
However, it is conceivable that some erroneous content of the SMW storage still persists for some reason. In this case, it makes sense to completely delete and reinstall the database structures of SMW before refreshing all data. To completely delete all SMW data, the setup script setupStore. In this case, it is suggested to first rebuild the records for all properties and types, and to process the remaining data afterwards.
So one would run: On large wikis, the parameters -s and -e can again be used as explained in the previous section. Automatic repair features Some changes on wiki pages require that the data of other pages is updated as well. For example, if a template that contains semantic annotations is changed, then the data for all pages using this template might also require update. Likewise, if the datatype of some property is changed, all pages using this property should be refreshed.
SMW usually takes care of such updates automatically. As in MediaWiki, it may take some time until all required updates are completed. There is no convenient way to review the progress. This property will be created each time a page in this new namespace is modified, after it was added to the wiki.