0

How can I pass an ask as a parameter of a query?

For example:

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

Then use the data again in a custom function:

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

If I try using something like the code below, when I debug the application, capital is equal to an empty String ( it's declared but empty ):

{#ask: [[England]]
|?population
|?currency
|capital={#ask: [[Category:City]][[London]]
         |?population
         |?currency
         |}
|}
M4rk
  • 2,172
  • 5
  • 36
  • 70
  • First of all your ask syntax should be {{#ask: QUERY |?PRINTOUT }}. Then I'm not sure what you are trying to do with '|captial=...'. Can you explain what you are trying to achieve? – leo Oct 11 '13 at 13:22

1 Answers1

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!

Community
  • 1
  • 1
Eliezer Bernart
  • 2,386
  • 24
  • 33