Extension:SemanticDependencyUpdater/ko
출시 상태: 안정 |
|
|---|---|
| 구현 | 사용자 인터페이스 |
| 설명 | Detects semantic inserts and deletions, including changes recorded on subobjects. |
| 만든 이 | Simon Heimler, Alexander Gesinn |
| 유지 보수자 | gesinn.it |
| 최신 버전 | 5.0.1 (2026-08-09) |
| MediaWiki | 1.43+ |
| 데이터베이스 변경 | 아니오 |
|
|
|
| Licence | MIT License |
| 다운로드 | GitHub:
Note: 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.
설치
- 파일을 Download하고
SemanticDependencyUpdater폴더를extensions/디렉토리에 넣어 주세요. - 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
wfLoadExtension( 'SemanticDependencyUpdater' );
- Configure as required.
완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.
Instead of downloading the zip archive, you may also check this extension out via Git:
git clone https://github.com/gesinn-it-pub/SemanticDependencyUpdater.git extensions/SemanticDependencyUpdater
Configuration
Mandatory
Make sure a "Semantic Dependency" property exists, e.g., "Property:Semantic_Dependency" needs to exist and MUST be of the datatype Text:
{{#set:Has type=Text}}
Optional
// Name of the Semantic Dependency property
$wgSDUProperty = 'Semantic Dependency';
// Property names whose changes alone must not trigger a dependency update (e.g. a Revision ID property that changes on every edit regardless of semantic content).
$wgSDUIgnoredProperties = [ '___REVID' ];
Usage
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.
{{#set:Semantic Dependency={{FULLPAGENAME}}}}
Update other page(s)
{{#set:Semantic Dependency=Product:Test Product}}
{{#set: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.
{{#set:Semantic Dependency=Part Of::{{FULLPAGENAME}}}}
More Advanced Queries
Be careful not to return too many pages, as this can cause a heavy load.
{{#set:Semantic Dependency=Category:Product}}
{{#set:Semantic Dependency=Category:Product AND Tag::Demo}}
{{#set:Semantic Dependency=Category:Person OR Category:Organization}}
Example test case
- Make sure, a page
Property:Semantic_Dependencyexists with content{{#set:Has type=Text}} - Make sure the property
Property:Titleexists with the content{{#set:Has type=Text}} - Create a page
Awith
{{#set:Title=A}}
{{#set:Semantic Dependency=Part Of::{{FULLPAGENAME}}}}
- Create a page
Bwith
* {{#set:Part Of=A}}{{#set:Title={{#show:A|?Title}}.B}}
* {{#show:{{FULLPAGENAME}}|?Title}}
- Now, change page
Aas follows
{{#set:Title=XXX}}
{{#set: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
| This extension is included in the following wiki farms/hosts and/or packages: |
- Stable extensions/ko
- User interface extensions/ko
- SMW::SQLStore::AfterDataUpdateComplete extensions/ko
- ArticleDelete extensions/ko
- MIT licensed extensions/ko
- Extensions in GitHub version control/ko
- All extensions/ko
- Extensions included in Canasta/ko
- Extensions included in semantic::core/ko
- Semantic MediaWiki extensions/ko
- Extensions by gesinn.it/ko
