Extension:Semantic Dependency

The Semantic Dependency extension uses a semantic property of type Page defined per namespace that, when present on a page in that namespace, indicates other pages that are dependent upon the first page; that is, when the first page is modified, all pages that it references through the property will be purged.

Installation
This extension requires Semantic MediaWiki version 1.9+ to be installed first.

Configuration parameters
In LocalSettings.php after including `SemanticTitle.php':

where:


 * NS# — Namespace index (not a namespace name!) (usually constant, like ). Only pages in specified namespaces are affected.
 * Property name# — Name of property of type Page to be used as the dependency link property in the specified namespace.

Example
For example, assume that a wiki contains information about books. Each book is represented by a page in the wiki. Then, assume that pages in namespace Review, with namespace constant NS_REVIEW, represent reviews by users of books. Each review has a property Book of type Page that is set to the title of the page about the book being reviewed. Each review also has a numerical rating assigned by the reviewer. If the book page contains a numerical property holding the average rating calculated over all of the reviews of the book, the property will need to be recalculated every time a review for that book is created or edited. So, the Book property in the review is used to create a dependency by setting $SemanticDependency_Properties as follows:

Then, every time a review is created or edited, the book page is purged, causing the properties on that page to be recalculated. Without this dependency, the book page would have to be edited and saved or the refreshLinks.php maintenance script would have to be run to refresh the data. Note: due to caching, the dependent page may still need to be refreshed in the browser to show the new value.