 In , " Elementary , Dear Data " she challenges Lt. <unk> Data to solve an original Sherlock Holmes mystery on the holodeck . He accepts her challenge , which results in the creation of a self @-@ aware hologram of Professor Moriarty ( Daniel Davis ) . Pulaski joins Data and Lieutenant <unk> La Forge ( <unk> Burton ) , but is captured by Moriarty who also takes over manual control of the Enterprise . Moriarty demands that they find a way to enable him to leave the holodeck , but is persuaded by Captain Jean @-@ Luc Picard ( Patrick Stewart ) to release control and be stored within the ship 's computer memory until a means can be found to grant his wish . ( Years later , Moriarty is released from the computer and takes control of the ship 's computer , again demanding his freedom . He is finally <unk> into thinking that his wish was granted , but remains trapped inside a computer simulation ( " Ship in a <unk> " ) . ) 
