Data's sentience hearing

The legal ruling on whether Data is Starfleet property

In 2365 a Starfleet legal hearing ruled that the android Data had the right to choose for himself and was not the property of Starfleet.

Commander Bruce Maddox wanted to disassemble Data in 2365 to study how to build more androids like him. When Data refused and resigned his commission, Maddox argued that Data was Starfleet property and had no such right. Judge Advocate General Phillipa Louvois held a hearing at Starbase 173 to decide the matter.
Riker was ordered to argue Starfleet's case and made a strong argument that Data was a machine. Picard defended Data, pointing out that a ruling against him would allow an entire race of androids to be treated as disposable property. Louvois ruled that Data had the right to choose, and Data declined Maddox's procedure.