On 9 November 2011 05:45, Jeroen De Dauw <jeroended...@gmail.com> wrote: > Hey,
>> One way to do this would be to automatically give each property some >> special properties, such that the property itself could be queried for its >> set of unique values, and the number of times each value has been used. > > This will not be trivial to implement, and is out of scope of what I want to > do here. If such functionality is created, it might make the value > distribution feature a bit obsolete, but I don't see this happening soon Right. I think the solution you have currently will be very useful for quite some time. I just wanted to raise one of my favourite suggestions ;-) > I'm curious to your ideas about > this though and have some questions: > > * Where/when would this property meta data be computed? On every change of > any occurrence of the property might be quite expensive. I'll leave this one to the experts! My frame of reference is categories, which do get updated every time a category is changed on a page (excepting changes made through templates). However, I see the problem, adding another instance of property-value [[x::y]], you don't want to re-calculate all the counts of all values for property x. > * Where would you defined how to compute this meta data? If possible I'd be > neat to have control over this in the wiki itself. Yeah that would be really cool. That's how I've been doing it with templates on the property page, but it isn't possible (afaik) to link string type properties to their counts. Again, I think this leads us back to aggregate queries (unless 'counts' were done as a one off, like 'Modification date'). >> although I suppose the most general solution of all would be to implement >> aggregation queries. >> .. >> I guess GROUP BY and COUNT() functionality are the bits that would would >> jeopardize sanity? :) > > I actually discussed this at length with Yaron, and we concluded that > generic group by functionality would not be terribly useful, since it's hard > to imagine cases where you would not just want to count the occurrences. My > current implementation is pretty much equivalent to doing a group by count I > think (not sure, as I'm not that familiar with the SQL group by statement). There are a bunch of neat things you can do with GROUP BY, here is a flavour: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html Thanks again for the great work. I'm going to go add barcharts to almost every numeric property in all my wikis :-D Dan. P.S. I like the #summarise idea with hooks for creating aggregate functions. ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel