In , " Elementary , Dear Data " she challenge Lt. Cmdr Data to solve an original Sherlock Holmes mystery on the holodeck . He accept her challenge , which result in the creation of a self @-@ aware hologram of Professor Moriarty ( Daniel Davis ) . Pulaski join Data and Lieutenant Geordi La Forge ( LeVar Burton ) , but is captured by Moriarty who also take over manual control of the Enterprise . Moriarty demand 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 take control of the ship 's computer , again demanding his freedom . He is finally tricked into thinking that his wish was granted , but remain trapped inside a computer simulation ( " Ship in a Bottle " ) . )