Extension:SemanticDependencyUpdater/pl
Status wydania: stabilne |
|
|---|---|
| Realizacja | Interfejs użytkownika |
| Opis | Detects semantic inserts and deletions, including changes recorded on subobjects. |
| Autor(zy) | Simon Heimler, Alexander Gesinn |
| Opiekun(owie) | gesinn.it |
| Ostatnia wersja | 5.0.0 (2026-02-03) |
| MediaWiki | 1.43+ |
| Zmiany w bazie danych | Nie |
|
|
|
| Licence | Licencja MIT |
| Pobieranie | GitHub:
Uwaga: Releases |
|
Compatibility
|
|
The Semantic Dependency Updater (SDU) extension detects semantic inserts and deletions, including changes recorded on subobjects. If the "Semantic Dependency" property is found, this extension will update all pages that have been selected through that property. A common use case is change propagation, where pages need to update (pull) their semantic data via an ask query from a changed page.
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.
Instalacja
- Download i umieść plik(i) w katalogu o nazwie
SemanticDependencyUpdaterw swoim kataloguextensions/. - Dodaj poniższy kod na dole twojego pliku LocalSettings.php:
wfLoadExtension( 'SemanticDependencyUpdater' );
- Configure as required.
Zrobione – Przejdź do Special:Version na twojej wiki, aby sprawdzić czy rozszerzenie zostało pomyślnie zainstalowane.
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
Konfiguracja
Mandatory
Make sure a "Semantic Dependency" property exists, e.g., "Property:Semantic_Dependency" needs to exist and MUST be of the datatype Text:
[[Has type::Text]]
Optional
// Name of the Semantic Dependency property
$wgSDUProperty = 'Semantic Dependency';
// If enabled, SDU will enqueue an UpdateJob for each dependent page.
// This is recommended for larger dependency graphs to avoid long save times.
$wgSDUUseJobQueue = true;
// If disabled, SDU will run a single forced update immediately after saving.
// This is useful for small setups or debugging, but may increase save latency.
$wgSDUUseJobQueue = false;
Użycie
The value of the Semantic Dependency property is evaluated as an ASK query, except that [[ or ]] must be omitted.
If there are more conditions, combine them through AND and OR
Examples
Update Self
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)
[[Semantic Dependency::Product:Test Product]]
[[Semantic Dependency::{{{Target Page|}}}]]
Update pages with relation to current page
This will update all pages that link with Part Of to the current page.
[[Semantic Dependency::Part Of::{{FULLPAGENAME}}]]
More Advanced Queries
Be careful not to return too many pages, as this can cause a heavy load.
[[Semantic Dependency::Category:Product]]
[[Semantic Dependency::Category:Product AND Tag::Demo]]
[[Semantic Dependency::Category:Person OR Category:Organization]]
Example test case
- Make sure, a page
Property:Semantic_Dependencyexists with content[[Has type::Text]] - Make sure the property
Property:Titleexists with the content[[Has type::Text]] - Make sure,
$wgSDUUseJobQueue = false; - Create a page
Awith
[[Title::A]]
[[Semantic Dependency::Part Of::{{FULLPAGENAME}}]]
- Create a page
Bwith
* [[Part Of::A| ]][[Title::{{#show:A|?Title}}.B]]
* {{#show:{{FULLPAGENAME}}|?Title}}
- Now, change page
Aas follows
[[Title::XXX]]
[[Semantic Dependency::Part Of::{{FULLPAGENAME}}]]
As a result, you should see
- XXX.B
- XXX.B
on page B
Debugging
- Note that on some systems, logging to /tmp might not work
- Make sure a log folder, writable by your web server, exists
> mkdir /var/log/mediawiki > chown -R www-data /var/log/mediawiki
- In your LocalSettings.php enable
$wgDebugLogGroups['SemanticDependencyUpdater'] = '/var/log/mediawiki/SDU.log';
- Watch the log file
> tail -f /var/log/mediawiki/SDU.log
- If things work as expected, this will look like:
2020-03-25 13:01:45 vagrant wikidb01-wk: [SDU] --> A 2020-03-25 13:01:45 vagrant wikidb01-wk: [SDU] -----> Data changes detected 2020-03-25 13:01:45 vagrant wikidb01-wk: [SDU] --------> [[Part Of::A]] 2020-03-25 13:01:45 vagrant wikidb01-wk: [SDU] --------> [Edit] B
| To rozszerzenie jest dołączone do następujących farm/hostów wiki lub pakietów: |
- Stable extensions/pl
- User interface extensions/pl
- SMW::SQLStore::AfterDataUpdateComplete extensions/pl
- MIT licensed extensions/pl
- Extensions in GitHub version control/pl
- All extensions/pl
- Extensions included in Canasta/pl
- Extensions included in semantic::core/pl
- Semantic MediaWiki extensions/pl
- Extensions by gesinn.it/pl
