The legend of the Seven Sleepers is a saintly legend known in both Christianity and Islam. The subject is a group of young men who, during the persecution of Christians, are urged to worship their emperor as a god or, in another version, to renounce God and worship the old "pagan" gods. Since they are Christians and refuse to do so, they have to flee. They hide in a cave - here the cave reference - and fall asleep there. The emperor has the cave bricked up. Nothing is heard of them for a long time, until the cave is opened by chance centuries later. They wake up and find everything changed. In the meantime, Christianity has become the Roman state religion, and the people flock to the cave to see the sleepers. These emit a light, confirm the story and die. However, the witnesses, including the current Roman emperor, are strengthened in their belief.
In this form, this legend is often referred to the city of Ephesus, is also called Seven Sleepers of Ephesus. It has inspired many notable people over time, for example there is a poem version by Johann Wolfgang von Goethe. The first writing is by Jacob of Sarug around 500 AD. Others are known by Gregory of Tours (c. 560-590), Dionysius Telmaharensis (c. 750-770) and Jacobus a Voragine (1270). The Christian version describes the seven sleepers as Christian martyrs and saints, commonly referred to as the Seven Sleepers of Ephesus. The story was cast by Christians as a martyrs and saints story, but it never made it into the Bible.
It also exists in the Qur'an, 18th Surah "al-Kahf" (The Cave) in verses 9 to 26 under the name Passengers of the Cave or أشابي الكهف (Eshab-ı Kehf, Ashâb-ı Kehf, People of the Cave). Of the islamic version there were also numerous other versions by various authors, including Tabari (c. 900), Al-Mas'udi (943 to 946) and az-Zamakhshari (c. 1134). In this version, a dog accompanied the youths into the cave and kept watch. Allah made them all sleep for 300 years. The seven sleeper caves are called Ashâb-ı Kehf in the Muslim part of the world.
However, it should not be forgotten that this legend contains many themes that appear in a variety of sagas and legends from all over the world. The rapturous sleeping and reawakening in another time is just as well known from German dwarf legends as from the Irish Sidhe. The number seven is also a fascinating number, a prime number, and is often used for number magic, by medieval alchemists as well as in the Jewish Kabbalah. There are even much shorter versions of the story set in completely different countries, for example the version from Germany listed below. Sleepers in caves can be found at all times and in all countries; similar stories also exist in the legends of King Arthur or the sleeping Emperor Barbarossa. The fact that you go to a magical place and lose centuries, that you return after one day and hundreds of years have passed is really widespread. Also the fact that they return seemingly intact and unchanged, but then die in a matter of days or hours. Another meme that is quite common.
However, there is a specialty with this story. For some reason a lot of people actually believed it really happened, and as a logic conclusion the cave actually existed. As a result people were looking for the cave for centuries. And they found it. Several times. We listed all caves which are definitely the true seven sleepers caves. All the others are fakes.