From: Peter R. <zoo...@gm...> - 2011-11-07 16:12:39
|
I've just developed a technique for nesting queries I haven't seen anywhere before, using templates to format a subquery – this example queries pages with [[attribute::value]] set for a property called "property" - then, assuming the value of that property is a page, queries the resulting page for a property called "subproperty" and returns its value. {{#ask: {{#ask: [[attribute::value]] | ?property= | format=list | mainlabel=- | sep={{pipes}} | intro={{OpenBrackets}} | outro={{ClosedBrackets}} }} | ?subproperty }} Is this something that can be done more easily some other way? Or is this just a hack that would ordinarily be filed under "Things that are not possible", specifically http://semantic-mediawiki.org/wiki/Help:Selecting_pages#Subqueries_for_properties ? I've never quite understood what case "subquery for property" was describing, but I couldn't find a better way to do this sort of thing using either property chains ([[attribute1.attribute2::value]] etc) or standard sub queries ([[attribute::<q>[[attribute2::value]]</q>]] … if it's new, would it be worth adding it to the documentation? Cheers – P |