Extension:SemanticDependencyUpdater/ja
Semantic Dependency Updater リリースの状態: 安定 |
|
---|---|
実装 | ユーザー インターフェイス |
説明 | Monitors semantic data changes and updates depended pages |
作者 | Simon Heimler, Alexander Gesinn |
メンテナー | gesinn.it |
最新バージョン | 3.0.0 (2023-08-16) |
MediaWiki | 1.35+ |
データベースの変更 | いいえ |
ライセンス | MIT ライセンス |
ダウンロード | GitHub:
<translate> Note:</translate> Releases |
|
|
Compatibility
|
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
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 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.
インストール
- <translate> <tvar name=1>Download</tvar> and place the file(s) in a directory called <tvar name=name>
SemanticDependencyUpdater
</tvar> in your <tvar name=ext>extensions/
</tvar> folder.</translate> - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'SemanticDependencyUpdater' );
- Configure as required.
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
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
設定
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]]
省略可能
// Name of the Semantic Dependency property
$wgSDUProperty = 'Semantic Dependency';
// If enabled, SDU will create a Job for each update
$wgSDUUseJobQueue = false;
使用法
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
例
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 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]]
Example test case
- Make sure, a page
Property:Semantic_Dependency
exists with content[[Has type::Text]]
- Make sure,
$wgSDUUseJobQueue = false;
- Create a page
A
with
[[Title::A]]
- Create a page
B
with
* [[Part Of::A| ]][[Title::{{#show:A|?Title}}.B]] * {{#show:{{FULLPAGENAME}}|?Title}}
- Now, change page
A
as follows
[[Title::XXX]]
As a result, you should see
- XXX.B - XXX.B
on page B
デバッグ
- 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 > chmod -R www-data. /var/log/mediawiki
- In your LocalSettings 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
関連項目
File:OOjs UI icon information-progressive.svg | <translate> This extension is included in the following wiki farms/hosts and/or packages:</translate>
<translate> This is not an authoritative list.</translate> <translate> Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here.</translate> <translate> Always check with your wiki farms/hosts or bundle to confirm.</translate> |
- Pages with script errors
- Pages with broken file links
- Stable extensions/ja
- User interface extensions/ja
- Extensions with manual MediaWiki version
- MIT licensed extensions/ja
- Extensions in GitHub version control/ja
- All extensions/ja
- Extensions not in ExtensionJson
- Semantic MediaWiki extensions/ja
- Extensions by gesinn.it/ja