Extension:SemanticDependencyUpdater

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
Semantic Dependency Updater
Release status: stable
Implementation User interface
Description Monitors semantic data changes and updates dependend pages
Author(s) Alexander Gesinn (planetenxintalk)
Latest version 1.4.0 (2018-08-21)
MediaWiki 1.25+
PHP 5.3+
Database changes No
License MIT License
Download
Releases
Parameters
  • $wgSDUProperty = 'Semantic Dependency';
  • $wgSDUUseJobQueue = false;
Hooks used
SMW::SQLStore::AfterDataUpdateComplete

Compatibility

  • Semantic MediaWiki 2.3+
Translate the SemanticDependencyUpdater extension if it is available at translatewiki.net
Check usage and version matrix.

The Semantic Dependency Updater (SDU) extension monitors pages for changes in their semantic data. If the "Semantic Dependency" property is found, this extension will update (null-edit) all pages that have been selected through that property.

The "Semantic Dependency property" is evaluated as an ASK query. It is therefore possible to define either a list of pages directly or do more complex selections.

It is possible to build a chain of semantic dependencies that will update recursively. Be careful not to build loops!

Installation[edit]

Semantic MediaWiki 2.3.0 or later is required!
  • Download and place the file(s) in a directory called SemanticDependencyUpdater in your extensions/ folder.

Instead of downloading the zip archive you may also check this extension out via Git:

git clone https://github.com/gesinn-it/SemanticDependencyUpdater.git extensions/SemanticDependencyUpdater

Configuration[edit]

MANDATORY[edit]

The "Semantic Dependency" property defined on page "Property:Semantic_Dependency" needs to be created in the target wiki and MUST be of the datatype Text provided by Semantic MediaWiki:

[[Has type::Text]]

Optional[edit]

The property name can also be changed.

// This is the property name that contains the query string that selects the dependend pages
$wgSDUProperty = 'Semantic Dependency';

// If enabled, SDU will create a Job for each update
$wgSDUUseJobQueue = false;

Usage[edit]

The value of the Semantic Dependency property is evaluated as an ASK query, except that [[ or ]] must be ommitted. If there are more conditions, combine them through AND and OR

Examples[edit]

Update Self[edit]

This will save the current page twice. Useful when the page stores semantic properties that are calculated from other properties of the same page.

[[Semantic Dependency::{{FULLPAGENAME}}]]

Update other page(s)[edit]

[[Semantic Dependency::Product:Test Product]]
[[Semantic Dependency::{{{Target Page|}}}]]

Update pages with relation to current page[edit]

This will update all pages that link with Part Of to the current page.

[[Semantic Dependency::Part Of::{{FULLPAGENAME}}]]

More Advanced Queries[edit]

Be careful that the query does not return too many pages, as this will result in a heavy load.

[[Semantic Dependency::Category:Product]]
[[Semantic Dependency::Category:Product AND Tag::Demo]]
[[Semantic Dependency::Category:Person OR Category:Organization]]

See also[edit]