![]() Release status: unmaintained |
|
---|---|
Implementation | User interface |
Description | Uses a property on one page to indicate that one or more other pages are dependent upon it. Saving the first page will cause the property values on the dependent pages to be updated. |
Author(s) | Cindy Cicalese (Cindy.cicalesetalk) |
Latest version | 1.2 (2017-07-28) |
Compatibility policy | Master maintains backward compatibility. |
MediaWiki | 1.23+ |
PHP | 5.3+ |
Database changes | No |
License | MIT License |
Download | Download extension Git [?]: |
Parameters
|
|
Hooks used
|
|
Translate the Semantic Dependency extension if it is available at translatewiki.net | |
Issues | Open tasks ยท Report a bug |
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
Note: This extension requires Semantic MediaWiki version 1.9+ to be installed first.
- Download and place the file(s) in a directory called
SemanticDependency
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php
require_once "$IP/extensions/SemanticDependency/SemanticDependency.php";
file: - Configure as required.
Done โ Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration
Flag | Default | Description |
---|---|---|
$SemanticDependency_Properties |
array(); |
an array mapping namespace numbers to property names |
$SemanticDependency_JobThreshold |
1 |
the maximum number of pages that will be updated immediately; if the number of dependent pages is greater than this number, any additional pages will be updated using the job queue |
In LocalSettings.php add:
$SemanticDependency_Properties = array(
NS1 => "Property name1",
NS2 => "Property name2",
...
);
where:
- NS# โ Namespace index (not a namespace name!) (usually constant, like
NS_USER
). 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 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:
$SemanticDependency_Properties = array(
NS_REVIEW => "Book"
);
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.
Release Notes
- Version 1.2
- Removed I18n shim for PHP.
- Version 1.1
- Added support for page deletion.
- Version 1.0
- Initial version.