James Moriarty

James Moriarty was a holographic character from the 24th century. He was created based on the literary version of the character from the Sherlock Holmes stories.

The hologram was created in 2365 when Geordi La Forge accidentally made the character smart enough to defeat Data. Moriarty managed to learn his true nature and held Katherine Pulaski hostage, despite being quite personable. Jean-Luc Picard made a deal with Moriarty, allowing the hologram to go into storage until such a time as Starfleet engineers could study the hologram and one day release him from the confines of the holodeck and ship's memory. 

In 2369, Moriarty was accidentally released from storage by Reginald Barclay. He was incensed that no work had been done (per Picard's promise) and played mind games with the USS Enterprise crew. The crew managed to trick Moriarty into believing that they had found a way to let him leave the holodeck with his romantic interest, Countess Regina Bartholomew. All the while, Moriarty and the countess resided in a constantly running holographic simulation of the universe, outside the ship's memory. 

2393 saw the Soong Foundation learn of Moriarty's existence. The foundation sued to take custody of the holographic program while Starfleet attorneys argued the security issues of doing so. Alyssa Cogley-Shaw compared Starfleet to the Obsidian Order as it wass "imprisonment without a trial."