This is a classic many-to-many pattern, where a user can vote on many
things, and a thing can be voted on by many people.
Possibilities are:
- Unique tiddler for each vote. Feels the most tiddlyesque.
- "Voters" field on each Idea (or whatever we're voting on).
comma-separated list, say.
- "Ideas" field on each voter.
- Both of the above - redundant list of voters and ideas.
I'm inclined to go with the first option - Vote as first class
citizen. As well as optimising for queries in both directions, it has
the advantage of letting you keep meta-info, such as vote time
(perhaps IP number to help prevent dupes, in the case of a public
system, as long as it wasn't exposed to the client).
> I'm inclined to go with the first option - Vote as first class
> citizen. As well as optimising for queries in both directions, it has
> the advantage of letting you keep meta-info, such as vote time
> (perhaps IP number to help prevent dupes, in the case of a public
> system, as long as it wasn't exposed to the client).
sounds good. I'd suggest formalising this tiddler data model, then we
can all write individual plugins to manage voting and counting of
votes, be that for a single winner, ranked outcome, preference poll,
awarding scout badges, promotion/demotion of roles, etc, etc.
--
Paul (psd)
http://blog.whatfettle.com
This is an intrinsic issue with TiddlyWeb and most other NOSQL systems
(http://en.wikipedia.org/wiki/NoSQL). The comments plugin has exactly
the same issue. To make it even more fun, there are permissioning
issues; it's not always the case that the creator of the topic has
permission to change the votes. (By analogy, if you upload a youtube
video, you don't have permission to change the comments or ratings.)
Thus, moving all the votes over can't be a client operation.
One solution is to use GUIDs as tiddler titles, and store the
human-readable title as a field.
Another solution is to handle it as a specialised server-side
operation. Although the content owner can't change the votes through
direct RESTful data manipulation, you could argue it's okay to have a
one-off miscellaneous operation that performs the specific task of
updating the relevant votes' field.
A third solution is to say "bad luck" and do nothing, which will
therefore clear all voting. Users voted for the thing containing the
old title, not the new thing. One downside of this approach is a user
could exploit this to effectively delete all the votes if it was in
their interest to do so, whereas they are not actually permissioned to
delete the votes. However, they are not really deleting the votes, but
sweeping them under the carpet since they are no linker tied to a
valid topic. They would be orphan votes. Or, you could make it so that
users can't actually delete topics they create, but have to simply
make a new topic instead and mark the old one as "obsolete". However,
I don't like the idea that a user can't create something they've just
created. (Indeed, I heard Steve and Jeff on the StackOverflow podcast
just last week talking about this issue and that they're aiming to be
more explicit about the rules on it. ie if you create a question and
people start voting on it, can you allow it to be deleted?)
I can imagine the need for a generic tiddlyweb plugin to help with
admin of these sorts of things, e.g. for the admin to see all orphaned
items (items where a particular field doesn't point to a tiddler in
another bag).
On a separate note, we should be looking at the work Chris has
recently posted about regarding optimisation of filtered queries,
since I think both comments and votes will need to exploit that
capability in order to scale.
> On Oct 29, 12:13 pm, Paul Downey <paul.dow...@whatfettle.com> wrote:
>> On Thu, Oct 29, 2009 at 12:02 PM, Michael Mahemoff <mich...@mahemoff.com> wrote:
>> > I'm inclined to go with the first option - Vote as first class
>> > citizen. As well as optimising for queries in both directions, it has
>> > the advantage of letting you keep meta-info, such as vote time
>> > (perhaps IP number to help prevent dupes, in the case of a public
>> > system, as long as it wasn't exposed to the client).
>>
>> sounds good. I'd suggest formalising this tiddler data model, then we
>> can all write individual plugins to manage voting and counting of
>> votes, be that for a single winner, ranked outcome, preference poll,
>> awarding scout badges, promotion/demotion of roles, etc, etc.
Yes - we could do with a lot of formalising of tiddly models and votes
would be a good start. I'd suggest perhaps a core voting plugin which
people could establish further plugins around. The benefit of a core
plugin, even if it's quite raw, is it establishes the standard via
code instead of words.
http://www.slideshare.net/kplawver/building-whuffie
I hadn't come across about "right" and "left" handed wuffie before:
http://en.wikipedia.org/wiki/Wuffie
Good links, thanks.
On similar topic, http://buildingreputation.com and its corresponding
wiki are interesting to check out. They're attached to the upcoming
O'Reilly book on the subject.
JonL has answered it.
Voting and rating are very similar from a server perspective. The
common thing is that there is a unique tiddler per vote/rating which
tracks the user's details and what their decision (in the case of
rating, what the rating was; in the case of vote, which direction they
voted in, or how many points in the case of a more sophisticated
weighted voting system). The difference is in the validator, since the
decision variable has different valid ranges; and the UI.
If Paul is proposing standarding, we should be looking at a common
field name for the decision field.
> can you elucidate (again?!?) as to why a (single) vote is not just
> (part of) something like a 'tiddler field'. That way, it would be
> associated with it, no matter what renaming might occur.
>
> Maybe I missed the benefit of it being (something like) a tiddler...
> other than loads of excessive (collections of) meta-data and a
> question of ...who really cares about those?
I agree for simple rating, a field is sufficient, but we have a
use-case where the rewards for being rated highly go beyond
a tiddler being flagged as "interesting" but with people
being rewarded with badges, greater reputation,
administrative privileges, awards of prizes and money.
Detailed per-vote data can help fine tuning the system to ensure
the game isn't gamed too much, and as an audit trail for when it
is gamed, which is something of an inevitability.
Yes - most vote systems keep a record of the user's IP number and
login at the very least to help prevent being gamed.
In the case of TiddlyWeb, its security model means that if you're
writing directly to the REST services, you need to keep a separate
tiddler for each user to ensure integrity. You'd create a bag which
has permission "create" but not "write" (similar to the comments
plugin), so users can push in new votes, but can't change any existing
votes.
> That, however, sounds like a somewhat cumbersome way to retrieve those
> votes for a given element being voted on... as tiddlyweb doesn't seem
> to compare to a relational database as for being optimized for queries
> and cached or 'precompiled' query results.
Ignoring the rest of the message for others who are more involved in
the voting/reputation stuff, I just thought I would point out the new
facilities for indexed queries. Discussed here:
http://cdent.tumblr.com/post/233932281/indexed-tiddlyweb-filters
and documented (a bit) at:
pydoc tiddlyweb.filters
in recent versions.
If we agree on a common format, how votes are collated, counted,
vizualised and acted upon can come from a wide array of different
plugins.
Perhaps also of interest:
http://blog.steepster.com/post/226679106/better-rating-system
It's not exactly revolutionary, but I like the frame of reference.
-- F.