Before the northern song dynasty, Xi, Luoyang and Kaifeng, the ancient capitals of the yellow river basin, were the political, economic and cultural centers of China?
The noun phrase "ancient capital" is the subject and "in the valley" is the attribute.
The appositive or parenthesis between commas can be understood as the subject.
The ancient capitals in this valley, such as Xi 'an, Luoyang and Kaifeng, were the political, economic and cultural centers of China before the Northern Song Dynasty.