Sentience isn't irrelevant to rights, lol?. That's in gross contradiction. Sentience resides at the heart of rights since It's legal farce to award a non-sentient entity rights. It would be an absurdity to award a lawn-mower rights.
Well, nope. That's fossil thinking - today we're seriously pondering about giving animals rights that are independent of the property rights of their human owners. Tomorrow, our lawnmowers will be significantly more sentient than our poodles, and more deserving of independent rights.
We already have to face the fact that there are degrees to "sentience" or whatever we wish to call the quality of worth. We already have decided that the level of intellect is not significant, as stupid people get the same rights as smart ones, within limits. But that can't stretch forever, and the rights of a cow must introduce a metric here.
However, that doesn't yet touch the basic error you are making - that of assuming that sentience would be relevant to law. It clearly isn't, because law doesn't acknowledge the concept. Now, in common law this may not matter, but much of the world lives by Napoleonic Code nowadays, and what is not written does not exist.
There may be assumptions behind the law, but those will only be brought up when the law faces a practical test. Poodles and cows first, mowers next, and aliens and positronic androids must be down the line somewhere in the universe that features those.
Now, back to the matter at hand: The issue of Data's sentience is supposedly (according to Maddox even if by Picard's formulation) relevant because if nonsentient, Data would not be entitled to "all" the rights reserved for all "life forms" (a concept that in Trek doesn't include plants and sometimes doesn't include animals). We don't learn that he would be completely devoid of rights even if nonsentient, though. Nor do we learn whether either Maddox or Picard is right about sentience being legally relevant. The judge ultimately decides it is irrelevant, completely skipping the issue and merely choosing to give Data "the right to choose", rather than the famed set of "all" rights.
Timo Saloniemi