Alot of the stupider Sonic fans like to come down on Secret Rings and its Arabian Nights theme and yet these same dumbasses will gush about how great the stories for Shadow the Hedgehog and Sonic Next Gen were because guns and beastiality are great and most of these fans I guess don't read books outside of Manga.
But many of us who though Secret Rings just copy/pasted elements of the books into the game and changed stuff around to be more "Sonic-like" such as having Tails and Knuckles as Ali Baba and Sinbad etc. But I talked with someone who played the game and read the massive book 1001 Arabian Nights and said that believe it or not, the game did a fairly good job in terms of level design. Yes Dinosaur Jungle, Skeleton Dome and the Night Palace are all places from various stories and depicted with a fair amount of accuracy give or take some artistic design choices.
As for Sharah coming from a ring. I bet you thought "Genies don't come from rings. They just did that because rings are a staple of the Sonic series." Right? WRONG! While skimming through the TV Tropes website I under "Disneyfication" defining how Disney likes to take some ahem "liberties" with stories to make them more kid friendly, I found this excerpt regarding Aladdin.
Aladdin, as well done as it is, is another example of alteration for alteration's sake. In the original story as presented in the Arabian Nights, Aladdin had two genies - a weaker one in a ring, and the stronger one in the lamp - and had no limit on the number of tasks he could set them to. Yes, he won the hand of a princess, but that was barely the midpoint of the story; the evil wizard who had first used Aladdin to try to retrieve the lamp (and who had no connection to the princess in any way) was not quickly disposed of but instead discovered Aladdin's success, and successfully stole the lamp (and the princess, and Aladdin's palace, and almost everything else) with a clever ruse. (Does anyone remember "New lamps for old"?) Aladdin had to win everything back from the wizard using his wits and the lesser genie he still had in his ring. And even then he still had problems...
So in actuality Sonic and the Secret Rings was more true to the story of Aladdin than Disney's Aladdin was. Sharah was the "weaker genie in a ring." which Sonic used to help him defeat the stronger genie in a lamp, Erazor Djinn and the fact he had four wishes at the end was also more true to the original story.
Interesting what you stumble upon by accident.
As for Black Knight's take on King Arthur ehh........