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 have their property values updated.

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

Configuration parameters
In LocalSettings.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
Assume that a wiki contains information about books, where each book is represented by a page in the wiki. Then, assume that pages in namespace Review, with namespace constant, 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 property values on the book page will be updated. 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.