0

如何将询问作为查询的参数传递?

例如:

myvar={#ask: [[Category:City]][[London]]
|?population
|?currency
|}

然后在自定义函数中再次使用数据:

{#ask: [[England]]
|?population
|?currency
|capital=myvar
|}

如果我尝试使用类似下面的代码,当我调试应用程序时,大写等于一个空字符串(它已声明但为空):

{#ask: [[England]]
|?population
|?currency
|capital={#ask: [[Category:City]][[London]]
         |?population
         |?currency
         |}
|}
4

1 回答 1

3

Your syntax is not correct.

It should be like this:

{{#ask: [[Category:City]] [[located in::England]] 
| ?population 
| ?currency 
}}

You can have more informations about inline queries at the Semantic MediaWiki website.

And you can see how build nested queries at this question: Semantic mediawiki #ask query: Displaying nested properties on the same query

Hope that help you. Thanks!

于 2013-12-17T17:16:21.287 回答