The present story of King Jali'ad of Hind and Shimas appears in the Thousand and One Nights and covers the nights 900 to 930. This manuscript seems to open with the tale of The Shepherd and the Rogue of the nine-hundred-and-twenty-second night. According to Richard Burton, the book of Shimas is one of the oldest story cycles to have entered the Thousand and one Nights.
The story can be paralleled with the legend of Barlaam and Josaphat, a renowned tale popularized in a Christian text known as the Balavariani, and which comprised Christianized episodes from the life of Buddha. The work has various titles, including Balawhar and Budasaf and Bilawhar wa Yudhasaf.