Hi,

On 05/02/13 15:21, Jeroen De Dauw wrote:
> Hey,
>
> (Question mainly aimed at Markus, though if you have any idea, I'd be
> happy to hear it)
>
> Why do all SMWDescription objects have an array of print requests?
>
> In my mind a query consists out of
>
> * A number of SMWDescription objects specifying the condition
> * A number of print requests specifying what to select
> * A number of parameters, some of which affect the query, most of which
> are for post-query processing
>
> So I am a bit surprised to find that the SMWDescription base class holds
> an array of print requests.

To answer this question, we have to go into the history of SMW ... There 
was a time when the world was young and print requests were still part 
of queries, written using [[Property::*]]. This is why they were located 
"inside" the query structure at this time. Today, all printout requests 
should be what the code calls "extra printouts", which are given as a 
separate list.

At all times, SMW just pushed print requests down to the root of the 
query for evaluation, so the position they were found in did not matter. 
One could have conceived another approach where one can really print 
information about objects that are referred to in the query. For example:

"show all employees that work for charity organisations, together with 
the size of this charity"

would be a print request about the organisation that has "caused" an 
employee to appear in the result. This is different from complex print 
requests that we are discussing now, where you could ask "show all 
employees that work for charity organisations, together with the size of 
all organisations (charity or not) that they work for".

To implement the former semantics, one would have to consider queries to 
return more than just a list of pages (employees), but rather a list of 
tuples (employees, charity organisations). This would lead to new issues 
(combinatorial explosion where the same employee can occur in many 
result rows; mismatch with the expectations of most query result 
printers). We had this at the very beginning of SMW and gave it up 
because it was not what the user wanted in most cases. So there simply 
are no real "nested printouts" now and it would be hard to add this 
functionality to the #ask stack.

Markus


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to