[uf-discuss] hReview feedback
maetl at mcs.vuw.ac.nz
Tue Jan 17 23:41:27 PST 2006
> I'm not familiar with Ruby syntax, but I guess you are saying that the range
> system built into Ruby is integer only?
It can also be used for strings, eg:
> > z = 'a'..'e'
> > z.to_a #=> ['a','b','c','d','e']
But yes, floats are unsupported. Testing out the following code causes
a type error:
r = 1.0..5.0
> While not directly relevant to microformats, my mathematician friend
> suggested storing everything as a percentage.
> Using my example, I guess you
> could multiply all of the values by 20 and get 86 [1,100].
In terms of machine readable data, that is an interesting idea. You
might not even need the [1,100] in this case - a % sign would
communicate this range directly and is also more readable to humans.
> > It's unlikely someone would review something 4.3 stars out of
> > 5 unless they were dragging a slider bar, or similar kind of UI input,
> > and not picking the rating directly.
> A good portion of the numerical ratings on the internet are aggregates of
> many people voting, usually without their own detailed reviews, so getting a
> float value for the rating would be pretty likely.
True, but this seems like a slightly separate use case from the
standard hReview, which is a *specific* review written by an author.
> > The start..end syntax is quite a nice shorthand for defining a range,
> > more typographic than mathematical though.
> I like "..." for being more user friendly, but it may also be more difficult
> to deal with when parsing. Any input?
Yes! That is precisely why I wanted to point out the range syntax from
Ruby with relation to your examples...
The title attribute is essentially human readable data, and any scheme
that aims to overload this attribute with specific machine readable
constraints, should retain readability as a primary goal.
Which of these following ratings is more readable in browser?
Which has the richest semantics?
Which is easiest to parse?
<img src="stars-2-0.gif" class="rating" alt="2 [0,5]" />
<img src="stars-2-0.gif" class="rating" alt="2 out of 5" />
<img src="stars-2-0.gif" class="rating" alt="2 (0..5)" />
<img src="stars-2-0.gif" class="rating" alt="2 (out of 0..5)" />
<img src="stars-2-0.gif" class="rating" alt="2 out of 0 to 5" />
<dfn class="rating" title="2 [0,5]"><img src="stars-2-0.gif" alt="* *" /></dfn>
I don't think there are necessarily clear cut answers, though I would
definitely tend towards encouraging the alt/title text to be closer to
I'm sure it's possible to cruft a regex that supports most of these
alt/title variations, though as an authoring rule, that maybe goes
beyond the scope of microformats/xmdp and into schema language/BNF
(Sorry, I think I missed the previous discussion on this... I should
have really tracked that down before firing off such thoughts :)
More information about the microformats-discuss