The Kojiki is a collation of different traditions woven into a single "official" mythology, made in an attempt to justify the rule of the imperial Yamato polity and at the same time to subsume different interest groups under its wing by giving them a place and an interest in the national genealogy-mythology. Apart from furthering the imperial agenda, an increased interest in the nation's origins in reaction to the influx of foreign culture and the need for an authoritative genealogical account by which to consider the claims of noble families and to reorganize them into a new system of ranks and titles are also possible factors for its compilation. The Kojiki narrative establishes the Yamato line's right to rule via myth and legend, portraying it as the progeny of heavenly deities and the rightful heir to the land of Japan. A good part of the latter portion of the text is spent recounting various genealogies which served not only to give the imperial family an air of antiquity (which may not necessarily reflect historical reality), but also served to tie, whether true or not, many existing clans' genealogies to their own. Regardless of the work's original intent, it finalized and possibly even formulated the framework by which Japanese history was examined in terms of the reign of emperors. In contrast to the Nihon Shoki (compiled 720), the first of six histories commissioned by the imperial court, which was modeled on Chinese dynastic histories and was intended to be a national chronicle that could be shown with pride to foreign envoys, the Kojiki is inward looking, concerned mainly with the ruling family and prominent clans, and is apparently intended for internal consumption. Whereas the Nihon Shoki uses a variety of source documents (including Chinese texts), the Kojiki is apparently based on sources handed down within the court. Transmission and study Whereas the Nihon Shoki, owing to its status as one of the six imperial histories, was widely read and studied during the Heian period (794–1185), the Kojiki was mostly treated as an ancillary text. Indeed, a work known as the Sendai Kuji Hongi (also known as the Kujiki), claimed to have been authored by Prince Shōtoku and Soga no Umako, was considered to be earlier and more reliable than the Kojiki. (Modern scholarly consensus holds the Kuji Hongi to be a Heian period forgery based on both the Kojiki and the