In the Professor James Moriarty story arc, the story sequence is
Elementary, Dear Data  : Ship in a Bottle.
According to Memory Alpha's In Universe Timeline, the story sequence is:
Babel : Ship in a Bottle : Aquiel.


Investigating a glitch on the holodeck, Barclay accidentally reactivates Dr. Moriarty's routine in Data's Sherlock Holmes holoprogram. The holographic villain is angry that the crew have forgotten their promise to transfer him to the real world some day. [N 1] However, he puzzles Picard, Data and Barclay when he walks outside the holodeck and stays in one piece. Moriarty asks Picard to help the Countess Bartholomew, the love of his life, to come alive as well.

After a while Data discovers inconsistencies. He finds that everything is a ruse and that he, Picard and Barclay are still on the holodeck with Moriarty. The rest of the ship is not real, including all other crew members. Unfortunately Moriarty has now the access codes to the real ship, after Picard was forced to use them, which is especially dangerous since the Enterprise is very close to two colliding gas giants. The crew, however, outwit Moriarty using his own trick when they just transfer him and the Countess Bartholomew to the holodeck in the holodeck instead of beaming them out to the real world. Now stored in a small module, the two are provided with lots of adventures in what they think is the real world.

Picard mentions the possibility that the crew's reality may actually be a fabrication generated by "a little device sitting on someone's table." This unnerves Barclay enough for him to test the nature of his own reality one more time: he gives an audible command to "end program" to test whether he is still in a simulation. There is no response.

Errors and Explanations

The Nitpicker's Guide
Next Generation Trekkers
Volume 2

Plot Oversights

  1. Data not attempting to impersonate Moriarty in order to allow him and Picard to leabe the holodeck. Moriarty's programming would instantly recognise the deception.

Equipment Oddities

  1. The uniform Picard acquires in the Holodeck not disappearing when he and Data finally leave. The uniform was probably created by the holodeck replication subsystem.

Nit Central

  1. Aaron Dotter on Friday, September 15, 2000 - 4:42 pm: I am surprised no one entertained the idea of building an android body for Moriarity, or some sort of computer device they could download him into which would let him move outside. Sven of Nine on Tuesday, February 20, 2001 - 5:35 am: On the other hand, imagine what havoc could ensue had Moriarty acquired an android body. Can you say The Schizoid Man? Seniram It may not be possible to safely complete such a transfer.
  2. Keith Alan Morgan (Kmorgan) on Monday, May 13, 2002 - 4:59 am: Picard, Data & Barclay are in the Holodeck. Would that be the same rinky dink little Holodeck we see at the beginning of the show? Three real people are wandering around, sometimes separately, in this tiny room and they not only think it is the Enterprise they never seem to bump into, or overhear, each other? The holodeck is designed to recreate internal walls.
  3. Where did Barclay get that big old hunk of active memory? I don't remember him bringing it in, or even seeing it in the panel that he works on at the beginning of the show. Wasn't it already in place in the Arch?
  4. LUIGI NOVI on Saturday, November 09, 2002 - 7:57 pm: Why didn’t Picard, Data and Barclay consider that they and Moriarty were still in the holodeck the moment Moriarty apparently stepped out of it in Act 1? I can buy Picard and Barclay possibly not thinking of this, but Data? Data’s mind is constructed to think of all possible permutations of a situation, and to approach problems using the scientific method. In trying to come up with an explanation for how Moriarty could step out of the holodeck, the first thing he should’ve attempted to establish was whether Moriarty was indeed still in it. The Holodeck may have been upgraded since Encounter at Farpoint to prevent Data recognising the actual walls.


  1. Depicted in Elementary, Dear Data

The Next Generation Season 6
Time's Arrow Part 2 I Realm of Fear I Man of the People I Relics I Schisms I True Q I Rascals I A Fistful of Datas I The Quality of Life I Chain of Command Part 1 I Chain of Command Part 2 I Ship in a Bottle I Aquiel I Face of the Enemy I Tapestry I Birthright Part 1 I Birthright Part 2 I Starship Mine I Lessons I The Chase I Frame of Mind I Suspicions I Rightful Heir I Second Chances I Timescape I Descent Part 1
Community content is available under CC-BY-SA unless otherwise noted.