How to display properties of a nested query in semantic media wiki? -
i have category called actors , called film. category film has property 'hasbudget' , 'hasactor'. each actor has property 'hasnationality'.
i need display list of australian actors have features in films budget above 40 million.
i use following query list actors , corresponding films , budget.
{{#ask:[[category:actor]] [[hasnationality::australia]] [[-hasactor::<q> [[category:film]] [[hasbudget::>40000000]]</q>]] |?# |?-hasactor |?hasbudget |format=broadtable |link=all |headers=show |searchlabel=... further results |class=sortable wikitable smwtable }}
however not able pick budget subquery. how can extract budget property?
any appreciated..thanks
that's right - you're querying category:actor
result you're receiving actor pages , not film pages. there no "joins" in smw query syntax, way achieve use sub-queries along template
result format.
the idea encapsulate sub-queries templates, way able query particular actors first, query on results (like displaying list of films , budgets per actor ).
modify query that:
{{#ask:[[category:actor]] [[hasnationality::australia]] [[-hasactor::<q> [[category:film]] [[hasbudget::>40000000]]</q>]] |?=title |format=template |link=none |searchlabel=... further results |named args=yes |template=actor result }}
create template called actor result
:
actor: {{{?title}}} actors films: {{#ask: [[category:film]] [[hasactor::{{{?title}}}]] |?hasbudget }}
so, way receive list of actors featured films >40000000 budget , in actor result
template query list of films & budgets each actor.
Comments
Post a Comment