Integrate Subobject Queries into Ask?

From semantic-mediawiki.org

It seems to me that querying for page properties and subobjects simultaneously is needlessly complicated. Having to perform sub-queries inside other templates just obfuscates the code unnecessarily. Couldn't something like below be implemented? Is there some technical reason this wouldn't work? I've written this as a separate parser function from #ask (since I'm considering writing an extension), but it seems this could integrate with #ask.

{{#sub_ask: [[Category:Recipe]]
    |? Title
    |? Author
    |? Person#sub: [[Has ingredient::+]]          <== notes [1] [2] [3]
        |? Has quantity
        |? Has unit
        |? Has ingredient
        |  format=template
        |  template=Part of recipe                <== note [3]
    #end_sub
    |  format=template
    |  template=Recipe
}}

[1] Implicitly does [[-Has subobject::<PAGENAME>]]
[2] [[Has ingredient::+]] not needed if "Part of recipe" subobjects are the only kind on the page
[3] Each subobject will get passed to the template "Part of recipe", and the output of each will
    be concatenated and set as the value of {{{Person}}} within the "Recipe" template

Is there some reason something like this wouldn't work or wouldn't be a good idea to implement in an extension or future release of SMW?

06:38, 18 September 2013

Similar concerns here. By now I must have lots of templates for subqueries in templates for queries and it's not easy to keep track which of these are still being used and where. Perhaps a cleaner solution syntax-wise (so that you won't have to embed things) is to have a new result format which points to a variable on the page. Anyway, you'll have a better chance getting attention from devs and a wider response if you post to the mailing list.

10:16, 18 September 2013