我在Semantic MediaWiki中有许多页面通过一个名为Is implemented by
的属性以某种层次结构进行链接。
E.g
-
"比利时小工具工厂"
Is implemented by
"带XYZ的小工具工厂"> -
"带有XYZ"
Is implemented by
"XYZ"模块A的Widget Plant -
"带有XYZ"
Is implemented by
"XYZ"模块B的Widget Plant
如何在"比利时的Widget Plant"页面上编写#ask
查询,该查询将使用format=graph
通过Is implemented by
属性显示所有页面的图形
我安装了GraphViz和Semantics Results Formats,它们似乎正在工作。
理想情况下,我想把这个查询放在一个模板中。
像这样:
{{#ask:[[Is implemented by::+]]
| ?Is implemented by
| format=graph
| graphname = Implementations
| graphcolor=yes
| graphsize = 800,800
| graphfontsize = 9
| graphlegend = yes
| graphlink = yes
| relation = child
| arrowdirection = RL
| nodelabel = displaytitle
}}
[[Is implemented by::+]]
表示"孤儿"(未实现的实体(将不会出现。如果不需要这样做,请确保所有实体都在一个类别中,例如[[Category:Implementations]]
,并将查询条件替换为[[Category:Implementations]]
;也可以使用[[Some definitely defined, and only for implementations, property::+]]
。