Professor James Moriarty was a character from Sir Arthur Conan Doyle's Sherlock Holmes novels. Moriarty was Holmes nemesis and equal.
A hologram of Moriarty from a program on the USS Enterprise-D gain sentience. (TNG: "Ship in a Bottle")
Moriarty 2.0 Edit
Moriarty returned in the 143rd century, and was up to his old tricks again, this time interfering with the affairs of the USS Enterprise-JFAZW. (Star Trek: Paradigms: Just Another Day)