From the jQuery doc:

To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

So, if someone sets hasrel to "false", using attr will return a value of true because it will stay a string, and data() will return a value of false, because it will be converted to a boolean. Probably data() is correct.