Here the 1840 edition added the preposition of, thus expanding “the city Nephi” to the fuller “the city of Nephi”. The original manuscript is quite fragmentary for the phrase “the city (of) Nephi”, but the y of city is partially extant and is immediately followed by Nephi. There is apparently no of in 𝓞. The 1908 RLDS edition restored the original “the city Nephi” to the RLDS text.
Elsewhere in the text we have only “the city of Nephi” (six times), including one nearby example: “Amalickiah marched with his armies … to the land of Nephi to the city of Nephi which was the chief city” (Alma 47:20). According to the earliest text, “the city of Nephi” is preferred, but there is one instance of “the city Nephi” (namely, here in Alma 47:31). Similarly, the text strongly prefers “the land of Nephi”, but there is one instance of “the land Nephi” in the earliest text; see the discussion under Alma 27:22–24.
Evidence involving other examples of “the city (of) X” shows that sometimes the of is lacking in the earliest extant sources, as in the following instances where later editions have added the of:
The addition of of in Alma 47:31 is probably unintended but not unexpected since English speakers prefer “the city of X” over “the city X”.
Summary: In Alma 47:31, the standard text retains the exceptional (but possible) phraseology “the city Nephi”, the apparent reading of the original manuscript; in general, the text reads “the city of X”; although “the city X” is possible, it occurs relatively infrequently in the text.